/* ============================================================
   AUDIOVIZ — Design Tokens
   Sterile neutral light / cool slate dark
   ============================================================ */

:root,
[data-theme="light"] {
  --bg: #f2f2f2;
  --bg-card: #ffffff;
  --bg-alt: #f7f7f7;
  --line: #e3e3e3;
  --line-bright: #c4c4c4;
  --ink: #1a1a1a;
  --ink-dim: #5a5a5a;
  --ink-faint: #a0a0a0;
  --accent: #1a1a1a;

  --hero-bg: #1a1a1a;
  --hero-bg-2: #0c0c0c;
  --hero-ink: #f2f2f2;
  --hero-ink-dim: #a0a0a0;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 32px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] {
  --bg: #0f1215;
  --bg-card: #181b1f;
  --bg-alt: #1c1f24;
  --line: #2a2e34;
  --line-bright: #404550;
  --ink: #ebebec;
  --ink-dim: #8a8a8c;
  --ink-faint: #4a4a4c;
  --accent: #ebebec;

  --hero-bg: #181b1f;
  --hero-bg-2: #0f1215;
  --hero-ink: #ebebec;
  --hero-ink-dim: #8a8a8c;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.15);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.25), 0 12px 32px rgba(0, 0, 0, 0.35);
}

:root {
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --radius-pill: 999px;

  --max-width: 1080px;
  --nav-height: 56px;
  --gutter: 24px;
  --gap: 18px;

  --card-radius: 14px;
  --card-pad: 22px;

  --font: 'Century Gothic', CenturyGothic, AppleGothic, 'Avenir Next', 'URW Gothic', 'Nunito Sans', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', 'Consolas', monospace;

  /* ── Motion + dopamine layer (shared by Lab games) ─────────────── */
  /* Spring ease w/ slight overshoot — snappy and tactile on click. */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Halo color matches each theme's existing glow used by .lab-pill — light
   theme glows dark-violet, dark theme glows cool-blue. */
[data-theme="light"] {
  --glow-rgb: 20, 20, 50;
  --glow-soft:   0 0 6px rgba(20, 20, 50, 0.30),
                  0 0 18px rgba(20, 20, 50, 0.14);
  --glow-strong: 0 0 8px rgba(20, 20, 50, 0.55),
                  0 0 24px rgba(20, 20, 50, 0.30),
                  0 0 56px rgba(20, 20, 50, 0.08);
}
[data-theme="dark"] {
  --glow-rgb: 210, 225, 255;
  --glow-soft:   0 0 6px rgba(210, 225, 255, 0.40),
                  0 0 18px rgba(190, 210, 255, 0.16);
  --glow-strong: 0 0 8px rgba(210, 225, 255, 0.65),
                  0 0 24px rgba(190, 210, 255, 0.32),
                  0 0 56px rgba(170, 195, 255, 0.10);
}
/* Default — light variants. Resolves before [data-theme="dark"] applies. */
:root {
  --glow-rgb: 20, 20, 50;
  --glow-soft:   0 0 6px rgba(20, 20, 50, 0.30),
                  0 0 18px rgba(20, 20, 50, 0.14);
  --glow-strong: 0 0 8px rgba(20, 20, 50, 0.55),
                  0 0 24px rgba(20, 20, 50, 0.30),
                  0 0 56px rgba(20, 20, 50, 0.08);
}

/* Selected-state halo — gentle breathing so the eye doesn't fixate. */
@keyframes pulse-glow {
  0%, 100% { box-shadow: var(--glow-soft); }
  50%      { box-shadow: var(--glow-strong); }
}

/* Press feedback — short scale dip then settle. JS adds .is-pressing for
   ~140ms on pointerdown. */
@keyframes blip-scale {
  0%   { transform: scale(1); }
  35%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}
.is-pressing { animation: blip-scale 140ms var(--ease-spring); }

/* Rotating halo around an element. Add to the Play button via JS while
   audio plays. The conic-gradient mask creates the spinning arc. */
@keyframes ring-spin { to { transform: rotate(360deg); } }
.is-spinning-ring {
  position: relative;
}
.is-spinning-ring::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(
    from 0deg,
    rgba(var(--glow-rgb), 0.85),
    rgba(var(--glow-rgb), 0.0) 40%,
    rgba(var(--glow-rgb), 0.0) 60%,
    rgba(var(--glow-rgb), 0.85)
  );
  mask: radial-gradient(circle, transparent calc(100% - 4px), black calc(100% - 4px));
  -webkit-mask: radial-gradient(circle, transparent calc(100% - 4px), black calc(100% - 4px));
  animation: ring-spin 2.4s linear infinite;
}
