:root {
  --ink: #141414;
  --ink-2: #8b8b8b;
  --bg: #ffffff;
  --line: #ececec;
  --accent: #ff5a1f;
  --ease-in-out-quint: cubic-bezier(0.83, 0, 0.17, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --cube: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

.layout {
  --side: 220px;
  position: relative;
  height: 100vh;
  height: 100dvh;
  transition: opacity 520ms cubic-bezier(0.4, 0, 0.6, 1);
}
.topbar { display: none; }
html.nav-locked { overflow: hidden; }
.layout.is-leaving { opacity: 0; pointer-events: none; }

/* ---------- Sidebar ----------
   Sits over the left of the full-screen shelf, which fades out before reaching it. */
.sidebar {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  z-index: 2;
  width: var(--side);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 18px 0 18px 18px;
}
/* The shelf fades in underneath the sidebar, so only its links take the pointer. */
.sidebar, .nav, .nav-group { pointer-events: none; }
.nav a, .nav-heading, .sidebar-foot { pointer-events: auto; }
.nav { position: relative; display: flex; flex-direction: column; gap: 32px; }
.nav-group { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.nav-heading { margin: 0 0 2px; }
.nav a {
  color: var(--ink-2);
  text-decoration: none;
  transition: color 150ms;
}
.nav a:hover, .nav a:focus-visible, .nav a[aria-current] { color: var(--ink); outline: none; }
.sidebar-foot { position: absolute; left: 18px; bottom: 18px; color: var(--ink-2); }
.sidebar-foot p { margin: 0; }

/* ---------- Cube marker ---------- */
.cube-marker {
  position: absolute;
  left: 0;
  top: 0;
  width: 10px;
  height: 10px;
  pointer-events: none;
  visibility: hidden;
  perspective: 120px;
}
.cube-view {
  display: block;
  width: var(--cube);
  height: var(--cube);
  transform-style: preserve-3d;
  transform: rotateX(-24deg) rotateY(36deg);
}
.cube {
  display: block;
  position: relative;
  width: var(--cube);
  height: var(--cube);
  transform-style: preserve-3d;
}
/* Solid faces in the six Rubik's colours. The edge line is dark so the white face still
   reads against the light page. */
.face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.28);
  transition: background-color 260ms ease;
}
.f-front  { background: #0051ba; transform: translateZ(calc(var(--cube) / 2)); }
.f-back   { background: #009e60; transform: rotateY(180deg) translateZ(calc(var(--cube) / 2)); }
.f-right  { background: #ff6a00; transform: rotateY(90deg) translateZ(calc(var(--cube) / 2)); }
.f-left   { background: #d0213b; transform: rotateY(-90deg) translateZ(calc(var(--cube) / 2)); }
.f-top    { background: #ffffff; transform: rotateX(90deg) translateZ(calc(var(--cube) / 2)); }
.f-bottom { background: #ffd500; transform: rotateX(-90deg) translateZ(calc(var(--cube) / 2)); }

/* ---------- Main / stage ---------- */
.main { position: absolute; inset: 0; }
.stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
}
.stage { cursor: grab; }
.stage.is-pointing { cursor: pointer; }
.stage.is-dragging { cursor: grabbing; }
.scene {
  position: absolute;
  inset: 0 0 110px 0;
  perspective: 1200px;
  perspective-origin: 50% 46%;
  /* Fully clear where the sidebar labels sit (and the matching strip on the right), then
     fades in underneath the rest of the sidebar. rolodex.js sets both widths. */
  --clear: 136px;
  --fade-w: 200px;
  --fade: linear-gradient(90deg,
    transparent 0, transparent var(--clear),
    #000 calc(var(--clear) + var(--fade-w)), #000 calc(100% - var(--clear) - var(--fade-w)),
    transparent calc(100% - var(--clear)), transparent 100%);
  -webkit-mask-image: var(--fade);
  mask-image: var(--fade);
}
.track {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

/* ---------- Plaques ----------
   Each plaque is an extruded rounded rectangle: two rounded side faces plus a ring of
   thin facets around the profile (the straight front facet doubles as the spine). */
.slab {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.slab > * {
  position: absolute;
  left: 0;
  top: 0;
  backface-visibility: hidden;
}
.facet { background: var(--edge); }
.spine { background: var(--spine); }

.side {
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  padding: calc(20px * var(--k));
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.side-title { position: relative; z-index: 2; font-size: calc(30px * var(--k)); line-height: 1.05; font-weight: 500; letter-spacing: -0.025em; margin: 0; }
/* Pictures sit untinted; each card's lettering is set dark or light to suit its picture. */
.side-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.side.ink-dark { color: #141414; }
.side.ink-light { color: #fff; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35); }
.side > .paint { z-index: 1; }

/* ---------- Palette (shared by plaques and section pages) ----------
   One muted charcoal for every section for now; per-section themes can come back later
   through the .t-<theme> classes both still carry. */
.slab, .page { --bg: #1c1c1b; --spine: #252524; --edge: #141413; --ink: #e9e7e2; }

/* ---------- Readout / scrubber ---------- */
.readout {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  height: 18px;
  font-size: 13px;
  pointer-events: none;
}
.readout-title { font-weight: 500; }
.readout.swap > * { animation: readout-in 260ms var(--ease-out-quint); }
@keyframes readout-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.scrubber {
  position: absolute;
  left: 50%;
  bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}
.scrub {
  width: 9px;
  height: 9px;
  border: 1px solid #cfcfcf;
  border-radius: 1px;
  transition: background 150ms, border-color 150ms, transform 150ms;
}
.scrub.is-current { border-color: #8b8b8b; background: #8b8b8b; transform: scale(1.2); }
.hint {
  position: absolute; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); margin: 0;
  text-align: center; color: var(--ink-2); font-size: 11.5px;
  transition: opacity 300ms;
}
.hint.is-hidden { opacity: 0; }

/* ---------- Intro (loader) ----------
   The page starts blank: the sidebar and the stage chrome are hidden until the intro
   cube has stamped out the shelf and jumps into the nav. */
.nav-group, .sidebar-foot {
  transition: opacity 700ms var(--ease-out-quint), transform 700ms var(--ease-out-quint);
  transition-delay: var(--d, 0ms);
}
.nav-group:nth-child(2) { --d: 70ms; }
.nav-group:nth-child(3) { --d: 140ms; }
.sidebar-foot { --d: 200ms; }
.intro-hide-side .nav-group,
.intro-hide-side .sidebar-foot { opacity: 0; transform: translateX(-8px); pointer-events: none; }

.readout, .scrubber { transition: opacity 600ms ease; }
.intro-hide-stage .readout,
.intro-hide-stage .scrubber,
.intro-hide-stage .hint { opacity: 0; }

.intro-layer { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.intro-layer > * { position: absolute; left: 0; top: 0; visibility: hidden; will-change: transform; }
.intro-ball {
  width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 34% 28%, #f4ff8a, #d7f53a 52%, #a8c61e);
  box-shadow: inset -2px -3px 6px rgba(0, 0, 0, 0.14);
}
.intro-ball svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro-ball path { fill: none; stroke: #fbfff0; stroke-width: 1.7; stroke-linecap: round; }
.intro-ball-ink { position: absolute; inset: 0; background: #141414; opacity: 0; }
.intro-shadow {
  width: 30px; height: 7px; margin: -3.5px 0 0 -15px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.26), transparent);
}
.intro-spark { width: 4px; height: 4px; margin: -2px 0 0 -2px; visibility: visible; opacity: 0; }
.intro-cube, .cube-cursor { width: var(--cube); height: var(--cube); margin: calc(var(--cube) / -2) 0 0 calc(var(--cube) / -2); perspective: calc(var(--cube) * 12); }
/* Laid out at its intro size (marker size x S in intro.js) so the edges stay sharp. */
.intro-cube { --cube: 24px; }
.intro-cube.is-bare .face { background: #141414; transition: none; }

/* ---------- Paint ---------- */
.side > .paint { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.side > .paint-corner { position: absolute; width: 0; height: 0; pointer-events: none; }

/* ---------- Cube cursor ---------- */
.cube-cursor { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; visibility: hidden; will-change: transform; }
/* The stage runs under the sidebar but the cube only takes over to the right of it, so
   the system cursor is hidden only while the cube is actually following. */
.stage.cube-engaged, .stage.cube-engaged * { cursor: none; }

/* ---------- About page (inside the layout) ----------
   Heading and timeline are one left-aligned column, centred as a box with auto
   margins rather than justify-content so a tall page scrolls from its top
   instead of being clipped. */
.placeholder {
  position: absolute;
  inset: 0 0 0 var(--side);
  display: flex;
  flex-direction: column;
  padding: 32px 28px;
  overflow: auto;
  animation: fade-up 380ms var(--ease-out-quint);
}
.placeholder[hidden] { display: none; }
.placeholder-inner { margin: auto; width: max-content; max-width: 100%; text-align: left; }
.placeholder-kicker { margin: 0 0 6px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-2); }
.placeholder-title { margin: 0; font-size: clamp(80px, min(12vw, 16vh), 184px); line-height: 0.9; letter-spacing: -0.045em; font-weight: 500; }
.placeholder-body { margin: 16px 0 0; }
.about { margin: 56px 0 0; width: 460px; max-width: 100%; }
.about div + div { margin-top: 28px; }
.about dt { margin: 0; font-weight: 500; }
.about dd { margin: 4px 0 0; }
.about-sign { display: block; width: 75px; height: auto; margin: 40px 0 0; }
.about-sign[hidden] { display: none; }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Play (typing test, inside the layout) ---------- */
.play {
  --type: clamp(18px, 2vw, 28px);
  --line-h: 1.6;
  --dim: #c4c4c4;
  --bad: #d0213b;
  --extra: #7e1424;
  position: absolute;
  inset: 0 0 0 var(--side);
  display: flex;
  flex-direction: column;
  padding: 32px 28px 18px;
  overflow: auto;
  animation: fade-up 380ms var(--ease-out-quint);
}
.play[hidden], .play [hidden] { display: none; }
/* One column on the area right of the sidebar. margin:auto (not justify-content)
   keeps a short screen scrolling from the top. The test stays full width; the
   result rows shrink-wrap so they share the restart button's centre line. */
.play-inner {
  margin: auto;
  width: min(1000px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.play-test { width: 100%; }

.play-progress {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: calc(var(--type) * 0.8);
  color: var(--ink-2);
  visibility: hidden;
}
.play.is-running .play-progress { visibility: visible; }
.play-wrap {
  position: relative;
  height: calc(var(--type) * var(--line-h) * 3);
  overflow: hidden;
  font-family: var(--mono);
  font-size: var(--type);
  line-height: var(--line-h);
  cursor: text;
}
.play-words {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  color: var(--dim);
  user-select: none;
  transition: transform 140ms ease, filter 200ms, opacity 200ms;
}
.word { margin-right: 0.6em; }
.word.is-error { text-decoration: underline 2px var(--bad); text-underline-offset: 0.3em; }
.word .ok { color: var(--ink); }
.word .bad { color: var(--bad); }
.word .extra { color: var(--extra); }
.play-caret {
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 1.2em;
  border-radius: 1px;
  background: var(--ink);
  transition: transform 90ms ease-out, filter 200ms, opacity 200ms;
}
.play-caret.is-idle { animation: caret-blink 1s ease-in-out infinite; }
@keyframes caret-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.play-focus {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  font-family: var(--sans);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms;
}
.play-wrap.is-blurred .play-words, .play-wrap.is-blurred .play-caret { filter: blur(5px); opacity: 0.45; }
.play-wrap.is-blurred .play-caret { animation: none; }
.play-wrap.is-blurred .play-focus { opacity: 1; }
.play-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  resize: none;
  font-size: 16px;
  pointer-events: none;
}
.play-cite { margin: 18px 0 0; font-size: 12.5px; color: var(--ink-2); text-align: left; }

.play-result { display: flex; flex-direction: column; align-items: center; }
.play-big { display: flex; gap: clamp(36px, 6vw, 88px); }
.play-big > div { display: flex; flex-direction: column; }
.play-label { color: var(--ink-2); font-size: 13px; }
.play-big b { font-family: var(--mono); font-weight: 400; font-size: clamp(56px, 7vw, 96px); line-height: 1; letter-spacing: -0.04em; }
.play-small { display: flex; gap: 40px; margin: 26px 0 0; }
.play-small dt { color: var(--ink-2); font-size: 12px; }
.play-small dd { margin: 2px 0 0; font-family: var(--mono); font-size: 18px; }
.play-entry { display: flex; align-items: baseline; gap: 14px; min-height: 24px; margin: 26px 0 0; color: var(--ink-2); }
.play-name {
  width: 16ch;
  padding: 0 0 1px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  outline: none;
  transition: border-color 150ms;
}
.play-name:hover, .play-name:focus { border-color: var(--ink); }

.play-result + .play-board { margin-top: 44px; }
.play-board { width: min(560px, 100%); }
.play-board-head { display: flex; justify-content: space-between; gap: 16px; margin: 0 0 10px; font-weight: 500; }
.play-note { font-weight: 400; color: var(--ink-2); }
.play-rows { list-style: none; margin: 0; padding: 0; }
.play-rows li {
  display: grid;
  grid-template-columns: 3ch 1fr 5ch 11ch;
  gap: 16px;
  align-items: baseline;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}
.play-rows .play-rows-head { border-top: 0; padding-top: 0; color: var(--ink-2); font-size: 11.5px; }
.play-rank { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.play-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-rows .play-wpm { text-align: right; font-family: var(--mono); }
.play-rows .play-date { text-align: right; color: var(--ink-2); }
.play-rows .is-own .play-rank { color: var(--ink); }
.play-rows .play-name { width: 100%; }
.play-empty { color: var(--ink-2); }

.play-actions { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 30px 0 0; }
.play-restart { padding: 8px; color: var(--ink-2); transition: color 150ms; }
.play-board-toggle { font-size: 12px; color: var(--ink-2); transition: color 150ms; }
.play-restart:hover, .play-restart:focus-visible, .play-board-toggle:hover, .play-board-toggle:focus-visible { color: var(--ink); outline: none; }
.play-restart svg { display: block; }
.play-hints { margin: 24px 0 0; text-align: center; font-size: 11.5px; color: var(--ink-2); }
.play-hints kbd { padding: 1px 5px; border-radius: 3px; background: var(--ink); color: #fff; font-family: var(--mono); font-size: 10.5px; }

/* ---------- Section page (replaces the whole site) ----------
   The card the page opens from grows into the picture band at its top (rolodex.js
   flies a copy of the card through .page-morph), while the page colour fades in under
   it and the text follows. No transform on .page itself: it would become the
   containing block of the fixed morph layer. */
.page {
  position: fixed;
  inset: 0;
  overflow: auto;
  background-color: var(--bg);
  color: var(--ink);
  transition: background-color 420ms ease;
}
.page[hidden] { display: none; }
.page:not(.is-visible) { background-color: transparent; }
.page-morph { position: fixed; z-index: 0; pointer-events: none; }
.page-morph:empty { display: none; }
.morph-card { position: absolute; left: 0; top: 0; overflow: hidden; background: var(--bg); will-change: transform, width, height; }
.morph-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.morph-title { position: absolute; margin: 0; font-weight: 500; line-height: 1.05; letter-spacing: -0.025em; white-space: nowrap; }
.morph-card.ink-dark { color: #141414; }
.morph-card.ink-light { color: #fff; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.35); }

.page-hero, .page-inner { position: relative; z-index: 1; }
.page-hero { height: clamp(240px, 42vh, 440px); }
.page-hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page-hero-art[hidden], .page.is-morphing .page-hero-art { visibility: hidden; }
.page-back {
  position: absolute;
  top: calc(18px + env(safe-area-inset-top, 0px));
  left: calc(20px + env(safe-area-inset-left, 0px));
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 13px 7px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  color: #e9e7e2;
  background: rgba(20, 20, 19, 0.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background-color 150ms, opacity 420ms var(--ease-out-quint) 420ms;
}
.page-back:hover, .page-back:focus-visible { background-color: rgba(20, 20, 19, 0.85); outline: none; }
.mini-cube { display: inline-block; width: 10px; height: 10px; perspective: 120px; }
.mini-cube .cube { transition: transform 500ms var(--ease-in-out-quint); }
.page-back:hover .mini-cube .cube { transform: rotateX(-90deg); }
.page-inner {
  max-width: calc(760px + 56px);
  margin: 0 auto;
  padding: 56px calc(28px + env(safe-area-inset-right, 0px)) calc(64px + env(safe-area-inset-bottom, 0px)) calc(28px + env(safe-area-inset-left, 0px));
  transition: opacity 420ms var(--ease-out-quint) 420ms, transform 640ms var(--ease-out-quint) 420ms;
}
.page:not(.is-visible) .page-inner { opacity: 0; transform: translateY(14px); }
.page:not(.is-visible) .page-back { opacity: 0; }
.page:not(.is-visible) .page-inner, .page:not(.is-visible) .page-back { transition-duration: 180ms; transition-delay: 0ms; }
.page-kicker { margin: 0 0 10px; font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.7; }
.page-title { margin: 0; font-size: clamp(56px, 9vw, 120px); line-height: 0.95; letter-spacing: -0.035em; font-weight: 500; }
.page-body { max-width: 520px; font-size: 16px; margin: 22px 0 40px; opacity: 0.9; }
.page-body.is-soon { margin: 16px 0 0; font-size: 12.5px; opacity: 0.6; }
.page-items { list-style: none; margin: 0; padding: 0; counter-reset: item; border-top: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); }
.page-items li {
  counter-increment: item;
  display: flex;
  gap: 18px;
  padding: 14px 0;
  font-size: 15px;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
}
.page-items li::before { content: counter(item, decimal-leading-zero); font-family: var(--mono); font-size: 11px; opacity: 0.6; padding-top: 3px; }

.page-link { display: inline-block; margin: -20px 0 40px; color: inherit; text-decoration: none; font-size: 14px; border-bottom: 1px solid currentColor; opacity: 0.9; }
.page-link[hidden], .page-groups[hidden] { display: none; }
.page-link:hover, .page-link:focus-visible { opacity: 1; outline: none; }
.page-groups { border-top: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); }
.page-group {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
}
.page-group h2 { margin: 0; font-family: var(--mono); font-size: 11px; font-weight: 400; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.7; padding-top: 4px; }
.page-group ul { list-style: none; margin: 0; padding: 0; }
.page-group li + li { margin-top: 22px; }
.page-group p { margin: 0; }
.row-head { display: flex; justify-content: space-between; gap: 16px; font-size: 15px; }
.row-head b { font-weight: 500; }
.row-head a { color: inherit; text-decoration: none; border-bottom: 1px solid color-mix(in srgb, currentColor 40%, transparent); transition: border-color 150ms; }
.row-head a:hover, .row-head a:focus-visible { border-bottom-color: currentColor; outline: none; }
.row-when { flex: none; font-family: var(--mono); font-size: 11.5px; opacity: 0.7; padding-top: 2px; }
.row-role { margin-top: 2px; font-size: 14px; opacity: 0.75; }
.row-text { margin-top: 6px; max-width: 480px; font-size: 14px; opacity: 0.9; }

@media (hover: none), (pointer: coarse) {
  .stage { touch-action: none; }
  .play-hints { display: none; }
}

@media (max-width: 760px) {
  .layout { --side: 0px; --bar: calc(52px + env(safe-area-inset-top, 0px)); }
  .sidebar {
    position: fixed;
    left: 0; right: 0; top: 0; bottom: auto;
    z-index: 30;
    width: auto;
    height: auto;
    padding: 0;
    justify-content: flex-start;
    background: #fff;
  }
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--bar);
    padding: env(safe-area-inset-top, 0px) 16px 0;
    background: #fff;
    pointer-events: auto;
    transition: opacity 700ms var(--ease-out-quint);
  }
  .intro-hide-side .topbar { opacity: 0; pointer-events: none; }
  .topbar-mark { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .topbar-title { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav-toggle { min-height: 44px; padding: 0 4px; font-size: 15px; pointer-events: auto; }
  .cube-marker { display: none; }
  .nav {
    display: none;
    position: fixed;
    inset: var(--bar) 0 0 0;
    z-index: 29;
    gap: 28px;
    padding: 8px 22px calc(64px + env(safe-area-inset-bottom, 0px));
    overflow: auto;
    background: #fff;
    pointer-events: auto;
  }
  .layout.nav-open .nav { display: flex; }
  .nav a { font-size: 20px; min-height: 44px; display: flex; align-items: center; }
  .nav-heading { font-size: 12px; }
  .sidebar-foot { display: none; }
  .layout.nav-open .sidebar-foot {
    display: block;
    position: fixed;
    left: 22px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    z-index: 31;
    pointer-events: auto;
  }
  .scene { top: var(--bar); perspective-origin: 50% 44%; }
  .placeholder, .play {
    inset: 0;
    padding: calc(var(--bar) + 24px) 20px calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .placeholder-title { font-size: clamp(56px, 18vw, 96px); }
  .about { width: 100%; }
  .page-hero { height: clamp(220px, 36vh, 320px); }
  .page-back { top: calc(10px + env(safe-area-inset-top, 0px)); left: 12px; min-height: 44px; padding: 0 16px 0 14px; }
  .page-inner { padding: 32px 16px calc(48px + env(safe-area-inset-bottom, 0px)); }
  .page-title { font-size: clamp(44px, 14vw, 72px); }
  .page-body { font-size: 15px; }
  .page-group { grid-template-columns: 1fr; gap: 14px; padding: 22px 0; }
  .row-head { flex-direction: column; gap: 2px; }
  .play { --type: clamp(18px, 5vw, 22px); }
  .play.is-running .play-inner { margin-top: 0; margin-bottom: auto; }
  .play-big b { font-size: clamp(56px, 18vw, 88px); }
  .play-restart { min-width: 44px; min-height: 44px; }
  .play-name { font-size: 16px; }
}
@media (max-width: 400px) {
  .play-rows li { grid-template-columns: 3ch 1fr 5ch; }
  .play-date { display: none; }
}

.page.is-instant, .page.is-instant .page-inner, .page.is-instant .page-back { transition: none; }

@media (prefers-reduced-motion: reduce) {
  .layout, .page, .page-inner, .page-back, .topbar { transition: none; }
  .placeholder, .play, .readout.swap > * { animation: none; }
  .play-words, .play-caret { transition: none; }
  .nav-group, .sidebar-foot { transition: none; }
}
