/* =====================================================================
 * Audible Wallpaper · /play
 * Full-bleed audio-reactive WebGL canvas with minimal floating chrome.
 * The wall is the page. Controls fade out on idle and lift back on
 * any pointer movement. Color/typography stay close to the splash so
 * /play and / read as the same project.
 * ===================================================================== */

* {
  box-sizing: border-box;
}

:root {
  --ink: rgba(255, 255, 255, .92);
  --ink-soft: rgba(255, 255, 255, .68);
  --ink-mute: rgba(255, 255, 255, .42);
  --line: rgba(255, 255, 255, .14);
  --gold: #d9b46f;
  --bg: #0a0d1a;
  --chrome-fade: 700ms cubic-bezier(.22, .61, .36, 1);
}

html,
body {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

body {
  position: fixed;
  inset: 0;
}

#wallpaper {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  /* The wall responds to touch; the cursor confirms it's a surface. */
  cursor: crosshair;
}

/* While locked the gate covers the canvas; we don't want the canvas
   to consume pointer events meant for the gate. */
.is-locked #wallpaper {
  pointer-events: none;
}

/* =====================================================================
 * Autoplay-intent (?autoplay=1) overrides
 *
 * When the visitor came from a homepage tap-through, the gate splash
 * is more friction than welcome — they've already engaged. We skip
 * the splash entirely, light up the wallpaper and chrome immediately,
 * and let play.js attempt autoplay underneath. If the browser blocks
 * audio.play(), the small audio-hint at the bottom invites a tap.
 * ===================================================================== */

html.autoplay-intent .gate {
  display: none;
}

html.autoplay-intent body.is-locked .chrome {
  opacity: 1 !important;
  pointer-events: auto !important;
}

html.autoplay-intent body.is-locked #wallpaper {
  pointer-events: auto;
}

/* =====================================================================
 * Tap-to-begin gate
 * ===================================================================== */

/* The gate is the very first frame of the experience. We open on
   pure paper-white with the black logo so the entry point reads as
   simple, calm, almost typographic — and only goes "vibey" (the
   liquid wallpaper, dark transport, gold accents) after the user
   taps in. The homepage already presents the brand on the dark
   theme; /play opens on the inverse to feel like a different room. */
.gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  grid-template-rows: 1fr auto auto 1fr;
  align-items: center;
  justify-items: center;
  gap: 0;
  padding: clamp(40px, 8vh, 96px) 24px;
  background: #ffffff;
  color: #0a0d1a;
  cursor: pointer;
  transition: opacity 900ms ease, transform 1100ms cubic-bezier(.22, .61, .36, 1), filter 900ms ease;
  outline: none;
}

.gate.is-gone {
  opacity: 0;
  transform: scale(1.04);
  filter: blur(6px);
  pointer-events: none;
}

.gate-mark {
  grid-row: 2;
  width: min(56vw, 380px);
  max-width: 92vw;
  animation: gateBreath 6.4s ease-in-out infinite;
}

.gate-mark img {
  display: block;
  width: 100%;
  height: auto;
}

@keyframes gateBreath {
  0%, 100% {
    opacity: .96;
    transform: translateY(0) scale(1);
  }
  50% {
    opacity: .82;
    transform: translateY(-2px) scale(1.005);
  }
}

.gate-meta {
  grid-row: 3;
  text-align: center;
  margin-top: clamp(28px, 5vh, 48px);
}

.gate-album {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .42em;
  text-transform: uppercase;
  /* On the white open-frame we shift the gold to a softer warm
     near-black so the album label reads as a typographic mark, not
     a neon accent. The gold returns once the wallpaper takes over. */
  color: #1f2233;
  opacity: .85;
}

.gate-prompt {
  margin: 16px 0 0;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 300;
  letter-spacing: -.02em;
  color: #0a0d1a;
}

.gate-prompt span {
  font-weight: 600;
  position: relative;
  display: inline-block;
  animation: gatePulse 2.4s ease-in-out infinite;
}

@keyframes gatePulse {
  0%, 100% { opacity: 1; transform: translateY(0); }
  50% { opacity: .6; transform: translateY(2px); }
}

.gate-hint {
  margin: clamp(20px, 3vh, 30px) 0 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(10, 13, 26, .55);
}

@media (prefers-reduced-motion: reduce) {
  .gate-mark,
  .gate-prompt span {
    animation: none;
  }
}

/* =====================================================================
 * Floating chrome (top + bottom)
 * Fades out after a few seconds of inactivity, fades back on movement.
 * ===================================================================== */

.chrome {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  pointer-events: none;
  opacity: 0;
  transform: translateY(0);
  transition: opacity var(--chrome-fade), transform var(--chrome-fade);
}

.is-locked .chrome {
  opacity: 0 !important;
  pointer-events: none !important;
}

body:not(.is-locked) .chrome {
  opacity: 1;
  pointer-events: auto;
}

body.chrome-hidden .chrome {
  opacity: 0;
  pointer-events: none;
}

body.chrome-hidden .chrome-top {
  transform: translateY(-8px);
}

body.chrome-hidden .chrome-bottom {
  transform: translateY(10px);
}

/* Manual stash. The user clicked the little X to get the chrome out
   of the way while exploring the wallpaper. Behaves like chrome-hidden
   but is sticky — pointer movement won't bring it back; only tapping
   or hovering the bottom-center peek handle will. */
body.chrome-stashed .chrome {
  opacity: 0;
  pointer-events: none;
}

body.chrome-stashed .chrome-top {
  transform: translateY(-8px);
}

body.chrome-stashed .chrome-bottom {
  transform: translateY(10px);
}

.chrome-top {
  top: 0;
  padding: env(safe-area-inset-top) clamp(14px, 3vw, 28px) 0;
  padding-top: max(env(safe-area-inset-top), 14px);
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.chrome-bottom {
  bottom: 0;
  /* Bottom padding scales with viewport height so the panel lifts
     off the bottom edge on laptops / desktops / TV displays without
     leaving wasted space on phones (where chrome already snugs
     against the home indicator via safe-area-inset-bottom). At
     ~1000px-tall screens this gives ~50px of breathing room below
     the merch mug; on short phone viewports it stays at the
     ~18px floor. */
  padding: 14px clamp(14px, 3vw, 28px) calc(env(safe-area-inset-bottom) + clamp(18px, 4.5vh, 56px));
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 100%);
}

/* Side action groups in chrome-top. Two pairs (exit+fullscreen on
   the left, minimize+stash on the right) framing the centered
   brand mark, giving the header a balanced 2 / brand / 2 layout.
   Living in chrome-top keeps chrome-bottom's panel clean so the
   streaming/merch row can close the column at the bottom
   safe-area edge with the merch mug as the last visible element. */
.chrome-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chrome-side-left,
.chrome-side-right { margin-top: 8px; }

/* Inside a chrome-side group, the exit button no longer needs its
   own top offset — the group provides it, and align-items: center
   takes care of the height mismatch between the 38px exit and the
   30px chrome-action buttons so their icon centers line up. */
.chrome-side .exit {
  margin-top: 0;
}

.chrome-action {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink-mute);
  cursor: pointer;
  padding: 0;
  transition: color 220ms ease, background 220ms ease,
              transform 220ms ease, border-color 220ms ease;
  -webkit-tap-highlight-color: transparent;
}

.chrome-action svg {
  width: 14px;
  height: 14px;
}

.chrome-action:hover,
.chrome-action:focus-visible {
  color: var(--ink);
  background: rgba(0, 0, 0, .42);
  border-color: rgba(255, 255, 255, .28);
  transform: scale(1.06);
  outline: none;
}

/* Minimize icon swaps minus → plus when toggled, indicating the
   inverse action ("expand"). */
.chrome-minimize .ico-min-vbar { display: none; }
.chrome-minimize[aria-pressed="true"] .ico-min-vbar { display: inline; }
.chrome-minimize[aria-pressed="true"] {
  color: var(--gold);
  border-color: rgba(217, 180, 111, .55);
}

/* Fullscreen icon swaps "expand corners" ↔ "compress corners"
   based on the actual fullscreen state. JS sets aria-pressed to
   match document.fullscreenElement. */
.chrome-fullscreen .ico-fs-exit { display: none; }
.chrome-fullscreen[aria-pressed="true"] .ico-fs-enter { display: none; }
.chrome-fullscreen[aria-pressed="true"] .ico-fs-exit { display: inline; }
.chrome-fullscreen[aria-pressed="true"] {
  color: var(--gold);
  border-color: rgba(217, 180, 111, .55);
}

/* Minimized state: keep only the vibe controls (color row, mood,
   depth) plus the action trio at top-right and the exit X at
   top-left. Hide the brand mark (it would compete with the focused
   vibe-controls aesthetic), the track strip, transport, scrub bar,
   and the streaming services + mug row. */
body.chrome-minimized .track-strip,
body.chrome-minimized .transport,
body.chrome-minimized .scrub,
body.chrome-minimized .services {
  display: none;
}

/* Exit button */
.exit {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-top: 8px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(0, 0, 0, .25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  transition: color 240ms ease, background 240ms ease, transform 240ms ease;
}

.exit svg {
  width: 18px;
  height: 18px;
}

.exit:hover,
.exit:focus-visible {
  color: var(--ink);
  background: rgba(0, 0, 0, .42);
  transform: scale(1.04);
  outline: none;
}

/* Brand mark, sized as the hero element of chrome-bottom. Sits
   directly above the track selector pills as the visual anchor
   for the whole player panel. The transparent-white logo art
   carries the high-contrast silhouette; the dual drop-shadow
   keeps it legible against the rare lighter palette stops (peach,
   pink, cream, mint) without needing a backplate.

   Centered via align-self inside chrome-bottom's column flex.
   Negative margin-bottom snugs the logo close to the track strip
   so the two read as a single hero unit (logo + tracks) rather
   than two stacked rows. */
.chrome-brand {
  align-self: center;
  display: inline-block;
  line-height: 0;
  /* No negative margin: let the standard chrome-bottom gap (14px)
     give the logo a comfortable beat of space above the track
     pills, treating it as the hero element of the panel rather
     than a sticker fused to the chip row. */
  -webkit-tap-highlight-color: transparent;
  transition: transform 280ms cubic-bezier(.22, .61, .36, 1),
              filter 280ms ease;
}

.chrome-brand img {
  display: block;
  /* Hero-sized — meant to read as "Talk Amongst Yerselves"
     announcing the album, not a fine-print credit. Generous
     vw component so it fills the available horizontal space on
     wide screens (TV / Sphere / 4K monitors) without dwarfing
     the controls beneath it. Floor and ceiling keep it sensible
     on tiny phones and ultrawide displays. */
  height: clamp(160px, 26vw, 300px);
  width: auto;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, .72))
          drop-shadow(0 1px 4px rgba(0, 0, 0, .58));
  opacity: .96;
  transition: opacity 280ms ease, filter 280ms ease;
}

.chrome-brand:hover,
.chrome-brand:focus-visible {
  outline: none;
  transform: scale(1.03);
}

.chrome-brand:hover img,
.chrome-brand:focus-visible img {
  opacity: 1;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, .82))
          drop-shadow(0 0 32px rgba(217, 180, 111, .32));
}

@media (max-width: 540px) {
  /* Phones: keep the logo proudly large but small enough that the
     full chrome-bottom column (logo + tracks + transport + scrub +
     palette + dials + services + mug) clears the chrome-top action
     buttons sitting in the opposite corners. The previous 168px
     stack pushed the logo's "Talk Amongst" rim up behind the X and
     fullscreen buttons on shorter handsets. */
  .chrome-brand img { height: 132px; }
}

@media (max-width: 380px) {
  .chrome-brand img { height: 116px; }
}

/* Short-viewport rescue: in-app browsers (Instagram, Facebook,
   LinkedIn, X/Twitter) eat 200-250px of vertical space with their
   own header + footer chrome, leaving the page with a viewport
   short enough that the chrome-bottom column overflows and clips
   the brand mark. When height drops below ~700px we tighten
   everything: smaller logo, smaller gap, smaller bottom padding —
   so the entire control panel still fits the visible area. */
@media (max-height: 720px) {
  .chrome-brand img { height: 96px; }
  .chrome-bottom    {
    gap: 10px;
    padding: 10px clamp(14px, 3vw, 28px) calc(env(safe-area-inset-bottom) + 12px);
  }
}

@media (max-height: 600px) {
  .chrome-brand img { height: 76px; }
  .chrome-bottom    {
    gap: 8px;
    padding: 8px clamp(14px, 3vw, 28px) calc(env(safe-area-inset-bottom) + 10px);
  }
}

/* In minimized mode the chrome collapses to just the vibe
   controls (color, mood, depth). The hero brand mark would
   compete for attention there, so it joins the track strip /
   transport / scrub / services in being hidden. */
body.chrome-minimized .chrome-brand {
  display: none;
}

/* Now playing label */
.now-playing {
  text-align: right;
  margin-top: 10px;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .5);
}

.np-track {
  margin: 0;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--ink);
}

.np-album {
  margin: 2px 0 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* Track strip */
.track-strip {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.track-chip {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink-soft);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;          /* slightly tighter so longer titles fit */
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;            /* keep each title on one line */
  transition: color 220ms ease, background 220ms ease, border-color 220ms ease;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 540px) {
  .track-chip {
    font-size: 10px;
    letter-spacing: .14em;
    padding: 7px 12px;
  }
}

.track-chip:hover,
.track-chip:focus-visible {
  color: var(--ink);
  border-color: rgba(255, 255, 255, .3);
  outline: none;
}

.track-chip.is-active {
  color: #1a1410;
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 4px 22px rgba(217, 180, 111, .25);
}

/* Transport */
.transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.ctl {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ink);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 220ms ease, transform 220ms ease, border-color 220ms ease;
  -webkit-tap-highlight-color: transparent;
}

.ctl svg {
  width: 18px;
  height: 18px;
}

.ctl-play {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .28);
}

.ctl-play svg {
  width: 22px;
  height: 22px;
}

.ctl:hover,
.ctl:focus-visible {
  transform: scale(1.05);
  background: rgba(255, 255, 255, .15);
  border-color: rgba(255, 255, 255, .3);
  outline: none;
}

.ctl-play:hover {
  background: rgba(255, 255, 255, .2);
}

.ctl-play .ico-pause { display: none; }
.ctl-play[data-state="playing"] .ico-play { display: none; }
.ctl-play[data-state="playing"] .ico-pause { display: block; }

/* Scrub bar. The visible runner is 3px tall but the click/touch
   target is much taller (via padding) so it's easy to grab on
   phones. The track is a positioned wrapper so the fill can grow
   inside it without affecting the hit area. */
.scrub {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 0 4px;
}

.scrub-track {
  flex: 1;
  position: relative;
  height: 22px;                        /* generous hit area */
  padding: 10px 0;                     /* visible track centered inside */
  cursor: pointer;
  touch-action: none;                  /* prevent page scroll while scrubbing */
  -webkit-tap-highlight-color: transparent;
}

/* Visible track */
.scrub-track::before {
  content: "";
  display: block;
  height: 2px;
  background: rgba(255, 255, 255, .14);
  border-radius: 999px;
  transition: height 220ms ease, background-color 220ms ease;
}

.scrub-track:hover::before,
.scrub-track:focus-visible::before,
.scrub-track.is-scrubbing::before {
  height: 4px;
  background: rgba(255, 255, 255, .22);
}

.scrub-track:focus-visible {
  outline: none;
}

/* Fill is absolutely positioned so it sits on top of the visible
   track regardless of the surrounding padding hit area. */
.scrub-fill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 2px;
  width: 0%;
  background: linear-gradient(to right, var(--gold), rgba(255, 255, 255, .8));
  border-radius: 999px;
  transition: width 160ms linear, height 220ms ease;
  pointer-events: none;
}

.scrub-track:hover .scrub-fill,
.scrub-track:focus-visible .scrub-fill,
.scrub-track.is-scrubbing .scrub-fill {
  height: 4px;
  transition: width 0ms linear, height 220ms ease;  /* snap during drag */
}


/* Color row: the palette dots plus the auto-cycle button on the
   right. Centered as a unit so the auto button reads as part of the
   same control even though it does something distinct. */
.palette-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* Palette picker — a row of color dots, each a gradient preview of
   the palette's mid → peak colors. Tap to select. The Mood and Depth
   sliders below operate within whichever palette is active. */
.palette-picker {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

/* Auto-cycle button. When pressed, the wallpaper drifts slowly
   through palettes — fade time and direction lightly modulated by
   the song's energy envelope so it feels matched to the music. */
.palette-auto {
  appearance: none;
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(0, 0, 0, .25);
  color: rgba(255, 255, 255, .55);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: color 220ms ease, background-color 220ms ease,
              border-color 220ms ease, transform 220ms ease,
              box-shadow 220ms ease;
  -webkit-tap-highlight-color: transparent;
}

.palette-auto svg {
  width: 16px;
  height: 16px;
}

.palette-auto:hover,
.palette-auto:focus-visible {
  color: var(--ink);
  border-color: rgba(255, 255, 255, .42);
  outline: none;
  transform: scale(1.06);
}

/* Active state — gentle gold ring + slow rotation so it reads as
   "auto-cycle is running". */
.palette-auto[aria-pressed="true"] {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(217, 180, 111, .14);
  box-shadow: 0 0 0 0 rgba(217, 180, 111, 0);
  animation: paletteAutoSpin 12s linear infinite;
}

@keyframes paletteAutoSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .palette-auto[aria-pressed="true"] { animation: none; }
}

.palette-dot {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, .18);
  width: 26px;
  height: 26px;
  border-radius: 999px;
  cursor: pointer;
  padding: 0;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
  -webkit-tap-highlight-color: transparent;
}

.palette-dot:hover,
.palette-dot:focus-visible {
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, .55);
  outline: none;
}

.palette-dot.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, .55), 0 0 0 4px rgba(255, 255, 255, .85), 0 4px 14px rgba(0, 0, 0, .45);
  transform: scale(1.06);
}

@media (max-width: 540px) {
  .palette-dot {
    width: 22px;
    height: 22px;
  }
}

/* Dials */
.dials {
  display: flex;
  gap: clamp(14px, 3vw, 30px);
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.dial {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dial-name {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-mute);
  min-width: 38px;
  text-align: right;
}

.dial input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: clamp(100px, 22vw, 180px);
  height: 18px;
  background: transparent;
  cursor: pointer;
}

.dial input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: rgba(255, 255, 255, .14);
  border-radius: 999px;
}

.dial input[type="range"]::-moz-range-track {
  height: 2px;
  background: rgba(255, 255, 255, .14);
  border-radius: 999px;
  border: 0;
}

.dial input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -6px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 0 rgba(217, 180, 111, 0);
  border: 0;
  cursor: grab;
  transition: box-shadow 220ms ease, transform 220ms ease;
}

.dial input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.12);
  box-shadow: 0 0 0 8px rgba(217, 180, 111, .12);
}

.dial input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--gold);
  border: 0;
  cursor: grab;
}

/* =====================================================================
 * Listen-everywhere row + floating Merch mug
 *
 * The streaming buttons are pill-shaped tiles with a soft dark fill,
 * sized so wordmark logos are readable on desktop and they wrap
 * naturally on narrower viewports (5 → 4 → 3 → 2 columns) without
 * orphaning. Each button reuses the existing brand SVG from /assets
 * but renders it monochrome at rest; hover restores the brand color.
 *
 * Merch is intentionally NOT a tile — the cut-out pink mug from
 * /assets/merch-mug-floating.png floats next to the streaming row,
 * giving the player a personality object that doesn't need a label.
 * ===================================================================== */

.services {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 4px;
}

.services-stream {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

/* Each streaming button. Fixed width so the row breaks cleanly into
   5 / 4 / 3 / 2 columns as the container narrows; flex-wrap +
   justify-content:center automatically centers any orphan row. */
.service-link {
  flex: 0 0 auto;
  width: 130px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .26);
  border: 1px solid rgba(255, 255, 255, .07);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background-color 220ms ease, border-color 220ms ease,
              transform 220ms ease, box-shadow 220ms ease;
  -webkit-tap-highlight-color: transparent;
}

.service-link img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 100px;
  object-fit: contain;
  /* Monochrome at rest. Each brand SVG is full-color; this filter
     recolors the visible pixels to a soft white. */
  filter: brightness(0) saturate(100%) invert(96%) sepia(2%) saturate(0%) hue-rotate(180deg) brightness(102%) contrast(85%);
  opacity: .82;
  transition: filter 280ms ease, opacity 220ms ease;
}

.service-link:hover,
.service-link:focus-visible {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .18);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  outline: none;
}

.service-link:hover img,
.service-link:focus-visible img {
  /* Drop the recolor filter so the original brand color reads. */
  filter: none;
  opacity: 1;
}

/* Wordmark text paired with an icon-only logo (SoundCloud). Sized
   to fit alongside the cloud icon inside the standard 130px tile. */
.service-link-text {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.005em;
  color: rgba(255, 255, 255, .82);
  transition: color 220ms ease;
  white-space: nowrap;
}

.service-link:hover .service-link-text,
.service-link:focus-visible .service-link-text {
  color: var(--ink);
}

.service-link--labeled img {
  height: 26px;        /* slightly smaller cloud so the text room exists */
  max-width: 30px;
}

/* SoundCloud brand orange on hover — the wordmark switches to the
   brand color so the pair feels intentional, not improvised. */
.service-link[href*="soundcloud.com"]:hover .service-link-text,
.service-link[href*="soundcloud.com"]:focus-visible .service-link-text {
  color: #ff5500;
}

/* Floating row sitting under the streaming grid: Instagram on the
   left, merch mug on the right. Both are cut-out / branded
   floating elements (no pill tile) so the row reads as personality
   rather than yet another services row. Mirror tilts give the pair
   a "tossed onto the page" cohesion. */
.services-floats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  width: 100%;
  margin-top: 4px;
}

/* Floating Instagram link. Uses just the Meta-spec camera glyph
   (gradient body, white lens stroke, white viewfinder dot) — the
   wordmark would be redundant since everyone recognizes the
   camera. Same floating treatment as the merch mug: drop shadow,
   gentle tilt, scales on hover. Tilts opposite the mug (+4°) so
   the pair mirrors visually. Sized to match the mug's optical
   weight, not its literal pixel height. */
.services-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 14px;
  transition: transform 280ms cubic-bezier(.22, .61, .36, 1),
              filter 280ms ease;
  -webkit-tap-highlight-color: transparent;
  transform: rotate(4deg);
  transform-origin: 50% 90%;
}

.services-social img {
  display: block;
  height: 52px;
  width: 52px;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .45));
  transition: filter 280ms ease;
}

.services-social:hover,
.services-social:focus-visible {
  outline: none;
  transform: rotate(8deg) translateY(-3px) scale(1.08);
}

.services-social:hover img,
.services-social:focus-visible img {
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .55))
          drop-shadow(0 0 22px rgba(214, 41, 118, .45));
}

/* Floating Merch mug. Cut-out pink mug photo (transparent
   background) sits alongside the streaming row, slightly tilted, no
   tile, no label. The mug IS the affordance. */
.services-mug {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 14px;
  transition: transform 280ms cubic-bezier(.22, .61, .36, 1),
              filter 280ms ease;
  -webkit-tap-highlight-color: transparent;
  transform: rotate(-4deg);
  transform-origin: 50% 90%;
}

.services-mug img {
  display: block;
  height: 64px;
  width: auto;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, .45));
  transition: filter 280ms ease;
}

.services-mug:hover,
.services-mug:focus-visible {
  outline: none;
  transform: rotate(-8deg) translateY(-3px) scale(1.08);
}

.services-mug:hover img,
.services-mug:focus-visible img {
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .55))
          drop-shadow(0 0 18px rgba(244, 156, 178, .35));
}

/* Breakpoints chosen to avoid orphan rows. 10 streaming items split
   cleanly into 5+5 (wide), 4+4+2 with a centered orphan (mid), and
   5+5 again (phone, 2 cols). 3-col would orphan a single item;
   skipped. */
@media (max-width: 720px) {
  .service-link {
    width: calc(25% - 5px);
    max-width: 160px;
  }
}

@media (max-width: 540px) {
  .service-link {
    width: calc(50% - 3px);
    max-width: 200px;
    height: 48px;
  }
  .service-link img {
    height: 32px;
    max-width: 110px;
  }
  .service-link--labeled img {
    height: 24px;
    max-width: 28px;
  }
  .services-mug img {
    height: 56px;
  }
  .services-social img {
    height: 46px;
    width: 46px;
  }
  .services-floats {
    gap: 20px;
  }
}

@media (max-width: 340px) {
  .service-link {
    width: 100%;
  }
}

/* =====================================================================
 * Chrome peek — visible only when the user has manually stashed the
 * chrome with the X button. A subtle handle at bottom-center, sized
 * for thumbs, that returns the controls on hover or tap.
 * ===================================================================== */

.chrome-peek {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  transform: translateX(-50%);
  z-index: 22;
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  /* Generous padding gives a thumb-sized hit target around the slim
     visual handle. */
  padding: 14px 28px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 600ms cubic-bezier(.22, .61, .36, 1);
  -webkit-tap-highlight-color: transparent;
}

.chrome-peek:focus-visible {
  outline: none;
}

.chrome-peek-bar {
  display: block;
  width: 56px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .26);
  box-shadow: 0 1px 8px rgba(0, 0, 0, .45);
  transition: width 280ms cubic-bezier(.22, .61, .36, 1),
              background-color 280ms ease,
              box-shadow 280ms ease;
}

body.chrome-stashed .chrome-peek {
  opacity: 1;
  pointer-events: auto;
}

/* When the visitor is idle (no pointer / key / touch for 6s) the
   peek bar also fades, even in stashed mode. Result: pure wallpaper
   on every screen, no UI at all. The first hint of activity
   re-runs scheduleChromeFade in JS, which strips chrome-hidden and
   the bar reappears as the entry point back to the controls. */
body.chrome-stashed.chrome-hidden .chrome-peek {
  opacity: 0;
  pointer-events: none;
}

.chrome-peek:hover .chrome-peek-bar,
.chrome-peek:focus-visible .chrome-peek-bar {
  width: 88px;
  background: rgba(217, 180, 111, .85);
  box-shadow: 0 2px 14px rgba(217, 180, 111, .35);
}

@media (prefers-reduced-motion: reduce) {
  .chrome-peek,
  .chrome-peek-bar {
    transition: none;
  }
}

/* =====================================================================
 * Audio hint — visible only when the page arrived with ?autoplay=1
 * but audio.play() was rejected by the browser. Sits above the chrome
 * controls, fades in softly, and clears the moment the user taps.
 * ===================================================================== */

.audio-hint {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 18;            /* above canvas (0), below chrome (20) */
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .26em;
  text-transform: uppercase;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .4);
  pointer-events: none;
  opacity: 0;
  transition: opacity 600ms cubic-bezier(.22, .61, .36, 1);
  animation: audioHintBreath 3.2s ease-in-out infinite;
}

.audio-hint.is-visible {
  opacity: 1;
}

.audio-hint-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(217, 180, 111, .65);
}

@keyframes audioHintBreath {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50%      { transform: translate(-50%, -50%) scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
  .audio-hint {
    animation: none;
    transition: none;
  }
}

@media (max-width: 540px) {
  .audio-hint {
    font-size: 10px;
    padding: 10px 18px;
    letter-spacing: .22em;
  }
}

/* =====================================================================
 * Responsive nudges for narrow phones
 * ===================================================================== */

@media (max-width: 540px) {
  .chrome-bottom { gap: 10px; padding-bottom: calc(env(safe-area-inset-bottom) + 14px); }
  /* Scrub stays visible on mobile — Andy wants quick access to a
     favorite section. The 22px hit area in .scrub-track gives plenty
     of room for thumbs. */
  .scrub { padding: 0 8px; }
  .scrub-time { font-size: 10px; }
  .now-playing { display: none; }
  .dials { gap: 18px; }
  .dial-name { min-width: 30px; font-size: 9px; }
  .dial input[type="range"] { width: clamp(80px, 30vw, 140px); }
  .ctl { width: 42px; height: 42px; }
  .ctl-play { width: 54px; height: 54px; }
}

/* =====================================================================
 * Reduced motion
 * ===================================================================== */

@media (prefers-reduced-motion: reduce) {
  .chrome,
  .chrome-top,
  .chrome-bottom,
  .gate,
  .ctl,
  .exit,
  .track-chip {
    transition: none !important;
  }
}
