/* ============ navglass — the glass bar ============
   The header is one sheet of liquid glass poured from the top edge of the viewport. It is
   attached to the top, left and right edges and never floats; where it meets the side walls it
   climbs them in concave fillets, the meniscus water makes against glass. Every panel (Settings,
   the sound deck, the hover tips) drips out of the same sheet through the same fillets, and the
   menu below 900px pours the sheet all the way down.

   Reading order, left to right: the mark · the chapters (a glass pill behind the one you are
   reading) · Ask AI · Sound · Settings · Let's talk. Every control is an icon plus a plain word;
   where the bar runs out of room the words fold away and hover/focus tips say what the icons
   are (the accessible names never depend on the tips).

   Icons: Lucide-style strokes on a 24-unit grid, drawn inline, always 1.5px on screen
   (non-scaling stroke) whatever size they are set at.

   Material (Apple's REGULAR variant — the bar is text): a tint strong enough to hold 4.5:1 on
   its own over any content, plus backdrop blur / saturate / brightness. On Chromium,
   html.has-lens adds true refraction: an SVG feDisplacementMap built from the sheet's own SDF
   (js/core/navglass.js), strongest at the edges. Everything else gets the same shape, frost and
   rims without the bend. html.nav-light (js/core/theme.js) re-tints it to paper.

   Shape: a mask on the glass layer (never on .nav — that would make .nav a backdrop root and
   empty the glass). --sh is the sheet height, --fil the fillet radius; both are registered so
   the compact shrink (64/22 → 52/14) is a real transition. */

@property --sh { syntax: '<length>'; inherits: true; initial-value: 64px; }
@property --fil { syntax: '<length>'; inherits: true; initial-value: 22px; }

/* ---------- local tokens (dark glass; paper below) ---------- */
.nav,
.menu {
  --n-ink: #ece8e1;
  --n-ink-2: rgba(236, 232, 225, 0.82);   /* ≥ 4.5:1 over the worst case (white under the glass) */
  --n-ink-3: rgba(236, 232, 225, 0.7);
  --n-ink-4: rgba(236, 232, 225, 0.28);   /* decorative only */
  --n-line: rgba(236, 232, 225, 0.12);
  --n-hover: rgba(236, 232, 225, 0.075);
  --n-tint: rgba(10, 10, 11, 0.62);
  --n-tint-deep: rgba(12, 12, 14, 0.78);
  --n-tone: saturate(1.7) brightness(0.8);
  --n-frost: blur(var(--n-blur, 12px)) var(--n-tone);
  --n-well: rgba(0, 0, 0, 0.26);
  --n-well-top: rgba(0, 0, 0, 0.5);
  --n-well-lip: rgba(255, 255, 255, 0.075);
  --n-rim: rgba(255, 255, 255, 0.13);
  --n-spec: 255, 255, 255;
  --n-bead: rgba(236, 232, 225, 0.1);
  --n-bead-hi: rgba(255, 255, 255, 0.36);
  --n-bead-lo: rgba(0, 0, 0, 0.34);
  --n-cta-bg: #ece8e1;
  --n-cta-ink: #0b0b0c;
  --n-cta-hover: #ffffff;
  --n-focus: var(--signal);
  /* light under the glass (the hover language — see "light" below) */
  --n-lit: 255, 246, 236;                  /* the light that pools under the pointer */
  --n-lit-a: 0.19;
  --n-glint: 255, 255, 255;                /* the rim catching it */
  --n-glint-a: 0.62;
  --n-key: rgba(236, 232, 225, 0.075);     /* a risen key of the sheet's glass */
  --n-key-top: rgba(255, 255, 255, 0.045);
  --n-key-hi: rgba(255, 255, 255, 0.13);
  --n-key-rim: rgba(255, 255, 255, 0.055);
  --n-key-drop: 0 1px 2px rgba(0, 0, 0, 0.4), 0 0 18px -3px rgba(255, 238, 222, 0.09);
  --n-ghost: rgba(236, 232, 225, 0.05);    /* the lighter key that previews a chapter */
  --n-cta-lit: 255, 255, 255;
  --n-cta-lit-a: 1;
  --n-cta-glint-a: 0;
  --n-cta-halo: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 8px 26px -8px rgba(255, 238, 222, 0.42);
  --n-icon-glow: drop-shadow(0 0 5px rgba(255, 244, 232, 0.3));
  /* motion: springs as linear() curves (sampled from damped harmonic springs), with
     cubic-bezier stand-ins where linear() is not supported */
  --n-spring: cubic-bezier(0.2, 0.9, 0.25, 1.04);   /* ζ 0.8 · ~370ms · 1% overshoot */
  --n-pop: cubic-bezier(0.3, 1.4, 0.5, 1);          /* ζ 0.55 · ~480ms · 12% overshoot */
}
@supports (transition-timing-function: linear(0, 1)) {
  .nav,
  .menu {
    --n-spring: linear(0, 0.031, 0.108, 0.21, 0.321, 0.432, 0.537, 0.631, 0.714, 0.783, 0.84, 0.887, 0.923, 0.951, 0.972, 0.986, 0.997, 1.004, 1.008, 1.01, 1.011, 1.011, 1.01, 1.009, 1.008, 1.007, 1.006, 1.004, 1.003, 1.003, 1);
    --n-pop: linear(0, 0.037, 0.13, 0.259, 0.405, 0.553, 0.692, 0.815, 0.917, 0.998, 1.057, 1.096, 1.118, 1.126, 1.123, 1.112, 1.097, 1.078, 1.06, 1.042, 1.026, 1.012, 1.002, 0.994, 0.988, 0.985, 0.984, 0.984, 0.986, 0.987, 0.99, 0.992, 0.994, 0.996, 0.998, 1, 1.001, 1.001, 1.002, 1.002, 1);
  }
}
html.nav-light .nav,
html.nav-light .menu {
  --n-ink: #0b0b0c;
  --n-ink-2: rgba(11, 11, 12, 0.8);
  --n-ink-3: rgba(11, 11, 12, 0.66);
  --n-ink-4: rgba(11, 11, 12, 0.26);
  --n-line: rgba(11, 11, 12, 0.13);
  --n-hover: rgba(11, 11, 12, 0.06);
  --n-tint: rgba(236, 232, 225, 0.68);
  --n-tint-deep: rgba(238, 234, 227, 0.84);
  --n-tone: saturate(1.4) brightness(1.15);
  --n-frost: blur(var(--n-blur, 12px)) var(--n-tone);
  --n-well: rgba(11, 11, 12, 0.055);
  --n-well-top: rgba(11, 11, 12, 0.17);
  --n-well-lip: rgba(255, 255, 255, 0.75);
  --n-rim: rgba(11, 11, 12, 0.17);
  --n-bead: rgba(255, 255, 255, 0.42);
  --n-bead-hi: rgba(255, 255, 255, 0.95);
  --n-bead-lo: rgba(11, 11, 12, 0.14);
  --n-cta-bg: #0b0b0c;
  --n-cta-ink: #ece8e1;
  --n-cta-hover: #26262a;
  --n-focus: #0b0b0c;
  /* on paper the light is white and the key casts a soft shadow */
  --n-lit: 255, 255, 255;
  --n-lit-a: 0.95;
  --n-glint: 255, 255, 255;
  --n-glint-a: 1;
  --n-key: rgba(255, 255, 255, 0.42);
  --n-key-top: rgba(255, 255, 255, 0.4);
  --n-key-hi: rgba(255, 255, 255, 0.95);
  --n-key-rim: rgba(11, 11, 12, 0.075);
  --n-key-drop: 0 1px 2px rgba(11, 11, 12, 0.1), 0 4px 12px -5px rgba(11, 11, 12, 0.2);
  --n-ghost: rgba(255, 255, 255, 0.3);
  --n-cta-lit: 255, 255, 255;
  --n-cta-lit-a: 0.17;
  --n-cta-glint-a: 0.5;
  --n-cta-halo: 0 0 0 1px rgba(11, 11, 12, 0.04), 0 10px 24px -10px rgba(11, 11, 12, 0.6);
  --n-icon-glow: drop-shadow(0 0 4px rgba(255, 255, 255, 0.9));
}

/* ---------- the sheet ---------- */
.nav {
  --sh: 64px;
  --fil: 22px;
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: calc(var(--sh) + var(--fil));
  color: var(--n-ink);
  pointer-events: none; /* the fillets are glass, not a hit area: clicks fall through to the page */
  transition: --sh 600ms var(--ease-out), --fil 600ms var(--ease-out), color 400ms var(--ease-ui);
}
.nav.is-compact { --sh: 52px; --fil: 14px; }
html.menu-open .nav { visibility: hidden; } /* the menu's own glass takes over, seamlessly */

.nav__glass,
.menu__glass {
  position: absolute;
  inset: 0 0 auto;
  height: calc(var(--sh) + var(--fil));
  background-color: var(--n-tint);
  -webkit-backdrop-filter: var(--n-frost);
  backdrop-filter: var(--n-frost);
  /* flat sheet + two concave fillets (transparent inside the fillet circle, glass outside it) */
  -webkit-mask:
    linear-gradient(#000 0 0) 0 0 / 100% var(--sh) no-repeat,
    radial-gradient(circle at 100% 100%, #0000 var(--fil), #000 calc(var(--fil) + 0.5px)) 0 var(--sh) / var(--fil) var(--fil) no-repeat,
    radial-gradient(circle at 0 100%, #0000 var(--fil), #000 calc(var(--fil) + 0.5px)) 100% var(--sh) / var(--fil) var(--fil) no-repeat;
  mask:
    linear-gradient(#000 0 0) 0 0 / 100% var(--sh) no-repeat,
    radial-gradient(circle at 100% 100%, #0000 var(--fil), #000 calc(var(--fil) + 0.5px)) 0 var(--sh) / var(--fil) var(--fil) no-repeat,
    radial-gradient(circle at 0 100%, #0000 var(--fil), #000 calc(var(--fil) + 0.5px)) 100% var(--sh) / var(--fil) var(--fil) no-repeat;
  transition: background-color 400ms var(--ease-ui);
}
/* Chromium, while the bar is still: the SVG filter frosts the interior itself and keeps the
   refracted rim nearly sharp. During scrolling (.is-lens off) the plain frost takes over — the
   lens costs ~4ms a frame over moving content, the frost ~1ms — and it condenses back at rest. */
.nav.is-lens .nav__glass { -webkit-backdrop-filter: url(#nav-lens) var(--n-tone); backdrop-filter: url(#nav-lens) var(--n-tone); }

/* inner light: a faint highlight where the glass meets the top edge, and a broad sheen under the pointer */
.nav__glass::before,
.menu__glass::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(30% 110% at var(--lx, 50%) 100%, rgba(var(--n-spec), calc(0.03 + var(--sheen, 0) * 0.06)), transparent 72%),
    linear-gradient(to bottom, rgba(var(--n-spec), 0.065), rgba(var(--n-spec), 0) 42%);
}
/* the frost is noise, not just blur: the site's grain, denser while σ is high */
.nav__glass::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: calc(0.035 + var(--sig, 0.5) * 0.07);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  transition: opacity 600ms var(--ease-ui);
}
html.nav-light .nav__glass::after { filter: invert(1); opacity: calc(0.025 + var(--sig, 0.5) * 0.05); }

/* ---------- rims: the specular edge where glass meets air ---------- */
.nav__edge {
  position: absolute;
  inset: 0 0 auto;
  height: calc(var(--sh) + var(--fil) + 1px);
  pointer-events: none;
}
.nav__rim,
.nav__prog {
  position: absolute;
  left: var(--fil);
  right: var(--fil);
  top: calc(var(--sh) - 1px);
  height: 1px;
  /* a drip hanging from the sheet opens a gap here, so sheet and drip read as one liquid */
  -webkit-mask: linear-gradient(to right, #000 var(--gl, 200vw), #0000 var(--gl, 200vw), #0000 var(--gr, 200vw), #000 var(--gr, 200vw));
  mask: linear-gradient(to right, #000 var(--gl, 200vw), #0000 var(--gl, 200vw), #0000 var(--gr, 200vw), #000 var(--gr, 200vw));
}
.nav__rim {
  background:
    radial-gradient(22% 100% at var(--lxr, 50%) 50%, rgba(var(--n-spec), calc(0.26 + var(--sheen, 0) * 0.5)), transparent),
    var(--n-rim);
}
html.nav-light .nav__rim { /* engraved on paper: a dark line with a white lip above it */
  top: calc(var(--sh) - 2px);
  height: 2px;
  background:
    radial-gradient(22% 100% at var(--lxr, 50%) 50%, rgba(255, 255, 255, calc(0.5 + var(--sheen, 0) * 0.4)), transparent),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.55) 50%, var(--n-rim) 50%);
}
/* scroll progress lives in the rim: the accent fills left → right, then runs down the right fillet */
.nav__prog { background: linear-gradient(to right, var(--signal) calc(var(--pl, 0) * 100%), #0000 0); opacity: 0.88; }

.nav__fil {
  position: absolute;
  top: calc(var(--sh) - 1px);
  width: var(--fil);
  height: calc(var(--fil) + 1px);
  --ring: #0000 calc(var(--fil) - 0.2px), #000 calc(var(--fil) + 0.3px), #000 calc(var(--fil) + 0.8px), #0000 calc(var(--fil) + 1.3px);
}
.nav__fil--l { left: 0; --at: 100% 100%; --lit: var(--ll, 0); }
.nav__fil--r { right: 0; --at: 0 100%; --lit: var(--lr, 0); }
.nav__fil::before,
.nav__fil::after {
  content: "";
  position: absolute;
  inset: 0;
  -webkit-mask: radial-gradient(circle at var(--at), var(--ring));
  mask: radial-gradient(circle at var(--at), var(--ring));
}
.nav__fil::before {
  background:
    linear-gradient(rgba(var(--n-spec), calc(var(--lit) * 0.5)) 0 0),
    var(--n-rim);
}
.nav__fil--r::after {
  background: conic-gradient(from 0deg at 0 100%, var(--signal) calc(var(--q, 0) * 90deg), #0000 0);
  opacity: 0.88;
}

/* ---------- the bar ---------- */
.nav__bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: var(--sh);
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: max(var(--gutter), calc(var(--fil) + 6px));
  pointer-events: auto;
}

/* keyboard focus: a clear 2px ring in the accent (ink on paper), never removed */
.nav :focus-visible,
.menu :focus-visible { outline: 2px solid var(--n-focus); outline-offset: 2px; border-radius: 9px; }

/* ---------- icons ---------- */
.ico {
  flex: none;
  width: 18px;
  height: 18px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ico * { vector-effect: non-scaling-stroke; }
/* the sound icon: struck-through headphones while off, whole while on */
.ico--sound .ico__on { display: none; }
[aria-pressed="true"] > .ico--sound .ico__on { display: inline; }
[aria-pressed="true"] > .ico--sound .ico__off { display: none; }

/* the latent mark: "AM" sampled from noise on a 28px canvas — no tile, no badge */
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  min-height: 44px;
  padding-inline: 4px;
  margin-left: -4px;
}
.latent { width: 28px; height: 28px; flex: none; }
.nav__name {
  font-size: 15px;
  font-weight: 450;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* ---------- the chapters: plain words, a glass pill behind the one being read ---------- */
.sched {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
  margin-inline: clamp(6px, 1.5vw, 28px);
}
.sched__nav { position: relative; min-width: 0; }
.sched__list { position: relative; z-index: 1; display: flex; align-items: center; }
.sched__list a {
  position: relative;
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 450;
  letter-spacing: -0.003em;
  line-height: 1;
  white-space: nowrap;
  color: var(--n-ink-2);
  transition: color 220ms var(--ease-ui), background-color 220ms var(--ease-ui);
}
.sched__list a::before { content: ""; position: absolute; inset: -8px 0; } /* 44px tall hit area */
.sched__list a:hover { color: var(--n-ink); transition-duration: 100ms; } /* light comes on fast, leaves slowly */
.sched__nav:not(.has-glide) .sched__list a:hover { background-color: var(--n-hover); } /* no script: a plain wash */
.sched__list a[aria-current] { color: var(--n-ink); background-color: transparent; }
.sched__list a:focus-visible { outline-offset: 0; border-radius: 14px; }

/* the pill: a convex glass bead (js/sections/nav.js moves it; js/core/navglass.js bends light through it) */
.sched__pill {
  position: absolute;
  left: 0;
  top: 50%;
  z-index: 0;
  width: 60px;
  height: 28px;
  margin-top: -14px;
  opacity: 0;
  pointer-events: none;
  transform-origin: 0 50%; /* the lean stretches it from its far side (js/sections/nav.js) */
  will-change: transform, opacity;
}
.sched__pill:not(.is-placed) { visibility: hidden; }
.sched__lens {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background:
    radial-gradient(70% 90% at 30% -10%, rgba(var(--n-spec), 0.16), transparent 70%),
    var(--n-bead);
  -webkit-backdrop-filter: blur(3px) saturate(1.5) brightness(1.08);
  backdrop-filter: blur(3px) saturate(1.5) brightness(1.08);
  box-shadow:
    inset 0 1px 0 var(--n-bead-hi),
    inset 0 -1px 0 var(--n-bead-lo),
    inset 0 0 0 1px rgba(var(--n-spec), 0.08),
    0 2px 8px -3px rgba(0, 0, 0, 0.45);
}
.nav.is-lens .sched__lens {
  -webkit-backdrop-filter: blur(1.5px) saturate(1.5) brightness(1.08) url(#nav-bead-lens);
  backdrop-filter: blur(1.5px) saturate(1.5) brightness(1.08) url(#nav-bead-lens);
}
html.nav-light .sched__lens {
  background:
    radial-gradient(70% 90% at 30% -10%, rgba(255, 255, 255, 0.6), transparent 70%),
    var(--n-bead);
  box-shadow:
    inset 0 1px 0 var(--n-bead-hi),
    inset 0 -1px 0 var(--n-bead-lo),
    inset 0 0 0 1px rgba(11, 11, 12, 0.08),
    0 2px 6px -3px rgba(11, 11, 12, 0.3);
}

/* ---------- the tools: Ask AI · Sound · Settings, one engraved well ---------- */
.nav__tools { flex: none; display: flex; align-items: center; gap: 10px; }

.console {
  position: relative;
  isolation: isolate; /* the key (z -1) floats on the well, under the words */
  display: flex;
  align-items: stretch;
  height: 36px;
  border-radius: 11px;
  background: var(--n-well);
  box-shadow: inset 0 1px 0 var(--n-well-top), inset 0 -1px 0 var(--n-well-lip);
}
.console > * { position: relative; display: flex; align-items: stretch; }
.console > * + *::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  z-index: 1;
  width: 1px;
  background: var(--n-line);
  transition: opacity 200ms var(--ease-ui);
}
/* the hairlines either side of the risen key dissolve into it */
.console > .is-lit::before,
.console > .is-lit + *::before { opacity: 0; }

.tool {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: -0.003em;
  white-space: nowrap;
  color: var(--n-ink-2);
  transition: color 220ms var(--ease-ui), background-color 220ms var(--ease-ui);
}
.tool:hover,
.tool[aria-expanded="true"] { color: var(--n-ink); }
.tool:hover { transition-duration: 100ms; }
.console:not(.has-glide) .tool:hover,
.console:not(.has-glide) .tool[aria-expanded="true"] { background-color: var(--n-hover); }
.prompt { border-radius: 11px 0 0 11px; padding-right: 8px; }
.prompt .ico { color: var(--signal); } /* AI is the signal */
.smp__btn { border-radius: 0 11px 11px 0; padding-right: 9px; }
.tool .chev {
  width: 14px;
  height: 14px;
  margin-left: -2px;
  color: var(--n-ink-3);
  transition: rotate 420ms var(--n-spring), translate 380ms var(--n-pop), color 200ms var(--ease-ui);
}
.smp__btn[aria-expanded="true"] .chev { rotate: 180deg; color: var(--n-ink-2); }

.prompt__kbd {
  margin-left: 3px;
  padding: 3px 6px 2px;
  border-radius: 5px;
  background: var(--n-hover);
  box-shadow: inset 0 0 0 1px var(--n-line);
  font: 500 10.5px/1.2 var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--n-ink-3);
}
html.is-touch .prompt__kbd,
html.is-touch .tip__kbd { display: none; }

/* sound: music.js renders its deck here — headphones · "Sound" · OFF/ON | ▾ (volume, score, interface sounds) */
.snd { min-width: 0; }
.snd__slot { display: flex; }
.nav .deck {
  height: 100%;
  border: 0;
  border-radius: 0;
  transition: background-color var(--d-ui) var(--ease-ui);
}
.console:not(.has-glide) .deck:hover,
.console:not(.has-glide) .deck.is-open { background-color: var(--n-hover); }
.nav .deck__toggle {
  gap: 7px;
  padding: 0 6px 0 12px;
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 450;
  letter-spacing: -0.003em;
  text-transform: none;
  color: var(--n-ink-2);
  transition: color var(--d-ui) var(--ease-ui);
}
.nav .deck:hover .deck__toggle,
.nav .deck.is-open .deck__toggle { color: var(--n-ink); }
.nav .deck__bars { display: none; }
.nav .deck__label { opacity: 1; }
.nav .deck.is-on .deck__icon { color: var(--signal); }
/* the state, said in a word (aria-pressed carries it for assistive tech) */
.nav .deck__toggle::after {
  content: "Off" / "";
  margin-left: 1px;
  padding: 3px 6px 2px;
  border-radius: 5px;
  background: var(--n-hover);
  box-shadow: inset 0 0 0 1px var(--n-line);
  font: 500 10.5px/1.2 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--n-ink-3);
}
.nav .deck.is-on .deck__toggle::after { content: "On" / ""; color: var(--n-ink); }
.nav .deck__more {
  display: grid;
  place-items: center;
  width: 24px;
  margin: 0 4px 0 0;
  border: 0;
  border-radius: 0;
  color: var(--n-ink-3);
}
.nav .deck__more:hover,
.nav .deck.is-open .deck__more { color: var(--n-ink); }
.nav .deck__more svg { transition: rotate 420ms var(--n-spring), translate 380ms var(--n-pop); }
.nav .deck.is-open .deck__more svg { transform: none; rotate: 180deg; }

/* Let's talk: the one solid thing on the glass */
.nav__cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 15px 0 13px;
  border-radius: 11px;
  background-color: var(--n-cta-bg);
  color: var(--n-cta-ink);
  font-size: 13.5px;
  font-weight: 520;
  letter-spacing: -0.005em;
  white-space: nowrap;
  --cta-rest: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.2), 0 6px 16px -8px rgba(0, 0, 0, 0.55);
  box-shadow: var(--cta-rest);
  isolation: isolate; /* its light (z -1) pools on the fill, under the words */
  transition:
    background-color 220ms var(--ease-ui),
    color 220ms var(--ease-ui),
    box-shadow 320ms var(--ease-ui),
    scale 420ms var(--n-pop);
}
.nav__cta-in { display: inline-flex; align-items: center; gap: 8px; }
.nav__cta .ico { width: 17px; height: 17px; }
/* the solid thing glows rather than washes: light pools under the pointer, the rim catches it
   (on the black paper button), and a soft halo lifts it off the glass */
.nav__cta::before,
.nav__cta::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 320ms var(--ease-ui);
}
.nav__cta::before {
  z-index: -1;
  background: radial-gradient(84px circle at var(--fx, var(--mx, 50%)) var(--fy, var(--my, 0%)), rgba(var(--n-cta-lit), var(--n-cta-lit-a)), rgba(var(--n-cta-lit), 0) 100%);
}
.nav__cta::after {
  padding: 1px;
  background: radial-gradient(52px circle at var(--fx, var(--mx, 50%)) var(--fy, var(--my, 0%)), rgba(255, 255, 255, var(--n-cta-glint-a)), rgba(255, 255, 255, 0) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.nav__cta:focus-visible { --fx: 50%; --fy: 0%; }
.nav__cta:focus-visible,
.nav__cta.is-press { box-shadow: var(--cta-rest), var(--n-cta-halo); }
.nav__cta:focus-visible::before,
.nav__cta:focus-visible::after,
.nav__cta.is-press::before,
.nav__cta.is-press::after { opacity: 1; }
@media (hover: hover) {
  .nav__cta:hover { box-shadow: var(--cta-rest), var(--n-cta-halo); }
  .nav__cta:hover::before,
  .nav__cta:hover::after { opacity: 1; transition-duration: 160ms; }
}
.nav__cta:active { scale: 0.97; transition: background-color 220ms var(--ease-ui), color 220ms var(--ease-ui), box-shadow 320ms var(--ease-ui), scale 110ms var(--ease-out); }

/* the envelope tips up, ready to go, and its flap eases open (seen edge-on, the fold flattens) */
.ico--mail { transition: translate 480ms var(--n-pop), rotate 480ms var(--n-pop); }
.ico--mail .ico__flap { transform-box: fill-box; transform-origin: 50% 0; transition: scale 520ms var(--n-pop); }
.nav__cta:focus-visible .ico--mail,
.nav__cta.is-press .ico--mail { translate: 0 -1.5px; rotate: -8deg; }
.nav__cta:focus-visible .ico__flap,
.nav__cta.is-press .ico__flap { scale: 1 0.45; }
@media (hover: hover) {
  .nav__cta:hover .ico--mail { translate: 0 -1.5px; rotate: -8deg; }
  .nav__cta:hover .ico__flap { scale: 1 0.45; }
}

/* ---------- light: the one hover language of the bar (js/core/navlight.js) ----------
   Glass doesn't wash grey when you point at it; it lights up from within, right under your
   finger, and its edge catches the light nearest to you. So:
     key    a bead of the sheet's own glass rises under what you point at and glides between
            controls on a spring (one per group: the chapter words, the Ask · Sound · Settings
            well). First arrival fades in where it is; leaving, it sinks away after a breath —
            or settles back on the control whose panel is open.
     light  inside the key, a soft pool follows the pointer (--mx/--my) and the 1px rim glints
            where the pointer is nearest. Keyboard focus gets the same key, lit from its top lip,
            with the whole rim catching.
     press  the key sinks to 96% and its light condenses.
   Single controls (Let's talk, the Settings rows, the menu) carry the same pool and rim on
   themselves. Icons each make one small gesture tied to what they do. */
@property --pool { syntax: '<length>'; inherits: true; initial-value: 68px; }

.glide {
  --pool: 68px;
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  width: 0;
  height: 28px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  scale: 0.94;
  background:
    radial-gradient(var(--pool) circle at var(--mx, 50%) var(--my, 0%), rgba(var(--n-lit), var(--n-lit-a)), rgba(var(--n-lit), 0) 100%),
    linear-gradient(to bottom, var(--n-key-top), rgba(255, 255, 255, 0) 60%),
    var(--n-key);
  box-shadow: inset 0 1px 0 var(--n-key-hi), inset 0 0 0 1px var(--n-key-rim), var(--n-key-drop);
  transition: opacity 160ms var(--ease-ui), scale 260ms var(--ease-out), --pool 240ms var(--ease-out);
  will-change: transform;
}
.glide.is-on {
  opacity: 1;
  scale: 1;
  transition: opacity 120ms var(--ease-ui), scale 480ms var(--n-pop), --pool 240ms var(--ease-out);
}
/* the rim: a 1px ring (mask-composite) carrying a glint centred on the pointer */
.glide::after {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(calc(var(--pool) * 0.8) circle at var(--mx, 50%) var(--my, 0%), rgba(var(--n-glint), var(--n-glint-a)), rgba(var(--n-glint), 0) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.glide.is-focus::after { background: rgba(var(--n-glint), calc(var(--n-glint-a) * 0.5)); }
.glide.is-on.is-press {
  --pool: 40px;
  scale: 0.96;
  transition: opacity 120ms var(--ease-ui), scale 110ms var(--ease-out), --pool 110ms var(--ease-out);
}

/* the well's key: concentric with the well (11px corners, 3px in) */
.glide-track { position: absolute; inset: 0; display: block; pointer-events: none; contain: size layout style; }
.console > .glide-track { position: absolute; display: block; z-index: -1; }
.console > .glide-track::before { content: none; }
.glide--key { border-radius: 8px; }
/* the chapter key is only light, never a second pill: no frost, no lens, no drawn edge — a pool
   under the pointer and the glint where its rim catches it, so the reading pill stays the one
   solid bead in the row */
.sched__nav > .glide-track { z-index: 0; }
.glide--word {
  --pool: 54px;
  border-radius: 14px;
  background:
    radial-gradient(var(--pool) circle at var(--mx, 50%) var(--my, 0%), rgba(var(--n-lit), var(--n-lit-a)), rgba(var(--n-lit), 0) 100%),
    var(--n-ghost);
  box-shadow: none;
}
.glide--word.is-on.is-press { --pool: 34px; }

/* keyboard: the ring sits exactly on the key's edge */
.console.has-glide .tool:focus-visible,
.console.has-glide .deck__toggle:focus-visible { outline-offset: -3px; border-radius: 8px; }
.console.has-glide .deck__more:focus-visible { outline-offset: -5px; border-radius: 7px; }

/* words and marks brighten with the light: on fast, off slow */
.prompt__kbd,
.nav .deck__toggle::after { transition: color 220ms var(--ease-ui), box-shadow 220ms var(--ease-ui); }
.console > .is-lit .prompt__kbd { color: var(--n-ink-2); box-shadow: inset 0 0 0 1px var(--n-ink-4); transition-duration: 100ms; }
.snd.is-lit .deck__toggle,
.smp.is-lit .smp__btn { color: var(--n-ink); }
.nav .snd.is-lit .deck__toggle::after { color: var(--n-ink-2); box-shadow: inset 0 0 0 1px var(--n-ink-4); transition-duration: 100ms; }
.nav .deck.is-on .deck__toggle::after { color: var(--n-ink); } /* "On" stays at full ink when lit */

/* icons glow from within while lit (the AI's spark in its own colour) */
.console .ico:not(.chev) { transition: filter 260ms var(--ease-ui); }
.console > .is-lit .ico:not(.chev) { filter: var(--n-icon-glow); }
.prompt.is-lit .ico--spark { filter: drop-shadow(0 0 5px color-mix(in srgb, var(--signal) 65%, transparent)); }

/* Ask AI: the twinkle is a one-shot gesture (navlight.js); here, where it turns about */
.ico--spark .ico__star,
.ico--spark .ico__glint { transform-box: fill-box; transform-origin: 50% 50%; }
/* Sound: two ripples off the ear cups and a bob, one-shot; hidden at rest */
.ico__waves path { opacity: 0; transform-box: fill-box; transform-origin: 50% 50%; }
.ico--sound .ico__on,
.ico--sound .ico__off { transform-box: fill-box; transform-origin: 50% 70%; }
/* Settings: the knobs slide along their tracks — while pointed at, and while the panel is open */
.ico--sliders .ico__knob,
.ico--sliders .ico__track { transform-box: fill-box; transition: translate 540ms var(--n-pop), scale 540ms var(--n-pop); }
.ico--sliders .ico__track { transform-origin: 100% 50%; }
.ico--sliders .ico__track--b { transform-origin: 0 50%; }
.smp__btn[aria-expanded="true"] .ico__knob,
.smp__btn:focus-visible .ico__knob { translate: 4px 0; }
.smp__btn[aria-expanded="true"] .ico__knob--b,
.smp__btn:focus-visible .ico__knob--b { translate: -4px 0; }
.smp__btn[aria-expanded="true"] .ico__track,
.smp__btn:focus-visible .ico__track { scale: 0.556 1; }
@media (hover: hover) {
  .smp__btn:hover .ico__knob { translate: 4px 0; }
  .smp__btn:hover .ico__knob--b { translate: -4px 0; }
  .smp__btn:hover .ico__track { scale: 0.556 1; }
  /* chevrons lean the way they will open (down), or close (up) */
  .smp__btn:hover .chev,
  .nav .deck__more:hover svg { translate: 0 1.5px; }
  .smp__btn[aria-expanded="true"]:hover .chev,
  .nav .deck.is-open .deck__more:hover svg { translate: 0 -1.5px; }
}

/* ---------- drips: panels that hang from the sheet through concave shoulders ---------- */
.drip,
.nav .deck__pop,
.tip {
  --f: 12px;  /* shoulder fillet */
  --r: 14px;  /* bottom corners */
  -webkit-mask:
    linear-gradient(#000 0 0) var(--f) 0 / calc(100% - 2 * var(--f)) calc(100% - var(--r)) no-repeat,
    linear-gradient(#000 0 0) calc(var(--f) + var(--r)) 100% / calc(100% - 2 * var(--f) - 2 * var(--r)) var(--r) no-repeat,
    radial-gradient(circle at 100% 0, #000 calc(var(--r) - 0.5px), #0000 var(--r)) var(--f) 100% / var(--r) var(--r) no-repeat,
    radial-gradient(circle at 0 0, #000 calc(var(--r) - 0.5px), #0000 var(--r)) calc(100% - var(--f)) 100% / var(--r) var(--r) no-repeat,
    radial-gradient(circle at 0 100%, #0000 var(--f), #000 calc(var(--f) + 0.5px)) 0 0 / var(--f) var(--f) no-repeat,
    radial-gradient(circle at 100% 100%, #0000 var(--f), #000 calc(var(--f) + 0.5px)) 100% 0 / var(--f) var(--f) no-repeat;
  mask:
    linear-gradient(#000 0 0) var(--f) 0 / calc(100% - 2 * var(--f)) calc(100% - var(--r)) no-repeat,
    linear-gradient(#000 0 0) calc(var(--f) + var(--r)) 100% / calc(100% - 2 * var(--f) - 2 * var(--r)) var(--r) no-repeat,
    radial-gradient(circle at 100% 0, #000 calc(var(--r) - 0.5px), #0000 var(--r)) var(--f) 100% / var(--r) var(--r) no-repeat,
    radial-gradient(circle at 0 0, #000 calc(var(--r) - 0.5px), #0000 var(--r)) calc(100% - var(--f)) 100% / var(--r) var(--r) no-repeat,
    radial-gradient(circle at 0 100%, #0000 var(--f), #000 calc(var(--f) + 0.5px)) 0 0 / var(--f) var(--f) no-repeat,
    radial-gradient(circle at 100% 100%, #0000 var(--f), #000 calc(var(--f) + 0.5px)) 100% 0 / var(--f) var(--f) no-repeat;
  /* rims everywhere glass meets air — never on the top, where the drip is still the sheet */
  background:
    radial-gradient(circle at 0 100%, #0000 calc(var(--f) - 0.2px), var(--n-rim) calc(var(--f) + 0.3px), var(--n-rim) calc(var(--f) + 0.8px), #0000 calc(var(--f) + 1.3px)) 0 0 / var(--f) var(--f) no-repeat,
    radial-gradient(circle at 100% 100%, #0000 calc(var(--f) - 0.2px), var(--n-rim) calc(var(--f) + 0.3px), var(--n-rim) calc(var(--f) + 0.8px), #0000 calc(var(--f) + 1.3px)) 100% 0 / var(--f) var(--f) no-repeat,
    linear-gradient(var(--n-rim) 0 0) var(--f) var(--f) / 1px calc(100% - var(--f) - var(--r)) no-repeat,
    linear-gradient(var(--n-rim) 0 0) calc(100% - var(--f)) var(--f) / 1px calc(100% - var(--f) - var(--r)) no-repeat,
    linear-gradient(var(--n-rim) 0 0) calc(var(--f) + var(--r)) 100% / calc(100% - 2 * var(--f) - 2 * var(--r)) 1px no-repeat,
    radial-gradient(circle at 100% 0, #0000 calc(var(--r) - 1.3px), var(--n-rim) calc(var(--r) - 0.8px), var(--n-rim) calc(var(--r) - 0.3px), #0000 calc(var(--r) + 0.2px)) var(--f) 100% / var(--r) var(--r) no-repeat,
    radial-gradient(circle at 0 0, #0000 calc(var(--r) - 1.3px), var(--n-rim) calc(var(--r) - 0.8px), var(--n-rim) calc(var(--r) - 0.3px), #0000 calc(var(--r) + 0.2px)) calc(100% - var(--f)) 100% / var(--r) var(--r) no-repeat,
    var(--n-tint-deep);
  -webkit-backdrop-filter: blur(18px) saturate(1.6) brightness(0.8);
  backdrop-filter: blur(18px) saturate(1.6) brightness(0.8);
  color: var(--n-ink);
}
html.nav-light .drip,
html.nav-light .nav .deck__pop,
html.nav-light .tip {
  -webkit-backdrop-filter: blur(18px) saturate(1.3) brightness(1.12);
  backdrop-filter: blur(18px) saturate(1.3) brightness(1.12);
}

/* Settings hangs from the sheet's bottom edge, right-aligned with its button */
.smp__panel {
  position: absolute;
  top: calc((var(--sh) + 100%) / 2);
  right: calc(-1 * var(--f));
  z-index: 2;
  width: calc(348px + 2 * var(--f));
  padding: 6px calc(16px + var(--f)) 8px;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 300ms var(--ease-in-out);
}
.smp__panel[hidden] { display: none; }
.smp__panel.is-open { clip-path: inset(0 -2px -2px -2px); transition: clip-path 460ms var(--ease-out); }

/* what a drip holds condenses as it pours: each row falls into place out of a little blur
   (σ falling to a crisp sample), staggered from the top; closing, it all clears at once */
.smp__panel > *,
.nav .deck__pop > * {
  opacity: 0;
  translate: 0 -7px;
  filter: blur(4px);
  transition: opacity 110ms var(--ease-ui), filter 110ms var(--ease-ui), translate 0s linear 120ms;
}
.smp__panel.is-open > *,
.nav .deck.is-open .deck__pop > * {
  opacity: 1;
  translate: 0 0;
  filter: none;
  transition:
    opacity 260ms var(--ease-ui) var(--d, 60ms),
    filter 340ms var(--ease-out) var(--d, 60ms),
    translate 520ms var(--n-spring) var(--d, 60ms);
}
.smp__panel > :nth-child(2), .nav .deck__pop > :nth-child(2) { --d: 95ms; }
.smp__panel > :nth-child(3), .nav .deck__pop > :nth-child(3) { --d: 130ms; }
.smp__panel > :nth-child(4), .nav .deck__pop > :nth-child(4) { --d: 165ms; }
.nav .deck__pop > :nth-child(5) { --d: 190ms; }
.nav .deck__pop > :nth-child(6) { --d: 215ms; }
.nav .deck__pop > :nth-child(n + 7) { --d: 240ms; }

/* tips: a tiny drip under a tool on hover or keyboard focus — a second voice, never the only label */
.tip {
  --f: 8px;
  --r: 9px;
  position: absolute;
  top: calc((var(--sh) + 100%) / 2);
  left: 50%;
  z-index: 3;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px calc(11px + var(--f)) 8px;
  font-size: 12px;
  font-weight: 450;
  letter-spacing: 0;
  white-space: nowrap;
  color: var(--n-ink);
  pointer-events: none;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 200ms var(--ease-in-out);
}
.tip__kbd { font: 500 10.5px/1 var(--font-mono); letter-spacing: 0.02em; color: var(--n-ink-3); }
/* hover tips only where a word has folded away; the first waits, the next ones along answer at once */
@media (hover: hover) and (max-width: 1319px) {
  .tool:hover .tip { clip-path: inset(0 -2px -2px -2px); transition: clip-path 360ms var(--ease-out) 600ms; }
  .console.is-tipping .tool:hover .tip { transition-delay: 60ms; }
}
.tool:focus-visible .tip { clip-path: inset(0 -2px -2px -2px); transition: clip-path 380ms var(--ease-out) 150ms; }
.tool[aria-expanded="true"] .tip { clip-path: inset(0 0 100% 0); transition: none; }

/* music.js's deck panel, re-poured as a drip (its markup and behaviour are untouched) */
.nav .deck__pop {
  top: calc((var(--sh) + 100%) / 2);
  right: calc(-1 * var(--f) - 3px);
  width: calc(300px + 2 * var(--f));
  padding: 12px calc(16px + var(--f)) 12px;
  border: 0;
  border-radius: 0;
  opacity: 1;
  translate: var(--shift, 0px) 0;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 280ms var(--ease-in-out), visibility 0s linear 280ms;
}
.nav .deck.is-open .deck__pop {
  translate: var(--shift, 0px) 0;
  clip-path: inset(0 -2px -2px -2px);
  transition: clip-path 460ms var(--ease-out), visibility 0s;
}
.nav .deck__pop::before { display: none; }
/* the deck speaks the glass's ink, so it re-themes on paper with the sheet */
.nav .deck__meta, .nav .deck__cue, .nav .deck__note, .nav .deck__vol-val, .nav .deck__num { color: var(--n-ink-3); }
.nav .deck__meta [data-deck-chapter] { color: var(--n-ink-2); }
.nav .deck__scope { border-color: var(--n-line); }
html.nav-light .nav .deck__scope canvas { filter: invert(1); }
.nav .deck__steps i { background: var(--n-ink-4); }
.nav .deck__steps i:nth-child(4n + 1) { background: var(--n-ink-3); }
.nav .deck__steps i.is-now { background: var(--signal); }
.nav .deck__ctrl { border-color: var(--n-line); }
.nav .deck__play { border-color: var(--n-line); }
.nav .deck__play:hover { background: var(--n-ink); color: var(--n-tint-deep); border-color: var(--n-ink); }
.nav .deck__vol::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--n-ink) var(--v), var(--n-ink-4) var(--v)); }
.nav .deck__vol::-moz-range-track { background: var(--n-ink-4); }
.nav .deck__vol::-moz-range-progress { background: var(--n-ink); }
.nav .deck__vol::-webkit-slider-thumb { background: var(--n-ink); }
.nav .deck__vol::-moz-range-thumb { background: var(--n-ink); }
.nav .deck__sfx { color: var(--n-ink-2); text-decoration-color: var(--n-line); }
.nav .deck__sfx b { color: var(--n-ink); }

/* ---------- settings rows: icon · what it is · its control (shared by the drip and the menu) ---------- */
.opt {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 13px;
  width: calc(100% + 20px);
  min-height: 62px;
  margin-inline: -10px;
  padding: 10px;
  border-radius: 10px;
  text-align: left;
  color: var(--n-ink);
}
.opt + .opt::before { /* hairline between rows */
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  top: 0;
  height: 1px;
  background: var(--n-line);
  transition: opacity var(--d-ui) var(--ease-ui);
}
/* a row answers like the bar's controls: a key of glass under it, light pooled at the pointer */
.opt--btn { isolation: isolate; transition: scale 420ms var(--n-pop); }
.opt--btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(150px circle at var(--fx, var(--mx, 50%)) var(--fy, var(--my, 0%)), rgba(var(--n-lit), calc(var(--n-lit-a) * 0.8)), rgba(var(--n-lit), 0) 100%),
    var(--n-key);
  box-shadow: inset 0 1px 0 var(--n-key-hi), inset 0 0 0 1px var(--n-key-rim);
  opacity: 0;
  transition: opacity 260ms var(--ease-ui);
}
.opt--btn:focus-visible { --fx: 50%; --fy: 0%; }
.opt--btn:focus-visible::after,
.opt--btn.is-press::after { opacity: 1; transition-duration: 120ms; }
.opt--btn:focus-visible::before,
.opt--btn:focus-visible + .opt::before,
.opt--btn.is-press::before,
.opt--btn.is-press + .opt::before { opacity: 0; }
@media (hover: hover) {
  .opt--btn:hover::after { opacity: 1; transition-duration: 140ms; }
  .opt--btn:hover::before,
  .opt--btn:hover + .opt::before { opacity: 0; }
}
.opt--btn:active { scale: 0.985; transition: scale 110ms var(--ease-out); }
.opt--btn:focus-visible { outline-offset: -2px; border-radius: 10px; }
.opt__ico { width: 20px; height: 20px; color: var(--n-ink-2); transition: color 220ms var(--ease-ui), translate 460ms var(--n-pop); }
/* each row's icon makes one small gesture of its own */
.opt__ico > * { transform-box: fill-box; transform-origin: 50% 50%; transition: rotate 560ms var(--n-pop), translate 460ms var(--n-pop), opacity 220ms var(--ease-ui); }
.opt--btn:focus-visible .opt__ico,
.opt--btn.is-press .opt__ico { color: var(--n-ink); }
[data-tour]:focus-visible .opt__ico > path,
[data-tour].is-press .opt__ico > path { rotate: 45deg; }               /* the compass needle swings */
[data-motion]:focus-visible .opt__ico > circle { translate: 2px 0; }    /* the ball runs ahead of its trails */
[data-rocket]:focus-visible .opt__ico { translate: 1px -1px; }          /* the rocket strains at its key */
@media (hover: hover) {
  .opt--btn:hover .opt__ico { color: var(--n-ink); }
  [data-tour]:hover .opt__ico > path { rotate: 45deg; }
  [data-motion]:hover .opt__ico > circle { translate: 2px 0; }
  [data-motion]:hover .opt__ico > path { opacity: 0.55; }
  [data-rocket]:hover .opt__ico { translate: 1px -1px; }
}
.opt__txt { display: grid; gap: 3px; min-width: 0; }
.opt__title { font-size: 14px; font-weight: 500; letter-spacing: -0.006em; line-height: 1.2; }
.opt__hint { font-size: 12px; line-height: 1.3; color: var(--n-ink-3); }

/* colour: the beads sit under the words */
.opt--colour { grid-template-columns: 20px minmax(0, 1fr); row-gap: 9px; padding-bottom: 12px; }
.opt--colour .opt__ctl { grid-column: 2; }

/* guided tour: Start ▸ / Stop ■ */
.opt__go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px 0 10px;
  border-radius: 14px;
  background: var(--n-hover);
  box-shadow: inset 0 0 0 1px var(--n-line);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--n-ink);
  transition: background-color var(--d-ui) var(--ease-ui), color var(--d-ui) var(--ease-ui);
}
.opt__go svg { width: 12px; height: 12px; fill: currentColor; }
.opt__go-stop,
.opt__go-end { display: none; }
[aria-pressed="true"] > .opt__go .opt__go-play,
[aria-pressed="true"] > .opt__go .opt__go-start { display: none; }
[aria-pressed="true"] > .opt__go .opt__go-stop { display: block; color: var(--signal); }
[aria-pressed="true"] > .opt__go .opt__go-end { display: inline; }
.opt--btn:hover > .opt__go { background: var(--n-ink); color: var(--n-cta-ink); box-shadow: none; }
html.nav-light .opt--btn:hover > .opt__go,
.menu .opt--btn:hover > .opt__go { color: var(--n-cta-ink); }

/* animations: a switch that says its state */
.switch { display: inline-flex; align-items: center; gap: 9px; }
.switch__val {
  min-width: 2.4em;
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-align: right;
  text-transform: uppercase;
  color: var(--n-ink-3);
}
.switch__track {
  position: relative;
  display: block;
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: var(--n-well);
  box-shadow: inset 0 0 0 1px var(--n-line), inset 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: background-color var(--d-ui) var(--ease-ui);
}
.switch__track::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--n-ink-2);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: translate var(--d-ui) var(--ease-out), background-color var(--d-ui) var(--ease-ui);
}
[aria-pressed="true"] > .switch .switch__val { color: var(--n-ink); }
[aria-pressed="true"] > .switch .switch__track { background: var(--signal); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.18); }
[aria-pressed="true"] > .switch .switch__track::after { translate: 14px 0; background: #fff; }
.opt[aria-disabled="true"] { cursor: default; }
.opt[aria-disabled="true"]:hover { background-color: transparent; }
.opt[aria-disabled="true"]::after { display: none; }
.opt[aria-disabled="true"] .switch { opacity: 0.55; }

/* rocket: the key under its hinged cover (css/tools.css draws them) */
.opt--arm .arm { width: 64px; height: 30px; margin-right: 3px; }

/* ---------- mobile: mark · chapter · sound · menu ---------- */
.nav__chap,
.nav__snd,
.nav__menu { display: none; }

.nav__chap {
  align-items: center;
  min-width: 0;
  min-height: 44px;
  padding: 2px 8px 0;
  margin-left: 4px;
  white-space: nowrap;
}
.nav__chap-name {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 21px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.nav__snd { width: 44px; height: 44px; margin-left: auto; place-items: center; color: var(--n-ink-2); border-radius: 11px; }
.nav__snd .ico { width: 20px; height: 20px; }
.nav__snd[aria-pressed="true"] { color: var(--signal); }
.nav__menu {
  position: relative;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 11px 0 14px;
  margin-right: -6px;
  border-radius: 11px;
  background: var(--n-well);
  box-shadow: inset 0 1px 0 var(--n-well-top), inset 0 -1px 0 var(--n-well-lip);
  font-size: 14px;
  font-weight: 500;
}
.nav__menu::after { content: ""; position: absolute; inset: -3px 0; } /* 44px tall hit area */

@media (max-width: 899px) {
  .nav { --sh: 56px; --fil: 16px; }
  .nav.is-compact { --sh: 56px; --fil: 16px; }
  .nav__bar { gap: 4px; }
  .sched, .nav__tools, .nav__name { display: none; }
  .nav__chap { display: inline-flex; }
  .nav__snd { display: grid; }
  .nav__menu { display: inline-flex; }
}

/* the same language as tap feedback: light blooms where the finger lands and lingers a moment
   (js/core/navlight.js adds .is-press), the control gives a little under it */
.nav__chap,
.nav__snd,
.prompt--menu,
.menu .deck__more,
.menu__links a { position: relative; }
.nav__chap,
.nav__snd,
.nav__menu,
.menu__close,
.prompt--menu,
.menu .deck__more,
.menu__links a { isolation: isolate; }
.nav__chap,
.nav__snd,
.nav__menu,
.menu__close,
.prompt--menu { transition: scale 420ms var(--n-pop), color 220ms var(--ease-ui); }
:is(.nav__chap, .nav__snd, .nav__menu, .menu__close, .prompt--menu, .menu .deck__more, .menu__links a)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(var(--pool, 68px) circle at var(--fx, var(--mx, 50%)) var(--fy, var(--my, 0%)), rgba(var(--n-lit), calc(var(--n-lit-a) * var(--lit-k, 1))), rgba(var(--n-lit), 0) 100%);
  box-shadow: inset 0 0 0 1px var(--n-key-rim);
  opacity: 0;
  transition: opacity 420ms var(--ease-ui);
}
.nav__chap { border-radius: 10px; }
/* a chapter row: a long, low streak of light along the glass, fading before it reaches the rules */
.menu__links a::before {
  inset: 4px -8px;
  border-radius: 12px;
  background: radial-gradient(170px 26px at calc(var(--fx, var(--mx, 50%)) + 8px) calc(var(--fy, var(--my, 50%)) - 4px), rgba(var(--n-lit), calc(var(--n-lit-a) * var(--lit-k, 1))), rgba(var(--n-lit), 0) 100%);
  box-shadow: none;
}
/* a finger needs a brighter answer than a pointer: the press lights up harder */
:is(.nav__chap, .nav__snd, .nav__menu, .menu__close, .prompt--menu, .menu .deck__more, .menu__links a).is-press { --lit-k: 1.7; }
:is(.nav__chap, .nav__snd, .nav__menu, .menu__close, .prompt--menu, .menu .deck__more, .menu__links a).is-press::before { opacity: 1; transition-duration: 90ms; }
:is(.nav__chap, .nav__snd, .nav__menu, .menu__close, .prompt--menu):focus-visible { --fx: 50%; --fy: 0%; }
:is(.nav__chap, .nav__snd, .nav__menu, .menu__close, .prompt--menu, .menu .deck__more, .menu__links a):focus-visible::before { opacity: 1; }
:is(.nav__chap, .nav__snd, .nav__menu, .menu__close, .prompt--menu):active { scale: 0.97; transition: scale 110ms var(--ease-out), color 220ms var(--ease-ui); }
@media (hover: hover) {
  :is(.nav__chap, .nav__snd, .nav__menu, .menu__close, .prompt--menu, .menu .deck__more)::before { transition-duration: 300ms; }
  :is(.nav__chap, .nav__snd, .nav__menu, .menu__close, .prompt--menu, .menu .deck__more, .menu__links a):hover::before { opacity: 1; transition-duration: 140ms; }
}
.prompt--menu .ico--spark { transition: filter 260ms var(--ease-ui); }
.prompt--menu.is-press .ico--spark { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--signal) 65%, transparent)); }
/* a chapter in the menu: the word steps toward you as you choose it */
.menu__name { display: inline-block; transition: translate 460ms var(--n-pop); }
.menu__links a.is-press .menu__name { translate: 4px 0; transition-duration: 160ms; }
@media (hover: hover) { .menu__links a:hover .menu__name { translate: 4px 0; } }

/* ---------- narrower desktops: the words fold away in order of least use; tips still say it all ---------- */
@media (min-width: 900px) and (max-width: 1319px) {
  .prompt__kbd { display: none; }                         /* Ctrl K moves into the tip */
  .nav .deck__toggle::after { display: none; }           /* OFF/ON: the struck-through headphones carry it */
  .sched__list a { padding: 0 11px; }
}
@media (min-width: 900px) and (max-width: 1199px) {
  .nav__name { display: none; }
}
@media (min-width: 900px) and (max-width: 1099px) {
  /* every name stays in the accessibility tree (clipped, not removed) and in the tips */
  .nav .deck__label {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .nav__bar { gap: 10px; }
  .sched { margin-inline: 4px; }
  .sched__list a { padding: 0 9px; font-size: 13px; }
  .tool { padding: 0 11px; }
  .smp__btn { padding-right: 8px; }
}
@media (min-width: 900px) and (max-width: 999px) {
  .tool__label {                                         /* icons only; the tips name them */
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

/* ---------- the menu: the sheet poured to the floor ---------- */
.menu {
  --sh: 56px;
  --fil: 16px;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--n-ink);
  overflow: hidden;
  overscroll-behavior: contain;
}
.menu[open] { display: block; }
.menu::backdrop { background: transparent; }
.menu__glass { background-color: var(--n-tint-deep); }
.menu__inner {
  position: relative;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--gutter) max(1.75rem, env(safe-area-inset-bottom));
  clip-path: inset(0 0 calc(100% - var(--sh)) 0); /* the content is revealed by the falling edge */
}
.menu.is-poured .menu__inner { clip-path: none; }
.menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.menu__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 450;
  letter-spacing: -0.01em;
}
/* Close sits exactly where Menu was */
.menu__close {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 11px 0 14px;
  margin-right: -6px;
  border-radius: 11px;
  background: var(--n-well);
  box-shadow: inset 0 1px 0 var(--n-well-top), inset 0 -1px 0 var(--n-well-lip);
  font-size: 14px;
  font-weight: 500;
  color: var(--n-ink);
}
.menu__close::after { content: ""; position: absolute; inset: -3px 0; }

.prompt--menu {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 52px;
  margin: 10px 0 22px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--n-well);
  box-shadow: inset 0 1px 0 var(--n-well-top), inset 0 -1px 0 var(--n-well-lip);
  font-size: 16px;
  color: var(--n-ink-2);
  text-align: left;
}
.prompt--menu .ico { width: 20px; height: 20px; color: var(--signal); }

.menu__links { border-top: 1px solid var(--n-line); }
.menu__links a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-height: 54px;
  padding: 10px 0 8px;
  border-bottom: 1px solid var(--n-line);
}
.menu__name {
  font-size: clamp(1.6rem, 7vw, 2.1rem);
  font-weight: 360;
  font-stretch: 104%;
  letter-spacing: -0.035em;
  line-height: 1.05;
}
.menu__links a[aria-current] .menu__name {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  letter-spacing: -0.01em;
}
.menu__links a[aria-current]::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--signal);
  align-self: center;
}

.menu__smp { margin-top: 30px; }
.menu__h { margin: 0 0 4px; font-size: 10.5px; color: var(--n-ink-3); }
.menu .opt { min-height: 66px; }
.menu .opt__title { font-size: 16px; }
.menu .opt__hint { font-size: 13px; }
.menu .opt__go { height: 34px; padding-inline: 12px 14px; font-size: 13.5px; border-radius: 17px; }

/* the menu's sound row: music.js's deck as a switch (OFF/ON) and a ▾ for volume and the score */
.menu__snd { display: flex; min-width: 0; }
.menu .deck {
  height: 40px;
  border: 0;
  border-radius: 11px;
  color: var(--n-ink);
  background: var(--n-well);
  box-shadow: inset 0 1px 0 var(--n-well-top), inset 0 -1px 0 var(--n-well-lip);
}
.menu .deck__icon,
.menu .deck__bars { display: none; }
.menu .deck__label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.menu .deck__toggle {
  gap: 9px;
  padding: 0 8px 0 12px;
  font: 500 10.5px/1 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--n-ink-3);
}
.menu .deck__toggle::before { content: "Off" / ""; min-width: 2.4em; text-align: right; }
.menu .deck.is-on .deck__toggle::before { content: "On" / ""; color: var(--n-ink); }
.menu .deck__toggle::after { /* the switch: a track with its knob drawn in */
  content: "";
  width: 32px;
  height: 18px;
  border-radius: 9px;
  background: radial-gradient(circle 6px at 9px 50%, var(--n-ink-2) 94%, #0000) no-repeat, var(--n-well);
  box-shadow: inset 0 0 0 1px var(--n-line), inset 0 1px 2px rgba(0, 0, 0, 0.25);
}
.menu .deck.is-on .deck__toggle::after {
  background: radial-gradient(circle 6px at calc(100% - 9px) 50%, #fff 94%, #0000) no-repeat, var(--signal);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.18);
}
.menu .deck__more { width: 40px; border-left: 1px solid var(--n-line); border-radius: 0 11px 11px 0; color: var(--n-ink-2); }
.menu .deck__pop { width: min(320px, calc(100vw - 2 * var(--gutter))); }

.menu__foot { display: grid; gap: 16px; margin-top: 30px; }
.nav__cta--menu { height: 52px; border-radius: 12px; font-size: 16px; }
.nav__cta--menu .ico { width: 19px; height: 19px; }
.menu__elsewhere { display: flex; flex-wrap: wrap; gap: 0 20px; text-transform: none; letter-spacing: 0.04em; color: var(--n-ink-2); }
.menu__elsewhere a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- reduced motion · reduced transparency · forced colours ---------- */
html.is-reduced .nav,
html.is-reduced .nav__glass,
html.is-reduced .smp__panel,
html.is-reduced .nav .deck__pop,
html.is-reduced .tip,
html.is-reduced .switch__track::after { transition: none; }
/* the light still comes on — instantly, held still at the top lip — and nothing moves */
html.is-reduced .glide,
html.is-reduced .glide.is-on,
html.is-reduced .glide.is-on.is-press { scale: 1; transition: none; }
html.is-reduced .smp__panel > *,
html.is-reduced .nav .deck__pop > * { translate: none; filter: none; transition: none; }
html.is-reduced :is(.nav__cta, .opt--btn, .nav__chap, .nav__snd, .nav__menu, .menu__close, .prompt--menu):active { scale: none; }
html.is-reduced .ico--mail { rotate: none !important; }
html.is-reduced :is(.ico--mail, .ico--mail *, .ico--sliders *, .opt__ico, .opt__ico > *, .menu__name, .tool .chev, .nav .deck__more svg) {
  translate: none !important;
  scale: none !important;
  transition: none !important;
}
html.is-reduced [data-tour] .opt__ico > path { rotate: none !important; }

html.no-transparency .nav__glass,
html.no-transparency .menu__glass,
html.no-transparency .drip,
html.no-transparency .nav .deck__pop,
html.no-transparency .tip,
html.no-transparency .sched__lens {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background-color: #0d0d0f;
}
html.no-transparency .sched__lens { background: #26262b; }
html.no-transparency.nav-light .nav__glass,
html.no-transparency.nav-light .menu__glass,
html.no-transparency.nav-light .drip,
html.no-transparency.nav-light .nav .deck__pop,
html.no-transparency.nav-light .tip { background-color: #ece8e1; }
html.no-transparency.nav-light .sched__lens { background: #f8f6f2; }
html.no-transparency .nav__glass::after { display: none; }
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .nav__glass, .menu__glass, .drip, .nav .deck__pop, .tip, .sched__lens {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    background-color: #0d0d0f;
  }
  .sched__lens { background: #26262b; }
  html.nav-light .nav__glass, html.nav-light .menu__glass, html.nav-light .drip,
  html.nav-light .nav .deck__pop, html.nav-light .tip { background-color: #ece8e1; }
  html.nav-light .sched__lens { background: #f8f6f2; }
  .nav__glass::after { display: none; }
}
@media (forced-colors: active) {
  .glide, .nav__cta::before, .nav__cta::after, .opt--btn::after { display: none; }
  .nav__glass, .menu__glass, .drip, .nav .deck__pop, .tip { background: Canvas; }
  .nav__rim { background: CanvasText; }
  .sched__lens { background: Canvas; border: 1px solid CanvasText; }
  .ico { stroke: CanvasText; }
  .nav__cta { border: 1px solid CanvasText; }
}
