/* ==========================================================================
   RJ Iammarino — personal site
   1. Tokens      2. Base        3. Background   4. HUD
   5. Layout+rail 6. Hero        7. Sections     8. Command menu
   9. Terminal    10. Motion     11. Responsive
   ========================================================================== */

/* 1. TOKENS --------------------------------------------------------------- */
:root {
  --bg: #07060d;
  --ink: #ecebf7;
  --muted: #9a97b5;
  --faint: #615e80;
  --line: #24223b;
  --panel: rgba(14, 13, 27, 0.72);
  --panel-solid: #0e0d1b;

  --cyan: #5ef2ff;
  --violet: #9b7bff;
  --magenta: #ff5fd2;
  --amber: #ffb86b;
  --acid: #c8ff5a;
  --accent: var(--cyan);
  --iu: #c9283e;           /* IU crimson, lifted so it reads on the dark background */

  --holo: linear-gradient(90deg, var(--cyan), var(--violet), var(--magenta), var(--amber), var(--acid), var(--cyan));
  --holo-dur: 9s;          /* set from the Signal dial */

  /* Background glow. --fx-gain, --fx-rx/ry come from the Signal dial,
     --fx-fade from scroll position. */
  --fx-opacity: 0.62;
  --fx-gain: 1;
  --fx-fade: 1;
  --fx-rx: 75%;
  --fx-ry: 85%;
  --grid-opacity: 0.5;

  --display: "Syne", "Instrument Sans", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --hud-h: 40px;
  --gutter: 24px;
}

:root[data-theme="light"] {
  --bg: #f4f2fb;
  --ink: #131022;
  --muted: #565170;
  --faint: #8f8aa8;
  --line: #d6d1e8;
  --panel: rgba(255, 255, 255, 0.78);
  --panel-solid: #ffffff;

  --cyan: #007d99;
  --violet: #5b34e6;
  --magenta: #c2189a;
  --amber: #b05c00;
  --acid: #4b7400;
  --iu: #990000;

  --fx-opacity: 0.3;
  --grid-opacity: 0.7;
}

/* 2. BASE ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--hud-h) + 40px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: var(--magenta); color: #07060d; }

a { color: inherit; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
h1, h2, h3 { margin: 0; font-weight: 700; }
ul, ol, dl, dd, figure, blockquote { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
b { font-weight: 600; }

kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 50;
  padding: 8px 12px; background: var(--ink); color: var(--bg);
  font-family: var(--mono); font-size: 12px; text-decoration: none;
}
.skip:focus { top: 52px; }

.holo-text {
  background: var(--holo);
  background-size: 300% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  animation: slide var(--holo-dur) linear infinite;
}

@keyframes slide { to { background-position: 300% 0; } }

/* 3. BACKGROUND ----------------------------------------------------------- */
#fx {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: -3;
  /* --beat (0..1) is set on this element by the Deck while it plays: the glow swells and reaches further */
  opacity: calc(min(0.95, var(--fx-opacity) * var(--fx-gain) * (1 + var(--beat, 0) * 1.1)) * var(--fx-fade));
  transform: scale(calc(1 + var(--beat, 0) * 0.05));
  transform-origin: 88% 4%;
  transition: opacity .3s linear;
  /* Static fallback if WebGL is unavailable */
  background:
    radial-gradient(40% 50% at 82% 8%, rgba(155, 123, 255, 0.55), transparent 70%),
    radial-gradient(35% 40% at 96% 30%, rgba(255, 95, 210, 0.4), transparent 70%),
    radial-gradient(30% 35% at 68% 0%, rgba(94, 242, 255, 0.4), transparent 70%);
  -webkit-mask-image: radial-gradient(calc(var(--fx-rx) * (1 + var(--beat, 0) * 0.35)) calc(var(--fx-ry) * (1 + var(--beat, 0) * 0.35)) at 88% 4%, #000 0%, rgba(0,0,0,.55) 38%, transparent 72%);
          mask-image: radial-gradient(calc(var(--fx-rx) * (1 + var(--beat, 0) * 0.35)) calc(var(--fx-ry) * (1 + var(--beat, 0) * 0.35)) at 88% 4%, #000 0%, rgba(0,0,0,.55) 38%, transparent 72%);
}

/* Fluid ink (ink.js): a see-through layer over the glow that the pointer stirs. */
#ink {
  position: fixed; inset: 0; z-index: -3;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: 0.62;
}
:root[data-theme="light"] #ink { opacity: 0.5; }

.gridlines {
  position: fixed; inset: 0; z-index: -2;
  /* --grid-gain and --grid-rx/ry come from the mixer's Grid fader */
  /* --beat (0..1) is set on this element by the Deck while it plays */
  opacity: min(1, calc(var(--grid-opacity) * var(--grid-gain, 1) * (1 + var(--beat, 0) * 1.6)));
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: calc(56px + var(--beat, 0) * 5px) calc(56px + var(--beat, 0) * 5px);   /* the lattice breathes with the Deck */
  background-position: center top;
  -webkit-mask-image: radial-gradient(var(--grid-rx, 90%) var(--grid-ry, 70%) at 70% 0%, rgba(0,0,0,.55), transparent 78%);
          mask-image: radial-gradient(var(--grid-rx, 90%) var(--grid-ry, 70%) at 70% 0%, rgba(0,0,0,.55), transparent 78%);
}

/* The pointer carries a small light that picks the grid out of the dark.
   --px / --py are set on this element by script. */
.gridlight {
  position: fixed; inset: 0; z-index: -2;
  pointer-events: none;
  opacity: 0; transition: opacity .5s ease;
  background-image:
    linear-gradient(to right, var(--cyan) 1px, transparent 1px),
    linear-gradient(to bottom, var(--magenta) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(230px circle at var(--px, 50%) var(--py, 50%), rgba(0,0,0,.5), transparent 72%);
          mask-image: radial-gradient(230px circle at var(--px, 50%) var(--py, 50%), rgba(0,0,0,.5), transparent 72%);
}
.gridlight.on { opacity: 0.55; }
:root[data-theme="light"] .gridlight.on { opacity: 0.4; }

/* Scanlines across the background, behind the content so text stays crisp.
   --scan (0..1) comes from the mixer. */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.063) 0 1px, transparent 1px 3px);
  opacity: var(--scan, 0.35);
}
:root[data-theme="light"] body::after {
  background: repeating-linear-gradient(to bottom, rgba(19,16,34,.07) 0 1px, transparent 1px 3px);
}

/* Film grain over everything. --grain (0..0.5) comes from the mixer. The layer
   is bigger than the screen and jumps around so the grain never sits still. */
body::before {
  content: "";
  position: fixed; inset: -120px; z-index: 39;
  pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' 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 0.9 -0.1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 200px 200px;
  opacity: var(--grain, 0.075);
  animation: grain 0.8s steps(1) infinite;
}
:root[data-theme="light"] body::before { filter: invert(1); }
@keyframes grain {
  0%   { transform: translate(0, 0); }
  17%  { transform: translate(-43px, 31px); }
  34%  { transform: translate(37px, -52px); }
  51%  { transform: translate(-71px, -23px); }
  68%  { transform: translate(59px, 47px); }
  85%  { transform: translate(-19px, 67px); }
}

/* 4. HUD ------------------------------------------------------------------ */
.hud {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  height: var(--hud-h);
  display: grid; grid-template-columns: auto 1fr repeat(3, auto); align-items: center; gap: 20px;
  padding: 0 var(--gutter);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.hud-id { color: var(--ink); }
.hud-id b { color: var(--magenta); font-weight: 500; margin: 0 4px; }
.hud-bar { position: relative; height: 2px; background: var(--line); }
.hud-bar i {
  display: block; height: 100%; width: 100%;
  transform: scaleX(0); transform-origin: left;
  background: var(--holo); background-size: 200% 100%;
}
/* one tick per section, placed by script */
.hud-bar b {
  position: absolute; top: -3px; width: 1px; height: 8px;
  background: var(--faint);
}
.hud-bar b.passed { background: var(--ink); }
.hud-clock { color: var(--faint); font-variant-numeric: tabular-nums; }
.hud-sec { min-width: 13ch; text-align: right; font-variant-numeric: tabular-nums; }

/* 5. LAYOUT + RAIL -------------------------------------------------------- */
.shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: calc(var(--hud-h) + 64px) var(--gutter) 56px;
  display: grid;
  grid-template-columns: 188px minmax(0, 1fr);   /* the rail, then everything else; 10b lays the sections out */
  gap: 72px;
  align-items: start;
}

.rail {
  position: sticky; top: calc(var(--hud-h) + 40px);
  display: grid; gap: 20px;
  /* on short screens the rail scrolls on its own instead of getting cut off */
  max-height: calc(100vh - var(--hud-h) - 56px);
  overflow-y: auto; scrollbar-width: none;
  padding: 4px 8px 8px 4px; margin: -4px -8px 0 -4px;   /* room for shadows and hover lifts inside the scroll box */
}
.rail::-webkit-scrollbar { display: none; }

.mark {
  width: 56px; height: 56px;
  display: grid; grid-template-columns: 1fr 1fr; place-items: center;
  padding: 0 8px;
  font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: -0.02em;
  text-decoration: none;
  border: 1px solid var(--ink);
  background: var(--panel);
  box-shadow: 4px 4px 0 var(--violet);
  transition: transform .18s ease, box-shadow .18s ease;
}
.mark:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--magenta); }
.mark:hover span { animation: glitch .32s steps(2) 1; }

.nav {
  position: relative;
  display: grid;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
}
/* corner brackets */
.nav::before, .nav::after {
  content: ""; position: absolute; width: 10px; height: 10px; pointer-events: none;
}
.nav::before { top: -1px; left: -1px; border-top: 1px solid var(--cyan); border-left: 1px solid var(--cyan); }
.nav::after { bottom: -1px; right: -1px; border-bottom: 1px solid var(--magenta); border-right: 1px solid var(--magenta); }

.nav a {
  position: relative;
  display: flex; align-items: baseline; gap: 12px;
  padding: 7px 10px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color .15s ease, background-color .15s ease, padding-left .15s ease;
}
.nav a i { font-style: normal; font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.nav a:hover { color: var(--ink); padding-left: 14px; }
.nav a.active { color: var(--ink); background: color-mix(in srgb, var(--violet) 14%, transparent); }
.nav a.active i { color: var(--accent); }
.nav a.active::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(to bottom, var(--cyan), var(--magenta));
}
/* How far through the current section you are. --p (0..1) is set by script. */
.nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(to right, var(--cyan), var(--magenta));
  transform: scaleX(var(--p, 0)); transform-origin: left;
}

.rail-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rail-tools .dial { grid-column: 1 / -1; }
.tool {
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
  padding: 7px 9px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--panel);
  transition: color .15s ease, border-color .15s ease;
}
.tool:hover { color: var(--ink); border-color: var(--faint); }
.tool-glyph {
  width: 12px; height: 12px; border-radius: 50%;
  background: conic-gradient(var(--cyan), var(--violet), var(--magenta), var(--amber), var(--acid), var(--cyan));
}

.tool[hidden] { display: none; }
.tool kbd { padding: 1px 5px; }
.tool--wide { grid-column: 1 / -1; }
.tool-more { margin-left: auto; color: var(--faint); letter-spacing: 0.08em; }
.tool[aria-expanded="true"] { color: var(--ink); border-color: var(--faint); }
.tool[aria-pressed="true"] { color: var(--ink); border-color: var(--faint); }

/* Sound toggle: three bars that only move while sound is on */
.tool-eq { display: inline-flex; align-items: flex-end; gap: 2px; width: 12px; height: 11px; flex: none; }
.tool-eq i { flex: 1; height: 3px; background: currentColor; transform-origin: bottom; }
.tool[aria-pressed="true"] .tool-eq i { height: 100%; background: var(--acid); animation: eq 0.9s ease-in-out infinite; }
.tool[aria-pressed="true"] .tool-eq i:nth-child(2) { animation-delay: -0.3s; }
.tool[aria-pressed="true"] .tool-eq i:nth-child(3) { animation-delay: -0.6s; }

/* Signal dial */
.dial {
  display: grid; gap: 8px;
  padding: 9px 10px 11px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.dial-head { display: flex; justify-content: space-between; }
.dial output { color: var(--ink); font-variant-numeric: tabular-nums; }
.dial input {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 14px; margin: 0;
  background: transparent; cursor: pointer;
  --fill: 35%;
}
.dial input::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(to right, var(--cyan), var(--magenta)) 0 0 / var(--fill) 100% no-repeat, var(--line);
}
.dial input::-moz-range-track { height: 2px; background: var(--line); }
.dial input::-moz-range-progress { height: 2px; background: linear-gradient(to right, var(--cyan), var(--magenta)); }
.dial input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 10px; height: 14px; margin-top: -6px;
  background: var(--ink); border: 0; border-radius: 0;
}
.dial input::-moz-range-thumb { width: 10px; height: 14px; background: var(--ink); border: 0; border-radius: 0; }

.content { position: relative; min-width: 0; }
/* At high signal a scrim rises behind the text so it stays readable. --scrim (0..1) is set by the dial. */
.content::before {
  content: ""; position: absolute; inset: -28px; z-index: -1;
  background: var(--bg);
  opacity: calc(var(--scrim, 0) * 0.74);
  pointer-events: none;
}

/* 6. HERO ----------------------------------------------------------------- */
.hero { padding-bottom: 8px; }

h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(29px, 5.4vw, 60px);   /* sized so "RJ Iammarino." fits one line at every width */
  line-height: 1;
  letter-spacing: -0.035em;
  white-space: nowrap;
}
h1 .dot { color: var(--magenta); }

.lede {
  margin: 24px 0 40px;
  max-width: 36ch;
  font-size: clamp(18px, 2.1vw, 22px);
  line-height: 1.4;
  color: var(--ink);
}

.intro {
  display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 28px;
  align-items: start;
}

/* Portrait card: 3D tilt + holo foil. --rx/--ry/--mx/--my set by script. */
.idcard {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  width: 176px;
  perspective: 700px;
}
.idcard-inner {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--panel-solid);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.2,.7,.2,1), box-shadow .3s ease;
  box-shadow: 6px 6px 0 color-mix(in srgb, var(--violet) 70%, transparent);
  will-change: transform;
}
.idcard.live .idcard-inner { transition: transform .08s linear, box-shadow .3s ease; box-shadow: 10px 12px 0 color-mix(in srgb, var(--magenta) 60%, transparent); }

.idcard img {
  display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 22%;
  filter: saturate(0.92) contrast(1.04);
}

/* iridescent border */
.idcard-inner::after {
  content: ""; position: absolute; inset: 0; padding: 1px; z-index: 4;
  background: var(--holo); background-size: 300% 100%;
  animation: slide var(--holo-dur) linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

/* foil sheen that follows the pointer */
.idcard-foil {
  position: absolute; inset: 0; z-index: 2;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.55), transparent 42%),
    linear-gradient(115deg,
      transparent 18%,
      rgba(94,242,255,.75) 34%, rgba(155,123,255,.75) 44%,
      rgba(255,95,210,.75) 54%, rgba(255,184,107,.75) 62%, rgba(200,255,90,.75) 70%,
      transparent 86%);
  background-size: 100% 100%, 260% 260%;
  background-position: 0 0, var(--mx) var(--my);
  mix-blend-mode: color-dodge;
  opacity: 0.16;
  transition: opacity .3s ease;
  pointer-events: none;
}
.idcard.live .idcard-foil { opacity: 0.6; }

/* glitch slice on hover: a band of the photo knocked sideways */
.idcard-slice {
  position: absolute; inset: 0; z-index: 1;
  background: url("assets/portrait.jpg") 50% 22% / cover;
  clip-path: inset(38% 0 52% 0);
  opacity: 0;
  pointer-events: none;
}
.idcard.live .idcard-slice { animation: slice .5s steps(1) 1; }

/* Hologram portrait (holo.js): the photo redrawn as particles. The <img> stays
   underneath for screen readers and print; it is only hidden once the canvas is live. */
.idcard-holo { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; }
.idcard.holo .idcard-inner { background: #07060d; }
.idcard.holo img { opacity: 0; }
.idcard.holo .idcard-slice { display: none; }

.idcard figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; justify-content: space-between; gap: 8px;
  padding: 22px 9px 7px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: #ecebf7;
  background: linear-gradient(to top, rgba(7,6,13,.88), transparent);
}
.idcard figcaption span:last-child { color: #5ef2ff; }

.bio-switch {
  display: inline-flex; margin-bottom: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.bio-switch button {
  padding: 5px 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.bio-switch button + button { border-left: 1px solid var(--line); }
.bio-switch button[aria-selected="true"] { color: var(--bg); background: var(--ink); }

.bio-body { color: var(--muted); }
.bio-body b { color: var(--ink); }

/* IU trident, set inline next to the school name. Drawn as a mask so it takes a
   theme colour and scales with the text around it (shape is 270:341). */
.iu {
  display: inline-block;
  width: 0.87em; height: 1.1em;
  margin-right: 0.38em;
  vertical-align: -0.14em;
  background: var(--iu);
  -webkit-mask: url("assets/iu-trident.svg") center / contain no-repeat;
          mask: url("assets/iu-trident.svg") center / contain no-repeat;
}

.spec { margin-top: 18px; border-top: 1px solid var(--line); }
.spec div {
  display: grid; grid-template-columns: 96px minmax(0, 1fr);
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em;
}
.spec dt { text-transform: uppercase; letter-spacing: 0.14em; color: var(--faint); }
.spec dd { color: var(--ink); }

.links {
  margin-top: 28px;
  display: flex; flex-wrap: wrap; gap: 6px 12px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.04em;
  color: var(--faint);
}
.links a {
  color: var(--ink); text-decoration: none;
  background: var(--holo) 0 100% / 300% 1px no-repeat;
  padding-bottom: 2px;
  transition: color .15s ease;
}
.links a:hover { color: var(--accent); animation: slide 3s linear infinite; }

/* 7. SECTIONS ------------------------------------------------------------- */
section[data-section] + section[data-section] { margin-top: 88px; }

.label {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.label i { font-style: normal; color: var(--accent); font-variant-numeric: tabular-nums; }
.label span { color: var(--ink); }
.label::after { content: ""; order: 2; flex: 1; height: 1px; background: linear-gradient(to right, var(--line), transparent); }
.label em { order: 3; font-style: normal; color: var(--faint); letter-spacing: 0.1em; }

/* Focus rows */
.row {
  display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 20px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.row:last-child { border-bottom: 1px solid var(--line); }
.row h3 { font-size: 17px; font-weight: 600; margin-bottom: 6px; }
.row p { color: var(--muted); }

.tag {
  display: inline-flex; align-items: center; gap: 8px; align-self: start;
  padding-top: 3px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
.tag::before { content: ""; width: 7px; height: 7px; background: var(--cyan); }
.row:nth-child(2) .tag::before { background: var(--magenta); }
.row:nth-child(3) .tag::before { background: var(--acid); }

/* Pull quote */
.pull { margin-bottom: 28px; padding-left: 18px; border-left: 2px solid var(--magenta); }
.pull p {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(22px, 3.4vw, 32px); line-height: 1.15; letter-spacing: -0.02em;
  text-wrap: balance;
}
.pull footer {
  margin-top: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint);
}

/* Built cards. --sx/--sy (pointer position) set by script. */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
/* an odd card out takes the full row instead of leaving a hole */
.cards > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.cards > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }   /* an odd last card spans the row */

.card {
  --sx: 50%; --sy: 50%;
  position: relative;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease;
}
.card > * { position: relative; z-index: 1; }
.card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(260px circle at var(--sx) var(--sy), color-mix(in srgb, var(--violet) 26%, transparent), transparent 70%);
  opacity: 0; transition: opacity .25s ease;
}
.card::after {
  content: ""; position: absolute; inset: 0; padding: 1px;
  background: radial-gradient(220px circle at var(--sx) var(--sy), var(--cyan), var(--magenta) 45%, transparent 75%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .25s ease; pointer-events: none;
}
.card:hover { transform: translateY(-3px); }
.card:hover::before, .card:hover::after { opacity: 1; }
.card header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card h3 { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.card p { color: var(--muted); font-size: 15px; }
.chip {
  flex: none;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--faint);
}

/* Lab: cards whose top half is a live canvas. The screens stay dark in both themes. */
.lab { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.exp {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: border-color .25s ease, transform .25s ease;
}
.exp--wide { grid-column: 1 / -1; }
.exp:hover, .exp:focus-within { border-color: var(--faint); }

.exp-stage {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #07060d;
  border-bottom: 1px solid var(--line);
  cursor: crosshair;
  touch-action: pan-y;
  outline-offset: -2px;
}
.exp--wide .exp-stage { aspect-ratio: 21 / 9; }
.exp-stage canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  /* the screens follow the mixer's Hue, and brighten with the Deck (--beat is set on .lab) */
  filter: hue-rotate(var(--hue-deg, 0deg)) brightness(calc(1 + var(--beat, 0) * 0.5));
}
/* ...and its Spread: a wash of the anchor colour as the rainbow collapses */
.exp-tint {
  position: absolute; inset: 0; z-index: 1;
  background: var(--cyan);
  mix-blend-mode: color;
  opacity: var(--wash, 0);
  pointer-events: none;
}
/* corner brackets, like the nav */
.exp-stage::before, .exp-stage::after {
  content: ""; position: absolute; z-index: 2; width: 12px; height: 12px; pointer-events: none;
  transition: width .25s ease, height .25s ease;
}
.exp-stage::before { top: 6px; left: 6px; border-top: 1px solid #5ef2ff; border-left: 1px solid #5ef2ff; }
.exp-stage::after { bottom: 6px; right: 6px; border-bottom: 1px solid #ff5fd2; border-right: 1px solid #ff5fd2; }
.exp:hover .exp-stage::before, .exp:hover .exp-stage::after { width: 20px; height: 20px; }

.exp-hint {
  position: absolute; left: 14px; bottom: 11px; z-index: 2;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(236, 235, 247, 0.6);
  pointer-events: none;
  transition: opacity .4s ease;
}
.exp.touched .exp-hint { opacity: 0; }

/* "Full screen" on the Raindrop card (space.js adds it) */
.exp-expand {
  position: absolute; top: 10px; right: 12px; z-index: 3;
  padding: 5px 10px;
  font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(236, 235, 247, 0.85);
  border: 1px solid rgba(236, 235, 247, 0.32);
  background: rgba(7, 6, 13, 0.6);
  transition: color .15s ease, border-color .15s ease;
}
.exp-expand:hover { color: #5ef2ff; border-color: #5ef2ff; }

.exp-body { padding: 16px 18px 18px; }
.exp-body header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.exp-body h3 { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.exp-body p { color: var(--muted); font-size: 15px; }

/* Play: two toys (play.js) */
.toy {
  margin-top: 16px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.toy-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.toy-head h3 { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.toy-note { margin-top: 14px; font-family: var(--mono); font-size: 11px; line-height: 1.6; letter-spacing: 0.02em; color: var(--faint); }

/* The Deck */
.deck-top { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin: 16px 0 14px; }
.deck-play {
  min-width: 96px; padding: 0 16px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink); border: 1px solid var(--ink); background: transparent;
  transition: background-color .15s ease, color .15s ease;
}
.deck-play:hover { background: color-mix(in srgb, var(--ink) 12%, transparent); }
.deck-play[aria-pressed="true"] { color: var(--bg); background: var(--ink); }
.deck-knob { flex: 0 0 112px; }
/* fixed height on purpose: a canvas with an automatic height resizes itself every time its pixels are resized */
.deck-scope { flex: 1 1 120px; min-width: 0; width: 0; height: 60px; background: #07060d; border: 1px solid var(--line); }

.deck-bars { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.deck-bars .pad { padding: 6px 12px; }
.pad--link { color: var(--accent); }
.deck-grid { display: grid; gap: 4px; }
.deck-row { display: grid; grid-template-columns: 46px repeat(16, minmax(0, 1fr)); gap: 3px; align-items: center; }
/* the track name doubles as its mute button */
.deck-name {
  padding: 0; text-align: left;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
}
.deck-name:hover { color: var(--ink); }
.deck-name[aria-pressed="true"] { color: var(--faint); text-decoration: line-through; }
.deck-row.muted .deck-cell { opacity: 0.32; box-shadow: none; }
.deck-cell {
  aspect-ratio: 1; min-height: 16px; padding: 0;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--c) 7%, transparent);
  touch-action: none;
  transition: transform .08s ease, background-color .1s ease;
}
/* a wider gap before each beat (cells are children 2..17 of the row) */
.deck-cell:nth-child(4n+2):not(:nth-child(2)) { margin-left: 5px; }
.deck-cell:hover { border-color: var(--c); }
.deck-cell[aria-pressed="true"] {
  background: var(--c); border-color: var(--c);
  box-shadow: 0 0 10px color-mix(in srgb, var(--c) 55%, transparent);
}
.deck-cell.at { border-color: var(--ink); }
.deck-cell.at[aria-pressed="true"] { transform: scale(1.14); filter: brightness(1.35); }

.deck-foot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.deck-kits { display: flex; flex-wrap: wrap; gap: 6px; margin-right: auto; }
.deck-foot .pad { padding: 8px 12px; }

/* Beat the Tape */
.tape-stage {
  position: relative;
  aspect-ratio: 16 / 7;
  margin-top: 16px;
  overflow: hidden;
  background: #07060d;
  border: 1px solid var(--line);
}
.tape-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tape-over {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 14px;
  padding: 16px;
  text-align: center;
  background: rgba(7, 6, 13, 0.6);
}
.tape-over[hidden] { display: none; }
.tape-title {
  max-width: 30ch;
  font-family: var(--display); font-weight: 700; font-size: clamp(16px, 2.6vw, 21px); line-height: 1.25;
  color: #ecebf7; text-wrap: balance;
}
.tape-start {
  padding: 9px 22px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: #07060d; background: #ecebf7; border: 1px solid #ecebf7;
}
.tape-start:hover { background: transparent; color: #ecebf7; }
.tape-start[hidden], .tape-modes[hidden] { display: none; }
/* the 3-2-1 before a round */
.tape-title.count { font-size: clamp(54px, 11vw, 96px); font-weight: 800; line-height: 1; letter-spacing: -0.04em; }
/* which market to play: these sit on the dark chart, so they keep fixed colours */
.tape-modes { display: flex; gap: 6px; }
.tape-modes .pad { padding: 6px 12px; color: #9a97b5; border-color: #3a3856; background: rgba(7, 6, 13, 0.6); }
.tape-modes .pad:hover { color: #ecebf7; border-color: #9a97b5; }
.tape-modes .pad.on { color: #07060d; background: #ecebf7; border-color: #ecebf7; }
.tape-bar { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; margin-top: 10px; }
.tape-trade {
  flex: 0 0 132px;
  padding: 12px 10px;
  font-family: var(--display); font-weight: 700; font-size: 18px;
  color: var(--acid); border: 1px solid var(--acid); background: color-mix(in srgb, var(--acid) 8%, transparent);
}
.tape-trade.sell { color: var(--magenta); border-color: var(--magenta); background: color-mix(in srgb, var(--magenta) 8%, transparent); }
.tape-trade:disabled { opacity: 0.4; cursor: default; }
.tape-trade:not(:disabled):active { transform: translateY(1px); }
.tape-stats { flex: 1 1 260px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); }
.tape-stats div { padding: 8px 10px; border-left: 1px solid var(--line); }
.tape-stats div:first-child { border-left: 0; }
.tape-stats dt { font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.tape-stats dd { margin-top: 3px; font-family: var(--mono); font-size: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.tape-stats dd.up { color: var(--acid); }
.tape-stats dd.down { color: var(--magenta); }

/* Career strip: every stop as a block on one time axis */
.strip { margin-bottom: 34px; }
.strip-bar { position: relative; height: 30px; }
.strip-seg {
  position: absolute; top: 4px; bottom: 4px;
  padding: 0;
  background: var(--c);
  opacity: 0.5;
  box-shadow: inset -2px 0 0 var(--bg);
  transition: opacity .2s ease, top .2s ease, bottom .2s ease;
}
.strip-seg:hover, .strip-seg:focus-visible, .strip-seg.hot { opacity: 1; top: 0; bottom: 0; }
.strip-axis { position: relative; height: 18px; margin-top: 6px; border-top: 1px solid var(--line); }
.strip-axis span {
  position: absolute; top: 5px; transform: translateX(-50%);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.strip-axis span::before { content: ""; position: absolute; left: 50%; top: -5px; width: 1px; height: 4px; background: var(--faint); }
.strip-read {
  min-height: 1.6em; margin-top: 10px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted);
}
.strip-read b { color: var(--ink); font-weight: 500; }
.tl-row { transition: opacity .2s ease; }
.timeline.dim .tl-row:not(.hot):not(.tl-edu) { opacity: 0.45; }
.tl-row.hot .tl-node::before { background: var(--accent); border-color: var(--accent); }
.tl-row.flash h3 { animation: flash 1s ease 1; }

/* Career totals */
.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 36px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.stat {
  display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 8px;
  padding: 16px 14px 14px;
  border-left: 1px solid var(--line);
}
.stat:first-child { border-left: 0; }
.stat dd {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(22px, 2.6vw, 26px); line-height: 1.1; letter-spacing: -0.03em; white-space: nowrap;
  font-variant-numeric: tabular-nums;
  background: var(--holo); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: slide var(--holo-dur) linear infinite;
}
.stat dt {
  font-family: var(--mono); font-size: 10.5px; line-height: 1.45; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}

/* Career timeline. --tl (0..1) is how far the spine has drawn; set by script. */
.timeline { --tl: 0; --spine: 154px; position: relative; }
.timeline::before, .tl-fill {
  content: ""; position: absolute; left: var(--spine); top: 8px; bottom: 8px; width: 1px;
}
.timeline::before { background: var(--line); }
.tl-fill {
  background: linear-gradient(to bottom, var(--cyan), var(--violet), var(--magenta));
  transform: scaleY(var(--tl)); transform-origin: top;
}

.tl-row {
  display: grid; grid-template-columns: 128px 20px minmax(0, 1fr); column-gap: 16px;
  padding-bottom: 26px;
}
.tl-row:last-child { padding-bottom: 0; }
.tl-when {
  padding-top: 3px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--faint); font-variant-numeric: tabular-nums;
}
.tl-node { position: relative; }
.tl-node::before {
  content: ""; position: absolute; left: 6px; top: 7px; width: 9px; height: 9px;
  background: var(--bg); border: 1px solid var(--muted);
  transform: rotate(45deg);
}
.tl-row.is-now .tl-node::before { background: var(--acid); border-color: var(--acid); animation: pulse 2.4s ease-out infinite; }
.tl-row.is-now .tl-when { color: var(--ink); }
.tl-row h3 { font-size: 16.5px; font-weight: 600; }
.tl-row h3 span {
  margin-left: 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}
.tl-row p { margin-top: 4px; color: var(--muted); font-size: 15px; }

/* Now */
.now { padding: 20px; background: var(--panel); border: 1px solid var(--line); }
.now-date {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--faint);
}
.now-date::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--acid);
  animation: pulse 2.4s ease-out infinite;
}
.now li { position: relative; padding: 5px 0 5px 22px; color: var(--muted); }
.now li::before {
  content: ">"; position: absolute; left: 0; top: 5px;
  font-family: var(--mono); font-size: 13px; color: var(--accent);
}

/* Life */
.life-line {
  margin-bottom: 24px;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(20px, 3vw, 27px); line-height: 1.2; letter-spacing: -0.02em;
  text-wrap: balance;
}
/* Column ratio matches the two photos' aspect ratios (3:4 and 4:3) so they share a height. */
.shots { display: grid; grid-template-columns: 0.75fr 1.333fr; gap: 16px; }
.shot {
  position: relative; overflow: hidden;
  background: var(--panel-solid);
  border: 1px solid var(--line);
}
.shot img {
  display: block; width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.92);
  transition: transform .7s cubic-bezier(.2,.7,.2,1), filter .4s ease;
}
.shot:hover img { transform: scale(1.04); filter: saturate(1.15); }
.shot::after {
  content: ""; position: absolute; inset: 0; padding: 1px;
  background: var(--holo); background-size: 300% 100%;
  animation: slide var(--holo-dur) linear infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s ease; pointer-events: none;
}
.shot:hover::after { opacity: 1; }
.shot figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; gap: 8px;
  padding: 26px 10px 8px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: #ecebf7;
  background: linear-gradient(to top, rgba(7,6,13,.85), transparent);
}
.shot figcaption span:last-child { color: #5ef2ff; }

.shot { cursor: zoom-in; }

/* Photo lightbox */
.lightbox {
  max-width: none; max-height: none;
  padding: 0; border: 0;
  background: transparent; color: var(--ink);
  overflow: visible;
  cursor: zoom-out;
}
.lightbox::backdrop {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.lightbox img {
  display: block;
  max-width: min(92vw, 1100px); max-height: 82vh;
  width: auto; height: auto;
  border: 1px solid var(--line);
}
.lightbox figcaption {
  margin-top: 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); text-align: center;
}
::view-transition-group(shot) { animation-duration: .42s; animation-timing-function: cubic-bezier(.2,.7,.2,1); }

/* Contact */
.channels { border-top: 1px solid var(--line); }
.channels li {
  display: grid; grid-template-columns: 128px minmax(0, 1fr) auto; align-items: center; gap: 12px 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.ch-key {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.biglink {
  justify-self: start;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(17px, 2.6vw, 25px); letter-spacing: -0.02em;
  text-decoration: none; overflow-wrap: anywhere;
  background: var(--holo) 0 100% / 300% 2px no-repeat;
  padding-bottom: 4px;
}
.biglink:hover { animation: slide 3s linear infinite; }
.copy {
  padding: 6px 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--panel);
}
.copy:hover { color: var(--ink); border-color: var(--faint); }

/* Footer */
.foot {
  margin-top: 96px; padding-top: 20px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 20px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint);
}
.foot-hint kbd { margin: 0 2px 0 8px; }
.foot-colophon { flex: 1 0 100%; text-transform: none; letter-spacing: 0.02em; line-height: 1.6; }

/* 8. COMMAND MENU --------------------------------------------------------- */
.palette {
  width: min(560px, calc(100vw - 32px));
  margin: 16vh auto 0;
  padding: 0;
  color: var(--ink);
  background: var(--panel-solid);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px color-mix(in srgb, var(--violet) 40%, transparent);
}
.palette::backdrop, .term::backdrop {
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.palette input {
  width: 100%;
  padding: 16px 18px;
  font: 500 15px var(--body); color: var(--ink);
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  outline: none;
}
.palette input::placeholder { color: var(--faint); }
.palette ul { max-height: 46vh; overflow: auto; padding: 6px; }
.palette li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 12px;
  font-size: 14.5px; cursor: pointer;
}
.palette li small { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }
.palette li[aria-selected="true"] { background: color-mix(in srgb, var(--violet) 18%, transparent); box-shadow: inset 2px 0 0 var(--cyan); }
.palette li.none { color: var(--faint); cursor: default; }
.palette-foot {
  display: flex; align-items: center; gap: 6px;
  margin: 0; padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint);
}
.palette-foot kbd + kbd { margin-left: -2px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 45;
  transform: translate(-50%, 16px);
  padding: 8px 14px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--bg); background: var(--ink);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 8b. MIXER --------------------------------------------------------------- */
.mixer {
  position: fixed; right: 20px; bottom: 20px; z-index: 34;
  width: 400px; max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px); overflow-y: auto; scrollbar-width: thin;
  color: var(--ink);
  background: color-mix(in srgb, var(--panel-solid) 93%, transparent);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px color-mix(in srgb, var(--violet) 35%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  font-family: var(--mono);
  animation: rise .22s cubic-bezier(.2,.7,.2,1);
}
.mixer[hidden] { display: none; }
.mixer-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.mixer-bar button { padding: 2px 8px; border: 1px solid var(--line); font-size: 10.5px; letter-spacing: 0.1em; color: var(--muted); }
.mixer-bar button:hover { color: var(--ink); }

.mixer-faders { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 4px; padding: 14px 10px 12px; }
.fader {
  --v: 0;
  display: grid; justify-items: center; gap: 9px;
  cursor: ns-resize; touch-action: none;
  -webkit-user-select: none; user-select: none;
  outline-offset: 4px;
}
.fader output { font-size: 10.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.fader span { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.fader-track {
  position: relative;
  width: 26px; height: 92px;
  border: 1px solid var(--line);
  background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 12.6px);
}
.fader-fill {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(var(--v) * 100%);
  background: linear-gradient(to top, color-mix(in srgb, var(--cyan) 50%, transparent), color-mix(in srgb, var(--magenta) 55%, transparent));
}
.fader-cap {
  position: absolute; left: -5px; right: -5px;
  bottom: calc(var(--v) * 100% - 5px);
  height: 10px;
  background: var(--ink);
  box-shadow: 0 2px 0 var(--violet);
}
.fader:hover .fader-cap, .fader:focus-visible .fader-cap { box-shadow: 0 2px 0 var(--magenta); }
/* the Hue fader shows the wheel itself */
.fader[data-key="hue"] .fader-track {
  background: linear-gradient(to top, hsl(184 80% 55% / .55), hsl(244 80% 60% / .55), hsl(304 80% 60% / .55), hsl(4 80% 60% / .55), hsl(64 80% 55% / .55), hsl(124 80% 55% / .55), hsl(184 80% 55% / .55));
}
.fader[data-key="hue"] .fader-fill { display: none; }

.mixer-ink { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); align-items: center; gap: 6px; padding: 0 12px 12px; }
.mixer-ink span { padding-right: 6px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.mixer-pads { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding: 0 12px 12px; }
.pad {
  padding: 9px 2px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--panel);
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.pad:hover { color: var(--ink); border-color: var(--faint); }
.pad:active { transform: translateY(1px); }
.pad.on { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.pad:disabled { opacity: 0.5; border-style: dashed; cursor: help; }
.pad--shuffle { color: var(--accent); }
.pad--slot { border-style: solid; color: var(--ink); }
.pad--slot.pad--empty { border-style: dashed; color: var(--faint); }

/* The Mixer's Edge fader rounds every panel. The corner brackets fade out once corners are round. */
.card, .exp, .toy, .now, .stats, .nav, .tool, .dial, .mixer, .palette, .term, .pad, .copy,
.bio-switch, .idcard-inner, .shot, .deck-play, .deck-scope, .tape-stage, .tape-trade, .tape-stats,
.mark, .strip-bar { border-radius: var(--radius, 0px); }
.exp, .stats, .bio-switch, .tape-stats, .strip-bar { overflow: hidden; }
.idcard-inner::after, .card::after, .shot::after { border-radius: inherit; }
.nav::before, .nav::after, .exp-stage::before, .exp-stage::after { opacity: var(--bracket, 1); }

/* ...and its Glitch fader splits the type into cyan and magenta. Gradient text is left alone. */
h1 > span:not(.holo-text), .lede, .row h3, .card h3, .exp-body h3, .toy-head h3, .tl-row h3,
.label span, .life-line, .pull p, .nav a {
  text-shadow:
    calc(var(--chroma, 0px) * -1) 0 color-mix(in srgb, var(--cyan) var(--chroma-a, 0%), transparent),
    var(--chroma, 0px) 0 color-mix(in srgb, var(--magenta) var(--chroma-a, 0%), transparent);
}

.mixer-foot {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
}
.mixer-foot button { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.mixer-foot button:hover { color: var(--ink); }

/* 8c. SECRETS ------------------------------------------------------------- */
.toast.egg {
  padding: 10px 16px;
  color: var(--ink); background: var(--panel-solid);
  border: 1px solid var(--magenta);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--cyan) 45%, transparent), 0 16px 40px rgba(0,0,0,.5);
}
.foot-secrets { color: var(--muted); }
.foot-secrets b { color: var(--accent); font-weight: 500; }

/* full-screen layers used by the secrets */
.playfield, .rain { position: fixed; inset: 0; width: 100%; height: 100%; }
.playfield { z-index: 55; cursor: crosshair; touch-action: none; }
.rain { z-index: 54; pointer-events: none; }
.play-hud {
  position: fixed; top: calc(var(--hud-h) + 14px); left: 50%; z-index: 56;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  padding: 8px 12px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink); background: var(--panel-solid);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.play-hud b { color: var(--acid); font-weight: 500; }
.play-hud button { padding: 2px 8px; border: 1px solid var(--line); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.play-hud button:hover { color: var(--ink); }

.horizon {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; align-content: center; gap: 14px;
  background: #000; color: #ecebf7;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; text-align: center;
  opacity: 0; transition: opacity .5s ease;
  pointer-events: none;
}
.horizon.on { opacity: 1; }
.horizon small { font-size: 10.5px; letter-spacing: 0.16em; color: #9a97b5; }

section.gone, .foot.gone {
  opacity: 0; transform: translateX(-18px) skewX(-10deg); filter: blur(4px);
  transition: opacity .22s ease, transform .22s ease, filter .22s ease;
}
section[data-section], .foot { transition: opacity .3s ease, transform .3s ease, filter .3s ease; }

.trident {
  position: fixed; top: -48px; z-index: 50;
  width: 22px; height: 28px;
  -webkit-mask: url("assets/iu-trident.svg") center / contain no-repeat;
          mask: url("assets/iu-trident.svg") center / contain no-repeat;
  pointer-events: none;
  animation: fall linear forwards;
}

/* the saucer */
.ufo {
  position: fixed; left: 0; top: 0; z-index: 58;
  width: 96px; height: 44px;
  pointer-events: none;
  transition: transform 2s cubic-bezier(.3,.7,.2,1);
  animation: ufo-bob 1.1s ease-in-out infinite alternate;
}
.ufo-dome {
  position: absolute; left: 30px; top: 0; width: 36px; height: 26px;
  border-radius: 18px 18px 6px 6px;
  background: radial-gradient(circle at 35% 30%, #ffffff, color-mix(in srgb, var(--cyan) 70%, transparent) 55%, transparent 100%);
  border: 1px solid var(--cyan);
}
.ufo-body {
  position: absolute; left: 0; top: 16px; width: 96px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--magenta));
  box-shadow: 0 0 22px color-mix(in srgb, var(--magenta) 60%, transparent), inset 0 -6px 0 rgba(0,0,0,.35);
}
.ufo-body::after {                        /* running lights */
  content: ""; position: absolute; left: 12px; right: 12px; top: 8px; height: 4px;
  background: repeating-linear-gradient(90deg, #fff 0 4px, transparent 4px 14px);
  animation: ufo-lights .5s steps(2) infinite;
}
.ufo-beam {
  position: absolute; left: 50%; top: 30px;
  width: var(--beam-w, 120px); height: var(--beam, 120px);
  transform: translateX(-50%) scaleY(0); transform-origin: top;
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
  background: linear-gradient(180deg, color-mix(in srgb, var(--cyan) 75%, transparent), color-mix(in srgb, var(--acid) 12%, transparent));
  opacity: 0; transition: transform .5s ease, opacity .4s ease;
}
.ufo.beam .ufo-beam { transform: translateX(-50%) scaleY(1); opacity: 1; }
@keyframes ufo-bob { from { margin-top: -3px; } to { margin-top: 4px; } }
@keyframes ufo-lights { to { background-position: 7px 0; } }

/* eleven */
.eleven {
  position: fixed; inset: 0; z-index: 59;
  display: grid; place-items: center;
  font-family: var(--display, "Syne", sans-serif); font-weight: 800; font-size: min(62vw, 86vh); line-height: 1;
  color: transparent; -webkit-text-stroke: 3px var(--magenta);
  text-shadow: -10px 0 color-mix(in srgb, var(--cyan) 70%, transparent), 10px 0 color-mix(in srgb, var(--amber) 70%, transparent);
  pointer-events: none;
  animation: eleven 2.6s cubic-bezier(.2,.7,.2,1) forwards;
}
@keyframes eleven { 0% { opacity: 0; transform: scale(.6); } 12% { opacity: 1; transform: scale(1.04); } 70% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.5); } }

/* the dog that naps when the page is left alone */
.napper {
  position: fixed; right: 22px; bottom: 10px; z-index: 40;
  font-size: 38px; line-height: 1;
  transform: translateX(160px);
  transition: transform 2.2s cubic-bezier(.3,.6,.3,1);
  pointer-events: none;
}
.napper.in { transform: none; }
.napper.up { transform: translate(190px, -14px); transition: transform .9s cubic-bezier(.5,0,.8,.4); }
.napper-dog { display: inline-block; animation: nap-breathe 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
.napper i {
  position: absolute; left: -2px; top: -2px;
  font: 500 13px var(--mono); font-style: normal; color: var(--accent);
  opacity: 0; animation: nap-z 3s ease-out infinite;
}
.napper i:nth-of-type(2) { animation-delay: 1s; }
.napper i:nth-of-type(3) { animation-delay: 2s; }
.napper:not(.in) i, .napper.up i { animation: none; }
@keyframes nap-breathe { 50% { transform: scaleY(.93); } }
@keyframes nap-z { 0% { opacity: 0; transform: translate(0, 0) scale(.7); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(-22px, -40px) scale(1.5); } }

/* 1998: the whole page as a home page from the dial-up years (twenty seconds, then it puts itself back) */
:root.y2k body, :root.y2k h1, :root.y2k h2, :root.y2k h3, :root.y2k p, :root.y2k a, :root.y2k li, :root.y2k dt, :root.y2k dd,
:root.y2k span, :root.y2k button, :root.y2k label, :root.y2k output, :root.y2k figcaption {
  font-family: "Comic Sans MS", "Comic Sans", "Chalkboard SE", "Comic Neue", cursive !important;
  letter-spacing: 0 !important; text-transform: none !important;
}
:root.y2k h1, :root.y2k h2 { color: #ffff00 !important; text-shadow: 3px 3px 0 #ff00ff !important; }
:root.y2k h3 { color: #00ff00 !important; text-shadow: none !important; }
:root.y2k .holo-text { background: none !important; -webkit-text-fill-color: #00ffff !important; color: #00ffff !important; animation: y2k-blink 1s steps(2) infinite !important; }
:root.y2k p, :root.y2k li, :root.y2k dd { color: #ffffff !important; }
:root.y2k a { color: #00ffff !important; text-decoration: underline !important; }
:root.y2k .card, :root.y2k .exp, :root.y2k .toy, :root.y2k .now, :root.y2k .stats, :root.y2k .nav {
  background: #000080 !important; border: 4px ridge #c0c0c0 !important; border-radius: 0 !important;
}
:root.y2k .pad, :root.y2k .tool, :root.y2k .deck-play, :root.y2k .copy, :root.y2k .tape-trade {
  color: #000 !important; background: #c0c0c0 !important;
  border: 2px outset #ffffff !important; border-radius: 0 !important;
}
:root.y2k .pad *, :root.y2k .tool * { color: #000 !important; }
:root.y2k .chip { color: #ff0000 !important; animation: y2k-blink 1s steps(2) infinite; }
:root.y2k .gridlines, :root.y2k #ink { visibility: hidden; }
.y2k-banner {
  position: fixed; left: 0; right: 0; top: var(--hud-h); z-index: 57;
  overflow: hidden; white-space: nowrap;
  padding: 5px 0;
  font: 700 15px "Comic Sans MS", "Comic Sans", cursive; color: #ffff00;
  background: repeating-linear-gradient(-45deg, #000 0 14px, #e8b800 14px 28px);
  border-bottom: 3px ridge #c0c0c0;
  pointer-events: none;
}
.y2k-banner span { display: inline-block; padding: 2px 10px 2px 100vw; background: #000; animation: y2k-scroll 16s linear infinite; }
.y2k-badge {
  position: fixed; right: 18px; bottom: 14px; z-index: 57;
  padding: 6px 12px;
  font: 13px "Comic Sans MS", "Comic Sans", cursive; color: #00ff00; background: #000;
  border: 3px ridge #c0c0c0;
  pointer-events: none;
}
.y2k-badge b { font-family: "Courier New", monospace; color: #ff0000; background: #200; padding: 0 4px; letter-spacing: 2px; }
@keyframes y2k-blink { 50% { opacity: 0; } }
@keyframes y2k-scroll { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) {
  .y2k-banner span { animation: none; padding-left: 10px; }
  :root.y2k .holo-text, :root.y2k .chip { animation: none !important; }
  .ufo, .napper-dog, .napper i { animation: none; }
}

/* 8d. RAINDROP, FULL SCREEN (space.js) ------------------------------------- */
.space {
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  overflow: hidden;
  background: #000; color: #ecebf7;
  font-family: var(--mono);
}
.space::backdrop { background: #000; }
.space canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.space canvas:active { cursor: grabbing; }
.space button {
  padding: 7px 14px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: #ecebf7; border: 1px solid #615e80; background: rgba(7, 6, 13, 0.62);
}
.space button:hover:not(:disabled) { border-color: #ecebf7; }
.space button:disabled { opacity: 0.5; cursor: default; }
.space-bar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 18px;
  padding: 12px 16px 28px;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #9a97b5;
  background: linear-gradient(to bottom, rgba(0,0,0,.7), transparent);
  pointer-events: none;
}
.space-bar button { margin-left: auto; pointer-events: auto; }
.space-title { color: #ecebf7; }
.space-title b { color: #ff5fd2; font-weight: 500; margin: 0 4px; }
.space-read {
  position: absolute; left: 16px; bottom: 74px;
  display: grid; gap: 7px;
  pointer-events: none;
}
.space-read div { display: grid; grid-template-columns: 124px auto; gap: 12px; align-items: baseline; }
.space-read dt { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: #9a97b5; }
.space-read dd { font-size: 13px; color: #ecebf7; font-variant-numeric: tabular-nums; text-shadow: 0 0 8px #000; }
.space-foot {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 28px 16px 14px;
  background: linear-gradient(to top, rgba(0,0,0,.75), transparent);
}
.space-go { color: #5ef2ff !important; border-color: #5ef2ff !important; }
.space-note { margin-left: auto; max-width: 52ch; font-size: 10px; line-height: 1.5; letter-spacing: 0.04em; color: #615e80; text-align: right; }
.space-veil {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 14px;
  padding: 24px;
  text-align: center;
  opacity: 0; transition: opacity 1.4s ease;
  pointer-events: none;
}
.space-veil.on { opacity: 1; }
/* a line that fades in as you fall past a landmark */
.space-call {
  position: absolute; left: 50%; top: 18%;
  width: min(560px, calc(100vw - 48px));
  margin: 0; transform: translateX(-50%);
  font-family: var(--body); font-size: clamp(15px, 2vw, 19px); line-height: 1.4;
  color: #ecebf7; text-align: center; text-shadow: 0 0 14px #000, 0 0 4px #000;
  opacity: 0; transition: opacity .7s ease;
  pointer-events: none;
}
.space-call.on { opacity: 1; }
.space-veil span { font-family: var(--display); font-weight: 800; font-size: clamp(26px, 5vw, 56px); line-height: 1; letter-spacing: -0.03em; }
.space-veil small { max-width: 52ch; font-size: 12px; line-height: 1.6; letter-spacing: 0.06em; color: #9a97b5; }

/* 8e. LIVE PAGE ----------------------------------------------------------- */
/* Everything added by groove.js, game.js, motion.js, hands.js and contact.js,
   plus the Deck's song row and note roll. */

/* Pages cross-fade (and Lab cards morph into their pages) where the browser can. */
@view-transition { navigation: auto; }

/* The Deck: song row, live markers, note roll */
.deck-bars .push, .deck-song .push { margin-left: auto; }
.deck-song { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.deck-song-label {
  margin-right: 4px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.deck-song .pad { padding: 6px 12px; }
.deck-slot { min-width: 36px; text-align: center; color: var(--ink); border-style: solid; }
.deck-slot.pad--empty { color: var(--faint); border-style: dashed; }
.deck-slot.live { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.deck-roll { display: grid; gap: 2px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.deck-roll[hidden] { display: none; }
.deck-roll-row { --c: var(--cyan); }
.deck-roll-row .deck-name { color: var(--faint); }
.deck-cell.roll-cell { aspect-ratio: auto; height: 13px; min-height: 0; }
.roll-cell.ghost { background: color-mix(in srgb, var(--c) 26%, transparent); border-color: color-mix(in srgb, var(--c) 55%, transparent); }

/* groove.js: the page on the beat */
#fx.beat { transition: none; }
.tl-row.on-beat .tl-node::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 14px var(--accent); }
.tl-row.on-beat .tl-when { color: var(--accent); }

/* game.js: Hit the Beat */
.hit {
  position: fixed; inset: 0; z-index: 60;
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  color: #ecebf7; font-family: var(--mono);
  background: rgba(7, 6, 13, 0.76);
  -webkit-backdrop-filter: blur(5px);
          backdrop-filter: blur(5px);
  outline: none;
}
.hit[hidden] { display: none; }
:root.hit-open { overflow: hidden; }
.hit-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px;
  padding: 12px 16px;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #9a97b5;
  border-bottom: 1px solid #2c2a45;
}
.hit-name { margin-right: auto; color: #ecebf7; }
.hit-stat b { margin-left: 6px; font-weight: 500; color: #ecebf7; font-variant-numeric: tabular-nums; }
.hit-bar button {
  padding: 4px 10px;
  font: inherit; letter-spacing: inherit; text-transform: inherit;
  color: #ecebf7; border: 1px solid #615e80;
}
.hit-bar button:hover { border-color: #ecebf7; }
#hit-canvas { display: block; width: 100%; height: 100%; min-height: 0; touch-action: none; }
.hit-over {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 16px;
  padding: 24px; text-align: center;
  background: rgba(7, 6, 13, 0.6);
}
.hit-over[hidden] { display: none; }
.hit-title { font-family: var(--display); font-weight: 800; font-size: clamp(32px, 7vw, 60px); line-height: 1; letter-spacing: -0.035em; }
.hit-sub { max-width: 46ch; font-size: 12.5px; line-height: 1.7; letter-spacing: 0.02em; color: #b9b6d3; }

/* The hero headline leans, swells and fades as the page scrolls away from it.
   Pure CSS, tied to the scroll position; browsers without scroll timelines skip it. */
@supports (animation-timeline: scroll()) {
  h1 {
    transform-origin: left center;
    animation: hero-leave linear both;
    animation-timeline: scroll(root);
    animation-range: 0 560px;
  }
  .lede {
    animation: lede-leave linear both;
    animation-timeline: scroll(root);
    animation-range: 0 560px;
  }
}
@keyframes hero-leave { to { transform: translateY(-18px) scale(1.16) skewX(-7deg); opacity: 0.18; filter: blur(3px); } }
@keyframes lede-leave { to { transform: translateY(-34px); opacity: 0.3; } }

/* motion.js: HUD readout */
.hud-xy { color: var(--faint); font-variant-numeric: tabular-nums; white-space: pre; }
@media (max-width: 1100px), (pointer: coarse) { .hud-xy { display: none; } }

/* motion.js: dust (section labels blow away and reassemble) */
.dust { position: fixed; inset: 0; z-index: 29; width: 100%; height: 100%; pointer-events: none; }
.label::after { transition: opacity .3s ease; }
.label.dusted > *, .label.dusted::after { opacity: 0; }

/* motion.js: the orb, and the bio text laid out around it */
.bio { position: relative; }
.orb {
  position: absolute; left: 0; top: 0; z-index: 3;
  width: 72px; height: 72px; padding: 0; border: 0; border-radius: 50%;
  cursor: grab; touch-action: none;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.92) 0, rgba(255, 255, 255, 0) 26%),
    radial-gradient(circle at 68% 76%, color-mix(in srgb, var(--magenta) 80%, transparent), transparent 58%),
    radial-gradient(circle at 42% 42%, var(--cyan), var(--violet) 62%, #140f2e 100%);
  box-shadow: 0 0 26px color-mix(in srgb, var(--cyan) 50%, transparent), inset 0 0 16px rgba(0, 0, 0, 0.5);
  will-change: transform;
}
.orb.docked { transition: transform .35s cubic-bezier(.2, .8, .2, 1); animation: orb-glow 2.8s ease-in-out infinite; }
.orb.held { cursor: grabbing; }
.orb:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
@keyframes orb-glow {
  50% { box-shadow: 0 0 40px color-mix(in srgb, var(--magenta) 65%, transparent), inset 0 0 16px rgba(0, 0, 0, 0.5); }
}
.bio-body.flowing { position: relative; }
.bio-body.flowing > p { position: absolute; left: 0; top: 0; width: 100%; opacity: 0; pointer-events: none; }
.flow-layer { position: absolute; inset: 0; }
.flow-layer > span { position: absolute; white-space: pre; }

/* motion.js: each Lab card's link to its own page; the door to the world */
.exp-body header .chip { margin-left: auto; }
.exp-open {
  padding: 2px 8px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.exp-open:hover { color: var(--bg); background: var(--accent); }
.door { border: 1px solid var(--line); border-radius: var(--radius); }   /* laid out in 10b */
.door-go {
  padding: 9px 22px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--bg); background: var(--ink); border: 1px solid var(--ink); text-decoration: none;
}
.door-go:hover { color: var(--ink); background: transparent; }

/* setups.js and eyes.js: both reuse the Tape's stage, overlay, buttons and stats */
.setups-read { min-height: 2.9em; margin-top: 10px; font-size: 14px; line-height: 1.45; color: var(--muted); }
.setups-read.hands-status { min-height: 0; font-size: 11px; }
.setups-calls { flex: 1 1 300px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.setups-calls .tape-trade { flex: none; width: 100%; }
.setups-calls .tape-trade[hidden] { display: none; }
.setups-calls .tape-trade.pass, .setups-calls .tape-trade.next { color: var(--ink); border-color: var(--line); background: transparent; }
.setups-calls .tape-trade.next { grid-column: 1 / -1; border-color: var(--ink); }
.setups-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); flex-basis: 380px; }
.eyes-view { flex: 0 0 auto; width: 112px; height: auto; aspect-ratio: 4 / 3; background: #07060d; border: 1px solid var(--line); border-radius: var(--radius); }
.eyes-actions { flex: 0 1 auto; display: grid; gap: 6px; align-content: center; }
.eyes-actions .pad { padding: 8px 14px; }
@media (max-width: 720px) {
  .setups-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .setups-stats div:nth-child(odd) { border-left: 1px solid var(--line); }
  .setups-stats div:nth-child(3n+1) { border-left: 0; }
  .setups-stats div:nth-child(n+3) { border-top: 0; }
  .setups-stats div:nth-child(n+4) { border-top: 1px solid var(--line); }
  .eyes-actions { flex: 1 1 140px; }
}

/* hands.js */
.hands-stage { display: flex; flex-wrap: wrap; align-items: stretch; gap: 14px; margin-top: 16px; }
#hands-view { width: 200px; height: auto; aspect-ratio: 4 / 3; background: #07060d; border: 1px solid var(--line); border-radius: var(--radius); }
.hands-side { display: grid; align-content: center; gap: 10px; }
.hands-side .deck-play { height: 44px; }
.hands-status { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.toy.live .hands-status { color: var(--accent); }
.hand-dot {
  position: fixed; left: 0; top: 0; z-index: 58;
  width: 26px; height: 26px; margin: -13px 0 0 -13px;
  border: 2px solid var(--cyan); border-radius: 50%;
  box-shadow: 0 0 18px var(--cyan);
  pointer-events: none; opacity: 0;
  transition: opacity .2s ease, width .12s ease, height .12s ease, margin .12s ease, background-color .12s ease;
}
.hand-dot + .hand-dot { border-color: var(--magenta); box-shadow: 0 0 18px var(--magenta); }
.hand-dot.seen { opacity: 1; }
.hand-dot.pinched { width: 14px; height: 14px; margin: -7px 0 0 -7px; background: var(--ink); }

/* contact.js: the note form */
.note {
  position: relative;
  margin-top: 28px; padding: 24px 22px 22px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.note::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--holo); background-size: 300% 100%;
  animation: slide var(--holo-dur) linear infinite;
}
.note h3 { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.note-lede { margin: 4px 0 18px; color: var(--muted); font-size: 15px; }
.note-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 11px 12px;
  font: inherit; font-size: 16px; color: var(--ink);
  background: color-mix(in srgb, var(--bg) 62%, transparent);
  border: 1px solid var(--line); border-radius: calc(var(--radius, 0px) * 0.6);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 128px; line-height: 1.5; resize: vertical; }
.field input:focus, .field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 24px color-mix(in srgb, var(--accent) 22%, transparent);
}
.field [aria-invalid="true"] { border-color: var(--magenta); }
.note-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.note-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.note-send {
  padding: 11px 28px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--bg); background: var(--ink); border: 1px solid var(--ink);
}
.note-send:hover:not(:disabled) { color: var(--ink); background: transparent; }
.note-send:disabled { opacity: 0.5; }
.note-status { flex: 1 1 220px; font-family: var(--mono); font-size: 11.5px; line-height: 1.5; letter-spacing: 0.02em; color: var(--muted); }
.note-status[data-kind="error"] { color: var(--magenta); }
.note-status[data-kind="ok"] { color: var(--accent); }

@media (max-width: 640px) {
  .note-row { grid-template-columns: minmax(0, 1fr); }
  .deck-cell.roll-cell { height: 18px; }
  #hands-view { width: 100%; }
  .hit-bar { gap: 6px 14px; }
}

/* live.js: live status tiles under Now (hidden until switched on in index.html) */
.live { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 16px; }
.live[hidden] { display: none; }
.live-tile {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; gap: 3px 12px;
  min-height: 86px; padding: 14px 16px;
  color: inherit; text-decoration: none;
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent); border-radius: var(--radius);
}
a.live-tile[href]:hover { border-color: var(--faint); }
.live-key {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint);
}
.live-key::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.live-tile[data-state="on"] .live-key::before { background: var(--acid); box-shadow: 0 0 10px var(--acid); }
.live-tile[data-state="idle"] .live-key::before { background: var(--amber); }
.live-tile[data-state="busy"] .live-key::before { background: var(--magenta); }
.live-title, .live-sub { grid-column: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.live-tile[data-state="off"] .live-title { font-weight: 500; color: var(--muted); }
.live-sub { font-size: 13.5px; color: var(--muted); }
.live-art { grid-column: 2; grid-row: 2 / span 2; width: 44px; height: 44px; object-fit: cover; border-radius: calc(var(--radius, 0px) * 0.5); }
.live-art[hidden], .live-bar[hidden] { display: none; }
.live-bar { grid-column: 1 / -1; height: 2px; margin-top: 8px; background: var(--line); }
.live-bar i { display: block; width: 0; height: 100%; background: linear-gradient(to right, var(--cyan), var(--magenta)); }
@media (min-width: 1180px) {
  /* with live status on, Now is two columns: the list, then the tiles two by two */
  #now:has(.live:not([hidden])) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; align-items: start; }
  #now:has(.live:not([hidden])) > .label { grid-column: 1 / -1; }
  #now:has(.live:not([hidden])) .now { max-width: none; }
  #now:has(.live:not([hidden])) .live { margin-top: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print { .live { display: none !important; } }

/* 9. TERMINAL ------------------------------------------------------------- */
.term {
  width: min(760px, calc(100vw - 32px));
  height: min(460px, 72vh);
  margin: auto auto 24px;
  padding: 0;
  color: var(--ink);
  background: color-mix(in srgb, var(--panel-solid) 94%, transparent);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px color-mix(in srgb, var(--cyan) 30%, transparent);
  font-family: var(--mono); font-size: 13px; line-height: 1.55;
}
.term[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; animation: rise .22s cubic-bezier(.2,.7,.2,1); }
.term-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.term-bar button { padding: 2px 8px; border: 1px solid var(--line); font-size: 10.5px; letter-spacing: 0.1em; color: var(--muted); }
.term-bar button:hover { color: var(--ink); }
.term-out { overflow: auto; padding: 12px 14px 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.term-out div { min-height: 1.55em; }
.term-out .t-cmd { color: var(--ink); }
.term-out .t-cmd::before { content: "rj@index:~$ "; color: var(--acid); }
.term-out .t-out { color: var(--muted); }
.term-out .t-hi { color: var(--cyan); }
.term-out .t-err { color: var(--magenta); }
.term-line { display: flex; align-items: center; gap: 8px; padding: 10px 14px 12px; border-top: 1px solid var(--line); }
.term-line label { flex: none; color: var(--acid); }
.term-line input {
  flex: 1; min-width: 0;
  font: inherit; color: var(--ink); caret-color: var(--magenta);
  background: transparent; border: 0; outline: none;
}

/* 10. MOTION -------------------------------------------------------------- */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }

/* Theme switch: the new theme wipes in as a circle from the toggle (script). */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--acid) 70%, transparent); }
  100% { box-shadow: 0 0 0 9px transparent; }
}
@keyframes glitch {
  0% { text-shadow: -2px 0 var(--cyan), 2px 0 var(--magenta); transform: translateX(1px); }
  50% { text-shadow: 2px 0 var(--cyan), -2px 0 var(--magenta); transform: translateX(-1px); }
  100% { text-shadow: none; transform: none; }
}
@keyframes slice {
  0%   { opacity: 1; clip-path: inset(38% 0 52% 0); transform: translateX(-9px); filter: hue-rotate(90deg); }
  25%  { opacity: 1; clip-path: inset(64% 0 22% 0); transform: translateX(7px);  filter: hue-rotate(-60deg); }
  50%  { opacity: 1; clip-path: inset(12% 0 78% 0); transform: translateX(-5px); filter: hue-rotate(160deg); }
  75%  { opacity: 1; clip-path: inset(48% 0 40% 0); transform: translateX(4px);  filter: none; }
  100% { opacity: 0; }
}
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes eq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
@keyframes fall { to { transform: translateY(calc(100vh + 96px)) rotate(var(--spin, 360deg)); } }
@keyframes flash { 0% { color: var(--accent); } 100% { color: inherit; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  .idcard-inner { transform: none; }
}

/* 10b. STRUCTURE ---------------------------------------------------------- */
/* The calm pass. Nothing was removed; this section decides what is loud and
   what is quiet, and how each section uses the width.
     - one big name per section, with a quiet one-line intro under it
     - panels are separated by space and a soft surface, not by outlines
     - small uppercase mono is for metadata only
     - things used now and then sit one click away: toy tabs, the Deck's
       Tools drawer, "How it works" notes, hints that show on hover
     - from 1180px up, sections lay out in columns instead of one tall stack */

/* Section rhythm: more air between sections than inside them. */
section[data-section] + section[data-section] { margin-top: 136px; }
#hello + #focus { margin-top: 72px; }   /* the hero already ends in open space */
.label { align-items: baseline; margin-bottom: 18px; }
.label span {
  font-family: var(--display); font-size: clamp(26px, 3vw, 38px); font-weight: 700;
  line-height: 1; letter-spacing: -0.025em; text-transform: none;
}
.label::after { align-self: center; }
.label em { font-size: 11px; }
/* the one-line intro under a section name: body type, not a second headline */
.life-line {
  max-width: 58ch; margin-bottom: 32px;
  font-family: var(--body); font-weight: 400;
  font-size: clamp(17px, 1.6vw, 20px); line-height: 1.5; letter-spacing: 0;
  color: var(--muted); text-wrap: pretty;
}

/* The rail: a table of contents and a few quiet tools, no boxes. */
.rail { gap: 16px; }
.nav { padding: 0; background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.nav::before, .nav::after { display: none; }
.tool { border-color: transparent; background: none; }
.tool:hover, .tool[aria-expanded="true"], .tool[aria-pressed="true"] {
  border-color: transparent;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.rail .dial { padding: 6px 9px 8px; border: 0; background: none; }

/* Panels: a soft surface and a hairline, so the content is what you see. */
.card, .exp, .toy, .now, .note, .stats, .door { border-color: color-mix(in srgb, var(--line) 55%, transparent); }
.spec, .spec div { border-color: color-mix(in srgb, var(--line) 60%, transparent); }
.spec div { padding: 8px 0; align-items: baseline; font-family: var(--body); font-size: 14px; letter-spacing: 0; }
.spec dt { font-family: var(--mono); font-size: 10.5px; }

/* The top bar's pointer readout only shows while the pointer is moving. */
.hud-xy { opacity: 0; transition: opacity .7s ease; }
.hud-xy.live { opacity: 1; transition-duration: .15s; }

/* Lab: hints and corner marks appear when you point at a screen. */
@media (hover: hover) {
  .exp-hint { opacity: 0; transition: opacity .2s ease; }
  .exp:not(.touched):hover .exp-hint, .exp:not(.touched) .exp-stage:focus-visible .exp-hint { opacity: 1; }
  .exp-stage::before, .exp-stage::after { opacity: 0; transition: opacity .2s ease, width .2s ease, height .2s ease; }
  .exp:hover .exp-stage::before, .exp:hover .exp-stage::after { opacity: var(--bracket, 1); }
}

/* The door to the world is a card in the Lab grid, with a little neon horizon for a screen. */
.door {
  display: grid; grid-template-rows: auto 1fr; grid-column: 1 / -1;
  margin-top: 0; padding: 0;
  border-style: solid; background: var(--panel);
  overflow: hidden;
}
.door-view {
  height: 150px;
  background:
    linear-gradient(rgba(255, 95, 210, 0.85), rgba(255, 95, 210, 0.85)) 0 56% / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, rgba(94, 242, 255, 0.34) 0 1px, transparent 1px 34px) 0 100% / 100% 44% no-repeat,
    repeating-linear-gradient(0deg, rgba(94, 242, 255, 0.26) 0 1px, transparent 1px 15px) 0 100% / 100% 44% no-repeat,
    linear-gradient(#0a0818, #150d33) 0 100% / 100% 44% no-repeat,
    radial-gradient(circle at 50% 56%, #ffb86b 0, #ff5fd2 12%, rgba(255, 95, 210, 0) 12.6%),
    linear-gradient(to bottom, #0b0820, #2a1257 56%);
}
.door-body { display: grid; gap: 8px; align-content: start; justify-items: start; padding: 16px 18px 18px; }
.door h3 { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.door p { color: var(--muted); font-size: 15px; }
.door-go { margin-top: 6px; }

/* Play: one toy on screen at a time (play.js builds the tabs). */
.toy-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 16px; }
.toy-tabs {
  display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px;
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
  border-radius: calc(var(--radius, 0px) + 3px);
}
.toy-tabs button {
  padding: 8px 18px;
  font-family: var(--body); font-size: 14.5px; font-weight: 500;
  color: var(--muted);
  border-radius: var(--radius, 0px);
  transition: color .15s ease, background-color .15s ease;
}
.toy-tabs button:hover { color: var(--ink); }
.toy-tabs button[aria-selected="true"] { color: var(--bg); background: var(--ink); }
.toy-bar .chip { margin-left: auto; }
.tabbed .toy { margin-top: 0; }
.tabbed .toy-head { display: none; }
.toy[hidden] { display: none; }

/* "How it works": the long notes fold away. */
.how { margin-top: 14px; }
.how summary {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); cursor: pointer; list-style: none;
}
.how summary::-webkit-details-marker { display: none; }
.how summary::before { content: "+"; width: 9px; color: var(--accent); }
.how[open] summary::before { content: "\2212"; }
.how summary:hover { color: var(--ink); }
.how .toy-note { max-width: 80ch; margin-top: 10px; }

/* The Deck: transport, then patterns and song on one line, then the grid.
   Everything else is in the Tools drawer. */
.deck-knob { padding: 4px 8px 6px; border: 0; background: none; }
.deck-bars { align-items: center; margin-bottom: 12px; }
.deck-label, .deck-song-label {
  margin-right: 4px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint);
}
.deck-bars .deck-song { margin: 0 0 0 18px; }
.deck-tools {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 12px; padding: 8px;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  border-radius: var(--radius, 0px);
}
.deck-tools[hidden] { display: none; }
.deck-tools .pad { padding: 6px 12px; }
.deck-tools .push { margin-left: auto; }
.deck-foot { align-items: center; }

/* Wide screens: use the width. */
@media (min-width: 1180px) {
  h1 { font-size: clamp(60px, 5.6vw, 84px); }

  /* hello: photo, story, facts */
  .bio { display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: 48px; align-items: start; }
  .bio > * { grid-column: 1; }
  .bio > .orb { grid-column: auto; }
  .bio-switch { justify-self: start; }
  .bio > .spec { grid-column: 2; grid-row: 1 / span 4; margin-top: 0; }

  /* focus: three lanes, side by side */
  .rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
  .row { grid-template-columns: minmax(0, 1fr); gap: 10px; align-content: start; padding: 22px 0 0; }

  /* services: three across, and a row of five splits three and two */
  .cards { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
  .cards > .card, .cards > .card:last-child:nth-child(odd) { grid-column: span 2; }
  .cards > .card:first-child:nth-last-child(5) ~ .card:nth-child(n+4) { grid-column: span 3; }

  /* lab: a three-column grid, the black hole two wide, the door in the last cell */
  .lab { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .exp--wide, .exp--wide-lg { grid-column: span 2; }
  .lab .exp-stage, .exp--wide .exp-stage { aspect-ratio: auto; height: 264px; }
  .door { grid-column: auto; }
  .door-view { height: 264px; }

  /* play: the Deck's steps stay a sensible height however wide it gets */
  .deck-cell { aspect-ratio: auto; height: 34px; }
  .deck-cell.roll-cell { height: 14px; }

  /* career, now: keep lines readable */
  .tl-row p { max-width: 68ch; }
  .now { max-width: 760px; }
  .shots { gap: 20px; }

  /* contact: the two channels on the left, the note form on the right */
  #contact { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); column-gap: 56px; align-items: start; }
  #contact > .label { grid-column: 1 / -1; }
  #contact .note { margin-top: 0; }
  #contact .channels li { grid-template-columns: minmax(0, 1fr) auto; }
  #contact .ch-key { grid-column: 1 / -1; }
}

/* 10c. FRONT DOOR (frontdoor.js) ------------------------------------------ */
/* The short path for someone here for work: two buttons in the hero, "Ask
   about this" on each Services card, topics in the note form, my local time,
   and a résumé button. */

/* hero: the two buttons, then the quiet links */
.cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.cta a {
  padding: 11px 24px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; text-decoration: none;
  border: 1px solid var(--ink); border-radius: var(--radius, 0px);
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.cta-main { color: var(--bg); background: var(--ink); }
.cta-main:hover { color: var(--ink); background: transparent; }
.cta-alt { color: var(--ink); border-color: var(--faint); }
.cta-alt:hover { border-color: var(--ink); }
.cta + .links { margin-top: 18px; }

/* services: the way from a card to the note form */
.card { display: flex; flex-direction: column; }
.card > p { flex: 1; }
.card-ask {
  align-self: flex-start; margin-top: 14px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); text-decoration: none;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size .2s ease;
}
.card-ask:hover, .card-ask:focus-visible { background-size: 100% 1px; }

/* the note form's topics */
.note-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.note-topics[hidden] { display: none; }
.note-topics-label { flex-basis: 100%; margin-bottom: 2px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.note-topics button {
  padding: 7px 13px;
  font-family: var(--body); font-size: 13.5px;
  color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--radius, 0px);
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.note-topics button:hover { color: var(--ink); border-color: var(--faint); }
.note-topics button[aria-checked="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }

/* contact: local time sits with the channels, in the same type as the links but quieter */
.where { font-family: var(--display); font-weight: 700; font-size: clamp(16px, 2.2vw, 21px); letter-spacing: -0.02em; color: var(--muted); }

/* career: the résumé button */
.career-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 30px; font-size: 14px; color: var(--muted); }

@media print { .cta, .card-ask, .note-topics, .career-foot, .ch-time { display: none !important; } }

/* 11. RESPONSIVE ---------------------------------------------------------- */
@media (max-width: 900px) {
  :root { --gutter: 16px; }
  .shell { grid-template-columns: minmax(0, 1fr); gap: 36px; padding-top: calc(var(--hud-h) + 28px); }
  .rail { position: static; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; max-height: none; overflow: visible; padding: 0; margin: 0; }
  .tool-more { display: none; }
  .nav {
    grid-column: 1 / -1; order: 3;
    display: flex; overflow-x: auto; scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; padding: 7px 10px; }
  .nav a:hover { padding-left: 10px; }
  .nav a.active::before { top: auto; left: 8px; right: 8px; bottom: 0; width: auto; height: 2px; background: linear-gradient(to right, var(--cyan), var(--magenta)); }
  .rail-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; }
  .rail-tools kbd { display: none; }
  .rail-tools .dial, .dial { grid-column: 1 / -1; order: 4; flex: 1 0 100%; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; }
  .dial-head { gap: 10px; }
  section[data-section] + section[data-section] { margin-top: 64px; }
  .foot { margin-top: 64px; }
  .hud-clock { display: none; }
  .hud { grid-template-columns: auto 1fr auto; }
}

@media (max-width: 560px) {
  .intro { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .idcard { width: 150px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .hud-id { display: none; }
  .hud { grid-template-columns: 1fr auto; }
  .label em, .foot-hint { display: none; }

  .timeline { --spine: 10px; }
  .tl-row { grid-template-columns: 20px minmax(0, 1fr); column-gap: 14px; }
  .tl-node { grid-column: 1; grid-row: 1 / span 2; }
  .tl-when { grid-column: 2; grid-row: 1; padding: 0 0 4px; }
  .tl-row > div { grid-column: 2; grid-row: 2; }
  .tl-row h3 span { display: block; margin: 2px 0 0; }

  .shots { grid-template-columns: minmax(0, 1fr); }
  .lab { grid-template-columns: minmax(0, 1fr); }
  .toy { padding: 14px 12px; }
  .deck-row { grid-template-columns: 40px repeat(16, minmax(0, 1fr)); gap: 2px; }
  .deck-name { font-size: 9px; letter-spacing: 0.06em; }
  .deck-cell { aspect-ratio: auto; min-height: 30px; }   /* taller than wide, so a fingertip can hit one */
  .deck-cell:nth-child(4n+2):not(:nth-child(2)) { margin-left: 3px; }
  .deck-knob { flex: 1 1 110px; }
  .tape-stage { aspect-ratio: 4 / 3; }
  .tape-trade { flex: 1 1 100%; }
  .tape-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tape-stats div:nth-child(odd) { border-left: 0; }
  .tape-stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .mixer { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; }
  .space-keys, .space-note { display: none; }
  .space-read { left: 12px; bottom: 66px; gap: 5px; }
  .space-read div { grid-template-columns: 96px auto; gap: 8px; }
  .space-read dd { font-size: 11.5px; }
  .fader-track { height: 78px; }
  .exp--wide .exp-stage { aspect-ratio: 16 / 10; }
  .foot-colophon { display: block; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }

  .channels li { grid-template-columns: minmax(0, 1fr) auto; }
  .ch-key { grid-column: 1 / -1; }
}

/* 12. PRINT ---------------------------------------------------------------
   Ctrl+P (or "Print resume" in the menu) gives a clean black-on-white CV:
   bio, focus, what I build, career and contact. No chrome, no canvases. */
@media print {
  :root, :root[data-theme="light"] {
    --bg: #fff; --ink: #000; --muted: #333; --faint: #666; --line: #ccc;
    --panel: #fff; --panel-solid: #fff; --accent: #000; --iu: #990000;
    --cyan: #000; --violet: #000; --magenta: #000; --amber: #000; --acid: #000;
  }
  @page { margin: 16mm 15mm; }
  html { scroll-behavior: auto; }
  body { font-size: 10.5pt; line-height: 1.45; }
  body::before, body::after, #fx, #ink, .gridlines, .dust, .orb, .hit, .hand-dot, .note, .door, .exp-open, .gridlight, .hud, .rail, .skip, .toast, dialog,
  .mixer, .playfield, .rain, .play-hud, .horizon, .trident, .foot-secrets, .ufo, .eleven, .napper, .y2k-banner, .y2k-badge,
  .links, .bio-switch, .copy, .foot-hint, .foot-colophon, .strip, .pull footer,
  .content::before, #lab, #play, #now, #life { display: none !important; }
  .shell { display: block; max-width: none; padding: 0; }
  section[data-section] + section[data-section] { margin-top: 20pt; }
  .label { margin-bottom: 10pt; }
  .js .reveal { opacity: 1 !important; transform: none !important; }
  .holo-text, .stat dd { background: none !important; -webkit-text-fill-color: #000; color: #000 !important; animation: none !important; }
  h1 { font-size: 30pt; }
  h1 br { display: none; }
  h1 .dot { color: #000; }
  .lede { margin: 6pt 0 14pt; max-width: none; font-size: 12pt; }
  .intro { grid-template-columns: 30mm minmax(0, 1fr); gap: 8mm; }
  .idcard { width: 30mm; }
  .idcard-inner { transform: none !important; box-shadow: none !important; }
  .idcard-inner::after, .idcard-foil, .idcard-slice, .idcard-holo, .idcard figcaption { display: none !important; }
  .idcard.holo img { opacity: 1 !important; }
  .bio-body[data-bio-panel="short"] { display: none !important; }
  .bio-body[data-bio-panel="long"] { display: block !important; }
  .row, .card, .stat, .tl-row, .channels li { break-inside: avoid; }
  .card { padding: 10pt; }
  /* the Mixer sets the panel colour on the page itself, which would print as grey boxes */
  .card, .stats, .stat, .now, .note { background: #fff !important; border-color: #ccc !important; }
  .card::before, .card::after { display: none !important; }
  .pull { margin-bottom: 12pt; }
  .pull p { font-size: 14pt; }
  .tl-row { padding-bottom: 10pt; }
  .tl-fill { display: none !important; }
  .foot { margin-top: 18pt; }
  a { text-decoration: none; }
  .biglink { background: none; font-size: 12pt; }
}
