/* ==========================================================================
   base — reset, type primitives, the scope
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

html {
  background: var(--pitch);
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100svh;
  background: var(--pitch);
  color: var(--cream);
  font-family: var(--f-body);
  font-size: var(--t-body);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, video, canvas, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
::selection { background: var(--signal); color: var(--pitch); }

/* ── type primitives ───────────────────────────────────────────────────── */

.meta {
  font-family: var(--f-mono);
  font-size: var(--t-meta);
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--cream-3);
}

.tnum { font-variant-numeric: tabular-nums; }

.sep { color: var(--signal); margin: 0 0.7em; }

.sp-line { display: block; overflow: hidden; }
.sp-w { display: inline-block; will-change: transform; }

.display {
  font-family: var(--f-display);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.02em;
}

/* ── the scope ─────────────────────────────────────────────────────────────
   A shared component: an oscilloscope in the hero, a spectrum in the room.
   Both are fed from one AnalyserNode, and both draw a real flat line when
   there is no signal rather than idling on a fake waveform. A studio that
   fakes its own meters is not one you would hire.
   ------------------------------------------------------------------------ */

.scope {
  position: relative;
  margin: 0;
  background: var(--pitch-2);
  border: 1px solid var(--line);
}

.scope canvas { width: 100%; height: 100%; display: block; }

.scope__cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.7rem;
  pointer-events: none;
  color: var(--cream-4);
}

.scope.is-live .scope__cap { color: var(--signal-2); }
.scope__hint { color: var(--cream-4); }

/* ── grain ─────────────────────────────────────────────────────────────── */

.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.5'/></svg>");
}

/* ── accessibility ─────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  top: 0.6rem; left: 0.6rem;
  z-index: 500;
  padding: 0.6rem 1rem;
  background: var(--signal);
  color: var(--pitch);
  font-family: var(--f-mono);
  font-size: var(--t-meta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transform: translateY(-180%);
  transition: transform 0.3s var(--attack);
}

.skip:focus-visible { transform: translateY(0); }
