:root {
  --bg: #f6f8f7;
  --surface: #ffffff;
  --border: #dde5e2;
  --text: #1d2b29;
  --muted: #5b6b68;
  --accent: #2f7d72;
  --accent-soft: #e3f1ee;
  --warn: #9a5b2b;
  --shadow: 0 1px 3px rgba(20, 40, 36, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111917; --surface: #18221f; --border: #27342f; --text: #e4ece9;
    --muted: #9aaba6; --accent: #6cc3b4; --accent-soft: #1d302c; --warn: #d9a073;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #111917; --surface: #18221f; --border: #27342f; --text: #e4ece9;
  --muted: #9aaba6; --accent: #6cc3b4; --accent-soft: #1d302c; --warn: #d9a073;
  --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--accent); }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* Header */
header.site {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 10;
}
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 60px; flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
nav a, .theme-btn {
  font-size: .9rem; text-decoration: none; color: var(--text);
  padding: 6px 12px; border-radius: 8px; border: 1px solid transparent;
  background: none; cursor: pointer; font-family: inherit;
}
nav a:hover, .theme-btn:hover { background: var(--accent-soft); }
nav a.active { border-color: var(--border); background: var(--accent-soft); color: var(--accent); }

/* Hero */
.hero {
  margin: 40px 0 8px; padding: 36px 32px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: 14px; box-shadow: var(--shadow);
}
.eyebrow {
  font-size: .75rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin: 0 0 8px;
}
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin: 0 0 4px; line-height: 1.1; }
.hero .expand { color: var(--muted); margin: 0 0 14px; font-size: .95rem; }
.hero .tagline { font-size: 1.15rem; max-width: 720px; margin: 0; }

/* Sections */
section { margin: 48px 0; }
h2 { font-size: 1.5rem; margin: 0 0 14px; }
h3 { font-size: 1.05rem; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.lead { font-size: 1.05rem; max-width: 780px; }
.muted { color: var(--muted); }
.note { font-size: .9rem; color: var(--muted); font-style: italic; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; box-shadow: var(--shadow);
}
.card p:last-child { margin: 0; }

/* Stats */
.stat .num { font-size: 2.2rem; font-weight: 700; color: var(--accent); line-height: 1.1; }

/* Table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 560px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--accent-soft); font-weight: 600; }
tr:last-child td { border-bottom: none; }
td.gap { color: var(--warn); }

/* Pipeline */
.steps { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); counter-reset: s; }
.step { position: relative; padding-top: 44px; }
.step::before {
  counter-increment: s; content: counter(s);
  position: absolute; top: 14px; left: 20px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: var(--surface);
  font-size: .8rem; font-weight: 700; display: grid; place-items: center;
}
.highlight { border-color: var(--accent); }

/* Episode */
.episode .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 700; }

ul.plain { padding-left: 20px; margin: 0; }
ul.plain li { margin-bottom: 4px; }

/* Docs list */
.doc {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 18px; margin-bottom: 8px; flex-wrap: wrap;
}
.badge {
  font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); white-space: nowrap;
}
.badge.soon { color: var(--muted); }

.role { color: var(--muted); font-size: .9rem; margin: 0; }

footer {
  border-top: 1px solid var(--border); margin-top: 64px; padding: 20px 0;
  font-size: .85rem; color: var(--muted);
}
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

@media (max-width: 600px) {
  .hero { padding: 26px 20px; margin-top: 24px; }
  section { margin: 36px 0; }
}
