/* SpecSync blog — shares the marketing site's design tokens (keep in sync with index.html :root) */
:root {
  --bg: #fafcfb;
  --bg-alt: #edf5f2;
  --card: #ffffff;
  --ink: #122a26;
  --ink-soft: #4a635d;
  --ink-faint: #7e938e;
  --line: #d7e4e0;
  --accent: #2a9d8f;
  --accent-deep: #157466;
  --accent-soft: #d9efe9;
  --accent-ghost: #eef7f4;
  --signal: #c97b2d;
  --signal-soft: #f7e9d8;
  --shadow: 0 1px 2px rgba(18,42,38,.05), 0 12px 32px -16px rgba(18,42,38,.18);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1f1c;
    --bg-alt: #0f2723;
    --card: #133029;
    --ink: #e9f3f0;
    --ink-soft: #a3bcb5;
    --ink-faint: #6f8b84;
    --line: #24443d;
    --accent: #3db5a4;
    --accent-deep: #7adcc9;
    --accent-soft: #175247;
    --accent-ghost: #12352e;
    --signal: #e09a4a;
    --signal-soft: #3d2e17;
    --shadow: 0 1px 2px rgba(0,0,0,.25), 0 14px 36px -16px rgba(0,0,0,.5);
  }
}
:root[data-theme="light"] {
  --bg: #fafcfb; --bg-alt: #edf5f2; --card: #ffffff; --ink: #122a26;
  --ink-soft: #4a635d; --ink-faint: #7e938e; --line: #d7e4e0;
  --accent: #2a9d8f; --accent-deep: #157466; --accent-soft: #d9efe9; --accent-ghost: #eef7f4;
  --signal: #c97b2d; --signal-soft: #f7e9d8;
  --shadow: 0 1px 2px rgba(18,42,38,.05), 0 12px 32px -16px rgba(18,42,38,.18);
}
:root[data-theme="dark"] {
  --bg: #0c1f1c; --bg-alt: #0f2723; --card: #133029; --ink: #e9f3f0;
  --ink-soft: #a3bcb5; --ink-faint: #6f8b84; --line: #24443d;
  --accent: #3db5a4; --accent-deep: #7adcc9; --accent-soft: #175247; --accent-ghost: #12352e;
  --signal: #e09a4a; --signal-soft: #3d2e17;
  --shadow: 0 1px 2px rgba(0,0,0,.25), 0 14px 36px -16px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Poppins", "Avenir Next", "Futura", "Century Gothic", "Trebuchet MS", system-ui, sans-serif;
  font-weight: 400;
  font-size: 16.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent-deep); text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 28px; width: 100%; }

.chapter {
  display: flex; align-items: center; gap: 14px; margin: 0 0 27px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-soft);
}
.chapter .num { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.chapter::after { content: ""; flex: 0 0 120px; height: 1px; background: var(--line); }
.chapter.center { justify-content: center; }
.chapter.center::after { display: none; }
h1, h2, h3 { font-weight: 300; letter-spacing: -0.015em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); line-height: 1.1; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.45rem); line-height: 1.16; }
h3 { font-size: 1.12rem; font-weight: 500; letter-spacing: 0; }
.lede { font-size: clamp(1.02rem, 1.6vw, 1.17rem); color: var(--ink-soft); max-width: 58ch; }
strong { font-weight: 500; }

/* ---------- nav (matches index.html) ---------- */
header.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 26, 23, .96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #1d3b35;
}
.nav-inner { display: flex; align-items: center; gap: 30px; height: 64px; }
.logo { display: flex; align-items: center; height: 64px; }
.logo-img { height: 24px; width: auto; display: block; background: transparent; }
nav.links { display: flex; gap: 26px; margin-left: auto; }
nav.links a { color: #9fbcb4; font-size: 14.5px; }
nav.links a:hover { color: #ffffff; }
nav.links a[aria-current="page"] { color: #ffffff; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; font-size: 14.5px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -8px var(--accent); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-deep); }
.nav .btn { padding: 9px 18px; }
.nav-toggle { display: none; align-items: center; justify-content: center; width: 40px; height: 40px; margin-left: auto; border: 1px solid #1d3b35; border-radius: 10px; background: transparent; color: #cfe0db; cursor: pointer; }
nav.links .only-mobile { display: none; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav .btn-primary { display: none; }
  nav.links {
    display: flex; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; gap: 0; margin: 0;
    background: rgba(10, 26, 23, .98); border-bottom: 1px solid #1d3b35;
    padding: 6px 0; transform: scaleY(0); transform-origin: top; opacity: 0;
    pointer-events: none; transition: transform .18s ease, opacity .18s ease;
  }
  nav.links.open { transform: scaleY(1); opacity: 1; pointer-events: auto; }
  nav.links a { padding: 13px 28px; font-size: 15px; }
  nav.links .only-mobile { display: block; color: #7adcc9; font-weight: 600; }
}

/* ---------- footer (matches index.html) ---------- */
footer { border-top: 1px solid var(--line); padding: 36px 0; font-size: 13px; color: var(--ink-faint); margin-top: auto; }
.foot-inner { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

/* ---------- blog index ---------- */
.blog-head { padding: 76px 0 20px; }
.blog-head p { margin: 14px 0 0; }
.posts { padding: 34px 0 92px; }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 20px; }
@media (max-width: 960px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .post-grid { grid-template-columns: 1fr; } }

.post-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; color: inherit;
  transition: border-color .15s ease, transform .15s ease;
}
.post-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.post-card h3 { font-size: 1.22rem; font-weight: 400; line-height: 1.3; }
.post-card p { margin: 0; font-size: 14.2px; color: var(--ink-soft); }
.post-meta { font-size: 12.8px; color: var(--ink-faint); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.post-card .more { margin-top: auto; padding-top: 10px; font-size: 13.5px; font-weight: 500; color: var(--accent-deep); }

.post-card.featured { grid-column: 1 / -1; padding: 36px 34px; box-shadow: var(--shadow); gap: 12px; }
.post-card.featured h3 { font-size: clamp(1.5rem, 2.8vw, 2rem); font-weight: 300; }
.post-card.featured p { font-size: 15.2px; max-width: 70ch; }

.tagline { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 11.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  background: var(--accent-soft); color: var(--accent-deep);
  padding: 4px 11px; border-radius: 999px;
}

.empty-state, .error-state {
  border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 56px 24px; text-align: center; color: var(--ink-soft); background: var(--card);
  margin-top: 20px;
}
.loading { color: var(--ink-faint); padding: 40px 0; text-align: center; }

/* ---------- article ---------- */
.article-wrap { max-width: 760px; margin: 0 auto; padding: 64px 28px 92px; width: 100%; }
.back-link { font-size: 13.5px; font-weight: 500; }
.back-link:hover { color: var(--accent); }
article header.post-header { margin: 22px 0 8px; }
article h1 { margin: 10px 0 16px; }
.post-excerpt { font-size: 1.08rem; color: var(--ink-soft); margin: 0 0 18px; }
article hr.rule { border: none; border-top: 1px solid var(--line); margin: 30px 0; }

.post-body { font-size: 16.2px; }
.post-body h2 { font-size: 1.65rem; font-weight: 400; margin: 40px 0 14px; }
.post-body h3 { font-size: 1.25rem; font-weight: 500; margin: 32px 0 10px; }
.post-body h4 { font-size: 1.05rem; font-weight: 600; margin: 26px 0 8px; }
.post-body p { margin: 0 0 18px; }
.post-body ul, .post-body ol { margin: 0 0 18px; padding-left: 24px; color: var(--ink); }
.post-body li { margin: 6px 0; }
.post-body a { text-decoration: underline; text-underline-offset: 3px; }
.post-body blockquote {
  margin: 0 0 18px; padding: 4px 0 4px 18px;
  border-left: 3px solid var(--accent); color: var(--ink-soft); font-style: italic;
}
.post-body code {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 6px;
  padding: 1px 6px; font-size: .88em;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.post-body pre {
  background: var(--bg-alt); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px; overflow-x: auto; margin: 0 0 18px;
  font-size: 13.5px; line-height: 1.55;
}
.post-body pre code { background: none; border: none; padding: 0; font-size: inherit; }
.post-body hr { border: none; border-top: 1px solid var(--line); margin: 28px 0; }
.post-body img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); display: block; }
.post-body figure { margin: 0 0 18px; }
.post-body figcaption { font-size: 12.8px; color: var(--ink-faint); margin-top: 8px; text-align: center; }

/* cover images */
.post-cover {
  width: 100%; max-height: 420px; object-fit: cover; display: block;
  border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow);
  margin: 26px 0 4px;
}
.card-cover {
  width: calc(100% + 48px); margin: -26px -24px 6px; display: block;
  height: 170px; object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0; border-bottom: 1px solid var(--line);
}
.post-card.featured .card-cover {
  width: calc(100% + 68px); margin: -36px -34px 10px; height: 280px;
}

/* ---------- admin console ---------- */
.console-wrap { max-width: 880px; margin: 0 auto; padding: 56px 28px 92px; width: 100%; }
.console-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 32px 30px;
}
.gate-card { max-width: 420px; margin: 10vh auto 0; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field .hint { font-weight: 400; color: var(--ink-faint); }
.field input[type="text"], .field input[type="password"], .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); color: var(--ink);
  padding: 11px 14px; font-size: 14.5px; font-family: inherit;
}
.field textarea { resize: vertical; line-height: 1.6; }
.field textarea.content {
  min-height: 380px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13.5px;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

.console-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.console-head h1 { font-size: 1.7rem; }
.console-head .spacer { margin-left: auto; }
.console-sub { font-size: 13.5px; color: var(--ink-faint); margin: 4px 0 0; }

.admin-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.admin-row { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-row:last-child { border-bottom: none; }
.admin-row .info { min-width: 0; flex: 1; }
.admin-row .title { font-weight: 500; font-size: 15px; }
.admin-row .slug { font-size: 12.5px; color: var(--ink-faint); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.status-pill {
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 999px; white-space: nowrap;
}
.status-pill.live { background: var(--accent-soft); color: var(--accent-deep); }
.status-pill.draft { background: var(--signal-soft); color: var(--signal); }
.row-actions { display: flex; gap: 8px; }
.btn-small { padding: 7px 14px; font-size: 13px; }
.btn-danger { border-color: transparent; background: transparent; color: var(--signal); }
.btn-danger:hover { border-color: var(--signal); }

.notice { border-radius: 10px; padding: 11px 16px; font-size: 14px; margin-bottom: 18px; }
.notice.ok { background: var(--accent-soft); color: var(--accent-deep); }
.notice.err { background: var(--signal-soft); color: var(--signal); }
.btn-row { display: flex; gap: 12px; margin-top: 8px; }

@media (max-width: 620px) {
  .wrap { padding: 0 20px; }
  .article-wrap, .console-wrap { padding-left: 20px; padding-right: 20px; }
  .blog-head { padding-top: 52px; }
}
