:root {
  color-scheme: dark;
  --bg: #0b0f13;
  --bg-soft: #10161c;
  --panel: #121a21;
  --panel-2: #17222b;
  --ink: #edf4f8;
  --muted: #9db0bd;
  --dim: #71838f;
  --line: #263640;
  --line-strong: #35505c;
  --cyan: #79d3ff;
  --cyan-soft: rgba(121, 211, 255, 0.14);
  --amber: #ffb46b;
  --amber-soft: rgba(255, 180, 107, 0.13);
  --green: #8fe3b0;
  --radius: 18px;
  --mono: ui-monospace, "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(121, 211, 255, 0.10), transparent 60%),
    radial-gradient(900px 600px at 0% 12%, rgba(255, 180, 107, 0.055), transparent 55%),
    var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #b7e9ff; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 20;
  padding: 10px 14px;
  background: var(--amber);
  color: #17120b;
  border-radius: 8px;
  font-weight: 700;
}
.skip-link:focus { top: 12px; }

.wrap {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 15, 19, 0.82);
  border-bottom: 1px solid rgba(38, 54, 64, 0.8);
  backdrop-filter: blur(14px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.02em;
}
.brand:hover { color: var(--ink); }
.brand-dim { color: var(--muted); }

.brand-mark {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background:
    linear-gradient(135deg, var(--cyan) 0 48%, transparent 48% 52%, var(--amber) 52% 100%);
  box-shadow: 0 0 24px rgba(121, 211, 255, 0.12);
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13.5px;
}
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }
.nav .nav-cta {
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 13px;
  background: rgba(23, 34, 43, 0.7);
}
.nav .nav-cta:hover { border-color: var(--cyan); }

.hero { padding: 92px 0 52px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 56px;
  align-items: start;
}
.eyebrow {
  margin: 0 0 18px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-size: clamp(42px, 6.2vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 720;
}
h1 span { color: var(--muted); }
.lede {
  max-width: 62ch;
  margin: 26px 0 0;
  color: #c5d2da;
  font-size: clamp(17px, 1.7vw, 20px);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 17px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 650;
  font-size: 14.5px;
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary {
  color: #08202b;
  background: var(--cyan);
  border-color: var(--cyan);
}
.button.primary:hover { background: #a6e3ff; color: #08202b; }
.button.ghost {
  color: var(--ink);
  border-color: var(--line-strong);
  background: rgba(18, 26, 33, 0.65);
}
.button.ghost:hover { border-color: var(--cyan); color: var(--ink); }
.button.small { min-height: 36px; padding: 7px 12px; font-size: 13px; }

.hero-note {
  margin-top: 22px;
  color: var(--dim);
  font-size: 13px;
}

.status-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(23, 34, 43, 0.82), rgba(18, 26, 33, 0.72));
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}
.status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(143, 227, 176, 0.8);
}
.status-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.status-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(38, 54, 64, 0.72);
  font-size: 13.5px;
}
.status-list span { color: var(--muted); }
.status-list strong { text-align: right; font-weight: 650; }
.status-list .accent { color: var(--amber); }
.status-list a { color: var(--cyan); text-decoration: none; }
.status-list a:hover { color: #b7e9ff; text-decoration: underline; }
.status-note {
  margin: 0;
  padding: 15px 18px;
  color: var(--dim);
  font-size: 12.5px;
}

.section { padding: 64px 0; }
.section.tight { padding-top: 28px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.section-head h2, .page-title, .section-heading {
  margin: 0;
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}
.section-heading { margin-bottom: 16px; }
.lede.compact { margin-top: 0; font-size: 16px; }
.section-head p {
  max-width: 52ch;
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
}
.kicker {
  margin: 0 0 10px;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.grid { display: grid; gap: 18px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(23, 34, 43, 0.72), rgba(18, 26, 33, 0.6));
  padding: 22px;
}
.card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: -0.015em;
}
.card p { color: var(--muted); margin: 0; font-size: 14px; }
.card p + p { margin-top: 10px; }
.card .tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px 9px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
}
.card .tag.accent { color: var(--amber); border-color: rgba(255, 180, 107, 0.3); background: var(--amber-soft); }
.card .tag.cyan { color: var(--cyan); border-color: rgba(121, 211, 255, 0.3); background: var(--cyan-soft); }
.card-top { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }

.moment { display: flex; flex-direction: column; gap: 14px; }
.moment .number {
  color: var(--amber);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
}
pre {
  margin: 0;
  padding: 15px;
  border: 1px solid rgba(38, 54, 64, 0.8);
  border-radius: 12px;
  background: #0a1015;
  color: #cbd8df;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre-wrap;
}
pre .ok { color: var(--green); }
pre .warn { color: var(--amber); }
pre .rule { color: var(--cyan); }

.sample-card { display: flex; flex-direction: column; }
.sample-card .run-id {
  margin-left: auto;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10.5px;
}
.sample-card h3 { margin-top: 4px; font-size: 22px; }
/* an archived sample: kept whole and replayable, visibly not featured */
.sample-card.archived { border-style: dashed; opacity: 0.88; }
.sample-card .superseded { color: var(--dim); font-size: 13px; margin-top: 10px; }
.sample-card .stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--line);
}
.sample-card .stats div {
  background: var(--panel);
  padding: 9px 11px;
}
.sample-card .stats span { display: block; color: var(--dim); font-size: 10.5px; font-family: var(--mono); }
.sample-card .stats strong { display: block; margin-top: 2px; font-size: 13px; font-weight: 650; }
.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
}
.text-link { font-size: 13px; color: var(--muted); text-decoration: none; }
.text-link:hover { color: var(--cyan); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 32px;
  align-items: center;
}
.split.top { align-items: start; }
.diagram {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0a0f14;
}
.caption { margin: 10px 0 0; color: var(--dim); font-size: 12px; }

/* inline code in prose — the charter ids, gate words and commands the
   samples page teaches with */
.card code, .list code, .lede code, p code {
  font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: rgba(127, 209, 255, 0.08);
  border: 1px solid rgba(127, 209, 255, 0.14);
  border-radius: 4px;
  padding: 0 4px;
}
.diagram-block { margin-top: 32px; }
/* the main page's "at a glance": the five ideas and the community in one
   drawing, wide on desktop, a tall variant on phones (<picture>) */
.glance { margin: 44px 0 0; }
.glance .kicker { margin-bottom: 12px; }
.glance img { display: block; width: 100%; height: auto; }
.glance figcaption { margin-top: 10px; color: var(--dim); font-size: 13px; }
/* "why this exists": the purpose, between the drawing and the five ideas */
.why-list { margin-top: 18px; }
.why-stage { margin-top: 14px; color: var(--dim); font-size: 14px; }

.list { margin: 0; padding: 0; list-style: none; }
.list li {
  padding: 13px 0;
  border-bottom: 1px solid rgba(38, 54, 64, 0.7);
  color: var(--muted);
  font-size: 14px;
}
.list li:first-child { padding-top: 0; }
.list li:last-child { border-bottom: 0; }
.list strong { color: var(--ink); font-weight: 650; }

.note {
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  padding: 16px 18px;
  border-radius: 0 12px 12px 0;
  color: #d8c7b5;
  font-size: 13.5px;
}
.note strong { color: var(--ink); }
.note.offset { margin-top: 18px; }

.site-footer {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  padding: 28px 0 40px;
  color: var(--dim);
  font-size: 12.5px;
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; }
.footer-inner p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

section[id] { scroll-margin-top: 84px; }

.page-hero { padding: 72px 0 24px; }
.page-hero .lede { max-width: 72ch; }
.page-hero .actions { margin-top: 24px; }

details {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(18, 26, 33, 0.6);
  padding: 0;
}
details + details { margin-top: 10px; }
summary {
  cursor: pointer;
  padding: 15px 18px;
  color: var(--ink);
  font-weight: 600;
}
details > div { padding: 0 18px 16px; color: var(--muted); font-size: 14px; }
details > div p { margin-top: 0; }

/* the runs side by side — generated by tools/samples-table.mjs; the
   wrapper scrolls on narrow screens so the page itself never does */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.runs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.runs-table th, .runs-table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.runs-table th {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--panel-2);
}
.runs-table tbody tr:last-child td { border-bottom: 0; }
.runs-table td { color: var(--muted); }
.runs-table td:first-child a { color: var(--ink); font-weight: 600; text-decoration: none; }
.runs-table td a { color: var(--cyan); text-decoration: none; }
.runs-table td a:hover { text-decoration: underline; }
.runs-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.runs-table small { color: var(--dim); font-size: 11px; }
.runs-table .run-id { color: var(--dim); font-family: var(--mono); font-size: 11px; }
.runs-table td.gates { white-space: normal; min-width: 150px; max-width: 220px; }
.runs-table td.ships { font-size: 12px; line-height: 1.6; }
.runs-table .muted { color: var(--dim); }
.runs-table .warn { color: var(--amber); }
.runs-table code { font-family: var(--mono); font-size: 12px; color: var(--ink); }

/* the concept ladder (landing) and the learn page */
.ladder { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.rung { display: flex; flex-direction: column; gap: 10px; }
.rung .rung-num { font-family: var(--mono); font-size: 12px; color: var(--amber); letter-spacing: 0.08em; text-transform: uppercase; }
.rung h3 { margin: 0; }
.rung .question { color: var(--ink); font-weight: 600; font-size: 14px; }
.rung pre { margin: 4px 0 0; font-size: 11.5px; white-space: pre-wrap; word-break: break-word; }
.rung .notlike, .notlike { color: var(--dim); font-size: 13px; }
.rung .notlike strong, .notlike strong { color: var(--muted); }
.rung .card-actions { margin-top: auto; }
.toc { display: flex; flex-wrap: wrap; gap: 8px 10px; list-style: none; padding: 0; margin: 22px 0 0; }
.toc a { display: inline-block; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 13px; }
.toc a:hover { color: var(--cyan); border-color: var(--line-strong); }
.section.concept { border-top: 1px solid var(--line); }
.section.concept pre { white-space: pre-wrap; word-break: break-word; }
.card.worked { margin-top: 18px; }
.diagram.wide { width: 100%; height: auto; display: block; margin-top: 12px; }
.glossary { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 10px 22px; margin: 0; }
.glossary dt { color: var(--ink); font-weight: 600; font-family: var(--mono); font-size: 13px; padding-top: 2px; }
.glossary dd { margin: 0; color: var(--muted); font-size: 14px; }
.glossary dt:target, .glossary dt:target + dd { color: var(--amber); }

@media (max-width: 900px) {
  .hero-grid, .split { grid-template-columns: 1fr; gap: 34px; }
  .grid.three { grid-template-columns: 1fr 1fr; }
  .ladder { grid-template-columns: 1fr 1fr; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .status-card { max-width: 560px; }
  .nav { gap: 14px; font-size: 13px; }
}

@media (max-width: 660px) {
  .wrap { width: min(100% - 32px, 1120px); }
  .site-header { position: static; }
  .header-inner {
    flex-wrap: wrap;
    min-height: 0;
    padding: 12px 0 10px;
    gap: 8px 16px;
  }
  .nav {
    display: flex;
    width: 100%;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 3px;
    font-size: 12.5px;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
  .nav .nav-cta { padding: 5px 11px; }
  .hero { padding-top: 58px; }
  h1 { font-size: clamp(38px, 12vw, 56px); }
  .grid.three, .grid.two { grid-template-columns: 1fr; }
  .ladder { grid-template-columns: 1fr; }
  .glossary { grid-template-columns: 1fr; gap: 2px; }
  .glossary dd { margin-bottom: 10px; }
  .section { padding: 46px 0; }
  .card { padding: 18px; }
  .sample-card h3 { font-size: 20px; }
  section[id] { scroll-margin-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .button { transition: none; }
}
