:root {
  --bg: #0a0d12; --bg2: #0e1219; --panel: #131822; --panel2: #181e2a; --line: #232b3a; --line2: #2f394c;
  --text: #eef1f6; --muted: #9aa5b8; --dim: #6f7a8e; --accent: #3ddc97; --accent-ink: #04130c; --blue: #58b7ff; --good: #3ddc97; --bad: #ff8a7a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; font: 16px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 28px; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.12; text-wrap: balance; }
p { margin: 0; }
code { background: var(--panel2); padding: 1px 6px; border-radius: 5px; font-size: 0.9em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; background: #000; padding: 8px 12px; z-index: 50; }

/* ---------- navigation ---------- */
.nav { position: sticky; top: 0; z-index: 30; background: rgba(10, 13, 18, 0.78); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.nav nav { display: flex; gap: 26px; margin-left: auto; }
.nav nav a { color: var(--muted); text-decoration: none; font-size: 0.94rem; } .nav nav a:hover { color: var(--text); }

/* ---------- buttons and form controls ---------- */
button, select, input { font: inherit; color: inherit; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 22px; border-radius: 10px; font-weight: 600; text-decoration: none; border: 1px solid var(--line2); color: var(--text); background: transparent; cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.15s; }
.btn:hover { border-color: #4a5670; background: #ffffff0a; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .btn.primary:hover { background: #5be6ab; border-color: #5be6ab; }
.btn.small { height: 38px; padding: 0 16px; font-size: 0.92rem; border-radius: 8px; }
.console button, .console select, .panel button { background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; padding: 0 12px; height: 36px; cursor: pointer; font-size: 0.9rem; transition: background 0.12s, border-color 0.12s; }
.console button:hover, .console select:hover, .panel button:hover { border-color: #4a5670; background: #1e2636; }
.console button[aria-pressed="true"] { background: #17382b; border-color: #2c8a63; color: #c9f6e2; }
.seg { display: inline-flex; } .seg button { border-radius: 0; margin-left: -1px; } .seg button:first-child { border-radius: 8px 0 0 8px; margin-left: 0; } .seg button:last-child { border-radius: 0 8px 8px 0; }
label { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 0.9rem; }
label output { color: var(--text); min-width: 3.4ch; text-align: right; font-variant-numeric: tabular-nums; }
input[type="range"] { accent-color: var(--accent); } input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; }
.chk { color: var(--text); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background:
  radial-gradient(900px 420px at 78% -10%, #3ddc9722, transparent 70%),
  radial-gradient(700px 380px at 8% 0%, #58b7ff1c, transparent 70%),
  linear-gradient(#0a0d12, #0c1017); }
.hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5; background-image: linear-gradient(#ffffff08 1px, transparent 1px), linear-gradient(90deg, #ffffff08 1px, transparent 1px); background-size: 56px 56px; mask-image: linear-gradient(#000, transparent 85%); -webkit-mask-image: linear-gradient(#000, transparent 85%); }
.hero-in { position: relative; z-index: 1; padding-top: 92px; padding-bottom: 72px; }
.eyebrow { font-size: 0.8rem; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 16px; }
.hero h1 { font-size: clamp(2.4rem, 5.6vw, 4.6rem); font-weight: 680; letter-spacing: -0.035em; line-height: 1.02; }
.lede { margin-top: 22px; font-size: clamp(1.05rem, 1.5vw, 1.28rem); color: var(--muted); max-width: 62ch; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 56px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; max-width: 1180px; }
@media (max-width: 980px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: #0f141cdd; padding: 22px 24px; }
.stat b { display: block; font-size: clamp(1.9rem, 3.4vw, 2.7rem); font-weight: 680; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat b.good { color: var(--accent); }
.stat span { display: block; margin-top: 10px; color: var(--muted); font-size: 0.94rem; line-height: 1.4; }
.fine { margin-top: 18px; color: var(--dim); font-size: 0.86rem; } .fine a { color: var(--muted); }

/* ---------- sections ---------- */
main > section { padding: 88px 0; border-bottom: 1px solid var(--line); }
main > section.alt { background: var(--bg2); }
main > section.demo { padding-top: 72px; }
.sect-head { margin-bottom: 34px; max-width: 900px; }
.sect-head h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); font-weight: 660; }
.sect-head .sub { margin-top: 14px; color: var(--muted); font-size: 1.05rem; max-width: 70ch; }

/* ---------- the live model ---------- */
.console { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: 0 30px 80px -30px #000c, 0 0 0 1px #ffffff05 inset; }
.bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; padding: 2px 2px 12px; }
.group { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.clock { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 5ch; font-size: 0.92rem; }
.more { position: relative; } .more summary { cursor: pointer; padding: 0 12px; height: 36px; display: inline-flex; align-items: center; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel2); list-style: none; font-size: 0.9rem; } .more summary::-webkit-details-marker { display: none; } .more summary::after { content: "▾"; margin-left: 8px; color: var(--dim); }
.more .pop { position: absolute; z-index: 12; top: 44px; right: 0; background: #151b27; border: 1px solid var(--line2); border-radius: 12px; padding: 14px; width: min(430px, 92vw); max-height: min(78vh, 760px); overflow: auto; display: grid; gap: 12px; box-shadow: 0 18px 50px #000b; }
.limgrid { display: grid; grid-template-columns: 2.2em repeat(4, minmax(0, 1fr)); gap: 5px 6px; align-items: center; font-size: 0.82rem; }
.limgrid span { color: var(--dim); line-height: 1.15; } .limgrid b { font-weight: 600; color: var(--text); }
.limgrid input { width: 100%; min-width: 0; background: #0d121a; color: var(--text); border: 1px solid var(--line2); border-radius: 7px; padding: 5px 6px; font: inherit; font-variant-numeric: tabular-nums; }
.limgrid input.changed { border-color: var(--accent); }
.tiny { margin: 0; color: var(--dim); font-size: 0.78rem; line-height: 1.4; } .row.sel { align-items: center; gap: 10px; } .row.sel select { flex: 1; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
.row { display: flex; justify-content: space-between; } .row input { flex: 1; margin: 0 6px; min-width: 0; }
fieldset { border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 6px; margin: 0; padding: 10px 12px; } legend { color: var(--dim); padding: 0 6px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }

#stage { position: relative; display: grid; gap: 8px; }
#stage.stacked { grid-template-columns: 1fr; } #stage.stacked .view canvas { height: clamp(210px, 33vh, 400px); }
#stage.side { grid-template-columns: 1fr 1fr; } #stage.side .view canvas { height: clamp(320px, 60vh, 660px); }
#stage.single { grid-template-columns: 1fr; } #stage.single .view canvas { height: clamp(320px, 66vh, 740px); } #stage.single .view.off { display: none; }
#stage:fullscreen { background: var(--bg); padding: 8px; align-content: center; } #stage:fullscreen.stacked .view canvas { height: 47vh; } #stage:fullscreen.side .view canvas, #stage:fullscreen.single .view canvas { height: 94vh; }
.view { margin: 0; position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line2); background: #000; }
.view canvas { display: block; width: 100%; touch-action: pan-y; cursor: grab; } .view canvas:active { cursor: grabbing; }
.view figcaption { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 8px; background: #0a0d12d9; border: 1px solid #ffffff1f; padding: 4px 12px 4px 10px; border-radius: 99px; font-weight: 600; font-size: 0.86rem; pointer-events: none; z-index: 2; backdrop-filter: blur(6px); }
.dot { width: 8px; height: 8px; border-radius: 50%; } .dot.fixed { background: #ffc94a; } .dot.smart { background: var(--accent); box-shadow: 0 0 0 4px #3ddc9730; }
#mini { width: 100%; height: 34px; border-radius: 8px; margin-top: 8px; border: 1px solid var(--line2); cursor: pointer; display: block; }
.scenarios { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 2px 4px; align-items: center; }
.scenarios .lead { color: var(--dim); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; margin-right: 6px; }
.scenarios button { border-radius: 99px; padding: 0 14px 0 8px; height: 34px; }
.scenarios button kbd { font: 600 0.72rem ui-monospace, SFMono-Regular, Menlo, monospace; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #ffffff12; color: var(--muted); margin-right: 8px; }
.scenarios #present { background: #17382b; border-color: #2c8a63; color: #c9f6e2; margin-left: auto; } .scenarios #present kbd { background: #3ddc9730; color: #c9f6e2; }
.hint { color: var(--dim); font-size: 0.82rem; padding: 8px 2px 2px; }
.card { position: absolute; right: 12px; top: 12px; z-index: 4; background: #0a0d12ee; border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px; width: min(300px, 80vw); font-size: 0.88rem; backdrop-filter: blur(8px); }
.card h3 { margin: 0 0 6px; font-size: 1rem; letter-spacing: 0; } .card h3 small { color: var(--muted); font-weight: 400; } .card dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; } .card dt { color: var(--muted); } .card dd { margin: 0; } .card button { margin-top: 10px; background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; height: 32px; padding: 0 12px; cursor: pointer; }
.caption { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 5; background: #0a0d12f2; border: 1px solid #3ddc9799; border-radius: 12px; padding: 12px 18px; width: max-content; max-width: min(780px, 92%); font-size: 1.04rem; line-height: 1.45; text-align: center; box-shadow: 0 14px 40px #000a; }
.caption small { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
.fps { position: absolute; left: 10px; bottom: 10px; z-index: 5; background: #000c; padding: 2px 8px; border-radius: 4px; font: 12px ui-monospace, monospace; }
.zoomhint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; background: #0a0d12e6; border: 1px solid var(--line2); padding: 8px 14px; border-radius: 99px; font-size: 0.9rem; pointer-events: none; }

/* ---------- panels, tables, cards ---------- */
.cols { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; }
.panel h3 { font-size: 1.06rem; margin-bottom: 12px; letter-spacing: -0.01em; } .panel h3 small { color: var(--dim); font-weight: 500; font-size: 0.8rem; margin-left: 8px; letter-spacing: 0.06em; text-transform: uppercase; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 0.94rem; }
th, td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: 0; }
th { color: var(--dim); font-weight: 600; font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; } td.n, th.n { text-align: right; padding-right: 0; padding-left: 12px; }
.better { color: var(--good); } .worse { color: var(--bad); }
.actions { margin-top: 14px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.9rem; }
details > summary { cursor: pointer; color: var(--muted); margin-top: 12px; font-size: 0.92rem; }
#log { margin: 0; padding: 0; list-style: none; max-height: 420px; overflow: auto; font-size: 0.9rem; } #log li { padding: 8px 0; border-bottom: 1px solid var(--line); color: #d5dbe6; line-height: 1.45; } #log li:last-child { border-bottom: 0; } #log time { color: var(--dim); margin-right: 10px; font: 0.8rem ui-monospace, SFMono-Regular, Menlo, monospace; }
.cards { display: grid; gap: 18px; } .cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cards.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cards article { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 26px; }
.cards article h3 { font-size: 1.12rem; margin-bottom: 10px; letter-spacing: -0.01em; } .cards article p { color: var(--muted); font-size: 0.97rem; }
.feat svg { width: 40px; height: 40px; padding: 8px; border-radius: 10px; background: #3ddc9716; border: 1px solid #3ddc9740; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 18px; }
.notes { margin-top: 20px; } .alt .cards article, .alt .panel { background: #121722; }
.cards.four article { padding: 22px; } .cards.four article h3 { font-size: 1rem; display: flex; align-items: center; gap: 10px; } .cards.four kbd { font: 600 0.74rem ui-monospace, SFMono-Regular, Menlo, monospace; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: #ffffff10; border: 1px solid var(--line2); color: var(--muted); flex: none; } .cards.four article p { font-size: 0.92rem; }
.prose { margin-top: 28px; color: var(--muted); } .prose ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; } .prose li { padding: 16px 0; border-top: 1px solid var(--line); font-size: 0.95rem; } .prose strong { color: var(--text); }
#matrix, #expect, #breakdown { overflow-x: auto; } #matrix table { min-width: 760px; } #expect table { min-width: 520px; } #matrix p { color: var(--muted); font-size: 0.92rem; margin-top: 14px; max-width: 90ch; }
#expect p { color: var(--muted); font-size: 0.92rem; margin-top: 14px; max-width: 90ch; }

footer { padding: 44px 0 56px; color: var(--muted); font-size: 0.9rem; } .foot { display: flex; flex-wrap: wrap; gap: 20px 60px; justify-content: space-between; } .foot strong { color: var(--text); } .foot > div { max-width: 62ch; } .foot p { margin-top: 8px; } .keys { color: var(--dim); }
.summary { position: fixed; inset: 0; z-index: 60; background: #070a0ef2; display: grid; place-items: center; padding: 20px; overflow: auto; } .summary > div { background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; padding: 28px 32px; max-width: 780px; width: 100%; } .summary h2 { font-size: 1.6rem; margin-bottom: 10px; } .summary p { color: var(--muted); margin-bottom: 14px; } .summary button { background: var(--panel2); border: 1px solid var(--line2); border-radius: 8px; height: 38px; padding: 0 14px; cursor: pointer; }

@media (max-width: 1080px) { .cards.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nav nav { display: none; } .nav-in .btn { margin-left: auto; } }
@media (max-width: 900px) { .cols, .cards.three { grid-template-columns: 1fr; } .prose ul { grid-template-columns: 1fr; } #stage.side { grid-template-columns: 1fr; } #stage.side .view canvas { height: 32vh; } main > section { padding: 60px 0; } .hero-in { padding-top: 60px; padding-bottom: 52px; } .scenarios #present { margin-left: 0; } }
@media (max-width: 620px) { .more .pop { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; width: auto; max-height: 72vh; overflow: auto; z-index: 40; } .wrap { padding: 0 16px; } .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat { padding: 16px 14px; } .stat span { font-size: 0.84rem; } .cards.four { grid-template-columns: 1fr; } .brand span { font-size: 0.95rem; } .nav-in { gap: 12px; } .console { padding: 10px; border-radius: 12px; } .panel { padding: 18px 16px; } .hint { display: none; } .btn { height: 46px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
h3.tbl { margin: 22px 0 10px; font-size: 1rem; font-weight: 640; color: var(--text); } h3.tbl:first-child { margin-top: 0; }
.panel h4 { margin: 18px 0 8px; font-size: 0.92rem; color: var(--muted); font-weight: 600; }
.panel td small { display: block; color: var(--dim); font-size: 0.76rem; }
.losspanel { margin-top: 24px; border-color: #5a3b2a; } ul.losses { margin: 0 0 10px; padding-left: 1.2em; display: grid; gap: 8px; color: var(--text); line-height: 1.5; }
#day, #losses { overflow-x: auto; } #day table { min-width: 880px; } #day p.sub { margin-top: 0; }
