:root {
  --bg: #f6f3ec;
  --bg-alt: #ece6da;
  --surface: #ffffff;
  --text: #1c2620;
  --muted: #5d6a61;
  --line: #d9d2c3;
  --accent: #2f6b45;
  --accent-ink: #ffffff;
  --accent-soft: #e1eee4;
  --warm: #b8743a;
  --header: #14231b;
  --header-ink: #e7efe9;
  --ok: #2e9b57;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111a15;
    --bg-alt: #16211b;
    --surface: #1b2821;
    --text: #e3ebe5;
    --muted: #9aaba0;
    --line: #2c3b32;
    --accent: #7cc68d;
    --accent-ink: #0f1a13;
    --accent-soft: #213428;
    --warm: #e0a061;
    --header: #0b130e;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; }
code { font-family: var(--mono); font-size: .9em; background: var(--accent-soft); padding: .1em .35em; border-radius: 4px; word-break: break-all; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; }
.center { text-align: center; justify-content: center; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 10; background: var(--surface); padding: 8px 12px; }

/* header */
.site-header { background: var(--header); color: var(--header-ink); position: sticky; top: 0; z-index: 5; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--header-ink); text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.logo-mark { width: 32px; height: 32px; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { color: var(--header-ink); text-decoration: none; padding: 8px 10px; border-radius: 8px; font-size: .95rem; opacity: .85; }
.site-nav a:hover { opacity: 1; background: rgba(255,255,255,.08); }
.site-nav a[aria-current="page"] { opacity: 1; background: rgba(143,209,138,.18); }
.nav-toggle, .nav-burger { display: none; }

@media (max-width: 900px) {
  .nav-burger { display: block; width: 40px; height: 40px; cursor: pointer; position: relative; }
  .nav-burger span, .nav-burger span::before, .nav-burger span::after {
    content: ""; position: absolute; left: 9px; width: 22px; height: 2px; background: var(--header-ink);
  }
  .nav-burger span { top: 19px; }
  .nav-burger span::before { left: 0; top: -7px; }
  .nav-burger span::after { left: 0; top: 7px; }
  .site-nav { display: none; width: 100%; flex-direction: column; padding-bottom: 12px; }
  .nav-toggle:checked ~ .site-nav { display: flex; }
}

/* hero */
.hero { background: linear-gradient(180deg, var(--header) 0%, #1f3a2c 100%); color: #eef4ef; padding: 56px 0 64px; }
.hero-inner { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero .lead { color: #cddbd1; }
.hero a { color: #a9e0a4; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; color: #f0c58a; margin: 0 0 8px; font-weight: 600; }
.hero-art { border-radius: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.35); width: 100%; }
.version-note { font-size: .9rem; color: #b7c8bc; margin-top: 20px; }
@media (max-width: 820px) { .hero-inner { grid-template-columns: 1fr; } .hero { padding: 40px 0; } }

.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn { display: inline-block; padding: 12px 20px; border-radius: 10px; background: #8fd18a; color: #10201a; font-weight: 600; text-decoration: none; border: 2px solid #8fd18a; }
.btn:hover { background: #a6dda2; border-color: #a6dda2; }
.hero .btn:not(.btn-ghost), .notfound .btn:not(.btn-ghost) { color: #10201a; }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-ghost:hover { background: rgba(127,127,127,.12); border-color: currentColor; }
.notfound .btn-ghost { color: var(--accent); }

/* sections */
.section { padding: 56px 0; }
.section.alt { background: var(--bg-alt); }
.page-head { padding: 48px 0 8px; }
.page-head .lead { margin: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .grid-4 { grid-template-columns: 1fr; } }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
@media (max-width: 720px) { .split { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card p:last-child { margin-bottom: 0; }
.feature h3 { color: var(--accent); }
.post-card { color: var(--text); text-decoration: none; transition: border-color .15s; }
.post-card:hover { border-color: var(--accent); }
.post-card h3 { margin: 0; }

.post-meta { font-size: .875rem; color: var(--muted); margin: 0 0 6px; }
.tag { color: var(--warm); font-weight: 600; }

/* prose */
.prose h2 { margin-top: 2em; }
.prose h2:first-child { margin-top: 0; }
.prose li { margin-bottom: .4em; }

/* devlog */
.post { padding: 32px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
.post:last-child { border-bottom: 0; }
.post h2 a { color: var(--text); text-decoration: none; }
.post h2 a:hover { color: var(--accent); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 16px 0; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child th, tr:last-child td { border-bottom: 0; }
thead th { background: var(--bg-alt); font-weight: 600; }
tbody th { font-weight: 600; white-space: nowrap; }

.notice { border-left: 4px solid var(--warm); background: var(--surface); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin: 20px 0; }

/* roadmap */
.roadmap { display: grid; gap: 8px; margin: 16px 0; }
.road { display: flex; gap: 12px; align-items: baseline; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.road span { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; min-width: 76px; }
.road.done span { color: var(--ok); }
.road.wip span { color: var(--warm); }
.road.plan span { color: var(--muted); }

/* status */
.status-banner { display: flex; align-items: center; gap: 10px; background: var(--accent-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font-weight: 600; margin-bottom: 32px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(46,155,87,.2); }
.incidents { padding-left: 1.2em; }
.incidents time { color: var(--muted); }

/* faq */
.faq { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none; position: relative; padding-right: 28px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 13px; font-size: 1.3rem; color: var(--accent); }
.faq[open] summary::after { content: "−"; }
.faq p { margin-top: 0; }

/* support */
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.contact-card p { margin: 0 0 8px; }
.contact-mail { font-size: 1.4rem; font-weight: 700; word-break: break-all; }

/* 404 */
.notfound { padding: 96px 0; }
.big-code { font-size: 5rem; font-weight: 800; color: var(--accent); margin: 0; line-height: 1; }
.notfound .lead { margin: 0 auto; }

/* footer */
.site-footer { background: var(--header); color: #b9c7bd; padding: 32px 0; font-size: .9rem; }
.site-footer a { color: #cfe6cc; }
.site-footer .muted { color: #8d9c92; }
.footer-inner { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; } }
