/* ============================================================
   The Math Cabinet
   A hand-built, dependency-free exhibit hall.
   ============================================================ */

:root {
  --ink: #070a12;
  --ink-2: #0b101c;
  --panel: #0d1322;
  --panel-2: #111a2c;
  --line: rgba(231, 236, 255, 0.09);
  --line-strong: rgba(231, 236, 255, 0.17);
  --text: #ece9e2;
  --muted: #9aa3b7;
  --muted-2: #707a90;
  --gold: #f2c14e;
  --gold-soft: #f8d98c;
  --teal: #6ee7d8;
  --violet: #b69cff;
  --rose: #ff8fb1;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;
  --radius: 22px;
  --max: 1320px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  background: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1100px 700px at 82% -5%, rgba(242, 193, 78, 0.09), transparent 60%),
    radial-gradient(900px 700px at 4% 38%, rgba(110, 231, 216, 0.055), transparent 60%),
    radial-gradient(1000px 800px at 70% 85%, rgba(182, 156, 255, 0.05), transparent 62%),
    var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at 50% 30%, black, transparent 78%);
  pointer-events: none;
}

::selection { background: var(--gold); color: #171204; }

a { color: inherit; }

button,
input { font: inherit; }

button { color: inherit; }

.grain {
  position: fixed;
  inset: -50%;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 220 220' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
  animation: grain-shift 9s steps(6) infinite;
}

@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 1%); }
  100% { transform: translate(0, 0); }
}

/* ------------------------------------------------------------
   Top bar
   ------------------------------------------------------------ */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 3.4vw, 46px);
  background: linear-gradient(180deg, rgba(7, 10, 18, 0.88), rgba(7, 10, 18, 0.62));
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  backdrop-filter: blur(18px) saturate(130%);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid rgba(242, 193, 78, 0.45);
  border-radius: 9px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1;
  background: rgba(242, 193, 78, 0.06);
  box-shadow: inset 0 0 18px rgba(242, 193, 78, 0.07);
}

.brand-text {
  font-family: var(--serif);
  font-size: 1.1rem;
  letter-spacing: 0.015em;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 27px);
  font-family: var(--mono);
  font-size: 0.69rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.nav a {
  position: relative;
  text-decoration: none;
  padding: 4px 0;
  transition: color 180ms ease;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--gold);
  transition: right 220ms ease;
}

.nav a:hover { color: var(--text); }
.nav a:hover::after { right: 0; }

.nav-cta {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold);
  border: 1px solid rgba(242, 193, 78, 0.36);
  border-radius: 999px;
  padding: 7px 13px;
  transition: background 180ms ease, color 180ms ease;
}

.nav-cta:hover { background: var(--gold); color: #181206; }

/* ------------------------------------------------------------
   Hero
   ------------------------------------------------------------ */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 128px clamp(22px, 6vw, 92px) 88px;
  isolation: isolate;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0.82;
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(7, 10, 18, 0.97) 0%, rgba(7, 10, 18, 0.86) 27%, rgba(7, 10, 18, 0.35) 60%, rgba(7, 10, 18, 0.08) 100%),
    linear-gradient(180deg, rgba(7, 10, 18, 0.32) 0%, transparent 30%, transparent 67%, var(--ink) 100%);
  pointer-events: none;
}

.hero-glyphs {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.hero-glyphs span {
  position: absolute;
  color: rgba(242, 193, 78, 0.15);
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 5rem);
  animation: glyph-drift 14s ease-in-out infinite alternate;
}

.hero-glyphs span:nth-child(1) { top: 17%; right: 19%; animation-delay: -1s; }
.hero-glyphs span:nth-child(2) { top: 36%; right: 7%; font-size: clamp(4rem, 11vw, 11rem); color: rgba(110, 231, 216, 0.08); animation-delay: -4s; }
.hero-glyphs span:nth-child(3) { top: 61%; right: 30%; animation-delay: -7s; }
.hero-glyphs span:nth-child(4) { top: 73%; right: 11%; animation-delay: -2s; }
.hero-glyphs span:nth-child(5) { top: 23%; right: 39%; color: rgba(182, 156, 255, 0.13); animation-delay: -9s; }
.hero-glyphs span:nth-child(6) { top: 48%; right: 23%; color: rgba(255, 143, 177, 0.11); animation-delay: -5s; }

@keyframes glyph-drift {
  from { transform: translate3d(0, -9px, 0) rotate(-3deg); }
  to { transform: translate3d(8px, 12px, 0) rotate(4deg); }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 790px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 26px;
  font-family: var(--mono);
  font-size: 0.69rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--muted);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(242, 193, 78, 0.45);
  animation: pulse 2.6s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(242, 193, 78, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(242, 193, 78, 0); }
  100% { box-shadow: 0 0 0 0 rgba(242, 193, 78, 0); }
}

h1 {
  margin: 0 0 34px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.15rem, 8.6vw, 8.15rem);
  line-height: 0.91;
  letter-spacing: -0.045em;
  text-wrap: balance;
  text-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

h1 em {
  font-style: italic;
  color: var(--gold);
  white-space: nowrap;
}

.lede {
  max-width: 620px;
  margin: 0 0 38px;
  color: var(--muted);
  font-size: clamp(1rem, 1.35vw, 1.13rem);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 13px;
  margin-bottom: 54px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 47px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.73rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  color: #171204;
  background: var(--gold);
  border-color: transparent;
  box-shadow: 0 12px 32px rgba(242, 193, 78, 0.18);
}

.btn-primary:hover { background: var(--gold-soft); box-shadow: 0 16px 38px rgba(242, 193, 78, 0.27); }

.btn-primary span { font-size: 1rem; line-height: 1; }

.btn-ghost {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
}

.btn-ghost:hover { border-color: rgba(242, 193, 78, 0.5); background: rgba(242, 193, 78, 0.06); }

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(26px, 4vw, 58px);
  margin: 0;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  max-width: 640px;
}

.hero-facts div { display: flex; flex-direction: column; gap: 2px; }

.hero-facts dt {
  font-family: var(--serif);
  font-size: 1.85rem;
  line-height: 1;
  color: var(--text);
}

.hero-facts dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.scroll-cue {
  position: absolute;
  right: clamp(22px, 6vw, 92px);
  bottom: 42px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  color: var(--muted-2);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
}

.scroll-cue i {
  display: block;
  width: 1px;
  height: 54px;
  background: linear-gradient(var(--gold), transparent);
  animation: cue 2.4s ease-in-out infinite;
  transform-origin: top;
}

@keyframes cue {
  0%, 100% { transform: scaleY(0.35); opacity: 0.3; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ------------------------------------------------------------
   Exhibits
   ------------------------------------------------------------ */

.exhibit-stack {
  width: min(var(--max), calc(100% - clamp(36px, 9vw, 128px)));
  margin: 0 auto;
}

.exhibit {
  display: grid;
  grid-template-columns: minmax(250px, 330px) minmax(0, 1fr);
  gap: clamp(36px, 5vw, 76px);
  align-items: start;
  padding: clamp(74px, 9vw, 122px) 0;
  border-top: 1px solid var(--line);
}

.exhibit-copy {
  position: sticky;
  top: 104px;
}

.exhibit-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 24px;
}

.exhibit-num {
  font-family: var(--mono);
  font-size: 0.69rem;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.exhibit-tag {
  font-family: var(--mono);
  font-size: 0.59rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  white-space: nowrap;
}

.exhibit h2 {
  margin: 0 0 27px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 3.3vw, 3.55rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.exhibit h2 em {
  font-style: italic;
  color: var(--gold);
}

.exhibit-copy > p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.76;
}

.exhibit-copy .note {
  position: relative;
  margin: 27px 0 25px;
  padding: 15px 17px 15px 18px;
  border-left: 1px solid rgba(242, 193, 78, 0.55);
  background: linear-gradient(90deg, rgba(242, 193, 78, 0.06), transparent);
  border-radius: 0 10px 10px 0;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.68;
}

.note span {
  display: block;
  margin-bottom: 5px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.inline-math {
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--text);
  white-space: nowrap;
}

.math-strip {
  display: inline-block;
  max-width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.022);
  color: var(--gold-soft);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  overflow-x: auto;
  white-space: nowrap;
}

.math-strip .sum { font-size: 1.15em; }

/* Stage ------------------------------------------------------ */

.exhibit-stage {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(16, 22, 38, 0.9), rgba(9, 13, 23, 0.94));
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
  overflow: hidden;
  transition: border-color 300ms ease, box-shadow 300ms ease;
}

.exhibit-stage:hover {
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow:
    0 42px 110px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.stage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 19px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.59rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stage-label { color: var(--teal); }
.stage-hint { color: var(--muted-2); text-align: right; }

.canvas-wrap {
  position: relative;
  width: 100%;
  background: #05070d;
  overflow: hidden;
  isolation: isolate;
}

.canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.fourier-wrap { aspect-ratio: 4 / 3; min-height: 300px; }
.ulam-wrap { aspect-ratio: 1 / 1; max-width: 610px; margin: 0 auto; }
.logistic-wrap { aspect-ratio: 16 / 9; }
.mandelbrot-wrap { aspect-ratio: 16 / 10; }
.collatz-wrap { aspect-ratio: 16 / 9; }
.chaos-wrap { aspect-ratio: 1 / 1; max-width: 610px; margin: 0 auto; }

.mandelbrot-wrap canvas {
  cursor: crosshair;
  touch-action: none;
}

/* Controls --------------------------------------------------- */

.controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 17px 19px 19px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.012);
}

.controls > .btn {
  align-self: flex-start;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 7px 12px;
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}

.chip:hover {
  color: var(--text);
  border-color: rgba(242, 193, 78, 0.46);
  transform: translateY(-1px);
}

.chip.is-active {
  color: #171204;
  background: var(--gold);
  border-color: var(--gold);
}

.chip:focus-visible,
.btn:focus-visible,
input:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.range {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.range-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--mono);
  font-size: 0.61rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.range-label output {
  color: var(--gold);
  letter-spacing: 0.05em;
}

input[type="range"] {
  appearance: none;
  width: 100%;
  height: 18px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(242, 193, 78, 0.55), rgba(110, 231, 216, 0.35));
}

input[type="range"]::-moz-range-track {
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(242, 193, 78, 0.55), rgba(110, 231, 216, 0.35));
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -5px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #171204;
  box-shadow: 0 0 0 1px rgba(242, 193, 78, 0.45), 0 0 16px rgba(242, 193, 78, 0.36);
}

input[type="range"]::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid #171204;
  box-shadow: 0 0 0 1px rgba(242, 193, 78, 0.45), 0 0 16px rgba(242, 193, 78, 0.36);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.61rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  display: inline-flex;
  align-items: center;
  width: 33px;
  height: 18px;
  padding: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  transition: background 180ms ease, border-color 180ms ease;
}

.switch-track span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted-2);
  transition: transform 180ms ease, background 180ms ease;
}

.switch input:checked + .switch-track {
  background: rgba(242, 193, 78, 0.22);
  border-color: rgba(242, 193, 78, 0.55);
}

.switch input:checked + .switch-track span {
  transform: translateX(15px);
  background: var(--gold);
}

.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.stat,
.axis-note {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  color: var(--muted-2);
}

.stat strong { color: var(--gold); font-weight: 500; }

/* Canvas overlays -------------------------------------------- */

.tooltip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  opacity: 0;
  transform: translate(12px, -50%);
  pointer-events: none;
  padding: 6px 9px;
  border-radius: 6px;
  background: rgba(242, 193, 78, 0.96);
  color: #171204;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: opacity 100ms ease;
}

.tooltip.is-on { opacity: 1; }

.crosshair {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  z-index: 3;
  background: linear-gradient(180deg, transparent, rgba(242, 193, 78, 0.85) 14%, rgba(242, 193, 78, 0.85) 86%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
}

.crosshair.is-on { opacity: 1; }

.readout,
.coord-readout,
.render-progress {
  position: absolute;
  z-index: 4;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(6, 9, 16, 0.76);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.03em;
  color: var(--gold-soft);
  pointer-events: none;
  white-space: nowrap;
}

.readout { top: 11px; right: 11px; }
.coord-readout { left: 11px; bottom: 11px; color: var(--muted); }
.render-progress {
  top: 11px;
  left: 11px;
  color: var(--teal);
  opacity: 0;
  transition: opacity 180ms ease;
}
.render-progress.is-on { opacity: 1; }

/* Collatz controls ------------------------------------------- */

.collatz-controls { gap: 12px; }

.number-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.number-form label {
  font-family: var(--mono);
  font-size: 0.61rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.number-form input {
  width: 122px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: rgba(4, 7, 14, 0.85);
  color: var(--gold-soft);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.btn-small {
  min-height: 34px;
  padding: 6px 13px;
  font-size: 0.62rem;
  letter-spacing: 0.09em;
}

.btn-quiet {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--muted);
}

.btn-quiet:hover {
  color: var(--text);
  border-color: rgba(242, 193, 78, 0.5);
}

/* ------------------------------------------------------------
   About & footer
   ------------------------------------------------------------ */

.about {
  width: min(1120px, calc(100% - clamp(36px, 9vw, 128px)));
  margin: 0 auto;
  padding: clamp(84px, 11vw, 150px) 0 clamp(90px, 10vw, 130px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(150px, 0.62fr) minmax(0, 1.7fr);
  gap: clamp(28px, 5vw, 80px);
  align-items: start;
}

.about-mark {
  font-family: var(--serif);
  font-size: clamp(9rem, 19vw, 18rem);
  line-height: 0.72;
  color: transparent;
  -webkit-text-stroke: 1px rgba(242, 193, 78, 0.3);
  opacity: 0.6;
  user-select: none;
}

.about h2 {
  margin: 0 0 30px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

.about-body {
  max-width: 650px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.78;
}

.about-body p { margin: 0 0 20px; }

blockquote {
  margin: 36px 0 0;
  padding: 4px 0 4px 24px;
  border-left: 1px solid rgba(242, 193, 78, 0.55);
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.1vw, 1.75rem);
  font-style: italic;
  line-height: 1.38;
  color: var(--text);
}

blockquote cite {
  display: block;
  margin-top: 13px;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-style: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(22px, 5vw, 72px);
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.61rem;
  letter-spacing: 0.09em;
  color: var(--muted-2);
}

.footer p { display: flex; align-items: center; gap: 9px; margin: 0; }
.footer .brand-mark { width: 25px; height: 25px; font-size: 0.9rem; border-radius: 7px; }

.footer-links { flex-wrap: wrap; gap: 18px; }

.footer a {
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease;
}

.footer a:hover { color: var(--gold); }

/* ------------------------------------------------------------
   Reveal
   ------------------------------------------------------------ */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 850ms cubic-bezier(0.2, 0.65, 0.25, 1), transform 850ms cubic-bezier(0.2, 0.65, 0.25, 1);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ------------------------------------------------------------
   Responsive
   ------------------------------------------------------------ */

@media (max-width: 1080px) {
  .nav { gap: 14px; }
  .nav a { font-size: 0.62rem; }
  .exhibit { grid-template-columns: minmax(220px, 290px) minmax(0, 1fr); gap: 34px; }
}

@media (max-width: 900px) {
  .nav { display: none; }
  .exhibit {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 72px 0;
  }
  .exhibit-copy { position: static; }
  .exhibit-copy > p { max-width: 620px; }
  .exhibit h2 { margin-bottom: 20px; }
  .about { grid-template-columns: 1fr; gap: 16px; }
  .about-mark { font-size: 8rem; opacity: 0.4; }
}

@media (max-width: 620px) {
  .topbar { padding: 12px 16px; }
  .brand-text { font-size: 0.96rem; }
  .nav-cta { font-size: 0.58rem; padding: 6px 10px; }
  .hero { padding: 112px 20px 76px; min-height: 94svh; }
  .hero-veil {
    background:
      linear-gradient(90deg, rgba(7, 10, 18, 0.92), rgba(7, 10, 18, 0.55)),
      linear-gradient(180deg, rgba(7, 10, 18, 0.2), transparent 32%, var(--ink) 100%);
  }
  h1 { font-size: clamp(2.9rem, 14vw, 4.9rem); letter-spacing: -0.05em; }
  .lede { font-size: 0.96rem; }
  .hero-actions { margin-bottom: 40px; }
  .btn { width: 100%; }
  .hero-facts { gap: 24px; }
  .scroll-cue { display: none; }
  .exhibit-stack { width: calc(100% - 32px); }
  .exhibit { padding: 58px 0; }
  .exhibit-stage { border-radius: 16px; }
  .stage-head { padding: 12px 14px; font-size: 0.54rem; }
  .stage-hint { display: none; }
  .controls { padding: 14px; }
  .fourier-wrap { aspect-ratio: 1 / 1; }
  .logistic-wrap { aspect-ratio: 4 / 3; }
  .mandelbrot-wrap { aspect-ratio: 4 / 3; }
  .collatz-wrap { aspect-ratio: 5 / 4; }
  .readout, .coord-readout, .render-progress { font-size: 0.54rem; padding: 5px 7px; }
  .about { width: calc(100% - 32px); }
  .about h2 { font-size: clamp(2.2rem, 11vw, 3.2rem); }
  .footer { flex-direction: column; align-items: flex-start; gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
