:root {
  --bg: #090a0e;
  --bg-2: #10131a;
  --bg-3: #171c26;
  --ink: #f3efe6;
  --muted: #a39c90;
  --faint: #6e685f;
  --line: rgba(243, 239, 230, 0.12);
  --copper: #e0a15a;
  --copper-2: #f0c48a;
  --teal: #7dcec6;
  --rose: #e07a62;
  --good: #b6d48a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(224, 161, 90, 0.16), transparent 55%),
    radial-gradient(900px 480px at -10% 20%, rgba(125, 206, 198, 0.08), transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 340;
  line-height: 1.5;
  font-size: 16px;
}
img { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--copper-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 22px;
  background: rgba(9, 10, 14, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.brand img { width: 28px; height: 28px; }
.top nav { display: flex; flex-wrap: wrap; gap: 16px; }
.top nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.top nav a:hover { color: var(--ink); }

.wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.hero { padding: 34px 0 10px; }
.hero-grid, .split {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 28px;
  align-items: start;
}
.kicker {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
}
h1, h2, h3 { font-family: var(--serif); font-weight: 460; letter-spacing: -0.02em; }
h1 { font-size: clamp(40px, 6vw, 68px); line-height: 0.96; margin: 0 0 12px; }
h2 { font-size: clamp(28px, 3vw, 40px); margin: 0 0 8px; }
h3 { font-size: 22px; margin: 0; }
.dek { color: var(--muted); font-size: 18px; max-width: 46ch; }
.stage-card, .panel, .card, .step, .talk {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.stage-card { padding: 10px; }
.gl-wrap { position: relative; height: 420px; border-radius: 14px; overflow: hidden; background: #07080c; }
.gl-wrap canvas, .viz canvas.gl { width: 100%; height: 100%; display: block; }
.frame-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.frame {
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 12px;
  text-align: left;
  color: var(--muted);
}
.frame.on, .frame:hover { border-color: rgba(224, 161, 90, 0.7); color: var(--ink); }
.frame canvas { width: 100%; height: 92px; display: block; border-radius: 10px; background: #08090d; }
.frame span { display: block; padding: 6px 6px 8px; font-family: var(--mono); font-size: 11px; }

.path-list { display: flex; flex-direction: column; gap: 8px; }
.step {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  color: inherit;
  box-shadow: none;
}
.step:hover { border-color: rgba(224, 161, 90, 0.55); }
.step b { display: block; font-weight: 480; }
.step small { color: var(--muted); }

.section { padding: 28px 0 10px; }
.section-head { display: flex; justify-content: space-between; gap: 18px; align-items: end; margin-bottom: 14px; }
.section-head p { margin: 0; color: var(--muted); max-width: 62ch; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.card {
  padding: 14px 14px 12px;
  text-align: left;
  color: inherit;
  box-shadow: none;
  min-height: 148px;
  transition: transform .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: rgba(224, 161, 90, 0.6); }
.card .num { font-family: var(--mono); color: var(--copper); font-size: 12px; }
.card p { color: var(--muted); margin: 8px 0 0; }

.talks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.talk { padding: 10px 12px; box-shadow: none; }
.talk b { font-weight: 480; }
.talk span { display: block; color: var(--muted); font-size: 13px; }

.overlay[hidden] { display: none; }
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(5, 6, 8, 0.72);
  display: grid;
  place-items: center;
  padding: 18px;
}
.sheet {
  width: min(1180px, 100%);
  height: min(920px, 100%);
  background: #0c0e13;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: rise .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.sheet-bar {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.sheet-bar h2 { font-size: 28px; }
.sheet-body {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.8fr);
  gap: 16px;
  padding: 14px;
  overflow: auto;
  min-height: 0;
}
.side { display: flex; flex-direction: column; gap: 10px; }
.viz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.viz-grid.one { grid-template-columns: 1fr; }
.viz-grid.three { grid-template-columns: 1fr 1fr 1fr; }
figure { margin: 0; }
.viz canvas, .viz-grid canvas {
  width: 100%;
  height: 260px;
  display: block;
  background: #08090d;
  border-radius: 12px;
  border: 1px solid var(--line);
  touch-action: none;
}
.viz-grid.tall canvas, canvas.tall { height: 420px; }
figcaption, .cap {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.slider, .field { display: flex; flex-direction: column; gap: 6px; }
.sl-top, .field-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.val { font-family: var(--mono); color: var(--ink); }
input[type="range"] { width: 100%; accent-color: var(--copper); }
select {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
}
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button, .btn, .btn.ghost {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  padding: 7px 12px;
}
.seg button.on, .btn.primary { background: var(--copper); color: #1a1208; border-color: transparent; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 14px; }
.reads {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
}
.reads div { border-top: 1px solid var(--line); padding-top: 6px; }
.reads dt { color: var(--faint); font-size: 11px; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.06em; }
.reads dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.formula {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: #141820;
  border: 1px solid var(--line);
}
.formula code { font-family: var(--mono); font-size: 13px; }
.formula .tag, .badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #10211a;
  background: var(--good);
  border-radius: 999px;
  padding: 3px 7px;
}
.formula.check .tag { background: var(--copper); color: #1a1208; }
.teach p { margin: 0 0 8px; color: var(--muted); }
.cite {
  display: inline-flex;
  border: 0;
  padding: 0 2px;
  background: transparent;
  color: var(--teal);
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.note { color: var(--faint); font-size: 13px; margin: 0; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 12px; }
th, td { padding: 5px 7px; border-bottom: 1px solid var(--line); text-align: right; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--faint); font-weight: 480; font-family: var(--mono); font-size: 10px; letter-spacing: 0.04em; }
.warn {
  border: 1px solid rgba(224, 161, 90, 0.45);
  color: var(--copper-2);
  border-radius: 12px;
  padding: 8px 10px;
  margin: 0;
  font-size: 14px;
}

footer {
  padding: 28px 0 48px;
  color: var(--muted);
  font-size: 14px;
}
footer .wrap { border-top: 1px solid var(--line); padding-top: 18px; }

@media (max-width: 900px) {
  .hero-grid, .split, .sheet-body, .cards, .talks, .viz-grid, .viz-grid.three { grid-template-columns: 1fr; }
  .gl-wrap { height: 300px; }
  .sheet { height: 100%; border-radius: 0; }
  .overlay { padding: 0; }
  h1 { font-size: 40px; }
  .frame-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .card { animation: none; transition: none; }
  html { scroll-behavior: auto; }
}
