:root {
  --bg: #0b1520;
  --bg-raised: #112131;
  --text: #d9e2ea;
  --text-muted: #93a4b4;
  --accent: #e3b964;
  --accent-soft: #e3b96422;
  --rule: #223649;
  --code-bg: #0e1b28;
  --max: 42rem;
  color-scheme: dark light;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f2ea;
    --bg-raised: #ece5d8;
    --text: #1d2833;
    --text-muted: #55616c;
    --accent: #8a5a12;
    --accent-soft: #8a5a1218;
    --rule: #d6ccbb;
    --code-bg: #ebe3d4;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 106.25%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

code, .mono {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}
code { background: var(--code-bg); padding: 0.1em 0.35em; border-radius: 4px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-top: 1rem; padding-bottom: 1rem; flex-wrap: wrap;
}
.brand {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text); text-decoration: none; font-size: 0.95rem;
}
.brand span { color: var(--accent); }
.site-nav { display: flex; gap: 1.25rem; font-size: 0.95rem; }
.site-nav a { color: var(--text-muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }

/* Hero */
.hero { padding: 4rem 0 2.5rem; }
.eyebrow {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  color: var(--accent); font-size: 0.8rem; letter-spacing: 0.14em;
  text-transform: uppercase; margin: 0 0 1rem;
}
h1 { font-size: clamp(2rem, 6vw, 2.9rem); line-height: 1.15; margin: 0 0 1.25rem; font-weight: 700; }
.lede { font-size: 1.15rem; color: var(--text); margin: 0 0 1.75rem; }

.terminal {
  background: var(--code-bg); border: 1px solid var(--rule); border-radius: 8px;
  padding: 1rem 1.1rem; margin: 2rem 0; overflow-x: auto;
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem; line-height: 1.55; white-space: pre; color: var(--text);
}
.terminal .prompt { color: var(--accent); }
.terminal .dim { color: var(--text-muted); }

.button {
  display: inline-block; background: var(--accent); color: var(--bg);
  padding: 0.65rem 1.2rem; border-radius: 6px; text-decoration: none;
  font-weight: 700; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 0.95rem;
}
.button:hover { filter: brightness(1.08); }
.button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); margin-left: 0.5rem; }

/* Sections */
section { padding: 1.5rem 0; }
h2 { font-size: 1.5rem; margin: 2rem 0 0.75rem; line-height: 1.3; }
h3 { font-size: 1.1rem; margin: 1.5rem 0 0.4rem; }
p { margin: 0 0 1rem; }

.pillars { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 1rem; }
.pillars li { background: var(--bg-raised); border-left: 3px solid var(--accent); padding: 0.9rem 1.1rem; border-radius: 0 6px 6px 0; }
.pillars strong { display: block; margin-bottom: 0.2rem; }

.phases { list-style: none; padding: 0; margin: 1rem 0; counter-reset: phase; }
.phases li { position: relative; padding: 0 0 1.1rem 2.4rem; border-left: 1px solid var(--rule); margin-left: 0.7rem; }
.phases li:last-child { border-left-color: transparent; }
.phases li::before {
  counter-increment: phase; content: counter(phase);
  position: absolute; left: -0.75rem; top: 0; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--bg-raised); border: 1px solid var(--rule); color: var(--text-muted);
  font: 700 0.75rem/1.45rem ui-monospace, Menlo, Consolas, monospace; text-align: center;
}
.phases li.current::before { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.status { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.75rem; color: var(--accent); margin-left: 0.4rem; }

.callout { background: var(--accent-soft); border: 1px solid var(--rule); border-radius: 8px; padding: 1.25rem; margin: 2rem 0; }
.callout h2 { margin-top: 0; }

/* Devlog list */
.post-list { list-style: none; padding: 0; margin: 1rem 0; }
.post-list li { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.post-list li:first-child { border-top: 1px solid var(--rule); }
.post-list h2, .post-list h3 { margin: 0 0 0.3rem; font-size: 1.2rem; }
.post-list a { text-decoration: none; }
.post-list p { margin: 0; color: var(--text-muted); }
.meta { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8rem; color: var(--text-muted); margin: 0 0 0.35rem; }

/* Article */
article { padding: 3rem 0 1rem; }
article h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); }
article ul { padding-left: 1.2rem; }
article li { margin-bottom: 0.5rem; }
.post-nav { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 1.25rem; margin-top: 2rem; font-size: 0.95rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); margin-top: 3rem; padding: 1.5rem 0 2.5rem; color: var(--text-muted); font-size: 0.9rem; }
.site-footer p { margin: 0.25rem 0; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 480px) {
  .button.secondary { margin: 0.6rem 0 0; }
  .hero { padding-top: 2.5rem; }
}
