:root {
  --bg: #0d1117;
  --bg-2: #0a0d12;
  --panel: #151b23;
  --panel-2: #10161d;
  --line: #262f3a;
  --text: #f0f6fc;
  --muted: #9aa6b2;
  --green: #3fb950;
  --green-strong: #0abf40;
  --green-soft: rgba(63, 185, 80, 0.12);
  --purple: #a371f7;
  --purple-strong: #8534f3;
  --purple-soft: rgba(163, 113, 247, 0.12);
  --warn: #f0883e;
  --radius: 16px;
  --font: "Mona Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --mono: "Mona Sans Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; }
a { color: var(--green); text-underline-offset: 3px; }
a:hover { color: #56d364; }
code { font-family: var(--mono); font-size: 0.88em; background: rgba(110, 118, 129, 0.2); padding: 0.12em 0.4em; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; }
.wrap { width: min(1180px, 100% - 48px); margin-inline: auto; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px clamp(16px, 4vw, 40px); background: rgba(13, 17, 23, 0.78); backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid rgba(240, 246, 252, 0.08); }
.brand { display: flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none; }
.brand img { width: 160px; height: auto; display: block; }
.brand-divider { width: 1px; height: 22px; background: var(--line); }
.brand-event { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.topnav { display: flex; align-items: center; gap: 6px; }
.topnav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 999px; }
.topnav a:hover { color: var(--text); background: rgba(240, 246, 252, 0.06); }
.topnav .topnav-cta { color: var(--bg); background: var(--text); }
.topnav .topnav-cta:hover { color: var(--bg); background: #d0d7de; }

/* Hero */
.hero { position: relative; min-height: min(92vh, 860px); display: flex; align-items: flex-end; overflow: hidden; isolation: isolate; background: radial-gradient(120% 80% at 70% 70%, #12301f 0%, var(--bg-2) 60%); }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; display: block; }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(10, 13, 18, 0.92) 0%, rgba(10, 13, 18, 0.62) 42%, rgba(10, 13, 18, 0.08) 75%), linear-gradient(0deg, rgba(13, 17, 23, 1) 0%, rgba(13, 17, 23, 0) 30%); pointer-events: none; }
.hero-content { width: min(1180px, 100% - 48px); margin: 0 auto; padding: 120px 0 clamp(72px, 12vh, 120px); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px; padding: 6px 14px; border: 1px solid rgba(63, 185, 80, 0.45); border-radius: 999px; color: #7ee787; background: rgba(13, 17, 23, 0.55); font: 600 13px/1.4 var(--mono); letter-spacing: 0.02em; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(63, 185, 80, 0.2); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(63, 185, 80, 0); } }
.hero h1 { margin: 0; max-width: 820px; font-size: clamp(42px, 6.4vw, 84px); line-height: 0.98; letter-spacing: -0.035em; font-weight: 800; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.45); }
.accent { background: linear-gradient(92deg, #7ee787 0%, #56d364 35%, #a371f7 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { max-width: 600px; margin: 26px 0 0; color: #c9d1d9; font-size: clamp(17px, 1.6vw, 20px); text-shadow: 0 1px 16px rgba(0, 0, 0, 0.6); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-byline { margin: 28px 0 0; color: var(--muted); font-size: 14px; }
.hero-legend { position: absolute; right: clamp(16px, 4vw, 40px); bottom: 26px; display: flex; gap: 18px; color: var(--muted); font-size: 13px; }
.hero-legend span { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 18px; height: 4px; border-radius: 2px; display: inline-block; }
.swatch-main { background: var(--green); box-shadow: 0 0 10px var(--green); }
.swatch-feature { background: var(--purple); box-shadow: 0 0 10px var(--purple); }
.flight-toggle { position: absolute; right: clamp(16px, 4vw, 40px); top: 88px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(240, 246, 252, 0.18); background: rgba(13, 17, 23, 0.6); color: var(--text); font: 600 13px var(--font); cursor: pointer; backdrop-filter: blur(8px); }
.flight-toggle:hover { border-color: rgba(240, 246, 252, 0.4); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 22px; border-radius: 999px; font: 700 16px var(--font); text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: transform 0.15s ease, background 0.15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green-strong); color: #04150a; }
.btn-primary:hover { background: #2ad15a; color: #04150a; }
.btn-ghost { color: var(--text); border-color: rgba(240, 246, 252, 0.28); background: rgba(13, 17, 23, 0.45); }
.btn-ghost:hover { color: var(--text); border-color: rgba(240, 246, 252, 0.6); }
.btn-small { min-height: 42px; padding: 8px 18px; font-size: 15px; background: var(--green-strong); color: #04150a; }

/* Intro strip */
.intro-strip { border-block: 1px solid var(--line); background: linear-gradient(90deg, rgba(63, 185, 80, 0.07), rgba(163, 113, 247, 0.07)); }
.intro-grid { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding: 26px 0; }
.intro-grid p { margin: 0; max-width: 620px; color: #c9d1d9; }
.stats { display: flex; gap: 32px; margin: 0; padding: 0; list-style: none; }
.stats li { display: flex; flex-direction: column; }
.stats b { font-size: 32px; line-height: 1; font-weight: 800; color: var(--text); }
.stats span { font-size: 13px; color: var(--muted); }

/* Layout */
.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 56px; padding: 64px 0 40px; }
.rail { position: sticky; top: 96px; align-self: start; }
.rail-title { margin: 0 0 12px; font: 700 12px var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); }
.rail-list { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 1px solid var(--line); counter-reset: stop; }
.rail-list li { counter-increment: stop; }
.rail-list a { position: relative; display: block; padding: 6px 0; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; }
.rail-list a::before { content: ""; position: absolute; left: -21px; top: 13px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--line); }
.rail-list a:hover { color: var(--text); }
.rail-list a.active { color: var(--text); }
.rail-list a.active::before { border-color: var(--green); background: var(--green); box-shadow: 0 0 12px var(--green); }
.rail-progress { margin-top: 18px; height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.rail-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--purple)); }

.section { padding: 56px 0; border-bottom: 1px solid rgba(240, 246, 252, 0.06); }
.section:first-child { padding-top: 0; }
.kicker { margin: 0 0 10px; font: 700 13px var(--mono); color: var(--green); letter-spacing: 0.06em; text-transform: uppercase; }
.demo .kicker { color: var(--purple); }
h2 { margin: 0 0 18px; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.1; letter-spacing: -0.02em; }
h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.25; }
.mini { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 22px 0 10px; }
.mini:first-child { margin-top: 0; }
.lead { max-width: 760px; margin: 0 0 26px; color: #c9d1d9; font-size: 18px; }
.note { margin: 22px 0 0; padding: 14px 18px; border-left: 3px solid var(--green); background: var(--green-soft); border-radius: 0 12px 12px 0; color: #c9d1d9; font-size: 15px; }
.fine { color: var(--muted); font-size: 13px; margin: 10px 0 0; }

.card { padding: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card p { margin: 0; color: #c9d1d9; }
.card-muted { background: var(--panel-2); }
.card-accent { border-color: rgba(163, 113, 247, 0.45); background: linear-gradient(160deg, rgba(163, 113, 247, 0.12), var(--panel) 60%); }
.card-warn { border-color: rgba(240, 136, 62, 0.45); background: linear-gradient(160deg, rgba(240, 136, 62, 0.1), var(--panel) 60%); }
.cards-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.compare, .prompt-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.prompt-compare { margin-top: 18px; }
.prompt-compare p { font-size: 17px; margin-top: 8px; }
.tag { display: inline-block; margin-bottom: 12px; padding: 3px 10px; border-radius: 999px; font: 700 12px var(--mono); background: rgba(110, 118, 129, 0.2); color: var(--muted); }
.tag-green { background: var(--green-soft); color: #7ee787; }
.tag-purple { background: var(--purple-soft); color: #d2a8ff; }
.files { margin: 12px 0; font: 14px/1.7 var(--mono); color: var(--muted); }
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding: 5px 0 5px 28px; color: #c9d1d9; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 12px; height: 7px; border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg); }

.waypoints { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; }
.waypoints a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; font-weight: 700; transition: border-color 0.2s, transform 0.2s; }
.waypoints a:hover { border-color: var(--green); transform: translateY(-2px); color: var(--text); }
.waypoints span { font: 700 13px var(--mono); color: var(--green); }
.waypoints li:nth-child(n+3) span { color: var(--purple); }

.zones { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 10px; }
.zone { padding: 22px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.zone b { font-size: 18px; }
.zone span { color: var(--muted); font-size: 15px; }
.zone-accent { border-color: rgba(63, 185, 80, 0.5); background: linear-gradient(160deg, rgba(63, 185, 80, 0.14), var(--panel) 65%); }
.zone-arrow { font: 600 13px var(--mono); color: var(--green); white-space: nowrap; }
.diffnote { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.diffnote p { margin: 0; padding: 14px 16px; border-radius: 12px; background: var(--panel-2); border: 1px dashed var(--line); color: #c9d1d9; font-size: 15px; }

.steps { display: grid; gap: 18px; }
.step { padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.step h3 { display: flex; align-items: center; gap: 12px; }
.step h3 span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--green-soft); color: #7ee787; font: 700 14px var(--mono); }
.step p { margin: 12px 0 0; color: #c9d1d9; font-size: 15px; }

.term { margin-top: 12px; border-radius: 12px; overflow: hidden; border: 1px solid #30363d; background: #010409; }
.term-bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: #161b22; border-bottom: 1px solid #30363d; }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #30363d; }
.term-bar i:nth-child(1) { background: #f85149; } .term-bar i:nth-child(2) { background: #d29922; } .term-bar i:nth-child(3) { background: #3fb950; }
.term pre, .code, .sample pre { margin: 0; padding: 16px 18px; overflow-x: auto; font: 14.5px/1.7 var(--mono); color: #e6edf3; }
.term code, .code code { background: none; padding: 0; font-size: inherit; }
.term-output pre { font-size: 13.5px; }
.t-fail { color: #ff7b72; } .t-ok { color: #7ee787; }
.copy { margin-left: auto; padding: 4px 12px; border-radius: 6px; border: 1px solid #30363d; background: #21262d; color: var(--text); font: 600 12px var(--font); cursor: pointer; }
.copy:hover { background: #30363d; }
.copy.done { color: #7ee787; border-color: rgba(63, 185, 80, 0.5); }
.sample { margin-top: 14px; border-radius: 12px; border: 1px dashed var(--line); background: var(--panel-2); }
.sample-label { margin: 0 !important; padding: 10px 18px 0; font: 600 12px var(--mono); color: var(--muted); }

.graph { margin: 0 0 22px; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: radial-gradient(80% 120% at 50% 0%, rgba(163, 113, 247, 0.1), var(--panel-2)); }
.graph svg { width: 100%; height: auto; display: block; }
.g-main { stroke: var(--green); stroke-width: 5; fill: none; filter: drop-shadow(0 0 6px rgba(63, 185, 80, 0.6)); }
.g-feature { stroke: var(--purple); stroke-width: 5; fill: none; stroke-dasharray: 2 0; filter: drop-shadow(0 0 6px rgba(163, 113, 247, 0.6)); }
.g-node circle { stroke-width: 4; }
.g-node-main circle { fill: #0d2a16; stroke: var(--green); }
.g-node-feature circle { fill: #251840; stroke: var(--purple); }
.g-node text { fill: var(--text); font: 700 15px var(--mono); text-anchor: middle; }
.g-label { fill: var(--muted); font: 600 15px var(--mono); }
.g-label-main { fill: #7ee787; } .g-label-feature { fill: #d2a8ff; }
.flow, .loop { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; list-style: none; margin: 0; padding: 0; counter-reset: flow; }
.flow li, .loop li { counter-increment: flow; position: relative; padding: 18px 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 6px; }
.flow li::before, .loop li::before { content: counter(flow, decimal-leading-zero); font: 700 12px var(--mono); color: var(--green); }
.loop li:nth-child(n+3)::before { color: var(--purple); }
.flow span, .loop span { color: var(--muted); font-size: 14.5px; }
.more { margin-top: 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.more summary { cursor: pointer; padding: 14px 18px; font-weight: 700; }
.more ul { margin: 0; padding: 0 18px 16px 38px; color: #c9d1d9; font-size: 15px; }
.more ul li { margin: 6px 0; }
.more .code { border-top: 1px solid var(--line); }

.demo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; align-items: start; }
.prompt { border-radius: 12px; border: 1px solid rgba(163, 113, 247, 0.45); background: linear-gradient(160deg, rgba(163, 113, 247, 0.12), var(--panel) 70%); overflow: hidden; }
.prompt-bar { display: flex; align-items: center; padding: 8px 12px; font: 700 12px var(--mono); color: #d2a8ff; text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 1px solid rgba(163, 113, 247, 0.25); }
.prompt p { margin: 0; padding: 16px 18px; color: #e6edf3; font-size: 15.5px; }
.tabs { display: flex; gap: 6px; margin: 16px 0 0; }
.tabs button { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 600 14px var(--font); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--text); background: var(--panel); border-color: rgba(240, 246, 252, 0.3); }

.playground { padding: 22px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); }
.play-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.play-head h3 { margin: 0; }
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); }
.segmented button { padding: 6px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 600 13px var(--font); cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--text); color: var(--bg); }
.play-form, .play-filter { margin-top: 16px; }
.play-form label, .play-filter label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.row { display: flex; gap: 8px; }
.playground input { flex: 1; width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 10px; border: 1px solid #3d444d; background: #010409; color: var(--text); font: 15px var(--font); }
.play-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.play-list li { padding: 10px 14px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.play-list li[hidden] { display: none; }
.play-status { min-height: 1.5em; margin: 10px 0 0; color: var(--muted); font-size: 14px; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 760px; }
.checklist label { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; }
.checklist input { width: 20px; height: 20px; accent-color: var(--green-strong); flex: none; }
.checklist label:has(input:checked) { border-color: rgba(63, 185, 80, 0.5); background: linear-gradient(90deg, rgba(63, 185, 80, 0.12), var(--panel)); }
.checklist-progress { margin: 14px 0 0; color: var(--muted); font: 600 14px var(--mono); }

.links { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.links a { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; transition: border-color 0.2s; }
.links a:hover { border-color: var(--green); color: var(--text); }
.links span { color: var(--muted); font-size: 14px; }

.tree { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tree li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; padding: 12px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.tree a { text-decoration: none; }
.tree span { color: var(--muted); font-size: 15px; }

.footer { border-top: 1px solid var(--line); padding: 36px 0 44px; background: var(--bg-2); }
.footer-grid { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; }
.footer p { margin: 4px 0; }
.footer-name { font-weight: 800; font-size: 18px; }
.footer .fine { max-width: 460px; text-align: right; }

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 1020px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding-top: 48px; }
  .rail { display: none; }
  .topnav a:not(.topnav-cta) { display: none; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap, .hero-content { width: calc(100% - 32px); }
  .brand img { width: 128px; }
  .brand-divider, .brand-event { display: none; }
  .hero { min-height: 88vh; }
  .hero-content { padding: 96px 0 96px; }
  .hero-shade { background: linear-gradient(0deg, rgba(13, 17, 23, 1) 8%, rgba(10, 13, 18, 0.72) 55%, rgba(10, 13, 18, 0.35) 100%); }
  .hero-legend { left: 16px; right: auto; bottom: 22px; flex-direction: column; gap: 6px; }
  .flight-toggle { top: 76px; }
  .intro-grid { flex-direction: column; align-items: flex-start; gap: 18px; }
  .cards-3, .compare, .prompt-compare, .demo-grid, .diffnote, .links { grid-template-columns: 1fr; }
  .waypoints, .flow, .loop { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .zones { grid-template-columns: 1fr; }
  .zone { min-height: 0; }
  .zone-arrow { padding-left: 18px; }
  .footer-grid { flex-direction: column; align-items: flex-start; }
  .footer .fine { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .dot { animation: none; }
  .btn, .waypoints a { transition: none; }
}
