:root {
  --bg: #0b0d17;
  --bg-2: #10132a;
  --ink: #ece6d8;
  --muted: #a59f93;
  --faint: #6f6a62;
  --gold: #e2b867;
  --soft: #7fc8b4;
  --hard: #e2766a;
  --line: rgba(236, 230, 216, .12);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --wrap: 1160px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.65 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-underline-offset: 3px; }
b { font-weight: 600; }
.mono { font-family: var(--mono); font-weight: 500; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } body { font-size: 16px; } }

#orbits { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .55; }
main, footer, nav { position: relative; z-index: 1; }

/* nav */
nav { position: absolute; inset: 0 0 auto; z-index: 5; }
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { font: 500 20px var(--serif); color: var(--ink); text-decoration: none; text-shadow: 0 1px 10px rgba(0,0,0,.6); }
.brand span { color: var(--gold); }
nav ul { display: flex; gap: 26px; list-style: none; margin: 0; padding: 0; font-size: 15px; align-items: center; }
nav ul a { color: var(--ink); text-decoration: none; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
nav ul a:hover { color: var(--gold); }
nav .pill { border: 1px solid rgba(226,184,103,.6); border-radius: 999px; padding: 6px 14px; background: rgba(11,13,23,.45); backdrop-filter: blur(6px); }
@media (max-width: 720px) { nav ul li:not(:last-child) { display: none; } }

/* hero */
.hero { position: relative; z-index: 1; height: 100svh; min-height: 600px; max-height: 1000px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; background: #000; }
#hero-gl, #hero-fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#hero-fallback { display: none; }
.no-gl #hero-fallback { display: block; transition: opacity .9s; }
.hero-shade { position: absolute; inset: 0; background:
  linear-gradient(180deg, rgba(11,13,23,.55) 0%, rgba(11,13,23,0) 18%),
  linear-gradient(90deg, rgba(11,13,23,.78) 0%, rgba(11,13,23,.35) 45%, rgba(11,13,23,0) 70%),
  linear-gradient(0deg, var(--bg) 0%, rgba(11,13,23,.6) 18%, rgba(11,13,23,0) 45%); }
.hero-copy { position: relative; width: 100%; padding-bottom: 28px; }
.eyebrow { font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 0 0 14px; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.08; margin: 0; }
h1 { font-size: clamp(42px, 6.6vw, 86px); max-width: 13ch; letter-spacing: -.015em; text-shadow: 0 2px 30px rgba(0,0,0,.5); }
h1 em, h2 em { font-style: italic; color: var(--gold); }
.lede { font-size: clamp(16.5px, 1.9vw, 19.5px); color: #e2dccf; max-width: 54ch; margin: 20px 0 28px; text-shadow: 0 1px 12px rgba(0,0,0,.8); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font: 500 15px var(--sans); text-decoration: none; border: 1px solid rgba(236,230,216,.25); color: var(--ink); background: rgba(16,19,42,.55); backdrop-filter: blur(6px); cursor: pointer; }
.btn.primary { background: var(--gold); color: #1a1408; border-color: var(--gold); }
.btn:hover { filter: brightness(1.1); }
.hero-bar { position: relative; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 26px; }
.caption { margin: 0; font-size: 14px; color: var(--muted); max-width: 70ch; min-height: 1.6em; transition: opacity .6s; }
.caption b { color: var(--ink); font-weight: 500; margin-right: 10px; }
.caption span { font-style: italic; font-family: var(--serif); font-size: 15px; }
.hero-nav { display: flex; align-items: center; gap: 10px; flex: none; }
.hero-nav button { width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(236,230,216,.25); background: rgba(16,19,42,.55); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; }
#hero-dots { display: flex; gap: 6px; }
#hero-dots button { width: 7px; height: 7px; padding: 0; border-radius: 50%; border: 0; background: rgba(236,230,216,.3); cursor: pointer; }
#hero-dots button[aria-current="true"] { background: var(--gold); width: 20px; border-radius: 4px; }
@media (max-width: 720px) { .hero-bar { flex-direction: column; align-items: flex-start; } .caption span { display: block; } #hero-dots { display: none; } }

/* sections */
section { padding: 120px 0; position: relative; }
@media (max-width: 600px) { section { padding: 80px 0; } }
h2 { font-size: clamp(36px, 5vw, 62px); max-width: 18ch; letter-spacing: -.01em; }
.sub { color: var(--muted); max-width: 64ch; margin: 20px 0 0; }
.sub b { color: var(--ink); font-weight: 500; }
.center { margin-left: auto; margin-right: auto; text-align: center; }

/* math flow */
.math { background: linear-gradient(180deg, transparent, rgba(16,19,42,.6) 30%, rgba(16,19,42,.6) 80%, transparent); }
.flow { list-style: none; margin: 72px 0 0; padding: 0; position: relative; }
.flow::before { content: ""; position: absolute; left: 27px; top: 10px; bottom: 10px; width: 1px; background: linear-gradient(var(--gold), rgba(226,184,103,.1)); }
.step { display: grid; grid-template-columns: 56px 1fr; gap: 28px; padding: 0 0 80px; opacity: .15; transform: translateY(24px); transition: opacity .9s, transform .9s; }
.step.in { opacity: 1; transform: none; }
.step-num { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--gold); display: grid; place-items: center; font: 500 15px var(--mono); color: var(--gold); background: var(--bg); position: relative; z-index: 1; }
.step h3 { font-size: clamp(24px, 3vw, 34px); margin: 10px 0 12px; }
.step p { color: var(--muted); max-width: 64ch; margin: 0 0 18px; }
.step p b { color: var(--ink); }
@media (max-width: 600px) { .step { grid-template-columns: 40px 1fr; gap: 16px; } .step-num { width: 40px; height: 40px; font-size: 13px; } .flow::before { left: 19px; } }

.chart-wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 36px; align-items: center; margin-top: 12px; }
@media (max-width: 900px) { .chart-wrap { grid-template-columns: 1fr; } }
#wheel { width: 100%; max-width: 560px; overflow: visible; }
#wheel text { font-family: var(--mono); fill: var(--muted); }
#wheel .glyph { font-family: "Noto Sans Symbols", "Noto Sans Symbols 2", "Segoe UI Symbol", serif; }
#wheel .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); transition: stroke-dashoffset 2.2s ease; }
.in #wheel .draw { stroke-dashoffset: 0; }
#wheel .pop { opacity: 0; transition: opacity .6s; }
.in #wheel .pop { opacity: 1; }
#wheel .moon-now { opacity: 0; transition: opacity .8s 1.6s; }
.show-moon #wheel .moon-now { opacity: 1; }
#wheel .aspect { opacity: 0; transition: opacity .8s; }
.show-aspects #wheel .aspect { opacity: 1; }

table.data { width: 100%; border-collapse: collapse; font: 13.5px/1.4 var(--mono); font-variant-numeric: tabular-nums; }
table.data th { text-align: left; font: 500 11px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
table.data td { padding: 7px 10px 7px 0; border-bottom: 1px solid rgba(236,230,216,.06); color: #d7d1c4; white-space: nowrap; }
table.data td .g, .sg { font-family: "Noto Sans Symbols", "Noto Sans Symbols 2", "Segoe UI Symbol", serif; color: var(--gold); margin-right: 8px; }
table.data tr.hit td { color: var(--ink); }
table.data tr.miss td { color: var(--faint); }
table.data tr.top td { background: rgba(226,184,103,.08); }
table.data td.soft { color: var(--soft); }
table.data td.hard { color: var(--hard); }
.scroll-x { overflow-x: auto; }

.numbers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 760px) { .numbers { grid-template-columns: 1fr; } }
.num { border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; background: rgba(11,13,23,.6); }
.num .k { font: 500 11px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.num .v { font: 400 42px/1.1 var(--serif); margin: 6px 0 4px; }
.num .v small { font: 500 14px var(--mono); color: var(--gold); margin-left: 10px; vertical-align: middle; }
.num .f { font: 13px/1.6 var(--mono); color: var(--muted); }
.num .f b { color: var(--ink); font-weight: 500; }
.bar { position: relative; height: 6px; border-radius: 3px; background: rgba(236,230,216,.1); margin-top: 14px; }
.bar i { position: absolute; top: -4px; width: 1px; height: 14px; background: var(--faint); }
.bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--gold); width: 0; transition: width 1.6s cubic-bezier(.2,.7,.2,1); }
.bar em { position: absolute; top: 14px; font: 10.5px var(--mono); color: var(--faint); font-style: normal; transform: translateX(-50%); }

.dial { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.dial div { border-left: 2px solid var(--gold); padding: 4px 0 4px 14px; }
.dial b { display: block; font: 400 26px var(--serif); }
.dial span { font-size: 13px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; background: rgba(11,13,23,.6); }
.chip small { display: block; font: 500 10.5px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.chip span { font-family: var(--serif); font-style: italic; font-size: 17px; }

.myth { margin: 0; display: grid; gap: 16px; }
.myth dt { font: 500 11px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.myth dd { margin: 2px 0 0; font: 400 20px/1.4 var(--serif); }

.distill { margin: 4px 0 0; font: italic 300 clamp(26px, 3.6vw, 42px)/1.25 var(--serif); color: var(--ink); max-width: 28ch; border-left: 3px solid var(--gold); padding-left: 24px; }

.prompt { white-space: pre-wrap; font: 14.5px/1.75 var(--mono); color: #d9d2bf; background: #070810; border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin: 0; min-height: 8em; }
.caret { display: inline-block; width: .55em; height: 1.1em; background: var(--gold); vertical-align: text-bottom; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.painting { margin: 8px 0 0; border-radius: 16px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px var(--line); clip-path: inset(0 100% 0 0 round 16px); transition: clip-path 2.4s cubic-bezier(.6,0,.2,1); }
.in .painting { clip-path: inset(0 0 0 0 round 16px); }

.flow .more { list-style: none; padding: 0 0 64px 84px; position: relative; }
.flow .more::before { content: ""; position: absolute; left: 22px; top: 6px; width: 11px; height: 11px; border-radius: 50%; border: 1px dashed var(--gold); background: var(--bg); }
.more button { background: none; border: 0; padding: 0; color: var(--gold); font: 500 15px var(--sans); cursor: pointer; text-align: left; }
.more button span { color: var(--muted); font-weight: 400; }
.more button:hover span { color: var(--ink); }
.flow:not(.collapsed) .more, .collapsed .detail, .collapsed tr.miss, .flow:not(.collapsed) ~ * .when-collapsed, .flow:not(.collapsed) .when-collapsed { display: none; }
.expand-row { padding-left: 84px; margin-top: -24px; }
@media (max-width: 600px) { .flow .more, .expand-row { padding-left: 56px; } .flow .more::before { left: 14px; } }

/* worlds */
.worlds { padding-bottom: 100px; }
.universe { position: relative; height: min(78vh, 760px); margin: 40px 0 70px; overflow: hidden; }
#universe { width: 100%; height: 100%; display: block; }
.universe::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 55%, var(--bg) 100%); }
.counter { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 2; text-align: center; text-shadow: 0 2px 20px rgba(0,0,0,.9); }
.counter span { font: 300 clamp(56px, 9vw, 120px)/1 var(--serif); color: var(--gold); font-variant-numeric: tabular-nums; }
.counter small { display: block; font: 500 12px var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ink); margin-top: 4px; }
.replay { position: absolute; right: 24px; bottom: 30px; z-index: 2; opacity: 0; transition: opacity .6s; font-size: 13px; padding: 8px 14px; }
.replay.on { opacity: 1; }
.split { display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: start; }
@media (max-width: 880px) { .split { grid-template-columns: 1fr; gap: 40px; } }
.h3big { font-size: clamp(28px, 3.4vw, 40px); max-width: 20ch; }
.ideas { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ideas li { border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; font: italic 15.5px var(--serif); color: #d7d1c4; }
.how { list-style: none; margin: 0; padding: 0; counter-reset: how; }
.how li { counter-increment: how; padding: 20px 0 20px 52px; border-top: 1px solid var(--line); position: relative; }
.how li::before { content: counter(how); position: absolute; left: 0; top: 18px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); display: grid; place-items: center; font: 500 14px var(--mono); }
.how b { display: block; font-weight: 500; }
.how span { color: var(--muted); font-size: 15px; }
.builtins-label { margin: 72px 0 14px; font: 500 11.5px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); }
.builtins { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.builtins figure { margin: 0; }
.builtins img { aspect-ratio: 16/9; object-fit: cover; border-radius: 8px; width: 100%; height: auto; }
.builtins figcaption { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
@media (max-width: 880px) { .builtins { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 520px) { .builtins { grid-template-columns: repeat(2, 1fr); } }

/* moves */
.moves .split { align-items: center; }
.move-stage { border-radius: 16px; overflow: hidden; aspect-ratio: 16/9; box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px var(--line); background: #000; }
#move-gl { width: 100%; height: 100%; display: block; }
.move-controls { margin-top: 28px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
#xray[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.move-thumbs { display: flex; gap: 8px; }
.move-thumbs button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; width: 84px; cursor: pointer; background: none; }
.move-thumbs button[aria-pressed="true"] { border-color: var(--gold); }
.move-thumbs img { aspect-ratio: 16/9; object-fit: cover; width: 100%; height: auto; }

/* install */
.install { text-align: center; }
.install h2 { margin: 0 auto; }
.cmd { margin: 40px auto 0; max-width: 780px; display: flex; align-items: center; gap: 12px; background: #070810; border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 14px 20px; text-align: left; }
.cmd code { font: 14.5px/1.5 var(--mono); color: #e9e2d0; flex: 1; overflow-x: auto; white-space: nowrap; }
.cmd code::before { content: "$ "; color: var(--faint); }
.cmd button { flex: none; font: 500 13px var(--sans); background: transparent; color: var(--gold); border: 1px solid rgba(226,184,103,.4); border-radius: 8px; padding: 7px 12px; cursor: pointer; }
.notify { margin: 72px auto 0; max-width: 780px; display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; text-align: left; border: 1px solid var(--line); border-radius: 16px; padding: 28px; background: rgba(16,19,42,.6); }
@media (max-width: 720px) { .notify { grid-template-columns: 1fr; } }
.notify h3 { font-size: 26px; }
.notify p { color: var(--muted); margin: 8px 0 0; font-size: 15px; }
.notify form { display: flex; flex-wrap: wrap; gap: 10px; align-content: start; }
.notify input { flex: 1 1 200px; min-width: 0; font: 15px var(--sans); color: var(--ink); background: #070810; border: 1px solid var(--line); border-radius: 999px; padding: 12px 18px; }
.notify input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.notify .fine { flex-basis: 100%; font-size: 12.5px; color: var(--faint); margin: 2px 0 0; }

footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--muted); font-size: 14px; background: var(--bg); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; justify-content: space-between; }
footer a { color: var(--muted); }

.static .step { opacity: 1; transform: none; transition: none; }
.static .painting { clip-path: none; transition: none; }
.static #wheel .draw, .static #wheel .pop, .static #wheel .moon-now, .static #wheel .aspect { stroke-dashoffset: 0; opacity: 1; transition: none; }
.static .bar span { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .step, .painting, .bar span, #wheel .draw { transition: none !important; }
  .step { opacity: 1; transform: none; }
  .painting { clip-path: none; }
  #wheel .draw { stroke-dashoffset: 0; }
}
