:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #1d2330; --muted: #5f6b7a; --line: #dfe3ea;
  --accent: #1f6f5c; --accent-ink: #ffffff; --accent-soft: #e3f1ed; --danger: #b42318;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --panel: #1a1e26; --ink: #e6e9ef; --muted: #98a2b3; --line: #2c323d;
    --accent: #4cc3a2; --accent-ink: #0d1a16; --accent-soft: #173229; --danger: #ff6b5f;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
[hidden] { display: none !important; }
a { color: var(--accent); }
.muted { color: var(--muted); }

.site-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1180px; margin: 0 auto; padding: 18px 24px; }
.brand { font-weight: 700; font-size: 20px; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.brand span { color: var(--accent); }
.site-head nav { display: flex; gap: 22px; align-items: center; }
.site-head nav a { color: var(--ink); text-decoration: none; font-size: 15px; }
.site-head nav a:hover { color: var(--accent); }
.site-head .signin { border: 1px solid var(--line); border-radius: 8px; padding: 6px 14px; background: var(--panel); }
.site-head .signin-m { display: none; color: var(--ink); text-decoration: none; font-size: 15px; }

main { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { letter-spacing: -.015em; line-height: 1.2; }

.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: center; padding: 28px 0 64px; }
.eyebrow { color: var(--accent); font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 12px; }
.hero h1 { font-size: 44px; margin: 0 0 18px; }
.oss-line { display: inline-block; font-size: 15px; font-weight: 500; background: var(--accent-soft); border-radius: 10px; padding: 8px 14px; margin: 0 0 16px; }
.lead { font-size: 18px; color: var(--muted); margin: 0 0 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.note { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.note.bad { color: var(--danger); }
figure { margin: 0; }
figure img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 18px 50px -24px rgba(16, 24, 40, .35); background: var(--panel); }

button, .button { font: inherit; border-radius: 8px; padding: 8px 16px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block; }
button:disabled { opacity: .55; cursor: default; }
.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ghost { background: transparent; }
.big { padding: 12px 22px; font-size: 16px; font-weight: 600; }

.features { padding: 24px 0 40px; }
.features h2, .showcase h2, .demo h2, .next h2 { font-size: 30px; margin: 0 0 20px; }
.features .grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.features article { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.features h3 { margin: 0 0 8px; font-size: 18px; }
.features p { margin: 0; color: var(--muted); font-size: 15px; }

.showcase { padding: 40px 0; display: grid; gap: 64px; }
.showcase .row { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 44px; align-items: center; }
.showcase .row.reverse figure { order: 2; }
.showcase h2 { font-size: 26px; }
.showcase p { color: var(--muted); }

.demo { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 40px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 36px 40px; margin: 32px 0; scroll-margin-top: 20px; }
.demo p { color: var(--muted); }
.demo h3 { margin: 24px 0 8px; font-size: 18px; }
.tries { margin: 0 0 24px; padding-left: 20px; }
.tries li { margin: 6px 0; }
.people { background: var(--accent-soft); border-radius: 12px; padding: 4px 22px 18px; align-self: start; }
.people dt { font-weight: 600; margin-top: 14px; }
.people dd { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.turnstile { margin-top: 12px; }

.oss { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 40px; padding: 40px 0 24px; scroll-margin-top: 20px; }
.oss h2 { font-size: 30px; margin: 0 0 16px; }
.oss p { color: var(--muted); }
.oss .stack { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 4px 24px 20px; align-self: start; }
.oss .stack h3 { font-size: 18px; margin: 18px 0 8px; }
.oss .stack ul { margin: 0; padding-left: 20px; }
.oss .stack li { margin: 8px 0; }
.next { padding: 16px 0 48px; }
.next p { color: var(--muted); max-width: 720px; }

.site-foot { max-width: 1180px; margin: 0 auto; padding: 28px 24px 40px; display: flex; flex-wrap: wrap; gap: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.site-foot .foot-links { margin-left: auto; display: flex; gap: 18px; }

@media (max-width: 900px) {
  .hero, .showcase .row, .demo, .oss { grid-template-columns: minmax(0, 1fr); }
  .showcase .row.reverse figure { order: 0; }
  .features .grid { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 34px; }
  .demo { padding: 24px 20px; }
  /* Every link stays reachable: the nav becomes a scrollable strip under the brand. */
  .site-head { flex-wrap: wrap; row-gap: 10px; padding: 14px 16px 10px; }
  .site-head nav { order: 3; width: 100%; gap: 16px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .site-head nav::-webkit-scrollbar { display: none; }
  .site-head nav { -webkit-mask-image: linear-gradient(to right, #000 88%, transparent); mask-image: linear-gradient(to right, #000 88%, transparent); }
  .site-head nav a { white-space: nowrap; font-size: 15px; }
  .site-head nav .signin { display: none; }
  .site-head .signin-m { display: inline-block; padding: 4px 12px; }
  main, .site-foot { padding-left: 16px; padding-right: 16px; }
}

/* The AI-built line at the top of the hero */
.ai-line { display: table; margin: 16px 0 0; padding: 8px 16px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.ai-line strong { font-weight: 650; }
.ai-line a { margin-left: 6px; white-space: nowrap; font-weight: 500; }
.ai-line a::after { content: " \2192"; }

/* ---- Inner pages (roadmap, architecture) ---- */
:root { --info: #2453a6; --info-soft: #e5edfb; --gray-soft: #eef0f4; }
@media (prefers-color-scheme: dark) { :root { --info: #8fb4ff; --info-soft: #1b2a45; --gray-soft: #232833; } }
.site-head nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.doc { padding-bottom: 32px; }
.page-hero { padding: 36px 0 28px; max-width: 860px; }
.page-hero h1 { font-size: 42px; margin: 0 0 16px; }
.doc h2 { font-size: 28px; margin: 0 0 14px; }
.doc h3 { font-size: 18px; margin: 0 0 8px; }
.doc section { padding: 28px 0; }
.doc p { color: var(--muted); }
.doc .intro { max-width: 820px; margin: 0 0 22px; }
.badge { display: inline-block; font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.badge.shipped { background: var(--accent-soft); color: var(--accent); }
.badge.next { background: var(--info-soft); color: var(--info); }
.badge.planned { background: var(--gray-soft); color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.cards { display: grid; gap: 16px; }
.cards.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card p { margin: 0; font-size: 15px; }
.card h3 { margin-bottom: 6px; }
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding-left: 22px; margin: 8px 0; color: var(--ink); font-size: 15px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.ticks.muted li::before { background: var(--line); border: 1px solid var(--muted); }
.ticks li span { color: var(--muted); }

/* Roadmap timeline */
.timeline { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 10%; right: 10%; top: 15px; height: 2px; background: var(--line); }
.timeline li { position: relative; text-align: center; padding: 0 8px; }
.timeline .dot { position: relative; z-index: 1; display: block; width: 32px; height: 32px; margin: 0 auto 12px; border-radius: 50%; border: 2px solid var(--line); background: var(--bg); font-weight: 700; font-size: 14px; line-height: 28px; color: var(--muted); }
.timeline li.shipped .dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.timeline li.next .dot { border-color: var(--info); color: var(--info); }
.timeline a { color: var(--ink); text-decoration: none; font-weight: 650; display: block; margin: 6px 0 2px; }
.timeline a:hover { color: var(--accent); }
.timeline small { color: var(--muted); font-size: 13px; }
.phase { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px 30px; margin: 0 0 20px; scroll-margin-top: 16px; }
.phase header { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 6px; }
.phase .when { color: var(--muted); font-size: 14px; }
.phase h2 { margin: 4px 0 6px; }
.phase .outcome { color: var(--ink); font-size: 17px; margin: 0 0 18px; max-width: 860px; }
.phase .cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 28px; }
.phase .cols h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 4px; }
.criteria .card h3::before { content: "\2713"; display: inline-block; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 13px; line-height: 22px; text-align: center; }
.callout { background: var(--accent-soft); border-radius: 14px; padding: 24px 28px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.callout p { margin: 4px 0 0; color: var(--ink); }
.callout h2 { margin: 0; font-size: 22px; }

/* Architecture diagram */
.diagram { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1.25fr) 40px minmax(0, 1fr); align-items: stretch; gap: 0; margin: 8px 0 4px; }
.tier { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--panel); }
.tier > h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.tier.edge { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; background: var(--bg); }
.box:last-child { margin-bottom: 0; }
.box b { display: block; font-size: 15px; }
.box span { display: block; color: var(--muted); font-size: 13px; line-height: 1.4; }
.box.planned { border-style: dashed; }
.box.key { border-color: var(--accent); }
.arrow { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 22px; }
.arrow::before { content: "\2192"; }
.legend { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stats .card b { display: block; font-size: 26px; letter-spacing: -.02em; color: var(--ink); }
.stats .card span { color: var(--muted); font-size: 14px; }
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; position: relative; padding: 14px 18px 14px 60px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.steps li::before { content: counter(step); position: absolute; left: 16px; top: 13px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; text-align: center; line-height: 30px; }
.steps li b { display: block; }
.steps li span { color: var(--muted); font-size: 15px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
table.spec { width: 100%; border-collapse: collapse; font-size: 15px; }
table.spec th, table.spec td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--line); }
table.spec tr:last-child td { border-bottom: 0; }
table.spec th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--bg); }
table.spec td:first-child { font-weight: 600; white-space: nowrap; }
table.spec td.ev { color: var(--muted); }
table.spec code, .doc code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: var(--gray-soft); border-radius: 5px; padding: 1px 5px; }
.toc { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.toc a { display: inline-block; font-size: 14px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; text-decoration: none; color: var(--ink); background: var(--panel); }
.toc a:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 900px) {
  .page-hero h1 { font-size: 32px; }
  .cards.c2, .cards.c3, .cards.c4, .stats, .phase .cols { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timeline { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .timeline::before { left: 15px; right: auto; top: 16px; bottom: 16px; width: 2px; height: auto; }
  .timeline li { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 14px; text-align: left; padding: 0; }
  .timeline .dot { margin: 0; grid-row: span 3; }
  .timeline a { margin: 4px 0 0; }
  .timeline .badge { justify-self: start; }
  .phase { padding: 22px 18px; }
  .diagram { grid-template-columns: minmax(0, 1fr); }
  .arrow { height: 34px; }
  .arrow::before { content: "\2193"; }
  /* Tables become one card-like block per row */
  .table-wrap { overflow: visible; }
  table.spec, table.spec tbody, table.spec tr, table.spec td { display: block; width: 100%; }
  table.spec thead { display: none; }
  table.spec tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  table.spec tr:last-child { border-bottom: 0; }
  table.spec td { border: 0; padding: 2px 0; white-space: normal; }
  table.spec td:first-child { white-space: normal; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
