/* A1 Drop the Needle: the record sleeve hero. Owned by Agent 2.
   Scroll-driven values are set by js/intro.js as custom properties on #intro:
   --intro-a   (0 to 1) vinyl slides out of the sleeve
   --intro-b   (0 to 1) sleeve falls back, record comes forward
   --intro-arm (0 to 1) tonearm swings onto the record
   Where scroll-driven animations are supported, CSS drives these instead (see bottom).
   Defaults are 1, so with no JS or reduced motion the final state shows statically. */

.intro {
  --intro-a: 1;
  --intro-b: 1;
  --intro-arm: 1;
  --gx: 30%;
  --gy: 20%;
  --tx: 0deg;
  --ty: 0deg;
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  padding: 0;
  background:
    radial-gradient(120% 80% at 80% 10%, color-mix(in srgb, var(--accent-3) 10%, transparent), transparent 60%),
    radial-gradient(90% 70% at 10% 100%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
    var(--bg-deep, var(--bg));
}
@supports (background: radial-gradient(in oklch, red, blue)) {
  .intro {
    background:
      radial-gradient(in oklch 120% 80% at 80% 10%, color-mix(in oklch, var(--accent-3) 12%, transparent), transparent 60%),
      radial-gradient(in oklch 90% 70% at 10% 100%, color-mix(in oklch, var(--tint-strong, var(--accent)) 12%, transparent), transparent 60%),
      var(--bg-deep, var(--bg));
  }
}

/* Scroll room for the reveal: only when motion is OK, on screens with room for a sticky stage. */
@media (min-width: 60em) and (min-height: 34em) {
  :root[data-motion="full"]:not([data-calm="on"]) .intro { height: 185vh; height: 185svh; }
  :root[data-motion="full"]:not([data-calm="on"]) .intro .intro__stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
  }
}

.intro__stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-8) var(--space-4) var(--space-8);
}

.intro__viz {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: .9;
}
:root[data-calm="on"] .intro__viz,
:root[data-contrast="high"] .intro__viz { display: none; }

.intro__glow {
  position: absolute;
  z-index: -1;
  inset: 10% 0 10% 35%;
  pointer-events: none;
  background:
    radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%) 60% 50% / 70% 80% no-repeat,
    radial-gradient(closest-side, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 70%) 85% 30% / 50% 60% no-repeat;
  filter: blur(10px);
}
@supports (color: oklch(0 0 0)) {
  .intro__glow {
    background:
      radial-gradient(in oklch closest-side, color-mix(in oklch, var(--tint-strong) 30%, transparent), transparent 70%) 60% 50% / 70% 80% no-repeat,
      radial-gradient(in oklch closest-side, color-mix(in oklch, var(--accent-2) 14%, transparent), transparent 70%) 85% 30% / 50% 60% no-repeat;
  }
}
:root[data-contrast="high"] .intro__glow { display: none; }

.intro__inner {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  display: grid;
  gap: var(--space-6);
  align-items: center;
}

/* ---------- Copy ---------- */
/* The name panel sits on glass. Body text is on --glass-fill-strong so contrast holds. */
.intro__copy {
  position: relative;
  max-width: 36rem;
  margin: 0;
  padding: clamp(var(--space-5), 3vw, var(--space-7));
  border: 1px solid var(--glass-border, var(--line));
  border-radius: calc(var(--radius) * 1.6);
  background: var(--glass-fill-strong, var(--surface));
  box-shadow: var(--glass-highlight, none), var(--glass-shadow, var(--shadow));
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .intro__copy {
    -webkit-backdrop-filter: blur(var(--glass-blur, 18px)) saturate(1.3);
    backdrop-filter: blur(var(--glass-blur, 18px)) saturate(1.3);
  }
}
:root[data-contrast="high"] .intro__copy { background: #000; border-color: #fff; box-shadow: none; }

.intro__kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
  font-family: var(--font-mono);
  font-size: .875rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
.intro__kicker-title { color: var(--text-muted); letter-spacing: .04em; }
.intro__kicker-title::before {
  content: "";
  display: inline-block;
  width: 1.5rem;
  height: 2px;
  margin-right: var(--space-3);
  vertical-align: middle;
  background: var(--line);
}

.intro__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.25rem, 1.6rem + 7vw, 7.25rem);
  line-height: .9;
  letter-spacing: -.035em;
  color: var(--text);
  text-wrap: balance;
}
.intro__title-line { display: block; }
.intro__title-line + .intro__title-line {
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  background: linear-gradient(in oklch 90deg, var(--accent), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .intro__title-line + .intro__title-line { color: var(--accent); }
}
:root[data-contrast="high"] .intro__title-line + .intro__title-line { background: none; color: var(--text); }

.intro__role {
  margin: var(--space-5) 0 var(--space-1);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  line-height: 1.2;
  color: var(--text);
}
.intro__stack {
  margin: 0 0 var(--space-5);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--accent-2);
}

.intro__lede {
  margin: 0 0 var(--space-4);
  max-width: 46ch;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--text);
}
.intro__tldr {
  display: inline-block;
  margin-right: var(--space-2);
  padding: 0 var(--space-2);
  border: 1px solid var(--accent-2);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: .8em;
  font-weight: 600;
  line-height: 1.6;
  color: var(--accent-2);
  vertical-align: .08em;
}
.intro__blurb {
  margin: 0 0 var(--space-3);
  max-width: 52ch;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
}
.intro__blurb--small { font-size: .9375rem; }
.intro__blurb a { color: var(--accent-2); text-underline-offset: .2em; }
.intro__blurb a:hover { color: var(--text); }

.intro__controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.intro__controls:not(:has(button:not([hidden]))) { display: none; }

.intro__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-2) var(--space-5);
  border: 2px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 600 1rem/1.2 var(--font-body);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast), color var(--dur-fast);
}
.intro__btn[hidden] { display: none; }
.intro__btn:hover { transform: translateY(-1px); }
.intro__btn:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.intro__btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}
.intro__btn--ghost:hover { border-color: var(--accent-2); }
.intro__btn-icon { flex: none; }
.intro__btn .icon-pause { display: none; }
.intro__btn[aria-pressed="true"] .icon-play { display: none; }
.intro__btn[aria-pressed="true"] .icon-pause { display: inline; }
.intro__btn--ghost[aria-pressed="true"] { border-color: var(--accent-2); color: var(--accent-2); }
.intro__btn--ghost[aria-pressed="true"] .icon-bars { opacity: .5; }

/* ---------- Scroll cue ---------- */
.intro__cue {
  position: absolute;
  left: 50%;
  bottom: var(--space-5);
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: .8125rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--text-muted);
  white-space: nowrap;
}
.intro__cue:hover { color: var(--accent); }
.intro__cue:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.intro__cue-icon { color: var(--accent); }

/* ---------- The deck (sleeve, vinyl, tonearm) ---------- */
.intro__deck {
  position: relative;
  width: 100%;
  max-width: 44rem;
  margin-inline: auto;
  aspect-ratio: 1.5 / 1;
}
.deck__scene {
  position: absolute;
  inset: 0;
  perspective: 1400px;
  perspective-origin: 50% 40%;
}
.deck__tilt {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(calc(6deg + var(--ty))) rotateY(calc(-8deg + var(--tx)));
}
.deck__stack {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54%;
  aspect-ratio: 1;
  margin: -27% 0 0 -27%;
  transform-style: preserve-3d;
  /* keep the whole group centred as it changes shape */
  transform: translateX(calc((-0.25 - 0.25 * var(--intro-a) + 0.2 * var(--intro-b)) * 100%));
}
/* margin-top % is relative to width, which keeps the square centred vertically */

.deck__sleeve,
.deck__record {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.deck__sleeve {
  transform-origin: 0% 50%;
  transform:
    translateX(calc(-10% * var(--intro-b)))
    translateZ(calc(2px - 170px * var(--intro-b)))
    rotateY(calc(26deg * var(--intro-b)));
  filter: brightness(calc(1 - .25 * var(--intro-b)));
}
.deck__record {
  inset: 2%;
  transform:
    translateX(calc((50% + 50% * var(--intro-a) - 30% * var(--intro-b))))
    translateZ(calc(60px * var(--intro-b)));
}

.sleeve, .vinyl, .tonearm { display: block; width: 100%; height: 100%; overflow: visible; }
.sleeve { filter: drop-shadow(0 18px 30px rgb(0 0 0 / .55)); }

/* Laminated sleeve: inset bezel highlight plus a specular hotspot that follows the pointer (--gx, --gy). */
.deck__gloss {
  position: absolute;
  inset: 0;
  border-radius: 1.5%;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .35), inset 1px 0 0 rgb(255 255 255 / .12), inset 0 -2px 0 rgb(0 0 0 / .35);
  background:
    radial-gradient(circle at var(--gx) var(--gy), rgb(255 255 255 / .28), rgb(255 255 255 / .06) 22%, transparent 48%),
    linear-gradient(115deg, transparent 35%, rgb(255 255 255 / .08) 45%, transparent 55%);
  mix-blend-mode: screen;
}
:root[data-contrast="high"] .deck__gloss { display: none; }

.sleeve__bg { fill: var(--surface-2); }
.sleeve .ring { stroke-width: 26; }
.sleeve .ring--1 { stroke: var(--accent); }
.sleeve .ring--2 { stroke: var(--accent-3); opacity: .9; }
.sleeve .ring--3 { stroke: var(--accent-2); opacity: .85; }
.sleeve__wear { fill: none; stroke: rgb(255 255 255 / .06); stroke-width: 10; }
.sleeve__kicker { font-family: var(--font-mono); font-size: 13px; font-weight: 600; letter-spacing: .22em; fill: var(--text); }
.sleeve__kicker--right { fill: var(--text-muted); letter-spacing: .12em; }
.sleeve__the { font-family: var(--font-display); font-weight: 700; font-size: 64px; letter-spacing: -2px; fill: var(--text); }
.sleeve__set { font-family: var(--font-display); font-weight: 700; font-size: 168px; letter-spacing: -10px; fill: var(--text); }
.sleeve__small { font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em; fill: var(--text-muted); }
.sleeve__small--b { fill: var(--accent); }
.sleeve__sticker { fill: var(--surface-2); stroke: rgb(255 255 255 / .08); }
.sleeve__edge { stroke: rgb(255 255 255 / .12); }

.deck__surface {
  position: absolute;
  inset: .5%;
  border-radius: 50%;
  display: none;
}
.deck__disc {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  filter: drop-shadow(0 16px 28px rgb(0 0 0 / .6));
  transform: rotate(var(--spin, 0deg));
}
/* Houdini: grooves and the specular sheen painted by the grooves worklet on a layer that does not spin,
   so the sheen stays put like real light while the label turns. SVG grooves remain as the fallback. */
@supports (background: paint(grooves)) {
  .deck__surface {
    display: block;
    --sheen-angle: 30;
    --groove-color: var(--vinyl-groove);
    --groove-gap: 3;
    --sheen-color: rgb(255 255 255 / .5);
    background: paint(grooves), var(--vinyl);
    box-shadow: 0 16px 34px rgb(0 0 0 / .6), inset 0 0 0 1.5px rgb(255 255 255 / .08);
  }
  .vinyl__base, .vinyl .vinyl__grooves { display: none; }
  .deck__sheen { display: none; }
}
.vinyl__base { fill: var(--vinyl); }
.vinyl__edge { fill: none; stroke: rgb(255 255 255 / .10); stroke-width: 1.5; }
.vinyl .groove { stroke: var(--vinyl-groove); stroke-width: .9; opacity: .9; }
.vinyl .groove--gap { stroke: #000; stroke-width: 2.2; opacity: .6; }
.vinyl__runout { fill: none; stroke: var(--vinyl-groove); stroke-width: 6; opacity: .5; }
.label__bg { fill: var(--accent); }
.label__ring { fill: none; stroke: var(--on-accent); stroke-width: 1; opacity: .35; }
.label__name { font-family: var(--font-mono); font-weight: 600; font-size: 11px; letter-spacing: .2em; fill: var(--on-accent); }
.label__title { font-family: var(--font-display); font-weight: 700; font-size: 25px; letter-spacing: -.5px; fill: var(--on-accent); }
.label__side { font-family: var(--font-body); font-weight: 600; font-size: 12px; fill: var(--on-accent); }
.label__rpm { font-family: var(--font-mono); font-size: 6.5px; letter-spacing: .1em; fill: var(--on-accent); opacity: .75; }
.label__hole { fill: var(--bg-deep, #000); stroke: rgb(0 0 0 / .4); }

.deck__sheen {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(from 20deg,
    transparent 0deg, rgb(255 255 255 / .16) 28deg, transparent 62deg,
    transparent 180deg, rgb(255 255 255 / .11) 208deg, transparent 242deg, transparent 360deg);
  -webkit-mask: radial-gradient(circle, transparent 0 20%, #000 21%, #000 69%, transparent 70%);
  mask: radial-gradient(circle, transparent 0 20%, #000 21%, #000 69%, transparent 70%);
  transform: rotate(calc(var(--tx) * 4 - var(--ty) * 2));
  mix-blend-mode: screen;
}
:root[data-contrast="high"] .deck__sheen { display: none; }

.deck__arm {
  position: absolute;
  width: 30%;
  height: 80%;
  right: -7.5%;
  top: -6%;
  transform-origin: 71.7% 10.6%;
  transform: translateZ(30px) rotate(calc(-30deg * (1 - var(--intro-arm))));
  opacity: clamp(0, calc(var(--intro-b) * 1.6 - .2), 1);
  filter: drop-shadow(-6px 12px 10px rgb(0 0 0 / .55));
}
.tonearm__base { fill: var(--surface-2); stroke: var(--line); stroke-width: 2; }
.tonearm__pivot { fill: var(--text-muted); }
.tonearm__weight { fill: var(--line); }
.tonearm__rod { stroke: var(--text-muted); stroke-width: 6; stroke-linecap: round; }
.tonearm__head { fill: var(--text); stroke: var(--line); stroke-width: 1; }
.tonearm__stylus { fill: var(--accent); }

.deck__shadow {
  position: absolute;
  left: 18%;
  right: 12%;
  bottom: -2%;
  height: 10%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(0 0 0 / .55), transparent);
  filter: blur(6px);
  z-index: -1;
}

/* ---------- Motion (only when motion is OK) ---------- */
@keyframes jr-intro-cue { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

:root[data-motion="full"]:not([data-calm="on"]) .intro--live .deck__arm {
  transition: transform 900ms var(--spring, var(--ease-spring)), opacity var(--dur) var(--ease-out);
}
/* When the spin button drops the needle, the arm swings on regardless of scroll. */
.intro.is-needle-down .deck__scene {
  --intro-a: 1;
  --intro-b: 1;
  --intro-arm: 1;
  transition: --intro-a 700ms var(--ease-out), --intro-b 900ms var(--ease-out) 150ms, --intro-arm 600ms var(--ease-out) 700ms;
}

/* ---------- Scroll-driven (CSS) path ----------
   Registered so the values interpolate. Ranges end in the readable final state (all 1). */
@property --intro-a { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --intro-b { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --intro-arm { syntax: "<number>"; inherits: true; initial-value: 1; }

@keyframes jr-intro-reveal {
  0%   { --intro-a: 0; --intro-b: 0; --intro-arm: 0; }
  42%  { --intro-a: 1; --intro-b: 0; --intro-arm: 0; }
  62%  { --intro-arm: 0; }
  80%  { --intro-a: 1; --intro-b: 1; }
  88%, 100% { --intro-a: 1; --intro-b: 1; --intro-arm: 1; }
}
@supports (animation-timeline: view()) {
  /* Narrow or short screens: the deck sticks under the nav and the first 45vh of page scroll drives it,
     while the name panel slides up over it like a sleeve. */
  :root[data-motion="full"]:not([data-calm="on"]) .intro {
    animation: jr-intro-reveal linear both;
    animation-timeline: scroll(root block);
    animation-range: 0 32vh;
  }
  /* Wide screens: the stage is sticky, so the section's own scroll drives it. */
  @media (min-width: 60em) and (min-height: 34em) {
    :root[data-motion="full"]:not([data-calm="on"]) .intro {
      animation: jr-intro-reveal linear both;
      animation-timeline: view();
      animation-range: contain 0% contain 100%;
    }
  }
}
:root[data-motion="full"]:not([data-calm="on"]) .intro--live .deck__tilt {
  will-change: transform;
}
:root[data-motion="full"]:not([data-calm="on"]) .intro__cue-icon {
  animation: jr-intro-cue 1.6s var(--ease-out) 1s 3;
}

/* ---------- Layout ---------- */
@media (max-width: 59.99em) {
  .intro__stage { padding-top: var(--space-7); padding-bottom: calc(var(--space-8) + var(--space-5)); justify-content: flex-start; }
  .intro__inner { gap: var(--space-4); }
  .intro__deck { order: -1; max-width: 32rem; }
  .intro__glow { inset: 0 0 50% 0; }
}
/* Narrow, motion OK: the record stays put while the panel scrolls over it. */
@media not ((min-width: 60em) and (min-height: 34em)) {
  :root[data-motion="full"]:not([data-calm="on"]) .intro__deck {
    position: sticky;
    top: 4.5rem;
    z-index: 0;
  }
  :root[data-motion="full"]:not([data-calm="on"]) .intro__copy {
    z-index: 1;
    margin-top: 20vh;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
  }
}

@media (min-width: 60em) {
  .intro__stage { padding-inline: var(--space-6); }
  .intro__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: var(--space-7); }
  .intro__deck { max-width: none; }
}

@media (min-width: 60em) and (max-height: 46em) {
  .intro__title { font-size: clamp(3rem, 1rem + 5.5vw, 5.5rem); }
  .intro__role { margin-top: var(--space-4); }
  .intro__stage { padding-block: var(--space-7); }
}

/* Calm and reduced: no 3D tilt flourish beyond the resting angle. */
:root[data-calm="on"] .deck__tilt { transform: rotateX(6deg) rotateY(-8deg); }

/* ---------- Custom cursor (js/cursor.js). Native cursor is never hidden. ---------- */
.jr-cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur) var(--ease-out);
  will-change: transform;
}
.jr-cursor.is-visible { opacity: 1; }
.jr-cursor__ring {
  position: absolute;
  left: -18px;
  top: -18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--accent) 80%, transparent);
  background:
    radial-gradient(circle, var(--accent) 0 3px, transparent 3.5px),
    repeating-radial-gradient(circle, transparent 0 5px, color-mix(in srgb, var(--text) 10%, transparent) 5px 6px);
  transform: scale(.6);
  transition: transform var(--dur) var(--ease-spring), border-color var(--dur), background-color var(--dur);
}
.jr-cursor.is-hover .jr-cursor__ring {
  transform: scale(1.5);
  border-color: var(--accent-2);
  background-color: color-mix(in srgb, var(--accent-2) 10%, transparent);
}
.jr-cursor.is-down .jr-cursor__ring { transform: scale(1.1); }
.jr-cursor__label {
  position: absolute;
  left: 32px;
  top: 14px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-2);
  color: var(--on-accent);
  font: 600 .75rem/1.4 var(--font-mono);
  letter-spacing: .04em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}
.jr-cursor.has-label .jr-cursor__label { opacity: 1; transform: none; }

@media (max-width: 24em) {
  .intro__kicker { letter-spacing: .04em; gap: var(--space-2); }
  .intro__kicker-title { white-space: nowrap; }
  .intro__kicker-title::before { display: none; }
  .intro__copy { padding: var(--space-5) var(--space-4); }
}

/* Keep "Russell" on one line at large text sizes and in the wider readable font:
   the name never grows wider than its panel. */
.intro__copy { container-type: inline-size; }
@supports (font-size: 1cqi) {
  .intro__title { font-size: min(clamp(3.25rem, 1.6rem + 7vw, 7.25rem), 26cqi); }
  :root[data-font="readable"] .intro__title { font-size: min(clamp(3.25rem, 1.6rem + 7vw, 7.25rem), 22cqi); }
}

/* Tells people sound is coming before they press play. */
.intro__sound-note {
  margin: var(--space-3) 0 0;
  font-size: .875rem;
  color: var(--text-muted);
}
.intro__controls:not(:has(button:not([hidden]))) + .intro__sound-note { display: none; }
