@font-face { font-family: Inter; font-weight: 400; font-display: swap; src: url(/fonts/inter-400.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 500; font-display: swap; src: url(/fonts/inter-500.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 600; font-display: swap; src: url(/fonts/inter-600.woff2) format('woff2'); }
@font-face { font-family: Inter; font-weight: 700; font-display: swap; src: url(/fonts/inter-700.woff2) format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-weight: 400; font-display: swap; src: url(/fonts/jetbrains-mono-400.woff2) format('woff2'); }

:root {
  --ink: #111;
  --grey: #8b8b8b;
  --faint: #c4c4c4;
  --line: #d6d6d6;
  --cell: min(64px, calc((100vw - 40px) / 10));
  --sans: Inter, 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #fff; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ------------------------------------------------------------ experience page */
body.exp { overflow: hidden; overscroll-behavior: none; touch-action: manipulation; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; outline: none; }
#stage.grabbing { cursor: grabbing; }

.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; pointer-events: none;
}
.top > * { pointer-events: auto; }
.brand { margin: 0; font-weight: 600; font-size: 14px; letter-spacing: -0.01em; text-decoration: none; }
.brand a { text-decoration: none; }
.brand span { color: var(--grey); font-weight: 500; }
.tools { display: flex; gap: 6px; align-items: center; }
.tool {
  height: 34px; min-width: 34px; padding: 0 10px; border-radius: 17px; border: 1px solid #e6e6e6; background: rgba(255,255,255,.85);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; font-size: 13px; font-weight: 500; text-decoration: none;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.tool:hover { border-color: #cfcfcf; }
.tool:focus-visible, .cell:focus-visible, #next:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.tool svg { width: 16px; height: 16px; }
#play .i-pause, #play.on .i-play { display: none; }
#play.on .i-pause { display: block; }
#mute .i-off, #mute.off .i-on { display: none; }
#mute.off .i-off { display: block; }

#caption {
  position: fixed; z-index: 2; left: 0; right: 0; top: clamp(58px, 9vh, 96px);
  text-align: center; pointer-events: none; padding: 0 20px;
}
#caption h2 {
  margin: 0; font-size: clamp(38px, 6.4vw, 76px); line-height: 1; font-weight: 700; letter-spacing: -0.035em;
}
#caption p { margin: 14px 0 0; font-size: clamp(15px, 1.6vw, 19px); line-height: 1.35; }
#caption b { font-weight: 700; }
#caption #line { color: var(--grey); font-weight: 500; }
#caption #line::before { content: ' '; }
#caption.in h2, #caption.in p { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
#caption.in p { animation-delay: .05s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* The timeline strip: ten glyphs on dashed guides, with a card that slides under the current one. */
#strip {
  --i: 0;
  position: fixed; z-index: 2; left: 50%; bottom: clamp(52px, 9vh, 92px); transform: translateX(-50%);
  width: calc(var(--cell) * 10);
}
#track { position: relative; height: var(--cell); display: flex; touch-action: none; cursor: pointer; }
#track::before, #track::after {
  content: ''; position: absolute; left: -24px; right: -24px; height: 0; border-top: 1px dashed var(--line); pointer-events: none;
}
#track::before { top: 18%; }
#track::after { top: 82%; }
#sel {
  position: absolute; left: 0; top: 0; width: var(--cell); pointer-events: none;
  transform: translateX(calc(var(--i) * 100%)); transition: transform .45s cubic-bezier(.3,1.35,.5,1);
}
#sel .card {
  position: absolute; left: 3px; right: 3px; top: -6px; height: calc(var(--cell) + 12px);
  background: #fff; border-radius: 12px; border: 1px solid #e9e9e9; box-shadow: 0 6px 18px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.06);
}
#sel .tick { position: absolute; left: 50%; top: calc(var(--cell) + 12px); width: 1px; height: 10px; background: var(--ink); }
#sel #date {
  position: absolute; left: 50%; top: calc(var(--cell) + 26px); transform: translateX(-50%);
  font-family: var(--mono); font-size: 12px; white-space: nowrap; color: var(--ink);
}
.cell {
  position: relative; z-index: 1; flex: 1; height: 100%; padding: 0; margin: 0; border: 0; background: none; cursor: pointer;
  color: var(--faint); transition: color .25s; display: flex; align-items: center; justify-content: center;
}
.cell svg { width: 70%; height: 70%; }
.cell:hover { color: #8d8d8d; }
.cell[aria-current='step'] { color: var(--ink); }
#strip.finale #sel .card { border-color: #111; }

#next {
  position: fixed; z-index: 3; left: 0; right: 0; margin: 0 auto; width: fit-content; bottom: calc(clamp(52px, 9vh, 92px) + var(--cell) + 30px);
  border: 0; background: var(--ink); color: #fff; border-radius: 20px; padding: 9px 16px; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.15); animation: rise .4s .3s both;
}
#next[hidden] { display: none; }
#weight-box {
  position: fixed; z-index: 3; right: 22px; top: 50%; transform: translateY(-50%);
  display: none; flex-direction: column; align-items: center; gap: 10px; font-family: var(--mono); font-size: 12px; color: var(--grey);
}
body.is-variable #weight-box { display: flex; }
#weight { writing-mode: vertical-lr; direction: rtl; height: 180px; width: 22px; accent-color: #111; }
#weight-out { color: var(--ink); min-width: 3ch; text-align: center; }

.credit {
  position: fixed; z-index: 2; left: 0; right: 0; bottom: 12px; text-align: center; font-size: 12px; color: var(--grey);
  pointer-events: none;
}
.credit a { pointer-events: auto; color: var(--grey); }
.credit kbd { font-family: var(--mono); font-size: 11px; border: 1px solid #e3e3e3; border-radius: 4px; padding: 0 4px; }

#flat, #nogl { display: none; }
body.no-webgl #stage { display: none; }
body.no-webgl #flat { display: block; position: fixed; left: 50%; top: 50%; width: min(36vh, 60vw); height: min(36vh, 60vw); transform: translate(-50%, -46%); color: var(--ink); }
body.no-webgl #flat.upside svg { transform: rotate(180deg); }
body.no-webgl #nogl { display: block; position: fixed; z-index: 3; left: 50%; top: 60px; transform: translateX(-50%); font-size: 13px; background: #fff4d6; border-radius: 8px; padding: 6px 12px; white-space: nowrap; }

@media (max-width: 640px) {
  .brand span { display: none; }
  .tool .label { display: none; }
  #weight-box { right: 10px; }
  #weight { height: 140px; }
  .credit .keys { display: none; }
}
@media (max-height: 560px) {
  #caption { top: 50px; }
  #caption h2 { font-size: 34px; }
  #caption p { margin-top: 6px; }
  #strip { bottom: 40px; }
  .credit { bottom: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  #sel { transition: none; }
  #caption.in h2, #caption.in p, #next { animation: none; }
}

/* ------------------------------------------------------------ story page */
body.story { overflow: auto; }
.story main { max-width: 680px; margin: 0 auto; padding: 72px 22px 96px; }
.story .top { position: static; padding: 14px 18px; }
.story h1 { font-size: clamp(36px, 6vw, 56px); letter-spacing: -0.035em; line-height: 1.02; margin: 0 0 14px; }
.story .lede { font-size: 19px; line-height: 1.5; color: #444; margin: 0 0 40px; }
.story article { display: grid; grid-template-columns: 92px 1fr; gap: 6px 26px; padding: 30px 0; border-top: 1px solid #eee; }
.story article svg { grid-row: span 3; width: 92px; height: 92px; color: var(--ink); }
.story article.upside svg { transform: rotate(180deg); }
.story h2 { margin: 0; font-size: 26px; letter-spacing: -0.02em; }
.story .meta { margin: 0; font-size: 15px; }
.story .meta time { font-family: var(--mono); font-size: 13px; color: var(--grey); margin-left: 6px; }
.story .meta span { color: var(--grey); }
.story article p.text { margin: 6px 0 0; font-size: 17px; line-height: 1.6; color: #333; }
.story .cta { display: inline-block; margin-top: 30px; background: var(--ink); color: #fff; text-decoration: none; padding: 12px 20px; border-radius: 24px; font-weight: 600; }
.story footer { margin-top: 48px; font-size: 14px; color: var(--grey); line-height: 1.6; }
@media (max-width: 520px) {
  .story article { grid-template-columns: 60px 1fr; gap: 4px 16px; }
  .story article svg { width: 60px; height: 60px; }
}
