/* ToolHost Blog — styles.css */
/* Brand tokens: canvas #08090a, panel #0d0e10, raised #141517 */
/* accent #5e6ad2, accent2 #7c87e8, ok #4cb782 */

/* ─── Reset & Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --canvas:    #08090a;
  --panel:     #0d0e10;
  --raised:    #141517;
  --line:      #1f2023;
  --line2:     #26282c;
  --ink:       #e6e7e9;
  --muted:     #8a8f98;
  --dim:       #52565e;
  --accent:    #5e6ad2;
  --accent2:   #7c87e8;
  --ok:        #4cb782;
  --warn:      #e8a838;
  --danger:    #e5534b;
  --font-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --radius:    8px;
  --radius-lg: 12px;
  --content-width: 720px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: rgba(94, 106, 210, 0.35); }

*::-webkit-scrollbar { width: 6px; }
*::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 6px; }
*::-webkit-scrollbar-track { background: transparent; }

a { color: var(--accent2); text-decoration: none; }
a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ─── Site Header / Nav ─────────────────────────────────────────────── */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(8, 9, 10, 0.9);
}

.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.site-logo:hover { text-decoration: none; color: var(--ink); }

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent2) 0%, var(--accent) 100%);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.logo-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.logo-sep {
  color: var(--line2);
  font-size: 18px;
  font-weight: 200;
}

.logo-section {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}

.header-spacer { flex: 1; }

.header-link {
  font-size: 13px;
  color: var(--dim);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.header-link:hover {
  color: var(--muted);
  background: var(--raised);
  text-decoration: none;
}

/* ─── Grid background (hero area) ──────────────────────────────────── */
.grid-bg {
  position: relative;
  overflow: hidden;
}

.grid-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(94, 106, 210, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(94, 106, 210, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 100% at 50% 0%, black 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 100% at 50% 0%, black 0%, transparent 80%);
}

/* ─── Blog Index Page ───────────────────────────────────────────────── */
.index-hero {
  padding: 72px 32px 56px;
  text-align: center;
  position: relative;
}

.index-hero-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.index-hero-title {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--ink);
  margin-bottom: 12px;
  line-height: 1.1;
}

.index-hero-tagline {
  font-size: 16px;
  color: var(--muted);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ─── Post List ─────────────────────────────────────────────────────── */
.post-list-wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 32px 96px;
}

.post-list-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin-bottom: 48px;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-item {
  display: block;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: none;
  position: relative;
}

.post-item:first-child {
  border-top: 1px solid var(--line);
}

.post-item:hover { text-decoration: none; }

.post-item:hover .post-item-title {
  color: var(--accent2);
}

.post-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.post-item-date {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--dim);
}

.post-item-tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(94, 106, 210, 0.08);
  border: 1px solid rgba(94, 106, 210, 0.2);
  border-radius: 4px;
  padding: 1px 7px;
}

.post-item-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.3;
  margin-bottom: 6px;
  transition: color 0.15s;
}

.post-item-excerpt {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 12px;
}

.post-item-read-more {
  font-size: 12.5px;
  color: var(--dim);
  font-weight: 500;
  transition: color 0.15s;
}

.post-item:hover .post-item-read-more {
  color: var(--accent2);
}

/* Empty state */
.post-list-empty {
  padding: 64px 0;
  text-align: center;
}

.post-list-empty-heading {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.post-list-empty-body {
  font-size: 13px;
  color: var(--dim);
}

/* ─── Post Page ─────────────────────────────────────────────────────── */
.post-hero {
  padding: 60px 32px 40px;
  text-align: center;
  position: relative;
}

.post-hero-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}

.post-hero-title {
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--ink);
  line-height: 1.15;
  max-width: 680px;
  margin: 0 auto 18px;
}

.post-hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.post-hero-meta-item {
  font-size: 12.5px;
  color: var(--dim);
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-hero-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line2);
}

/* ─── Post Content ──────────────────────────────────────────────────── */
.post-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  max-width: var(--content-width);
  margin: 0 auto;
}

.post-content-wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 48px 32px 96px;
}

/* Prose styles */
.post-body {
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.8;
}

.post-body p { margin-bottom: 24px; }
.post-body p:last-child { margin-bottom: 0; }

.post-body h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 40px 0 14px;
  line-height: 1.2;
}

.post-body h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 30px 0 10px;
  line-height: 1.25;
}

.post-body strong { color: var(--ink); font-weight: 600; }

.post-body a {
  color: var(--accent2);
  text-underline-offset: 3px;
}

.post-body a:hover { color: var(--ink); }

.post-body ul,
.post-body ol {
  padding-left: 24px;
  margin-bottom: 24px;
}

.post-body li {
  margin-bottom: 8px;
  padding-left: 4px;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent2);
  background: rgba(94, 106, 210, 0.08);
  border: 1px solid rgba(94, 106, 210, 0.15);
  border-radius: 4px;
  padding: 1px 5px;
}

.post-body pre {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  overflow-x: auto;
  margin-bottom: 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.post-body blockquote {
  border-left: 3px solid var(--accent);
  margin: 28px 0;
  padding: 12px 20px;
  background: rgba(94, 106, 210, 0.04);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.post-body blockquote p {
  margin-bottom: 0;
  color: var(--muted);
  font-style: italic;
}

.post-body hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin: 40px 0;
}

/* ─── Post Footer / Back link ───────────────────────────────────────── */
.post-footer {
  border-top: 1px solid var(--line);
  padding-top: 32px;
  margin-top: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.15s;
  font-weight: 500;
}

.back-link:hover {
  color: var(--accent2);
  text-decoration: none;
}

.post-footer-author {
  font-size: 12.5px;
  color: var(--dim);
  font-family: var(--font-mono);
}

/* ─── Site Footer ───────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 32px;
}

.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.footer-logo:hover { color: var(--ink); text-decoration: none; }

.footer-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.footer-links a {
  font-size: 12.5px;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--muted); text-decoration: none; }

.footer-copy {
  font-size: 12px;
  color: var(--dim);
  width: 100%;
}

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .site-header { padding: 0 20px; }
  .index-hero  { padding: 52px 20px 40px; }
  .post-hero   { padding: 48px 20px 32px; }
  .post-list-wrap   { padding: 0 20px 64px; }
  .post-content-wrap { padding: 40px 20px 64px; }
  .site-footer { padding: 28px 20px; }
  .site-footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-links { flex-wrap: wrap; gap: 12px; }
  .post-footer { flex-direction: column; align-items: flex-start; }
}
