/* Prometheus devlog. Colours are tokens; dark mode follows the system unless the visitor picks
   one with the nav toggle (data-theme on <html>). */
:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-2: #f3efe9;
  --text: #1d1b19;
  --muted: #6c665e;
  --border: #e6e0d7;
  --accent: #c9501c;
  --accent-soft: #fbe8dd;
  --shadow: 0 1px 2px rgb(30 20 10 / 0.05), 0 8px 24px rgb(30 20 10 / 0.06);
  --radius: 14px;
  --measure: 700px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121113;
    --surface: #1a191c;
    --surface-2: #222024;
    --text: #ece8e2;
    --muted: #a29c93;
    --border: #2c2a2e;
    --accent: #ff8a4c;
    --accent-soft: #2d1d15;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121113;
  --surface: #1a191c;
  --surface-2: #222024;
  --text: #ece8e2;
  --muted: #a29c93;
  --border: #2c2a2e;
  --accent: #ff8a4c;
  --accent-soft: #2d1d15;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--font);
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 20; background: var(--surface); padding: 8px 12px; }

/* ---- navigation ---------------------------------------------------------------------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand svg { width: 22px; height: 22px; color: var(--accent); }
.brand-sub { color: var(--muted); font-weight: 500; }
.tabs { display: flex; gap: 4px; margin-right: auto; }
.tabs a {
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 550;
  padding: 18px 12px;
  box-shadow: inset 0 -2px 0 transparent;
  transition: color 0.15s, box-shadow 0.15s;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.nav-actions { display: flex; gap: 4px; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

@media (max-width: 680px) {
  .nav-inner { flex-wrap: wrap; gap: 0 12px; min-height: 0; padding-top: 10px; }
  .brand { margin-right: auto; }
  .tabs { order: 3; width: 100%; margin: 0; justify-content: space-between; }
  .tabs a { flex: 1; text-align: center; padding: 12px 4px; }
}

/* ---- layout -------------------------------------------------------------------------- */
main { max-width: 1120px; margin: 0 auto; padding: 48px 16px 72px; }
.wrap { max-width: 960px; margin: 0 auto; }
.wrap.narrow { max-width: 760px; }
.wrap.wide { max-width: 1040px; }
.intro { margin-bottom: 48px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font: 600 13px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1 { font-size: clamp(32px, 5vw, 48px); line-height: 1.1; letter-spacing: -0.025em; margin: 0 0 16px; }
.lede { font-size: 19px; color: var(--muted); margin: 0 0 20px; max-width: 640px; }
.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 15px;
  font-weight: 550;
  text-decoration: none;
}
a.status:hover { box-shadow: inset 0 0 0 1px var(--accent); }
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .status .dot { animation: ember 2.4s ease-in-out infinite; }
  @keyframes ember { 50% { opacity: 0.35; } }
}
.section-label {
  font: 600 13px/1 var(--mono);
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 40px 0 16px;
}
.section-label:first-child { margin-top: 0; }

/* ---- cards --------------------------------------------------------------------------- */
.card {
  display: grid;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card { grid-template-columns: minmax(0, 1fr); }
.card > * { min-width: 0; }
.card-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top center; background: var(--surface-2); }
.card-cover.placeholder {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 75%, var(--accent-soft), var(--surface-2) 70%);
  color: var(--accent);
}
.card-cover.placeholder svg { width: 56px; height: 56px; opacity: 0.85; }
.card-body { padding: 20px 22px 22px; }
.card h3 { font-size: 22px; line-height: 1.25; letter-spacing: -0.015em; margin: 4px 0 8px; }
.card .excerpt { color: var(--muted); margin: 0 0 14px; }
.card .more { color: var(--accent); font-weight: 600; font-size: 15px; }
.card.featured { grid-template-columns: 1.25fr 1fr; }
.card.featured .card-cover { height: 100%; aspect-ratio: auto; min-height: 260px; }
.card.featured .card-body { padding: 28px; align-self: center; }
.card.featured h3 { font-size: 28px; }
@media (max-width: 760px) {
  .card.featured { grid-template-columns: 1fr; }
  .card.featured .card-cover { aspect-ratio: 16 / 9; min-height: 0; }
  .card.featured .card-body { padding: 20px 22px 22px; }
  .card.featured h3 { font-size: 23px; }
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card-grid .card { grid-template-rows: auto 1fr; }
.meta { color: var(--muted); font: 500 13px/1.4 var(--mono); margin: 0; }

.archive { display: grid; gap: 28px; }
.archive h3 { font-size: 15px; font-weight: 600; color: var(--muted); margin: 0 0 6px; }
.archive ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.archive li { border-bottom: 1px solid var(--border); }
.archive a {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 2px 16px;
  padding: 14px 4px;
  color: var(--text);
  text-decoration: none;
}
.archive a:hover .title { color: var(--accent); }
.archive time { color: var(--muted); font: 500 13px/1.6 var(--mono); grid-row: span 2; padding-top: 2px; }
.archive .title { font-weight: 650; }
.archive .excerpt { color: var(--muted); font-size: 15px; }
@media (max-width: 520px) {
  .archive a { grid-template-columns: 1fr; }
  .archive time { grid-row: auto; }
}

/* ---- posts --------------------------------------------------------------------------- */
.post-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--measure));
  justify-content: center;
  gap: 56px;
}
@media (min-width: 1080px) {
  .post-layout { grid-template-columns: minmax(0, var(--measure)) 220px; }
}
.post-head { margin-bottom: 32px; }
.post-head h1 { margin: 16px 0 12px; }
.back { font-size: 15px; font-weight: 550; text-decoration: none; }
.toc { display: none; }
@media (min-width: 1080px) {
  .toc { display: block; position: sticky; top: 92px; align-self: start; font-size: 14px; }
  .toc-inline { display: none; }
}
.toc p { font: 600 12px/1 var(--mono); color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; margin: 6px 0 12px; }
.toc ol, .toc-inline ol { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: block;
  padding: 6px 0 6px 14px;
  border-left: 2px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  line-height: 1.35;
}
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--text); border-left-color: var(--accent); }
.toc-inline {
  margin: 0 0 32px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 4px 16px;
}
.toc-inline summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.toc-inline li a { display: block; padding: 6px 0; text-decoration: none; }
.toc-inline ol { padding-bottom: 10px; }

.prose { max-width: var(--measure); }
.prose h2 { font-size: 26px; line-height: 1.25; letter-spacing: -0.015em; margin: 48px 0 12px; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 18px; }
.prose li { margin: 0 0 6px; }
.prose li::marker { color: var(--accent); }
.prose code { font: 0.9em var(--mono); background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.prose table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0 0 22px;
  font-size: 15px;
}
.prose th, .prose td { padding: 9px 14px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.prose th { font: 600 12px/1.4 var(--mono); color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.prose td:first-child { white-space: normal; min-width: 180px; }
.prose tbody tr:hover { background: var(--surface-2); }
.prose figure { margin: 28px 0; }
.prose figure > a, .gallery figure > a { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); cursor: zoom-in; }
figcaption { color: var(--muted); font-size: 14px; line-height: 1.45; margin-top: 10px; }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.post-nav a { display: flex; flex-direction: column; text-decoration: none; color: var(--text); font-weight: 600; max-width: 48%; }
.post-nav a span { color: var(--muted); font: 500 13px/1.6 var(--mono); }
.post-nav .newer { text-align: right; margin-left: auto; }

/* ---- roadmap ------------------------------------------------------------------------- */
.page-head { margin-bottom: 36px; }
.roadmap { position: relative; padding-left: 32px; }
.roadmap > p:first-child { margin-left: -32px; color: var(--muted); font-size: 18px; }
.roadmap h2 { position: relative; font-size: 22px; margin-top: 40px; }
.roadmap h2::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 0.32em;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--bg);
}
.roadmap h2:first-of-type::before { background: var(--accent); }
.roadmap h2:nth-of-type(2)::before { background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.roadmap h2 + ul { position: relative; }
.roadmap h2 + ul::before {
  content: "";
  position: absolute;
  left: -26px;
  top: -18px;
  bottom: -40px;
  border-left: 2px solid var(--border);
}
.roadmap ul:last-child::before { bottom: 0; }
.roadmap ul { padding-left: 20px; }
.page-head .status { margin-top: 4px; }

/* ---- gallery ------------------------------------------------------------------------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 28px 20px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top center; }
.gallery figcaption a { display: block; margin-top: 4px; font-weight: 600; text-decoration: none; }
@media (max-width: 400px) { .gallery { grid-template-columns: 1fr; } }

/* ---- lightbox ------------------------------------------------------------------------ */
.lightbox {
  width: min(96vw, 1600px);
  max-height: 94vh;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ece8e2;
}
.lightbox::backdrop { background: rgb(10 9 8 / 0.88); }
.lightbox img { max-height: 84vh; width: auto; margin: 0 auto; border-radius: 10px; cursor: zoom-out; }
.lightbox p { text-align: center; margin: 12px 0 0; font-size: 15px; color: #c8c2b9; }

/* ---- footer -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 16px 40px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: inherit; }
