/* Harvard at the Head of the Charles: full-bleed sticky 3D stage with caption cards, then a reading column. */
:root {
  --paper: #ffffff; --ink: #121212; --ink-2: #333; --muted: #6b6b6b; --faint: #9a9a9a; --rule: #e4e2de;
  --crimson: #a51c30; --cam: #7fb2dc; --uw: #5b3fa0; --win: #f07d00; --cal: #e8b923;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --col: 620px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font-family: var(--serif); font-size: 20px; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-variant-numeric: lining-nums; }
a { color: inherit; text-decoration-color: #bbb; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
:focus-visible { outline: 2px solid var(--crimson); outline-offset: 2px; }

/* ---------------- stage ---------------- */
.scrolly { position: relative; }
.stage { position: sticky; top: 0; height: 100vh; height: 100lvh; width: 100%; overflow: hidden; background: #1a1d21;
  --glass: rgba(14, 16, 20, .74); --glass-line: rgba(255, 255, 255, .09); --on-glass: #f4f2ee; --on-glass-2: rgba(244, 242, 238, .66); --hot: #ff5c70; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; contain: strict; }
.scrim { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .8s ease;
  background: linear-gradient(180deg, rgba(10, 12, 16, .28) 0%, rgba(10, 12, 16, 0) 22%, rgba(10, 12, 16, 0) 38%, rgba(10, 12, 16, .78) 100%), linear-gradient(90deg, rgba(10, 12, 16, .42) 0%, rgba(10, 12, 16, 0) 62%); }
.stage.is-hero .scrim { opacity: 1; }
/* a soft vignette on every shot keeps the eye in the middle of the frame */
.stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; box-shadow: inset 0 0 180px rgba(8, 10, 14, .38); }
.poster { position: absolute; inset: 0; z-index: 3; transition: opacity 1.4s ease; background: #1a1d21; }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }   /* unfiltered: it dissolves into the same 3D view */
.poster::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,12,16,.15) 0%, rgba(10,12,16,0) 35%, rgba(10,12,16,.45) 100%); pointer-events: none; }
.poster-cr { position: absolute; right: 10px; bottom: 8px; z-index: 1; font: 11px/1.3 system-ui, sans-serif; color: rgba(255,255,255,.85); text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.poster.gone { opacity: 0; pointer-events: none; }
.loader { position: absolute; left: 0; right: 0; top: 0; height: 2px; z-index: 6; pointer-events: none; transition: opacity .6s ease .3s; }
.loader i { display: block; height: 100%; width: 0; background: var(--hot); box-shadow: 0 0 8px rgba(255, 92, 112, .7); transition: width .35s ease; }
.loader.done { opacity: 0; }
.credit { position: absolute; right: 12px; bottom: 8px; z-index: 4; max-width: 60vw; font: 500 10px/1.25 var(--sans); color: rgba(255, 255, 255, .82); text-align: right; text-shadow: 0 0 3px rgba(0, 0, 0, .7); pointer-events: none; }
.credit b { font: 600 12.5px/1 "Product Sans", var(--sans); letter-spacing: -.01em; margin-right: 4px; color: #fff; }

/* ---------------- map labels: pins stand on the water ---------------- */
.lbl { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform, opacity; visibility: hidden; font-family: var(--sans); --stem: 26px; }
.lbl .tag { display: flex; align-items: center; gap: 6px; }
.lbl.pin .tag { position: relative; transform: translateX(var(--dx, 0px)); transition: transform .25s ease; }
/* a tag slid sideways keeps an elbow back to its stem */
.lbl.pin .tag::after { content: ""; position: absolute; top: 100%; left: calc(50% + var(--ll, 0px)); width: var(--lw, 0px); height: 1.5px; background: rgba(255, 255, 255, .95); box-shadow: 0 0 2px rgba(0, 0, 0, .45); }
.lbl.pin { display: flex; flex-direction: column; align-items: center; }
.lbl.pin::after { content: ""; width: 1.5px; height: var(--stem); background: linear-gradient(rgba(255, 255, 255, .95), rgba(255, 255, 255, .55)); box-shadow: 0 0 2px rgba(0, 0, 0, .45); }
.lbl.pin::before { content: ""; position: absolute; bottom: -3px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .28); }
.lbl.boat .tag { padding: 5px 10px 5px 8px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--on-glass);
  font-size: 12.5px; font-weight: 700; letter-spacing: .01em; border-radius: 999px; border: 1px solid var(--glass-line); box-shadow: 0 4px 14px rgba(0, 0, 0, .28); }
.lbl.boat i { width: 9px; height: 9px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .85); }
.lbl.boat em { font-style: normal; font-weight: 500; color: var(--on-glass-2); font-variant-numeric: tabular-nums; }
.lbl.boat .wc:not(:empty) { margin-left: 2px; padding-left: 7px; border-left: 1px solid var(--glass-line); }
.lbl.boat.h .wc { color: rgba(255, 255, 255, .85); }
.lbl.boat.h .tag { background: var(--crimson); border-color: rgba(255, 255, 255, .25); color: #fff; }
.lbl.boat.h em { color: rgba(255, 255, 255, .8); }
.lbl.station .tag { flex-direction: column; gap: 1px; padding: 5px 9px 5px; background: rgba(255, 255, 255, .94); color: var(--ink); border-radius: 3px; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); text-align: center; }
.lbl.station b { font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.lbl.station span { font-size: 10.5px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.lbl.station.weld .tag { background: var(--crimson); color: #fff; }
.lbl.station.weld span { color: rgba(255, 255, 255, .82); }
.lbl.place { color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .02em; text-shadow: 0 0 4px rgba(0, 0, 0, .85), 0 0 1px rgba(0, 0, 0, .95); }
.lbl.seg { background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: var(--on-glass); padding: 8px 12px 8px; font-size: 11.5px; line-height: 1.35; text-align: left;
  border-radius: 4px; border: 1px solid var(--glass-line); border-left: 3px solid var(--hot); box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }
.lbl.seg.won { border-left-color: #8fb3d1; }
.lbl.seg b { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.015em; font-variant-numeric: tabular-nums; margin-bottom: 2px; }
.lbl.seg.lost b { color: var(--hot); }
.lbl.seg.won b { color: #a9cbe6; }
.lbl.seg span { display: block; color: var(--on-glass-2); }
.lbl.gap { background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); color: var(--on-glass); padding: 5px 11px; font-size: 12px; font-weight: 500;
  border-radius: 999px; border: 1px solid var(--glass-line); box-shadow: 0 4px 14px rgba(0, 0, 0, .28); }
.lbl.gap b { color: var(--hot); font-weight: 800; font-variant-numeric: tabular-nums; font-size: 13px; }
.lbl.windlbl { display: flex; flex-direction: column; align-items: center; gap: 1px; background: rgba(255, 255, 255, .9); color: #16324f; padding: 5px 11px 6px; font-size: 11.5px; line-height: 1.2; border-radius: 2px; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.lbl.windlbl b { font-weight: 800; font-size: 13px; }
.lbl.windlbl span { color: #4b6684; }
.lbl.windlbl .arr { display: block; color: #2c6fb3; line-height: 0; margin-bottom: 1px; transition: transform .2s linear; }

/* ---------------- race tracker: a broadcast-style strip ---------------- */
.tracker { position: absolute; z-index: 2; right: 20px; bottom: calc(26px + env(safe-area-inset-bottom, 0px)); width: min(520px, calc(100vw - 40px)); padding: 13px 18px 12px;
  background: var(--glass); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); border: 1px solid var(--glass-line); border-radius: 6px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .32); font-family: var(--sans); color: var(--on-glass); opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; pointer-events: none; }
.tracker.on { opacity: 1; transform: none; }
.tk-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tk-title { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--on-glass-2); }
.tk-title b { color: var(--on-glass); font-weight: 800; margin-right: 3px; }
.tk-clock { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tk-course { position: relative; height: 34px; margin: 6px 4px 4px; }
.tk-rail, .tk-fill { position: absolute; left: 0; top: 11px; height: 3px; border-radius: 2px; }
.tk-rail { right: 0; background: rgba(255, 255, 255, .16); }
.tk-fill { width: 0; background: rgba(255, 255, 255, .7); }
.tk-course .stn { position: absolute; top: 6px; width: 1px; height: 13px; background: rgba(255, 255, 255, .45); }
.tk-course .stn span { position: absolute; top: 15px; left: 0; transform: translateX(-50%); font-size: 9.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--on-glass-2); white-space: nowrap; }
.tk-course .stn:first-of-type span { transform: none; }
.tk-course .stn.end span { transform: translateX(-100%); }
.tk-course .stn.weld { background: var(--hot); }
.tk-course .stn.weld span { color: var(--hot); }
.tk-course .dot { position: absolute; top: 12.5px; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 2px solid rgba(14, 16, 20, .9); will-change: left; }
.tk-course .dot.h { width: 14px; height: 14px; margin: -7px 0 0 -7px; border-color: #fff; z-index: 2; }
.tk-board { list-style: none; margin: 4px 0 0; padding: 9px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--glass-line); }
.tk-board li { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tk-board li .n { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; }
.tk-board li .n i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tk-board li .g { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; color: var(--on-glass); }
.tk-board li .g small { font-size: 11px; font-weight: 500; color: var(--on-glass-2); margin-left: 2px; }
.tk-board li .p { font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--on-glass-2); }
.tk-board li.h .g { color: var(--hot); }
.tk-board li .w { font-size: 11px; font-weight: 500; color: var(--on-glass-2); font-variant-numeric: tabular-nums; }
.tk-board li .w b { font-weight: 800; color: var(--on-glass); }
.tk-board li.h .w b { color: var(--hot); }
.tk-wp { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--glass-line); }
.tk-wp-h { font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--on-glass-2); }
.tk-wp-h span { font-weight: 500; letter-spacing: .02em; text-transform: none; margin-left: 4px; opacity: .8; }
#wpChart { display: block; width: 100%; height: 66px; margin-top: 4px; overflow: visible; }
#wpChart text { font-family: var(--sans); font-size: 9.5px; fill: var(--on-glass-2); font-variant-numeric: tabular-nums; }
#wpChart text.v { font-size: 10.5px; font-weight: 800; }
.tk-note { font-size: 10px; color: var(--on-glass-2); margin-top: 8px; opacity: .8; }

/* ---------------- steps ---------------- */
.steps { position: relative; z-index: 5; margin-top: -100vh; margin-top: -100lvh; pointer-events: none; }
.step { min-height: 150vh; display: flex; align-items: center; padding: 0 max(24px, 5vw); }
.step:last-child { min-height: 160vh; }
/* the race sections get twice the scroll, so the clock (and the camera) move through each stretch slowly */
.step[data-step="start"], .step[data-step="riverside"], .step[data-step="wind"], .step[data-step="finish"] { min-height: 300vh; }
.step[data-step="weld"] { min-height: 450vh; }
.card { pointer-events: auto; width: 100%; max-width: 384px; padding: 20px 24px 21px; font-size: 18px; line-height: 1.52;
  background: rgba(14, 16, 20, .76); backdrop-filter: blur(20px) saturate(1.35); -webkit-backdrop-filter: blur(20px) saturate(1.35); color: #f4f2ee;
  border: 1px solid rgba(255, 255, 255, .09); border-radius: 6px; box-shadow: 0 18px 50px rgba(0, 0, 0, .3); }
.card p { margin: 0; }
.card p + p { margin-top: .75em; }
.card .label { display: flex; align-items: center; gap: 10px; font: 700 10.5px/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: rgba(244, 242, 238, .62); margin-bottom: .95em; }
.card .label::before { content: ""; width: 18px; height: 2px; background: #ff5c70; flex: none; }
.card .label + p { margin-top: 0; }
.card b.n { font-family: var(--sans); font-weight: 800; color: #ff5c70; font-size: .95em; font-variant-numeric: tabular-nums; }
.card b[class^="k-"] { font-family: var(--sans); font-size: .86em; font-weight: 700; padding: 1px 7px 2px; border-radius: 999px; white-space: nowrap; }
.k-h { background: var(--crimson); color: #fff; }
.k-cam { background: var(--cam); color: #0e2233; }
.k-uw { background: var(--uw); color: #fff; }
.k-win { background: var(--win); color: #fff; }
.k-cal { background: var(--cal); color: #1b1600; }

.step-hero { min-height: 100vh; min-height: 100svh; flex-direction: column; justify-content: flex-end; align-items: flex-start; padding-bottom: max(64px, 9vh); }
.headline { pointer-events: auto; max-width: 820px; color: #fff; text-shadow: 0 1px 20px rgba(0, 0, 0, .35); }
.kicker { display: inline-block; font: 700 12px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; margin: 0 0 18px; padding-top: 10px; border-top: 3px solid var(--crimson); }
.headline h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(34px, min(4.6vw, 6.8vh), 62px); line-height: 1.04; letter-spacing: -.015em; margin: 0 0 18px; text-wrap: balance; }
.dek { font-size: clamp(18px, 1.8vw, 23px); line-height: 1.4; margin: 0 0 22px; max-width: 640px; text-wrap: pretty; }
.byline { font: 500 15px/1.4 var(--sans); margin: 0; }
.byline span { font-weight: 700; }
.cue { position: absolute; left: 50%; bottom: 4vh; width: 1px; height: 44px; background: rgba(255, 255, 255, .35); overflow: hidden; }
.cue span { position: absolute; left: 0; top: 0; width: 1px; height: 60%; background: #fff; }

/* ---------------- article ---------------- */
.body { position: relative; z-index: 6; background: var(--paper); padding: 80px 20px 96px; }
.body > * { max-width: var(--col); margin-left: auto; margin-right: auto; }
.body p { margin-top: 0; margin-bottom: 1.15em; }
.body .lede::first-letter { float: left; font-size: 3.6em; line-height: .86; font-weight: 700; margin: .06em .08em 0 0; color: var(--ink); }
.body h2 { font: 700 30px/1.15 var(--serif); letter-spacing: -.01em; margin: 2.1em auto .6em; text-wrap: balance; }
.fig { max-width: 700px; margin: 40px auto 48px; padding-top: 14px; border-top: 1px solid var(--ink); }
.fig figcaption { margin-bottom: 14px; }
.fig .ft { font: 700 18px/1.3 var(--sans); letter-spacing: -.005em; margin-bottom: 4px; }
.fig .fs { font: 400 15px/1.45 var(--sans); color: var(--ink-2); max-width: 620px; }
.fig .src { font: 400 12px/1.45 var(--sans); color: var(--muted); margin-top: 10px; }
/* wind figure controls */
.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 12px; }
.presets button { font: 600 12px/1 var(--sans); border: 1px solid var(--rule); background: #fff; color: var(--ink); padding: 7px 10px; border-radius: 999px; cursor: pointer; }
.presets button:hover { border-color: var(--ink); }
.presets button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.ctl { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 12px; align-items: center; font: 500 13px/1.3 var(--sans); margin: 0 0 10px; }
.ctl label { color: var(--ink-2); }
.ctl output { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 92px; text-align: right; }
.ctl input[type=range] { width: 100%; accent-color: var(--crimson); }
@media (max-width: 640px) { .ctl { grid-template-columns: 1fr auto; } .ctl label { grid-column: 1 / -1; margin-bottom: -6px; } }
/* two charts side by side, stacked on narrow screens */
.fig.pair { max-width: 860px; }
.fig.pair .panels { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.fig.pair .panel .ft { font-size: 16px; }
.fig.pair .panel .fs { font-size: 13.5px; min-height: 4.4em; margin-bottom: 8px; }
@media (max-width: 680px) { .fig.pair .panels { grid-template-columns: 1fr; gap: 30px; } .fig.pair .panel .fs { min-height: 0; } }
.fig svg { display: block; width: 100%; height: auto; overflow: visible; }
.fig svg text { font-family: var(--sans); }
.fig svg .tick { fill: var(--muted); font-size: 11.5px; }
.fig svg .tick.strong { fill: var(--ink); font-weight: 700; }
.fig svg .ann { font-size: 12px; font-weight: 700; fill: var(--ink); }
.fig svg .end { font-size: 12px; font-weight: 600; fill: var(--muted); }
.fig svg .end.hi { fill: var(--crimson); font-weight: 800; }
.fig svg .endsub { font-weight: 400; fill: var(--muted); }
.fig svg .colhead { font-size: 12px; font-weight: 700; fill: var(--ink); }
.fig svg .rowlab { font-size: 13px; font-weight: 600; fill: var(--ink); font-variant-numeric: tabular-nums; }
.fig svg .rowlab.strong { font-weight: 800; }
.fig svg .cell { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fig svg .cell.strong { font-weight: 800; }
.tip { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; opacity: 0; transition: opacity .12s; background: #fff; color: var(--ink); border: 1px solid #ddd; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); padding: 7px 10px; font: 400 13px/1.4 var(--sans); max-width: 260px; }
.tip b { font-weight: 700; }
.tip span { color: var(--muted); }
.body p.placeholder { font: 600 15px/1.5 var(--sans); background: #fff4c2; border-left: 4px solid #e0b100; padding: 10px 14px; color: #5c4a00; }
.method { border-top: 1px solid var(--rule); margin-top: 64px; padding-top: 22px; font: 400 14.5px/1.6 var(--sans); color: var(--ink-2); }
.method h3 { font: 700 12px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); margin: 0 0 14px; }
.method p { margin: 0 0 .9em; }

@media (max-width: 760px) {
  body { font-size: 18.5px; }
  .step { align-items: flex-end; padding: 0 12px 7vh; min-height: 140vh; }
  .step[data-step="start"], .step[data-step="riverside"], .step[data-step="wind"], .step[data-step="finish"] { min-height: 260vh; }
  .step[data-step="weld"] { min-height: 380vh; }
  .card { max-width: none; font-size: 16.5px; padding: 15px 17px 16px; }
  .step-hero { min-height: 100vh; min-height: 100svh; padding: 0 20px max(56px, 9vh); }
  .tk-course .stn.cbc span { display: none; }
  .tracker { left: 10px; right: 10px; width: auto; top: calc(10px + env(safe-area-inset-top, 0px)); bottom: auto; padding: 9px 12px 9px; transform: translateY(-10px); }
  .tk-clock { font-size: 19px; }
  .tk-course { height: 30px; }
  .tk-board li .g { font-size: 15px; }
  #wpChart { height: 52px; }
  .tk-note { display: none; }
  .body h2 { font-size: 26px; }
  .credit { font-size: 9px; left: 10px; right: 10px; max-width: none; text-align: left; }
}

/* no WebGL: the poster photo stays, map furniture is hidden */
.no-webgl .tracker, .no-webgl .loader, .no-webgl .labels, .no-webgl .credit { display: none; }
.no-webgl .poster { opacity: 1 !important; }
