:root {
  --surface: #eeede9;
  --shallow: #dfe8ee;
  --deep: #12204a;
  --abyss: #0a1230;
  --ink: #0f1b3d;
  --link: #1d4e9e;
  --plume: #1c50a3;
  --warm: #b5402c;
  --on-deep: #e7edf8;
  --on-deep-soft: #aebbd6;
  --serif: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --gutter: clamp(16px, 5vw, 56px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--serif);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--warm); outline-offset: 3px; border-radius: 2px; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.band { padding: clamp(56px, 9vw, 112px) 0; }
.surface { background: var(--surface); }
.shallow { background: var(--shallow); }
.deep { background: var(--deep); color: var(--on-deep); }
.abyss { background: var(--abyss); color: var(--on-deep); }
.deep a, .abyss a { color: #a9c8ff; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.015em; line-height: 1.1; }
h2 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); margin-bottom: 0.6em; }
h3 { font-size: 1.3rem; letter-spacing: -0.005em; line-height: 1.25; }
p { margin: 0 0 1em; max-width: 62ch; }
.sans { font-family: var(--sans); }

/* top bar */
.top { display: flex; flex-wrap: wrap; gap: 6px 20px; padding: 22px 0; font: 0.95rem var(--sans); }
.top a { color: var(--ink); text-decoration: none; }
.top a:hover { text-decoration: underline; }
.top .home { margin-right: auto; font-weight: 600; }

/* hero */
.hero { padding: clamp(28px, 6vw, 72px) 0 clamp(24px, 4vw, 40px); }
.hero h1 { font-size: clamp(3.2rem, 11vw, 8.2rem); line-height: 0.92; letter-spacing: -0.035em; }
.hero .lede { font-size: clamp(1.2rem, 2.4vw, 1.6rem); line-height: 1.4; margin: 0.9em 0 0; max-width: 34ch; }
.hero .who { font: 0.95rem/1.5 var(--sans); color: #425078; margin-top: 1.4em; }

/* simulation */
.lab { padding-bottom: clamp(48px, 7vw, 88px); }
.lab-bleed { max-width: 1400px; margin: 0 auto; padding: 0 var(--gutter); }
.strip { height: 8px; width: 100%; }
.stage { position: relative; background: #eae6e2; }
#sim-canvas { display: block; width: 100%; touch-action: pan-y; cursor: crosshair; }
.strip-label, .xticks { display: flex; justify-content: space-between; font: 0.8rem var(--sans); color: #44507a; }
.strip-label { margin-bottom: 4px; }
.xticks { margin-top: 4px; font-variant-numeric: tabular-nums; }
.readout { font: 0.85rem var(--sans); color: #44507a; min-height: 1.4em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.controls { display: flex; flex-wrap: wrap; gap: 18px 30px; align-items: flex-end; margin-top: 18px; font: 0.92rem var(--sans); }
.controls fieldset { border: 0; padding: 0; margin: 0; }
.controls legend, .controls .lab-l { display: block; padding: 0; margin-bottom: 6px; color: #44507a; font-size: 0.82rem; }
.btns { display: flex; gap: 8px; }
button {
  font: 600 0.92rem var(--sans); padding: 9px 18px; border-radius: 3px; cursor: pointer;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
}
button:hover { background: rgba(15, 27, 61, 0.08); }
button.primary { background: var(--ink); color: #fff; min-width: 5.2rem; }
button.primary:hover { background: #243566; }
.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 3px; overflow: hidden; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 8px 14px; cursor: pointer; }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--warm); outline-offset: -3px; }
.seg label + label span { border-left: 1.5px solid var(--ink); }
input[type=range] { width: 150px; accent-color: var(--plume); }
.check { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; }
.legend { margin-top: 26px; max-width: 420px; font: 0.8rem var(--sans); color: #44507a; }
.legend .bar { height: 10px; margin: 5px 0 4px; }
.legend .row { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.note { font: 0.92rem/1.55 var(--sans); color: #34416b; max-width: 70ch; margin-top: 22px; }

/* movie */
.movie { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 56px); align-items: center; }
.movie video { width: 100%; height: auto; display: block; background: #fff; }
.movie h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); }

/* about */
.about { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(20px, 5vw, 72px); }
.facts { font: 0.95rem/1.55 var(--sans); margin: 0; }
.facts dt { font-weight: 600; margin-top: 1.1em; }
.facts dt:first-child { margin-top: 0; }
.facts dd { margin: 0; color: #34416b; }

/* research rows */
.rows { margin: 2.2em 0 0; padding: 0; list-style: none; }
.rows li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(12px, 5vw, 72px); padding: 26px 0; border-top: 1px solid rgba(231, 237, 248, 0.28); }
.rows .when { font: 0.92rem/1.5 var(--sans); color: var(--on-deep-soft); }
.rows .when b { display: block; color: var(--on-deep); font-weight: 600; }
.rows p { margin: 0.5em 0 0; color: var(--on-deep-soft); }
.intro p { color: var(--on-deep); font-size: 1.15rem; }

/* teaching */
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 6vw, 80px); }
.two ul { margin: 0; padding-left: 1.1em; }
.two li { margin-bottom: 0.8em; max-width: 52ch; }

/* contact */
.contact a { font-size: clamp(1.3rem, 3vw, 1.9rem); font-family: var(--serif); }
.contact ul { list-style: none; padding: 0; margin: 1.2em 0 0; display: grid; gap: 0.5em; }
footer.abyss { padding: 0 0 40px; font: 0.85rem var(--sans); color: var(--on-deep-soft); }

/* depth gauge: a thin strip down the right edge that darkens like the water column */
.depth { position: fixed; right: 0; top: 0; bottom: 0; width: 6px; z-index: 5; background: linear-gradient(#eeede9, #8fb4d8 35%, #1c50a3 60%, #12204a 80%, #0a1230); pointer-events: none; }
.depth i { position: absolute; left: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--warm); border: 2px solid #fff; transform: translateY(-50%); }

@media (max-width: 760px) {
  .movie, .about, .rows li, .two { grid-template-columns: 1fr; }
  .top .home { width: 100%; }
  input[type=range] { width: 130px; }
}
@media (max-width: 480px) { .depth { display: none; } }
