/* technobitch.com — the scene is the interface.
 *
 * Layers, back to front: #stage (the WebGL canvas: full viewport, owns the
 * gestures) → .fallback (static art when WebGL is unavailable) → .scene
 * (fixed, pointer-events: none: floating type and a few glyph buttons that
 * opt back in) → .cursor → the About <dialog> in the top layer.
 *
 * No panels and no boxes: legibility over the scene comes from soft dark
 * halos and glows on the type itself.
 *
 * Geometry comes from layout.js as custom properties on :root: --cx/--cy
 * (mandala centre), --r (layout radius), --ring (seek-ring centreline),
 * --block-left/--block-top/--block-width (the title block), --heart (the
 * awaken ring), --block-bottom (portrait: the title block's distance from the
 * bottom edge). State attributes on <html>: data-layout = wide | portrait |
 * landscape, data-mode = dormant | charging | awakening | flow | paused, plus
 * data-orbit, data-about and data-hud="hidden" (auto-hide while playing).
 * charging = asked to play, waiting for the first sound.
 */

@font-face {
  font-family: "Unbounded";
  src: url("../fonts/unbounded-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Registered so palette changes cross-fade; unsupported browsers just snap. */
@property --accent { syntax: "<color>"; inherits: true; initial-value: #8b5cf6; }
@property --accent-2 { syntax: "<color>"; inherits: true; initial-value: #ec4899; }
@property --accent-3 { syntax: "<color>"; inherits: true; initial-value: #f5c76a; }

:root {
  --bg: #05020d;
  --bg-2: #140a2e;
  --violet: #8b5cf6;
  --violet-light: #c4b5fd;
  --gold: #f5c76a;
  --text: #f5f3ff;
  --muted: #a5a1c2;
  --focus: #e9e3ff;
  --love: #ff5fa8;

  /* Track palette, driven from JS (main.js → palette.js). */
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --accent-3: #f5c76a;
  --accent-rgb: 139 92 246;
  --on-accent: #12081f; /* ink on an accent gradient (the 404 page's button) */
  --glow: rgb(var(--accent-rgb) / 0.5);
  --glow-soft: rgb(var(--accent-rgb) / 0.2);

  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-ui: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease-out: cubic-bezier(.16, .84, .24, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  /* Legibility over the scene: a dark halo hugging the glyphs, never a box. */
  --halo: 0 0 1px rgb(5 2 13 / 0.75), 0 1px 12px rgb(5 2 13 / 0.9), 0 0 30px rgb(5 2 13 / 0.65);
  --glow-text: 0 0 18px rgb(var(--accent-rgb) / 0.55), 0 0 44px rgb(var(--accent-rgb) / 0.3);

  /* Geometry (layout.js overwrites these; the defaults keep a no-JS page sane). */
  --cx: 50vw;
  --cy: 44vh;
  --r: min(42vw, 30vh);
  --ring: calc(var(--r) * 0.885);
  --block-left: 16px;
  --block-top: calc(var(--cy) + var(--r));
  --block-bottom: 18px;
  --block-width: calc(100vw - 32px);
  --heart: 120px;

  transition: --accent 1.2s ease, --accent-2 1.2s ease, --accent-3 1.2s ease;
  color-scheme: dark;
}

@supports (color: color-mix(in srgb, red 50%, blue)) {
  :root {
    --glow: color-mix(in srgb, var(--accent) 50%, transparent);
    --glow-soft: color-mix(in srgb, var(--accent) 20%, transparent);
  }
}

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

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

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

body {
  background:
    radial-gradient(90% 70% at 50% 42%, rgb(52 24 108 / 0.35) 0%, rgb(20 10 46 / 0.45) 40%, rgb(5 2 13 / 0) 75%),
    var(--bg);
  color: var(--text);
  font: 400 15px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

h1, h2, h3, p, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg, canvas { display: block; }
a { color: inherit; }

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

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

/* Counters inside running text roll on change (ui.js setCount): an inline box ignores transform. */
.meta-plays .num,
.veil-visitors .num { display: inline-block; }

.safe-probe {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  visibility: hidden;
  pointer-events: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Per-letter display type (letters.js): words never break inside. */
.word { display: inline-block; white-space: nowrap; }
.ch { display: inline-block; }

/* ---------------------------------------------------------------- stage */

#stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
}

/* The custom cursor replaces the native one over the scene (beats the
   stage's inline cursor while it hovers the ring). */
.has-cursor #stage,
.has-cursor [data-cursor] { cursor: none !important; }

.fallback { display: none; }

.no-webgl .fallback {
  display: block;
  position: fixed;
  z-index: 0;
  left: var(--cx);
  top: var(--cy);
  width: calc(var(--r) * 2.24);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: url("../img/fallback.svg") center / contain no-repeat;
  pointer-events: none;
  animation: fallback-breathe 8s ease-in-out infinite;
}

.scene {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ---------------------------------------------------------------- top HUD */

.top {
  position: fixed;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  pointer-events: none;
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
}

.brand {
  flex: 0 1 auto;
  min-width: 0;
  pointer-events: auto;
  min-height: 44px;
  padding: 0 6px;
  font: 700 13px/1 var(--font-display);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
  text-shadow: var(--halo), 0 0 14px rgb(196 181 253 / 0.65);
  transition: opacity 1.2s var(--ease-out), filter 1.2s var(--ease-out), text-shadow 0.4s;
}

.brand:hover { text-shadow: var(--halo), 0 0 18px rgb(var(--accent-rgb) / 0.95); }

:is([data-mode="dormant"], [data-mode="charging"]) .brand {
  opacity: 0;
  filter: blur(8px);
  pointer-events: none;
}

[data-mode="awakening"] .brand { transition-delay: 1.5s; }

.top-actions {
  flex: none; /* the controls are never pushed off screen */
  display: flex;
  align-items: center;
  pointer-events: auto;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px 0 4px;
  font: 500 13px/1 var(--font-ui);
  letter-spacing: 0.04em;
  white-space: nowrap;
  color: var(--muted);
  text-shadow: var(--halo);
}

.live .num { color: var(--text); font-weight: 600; }

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px 2px rgb(74 222 128 / 0.65);
  animation: live 2.6s ease-in-out infinite;
}

.icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: rgb(245 243 255 / 0.8);
  transition: color 0.3s, filter 0.3s;
}

.icon svg {
  width: 20px;
  height: 20px;
  filter: drop-shadow(0 0 5px rgb(5 2 13 / 0.95));
}

.icon:hover {
  color: #fff;
  filter: drop-shadow(0 0 9px rgb(var(--accent-rgb) / 0.9));
}

.icon .when-on { display: none; }
.icon[aria-pressed="true"] .when-on { display: block; }
.icon[aria-pressed="true"] .when-off { display: none; }

/* ---------------------------------------------------------------- title block */

.now {
  --title-size: clamp(26px, 2.2vw + 8px, 42px);
  position: fixed;
  z-index: 2;
  left: var(--block-left);
  top: var(--block-top);
  width: var(--block-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  /* The hide / show nudge rides on `translate`: `transform` is the landscape
     centring, which must not animate when the layout flips (rotation). */
  transition: opacity 0.9s var(--ease-out), translate 0.9s var(--ease-out), visibility 0s linear 0.9s;
}

[data-mode="awakening"] .now,
[data-mode="flow"] .now,
[data-mode="paused"] .now {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

[data-mode="awakening"] .now { transition-delay: 1.9s, 1.9s, 0s; }

/* Phones and tablets in portrait: the block hangs from the bottom edge (layout.js). */
[data-layout="portrait"] .now {
  top: auto;
  bottom: var(--block-bottom);
}

.index {
  pointer-events: auto;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 26px;
  padding: 0 12px;
  font: 600 11px/1 var(--font-ui);
  letter-spacing: 0.32em;
  color: var(--muted);
  text-shadow: var(--halo);
  transition: color 0.3s;
}

.index::before {
  content: "";
  position: absolute;
  inset: -9px 0; /* a 44 px target around the 26 px row */
}

.index svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
  filter: drop-shadow(0 0 6px rgb(var(--accent-rgb) / 0.9));
  transition: transform 0.6s var(--ease-out);
}

.index .num { color: var(--text); }
.index-sep { opacity: 0.45; }

.index-text { white-space: nowrap; }

/* "BORROWED LIGHT · 01 / 08": the album names itself in its own cold light. */
.index-album {
  text-transform: uppercase;
  color: #eef1ff;
  text-shadow: var(--halo), 0 0 12px rgb(159 176 255 / 0.85);
}

.index-album::after {
  content: "·";
  margin: 0 0.55em 0 0.75em;
  color: var(--muted);
  text-shadow: none;
}
.index:hover { color: var(--text); }
.index:hover svg { transform: rotate(90deg); }

.title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 2.5vw, 28px);
  width: 100%;
}

.title {
  flex: 0 1 auto;
  min-width: 0;
  max-width: calc(100% - 112px);
  font: 600 var(--title-size)/1.1 var(--font-display);
  letter-spacing: -0.005em;
  color: #fff;
  text-shadow: var(--halo), var(--glow-text);
  text-wrap: balance;
}

.title[data-long="l"] { font-size: calc(var(--title-size) * 0.88); }
.title[data-long="xl"] { font-size: calc(var(--title-size) * 0.76); }

.chev {
  pointer-events: auto;
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: rgb(245 243 255 / 0.62);
  transition: color 0.3s, transform 0.45s var(--ease-spring), filter 0.3s;
}

.chev svg {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 0 5px rgb(5 2 13 / 0.95));
}

.chev:hover { color: #fff; filter: drop-shadow(0 0 10px rgb(var(--accent-rgb) / 0.85)); }
#prev:hover { transform: translateX(-3px); }
#next:hover { transform: translateX(3px); }

.meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 24px;
  font: 500 13.5px/1 var(--font-ui);
  letter-spacing: 0.05em;
  color: var(--muted);
  text-shadow: var(--halo);
}

.meta .num { color: var(--text); }
.meta-sep { opacity: 0.4; }

.meta-plays svg,
.like svg {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  vertical-align: -1px;
  filter: drop-shadow(0 0 4px rgb(5 2 13 / 0.95));
}

.meta-plays svg { width: 10px; height: 10px; vertical-align: 0; }

.meta:has(.seek:focus-visible) .meta-time {
  outline: 2px solid var(--focus);
  outline-offset: 5px;
  border-radius: 4px;
}

[data-buffering] .meta-time { animation: buffering 1.1s ease-in-out infinite; }

/* No WebGL, so no ring to drag: the seek range becomes a visible scrubber on
   its own row above the meta line (the fill is ui.js's --fill). */
.no-webgl .meta { flex-wrap: wrap; row-gap: 0; }

.no-webgl .seek {
  --fill: 0%;
  order: -1;
  flex: 0 0 100%;
  position: static;
  width: auto;
  height: 40px;
  margin: 0;
  padding: 0 max(0px, calc(50% - 160px));
  overflow: visible;
  clip: auto;
  white-space: normal;
  background: transparent;
  pointer-events: auto;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.no-webgl .seek::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--accent) 0 var(--fill), rgb(245 243 255 / 0.25) var(--fill));
}

.no-webgl .seek::-moz-range-track {
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, var(--accent) 0 var(--fill), rgb(245 243 255 / 0.25) var(--fill));
}

.no-webgl .seek::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -6px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px 2px rgb(var(--accent-rgb) / 0.9);
  -webkit-appearance: none;
  appearance: none;
}

.no-webgl .seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px 2px rgb(var(--accent-rgb) / 0.9);
}

.no-webgl .seek:focus-visible { outline-offset: -8px; }
.no-webgl .meta:has(.seek:focus-visible) .meta-time { outline: none; }

.like {
  pointer-events: auto;
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  transition: color 0.3s;
}

.like::before {
  content: "";
  position: absolute;
  inset: -15px -12px;
}

.like svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  transition: fill 0.3s, filter 0.3s;
}

.like:hover { color: var(--text); }
.like[aria-pressed="true"] { color: var(--love); }
.like[aria-pressed="true"] svg { fill: currentColor; filter: drop-shadow(0 0 8px rgb(255 95 168 / 0.9)); }
.like[aria-pressed="true"] .num { color: #ffd1e6; }

/* ---------------------------------------------------------------- dormant intro */

.intro {
  --mark: min(calc(var(--block-width) / 10.4), calc(var(--r) * 0.17), 76px);
  position: fixed;
  z-index: 2;
  left: var(--block-left);
  /* og-image composition: the wordmark sits just under the figure's cushion (≈ cy + 0.66 R), over the ring's dim lower arc. */
  top: calc(var(--cy) + var(--r) * 0.66);
  width: var(--block-width);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
  opacity: 0;
}

.js .intro.is-in {
  opacity: 1;
  transition: opacity 0.7s var(--ease-out); /* back from behind the orbit / About */
}

/* Tappable (it awakens the music) only while asleep: once it dissolves, the scene beneath takes the pointer. */
:is([data-mode="dormant"], [data-mode="charging"]) .intro.is-in { pointer-events: auto; }

html:not(.js) .intro { animation: failsafe-in 1s ease 4s both; }

.wordmark {
  margin-right: -0.1em;
  font: 700 var(--mark)/1 var(--font-display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #fff;
  text-shadow:
    0 0 8px rgb(255 255 255 / 0.55),
    0 0 26px rgb(196 181 253 / 0.8),
    0 0 70px rgb(139 92 246 / 0.7);
}

.tagline {
  margin-top: 0.85em;
  font: 400 max(13px, calc(var(--mark) * 0.3))/1.3 var(--font-ui);
  letter-spacing: 0.06em;
  color: rgb(245 243 255 / 0.86);
  text-shadow: var(--halo);
}

/* The new album's billing line at the foot of the dormant screen: it fills
   the tall phone's lower third with the news, and a tap starts the album. */
.release {
  position: fixed;
  z-index: 2;
  left: 50%;
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 12px));
  display: grid;
  justify-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 6px 16px;
  white-space: nowrap;
  /* Centred with `translate`, not `transform`, so nothing that animates a
     transform can replace the centring (intro.js moves the children). */
  translate: -50% 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s var(--ease-out), filter 0.7s var(--ease-out);
}

/* Engines without individual transform properties (Safari < 14.1). */
@supports not (translate: 0) {
  .release { transform: translateX(-50%); }
}

.js .release.is-in { opacity: 1; }
[data-mode="dormant"] .release.is-in { pointer-events: auto; }

[data-mode="charging"] .release.is-in,
[data-mode="awakening"] .release {
  opacity: 0;
  filter: blur(8px);
}

html:not(.js) .release { display: none; }

.release-kicker {
  font: 600 10px/1 var(--font-ui);
  letter-spacing: 0.46em;
  margin-right: -0.46em;
  text-transform: uppercase;
  color: var(--muted);
  text-shadow: var(--halo);
}

.release-title {
  font: 600 clamp(13px, 3.3vw, 17px)/1 var(--font-display);
  letter-spacing: 0.24em;
  margin-right: -0.24em;
  text-transform: uppercase;
  color: #eef1ff;
  text-shadow: var(--halo), 0 0 14px rgb(159 176 255 / 0.9), 0 0 36px rgb(159 176 255 / 0.45);
  transition: text-shadow 0.35s;
}

.release-year { color: rgb(238 241 255 / 0.62); }

.release:hover .release-title { text-shadow: var(--halo), 0 0 18px rgb(238 241 255 / 0.95), 0 0 44px rgb(159 176 255 / 0.7); }

[data-layout="portrait"] .release { bottom: calc(var(--block-bottom) + 6px); }

[data-layout="landscape"] .release {
  left: calc(var(--block-left) + var(--block-width) / 2);
  bottom: max(12px, env(safe-area-inset-bottom));
}

/* Small landscape phones: the line fits the text column. */
[data-layout="landscape"] .release-title {
  font-size: min(17px, calc(var(--block-width) / 22));
  letter-spacing: 0.18em;
  margin-right: -0.18em;
}

/* ---------------------------------------------------------------- heart */

.heart {
  position: fixed;
  z-index: 2;
  left: var(--cx);
  top: var(--cy);
  width: var(--heart);
  height: var(--heart);
  margin: calc(var(--heart) / -2) 0 0 calc(var(--heart) / -2);
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  pointer-events: auto;
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 1.4s var(--ease-out), transform 1.4s var(--ease-out);
}

.has-gestures .heart { pointer-events: none; }

.heart:focus-visible { outline: none; opacity: 1; transform: none; }

/* A soft breath of light behind the ring. */
.heart::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(var(--accent-rgb) / 0.22) 0%, rgb(var(--accent-rgb) / 0.08) 45%, transparent 70%);
  animation: heart-breathe 5s ease-in-out infinite;
}

/* The breathing ring itself. */
.heart::after {
  content: "";
  position: absolute;
  inset: 17%;
  border-radius: 50%;
  border: 1px solid rgb(255 255 255 / 0.55);
  box-shadow: 0 0 14px rgb(var(--accent-rgb) / 0.55), inset 0 0 14px rgb(var(--accent-rgb) / 0.35);
  animation: heart-breathe 5s ease-in-out infinite;
}

.heart-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: spin 48s linear infinite;
}

.heart-ring {
  fill: none;
  stroke: rgb(255 255 255 / 0.14);
  stroke-width: 1;
}

.heart-words {
  fill: rgb(245 243 255 / 0.9);
  font: 600 9.5px/1 var(--font-ui);
  letter-spacing: 0.32em;
  paint-order: stroke;
  stroke: rgb(5 2 13 / 0.6);
  stroke-width: 2.5px;
  transition: opacity 0.8s;
}

.heart-glyph {
  position: relative;
  width: clamp(17px, calc(var(--heart) * 0.13), 22px);
  height: clamp(17px, calc(var(--heart) * 0.13), 22px);
  fill: currentColor;
  /* A dark rim first so the glyph reads even over the heart chakra's white-hot core. */
  filter: drop-shadow(0 0 1.5px rgb(5 2 13 / 0.95)) drop-shadow(0 0 8px rgb(255 255 255 / 0.75)) drop-shadow(0 0 16px rgb(var(--accent-rgb) / 0.9));
}

.heart-glyph.g-pause { display: none; }
.heart[data-glyph="pause"] .g-play { display: none; }
.heart[data-glyph="pause"] .g-pause { display: block; }

.heart.is-in,
[data-mode="paused"]:not([data-orbit]) .heart {
  opacity: 1;
  transform: none;
}

[data-mode="paused"] .heart-words,
[data-mode="flow"] .heart-words { opacity: 0; }
[data-mode="paused"] .heart-glyph { animation: glyph-breathe 2.6s ease-in-out infinite; }

/* Charging: the tap was heard, the music is on its way. The ring becomes a
   travelling arc of light, the words turn to "breathe in" and the breath
   quickens — until the first sound, when the awakening takes over. */
[data-mode="charging"] .heart-svg { animation-duration: 2.8s; }

[data-mode="charging"] .heart-ring {
  stroke: rgb(255 255 255 / 0.85);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-dasharray: 26 74;
  filter: drop-shadow(0 0 4px rgb(var(--accent-rgb) / 0.95));
  transition: stroke 0.4s;
}

[data-mode="charging"] .heart::before,
[data-mode="charging"] .heart::after { animation: heart-inhale 1.6s ease-in-out infinite; }
[data-mode="charging"] .heart-glyph { animation: glyph-breathe 1.6s ease-in-out infinite; }

[data-mode="awakening"] .heart {
  opacity: 0;
  transform: scale(1.45);
  transition: opacity 0.55s ease-out, transform 0.9s var(--ease-out);
}

[data-mode="awakening"] .heart-glyph {
  opacity: 0;
  transition: opacity 0.15s;
}

/* ---------------------------------------------------------------- orbit */

/* Two orbits around the heart (orbit.js sizes them from the circumference:
   --orb, --bead, --cover): the singles as album-art orbs on the seek ring's
   path, the album as an inner circle of numbered light-beads that drifts the
   other way. The hovered / focused track's cover blooms at the heart and its
   caption takes the title block's place. */

.orbit {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.orbit-ring {
  position: absolute;
  left: var(--cx);
  top: var(--cy);
  width: 0;
  height: 0;
  animation: spin 240s linear infinite;
}

.orb-slot {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(var(--x, 0), var(--y, 0));
}

.orb-spin {
  display: block;
  animation: spin 240s linear infinite reverse;
}

.orbit-inner { animation-duration: 180s; animation-direction: reverse; }
.orbit-inner .orb-spin { animation-duration: 180s; animation-direction: normal; }

.orbit:hover .orbit-ring,
.orbit:hover .orb-spin,
.orbit:focus-within .orbit-ring,
.orbit:focus-within .orb-spin { animation-play-state: paused; }

.orb {
  --glow: var(--accent);
  position: absolute;
  left: calc(var(--orb, 64px) / -2);
  top: calc(var(--orb, 64px) / -2);
  width: var(--orb, 64px);
  height: var(--orb, 64px);
  border-radius: 50%;
  pointer-events: auto;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.22), 0 0 16px 0 var(--glow), 0 10px 26px -8px rgb(0 0 0 / 0.9);
  /* Hover grows with `scale`, which composes with orbit.js's entrance and exit transforms instead of being replaced by them. */
  transition: scale 0.5s var(--ease-spring), box-shadow 0.4s, filter 0.4s;
}

.orb img,
.orb-ph {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.orb-ph {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--glow), var(--bg-2) 75%);
}

.orb-ph svg { width: 40%; height: 40%; color: rgb(255 255 255 / 0.8); }

/* Art that failed to load (orbit.js): the no-art gradient, not a broken-image glyph. */
.orb[data-noart] { background: radial-gradient(circle at 35% 30%, var(--glow), var(--bg-2) 75%); }
.orb[data-noart] img { display: none; }

/* Sphere shading: a specular highlight and a darker limb. */
.orb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgb(255 255 255 / 0.32), transparent 38%),
    radial-gradient(circle at 50% 50%, transparent 58%, rgb(5 2 13 / 0.55) 100%);
  pointer-events: none;
}

/* The album's beads: moonlit marble pearls with the track number in ink. */
.orb-bead {
  --glow: rgb(159 176 255 / 0.75);
  left: calc(var(--bead, 48px) / -2);
  top: calc(var(--bead, 48px) / -2);
  width: var(--bead, 48px);
  height: var(--bead, 48px);
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 36% 30%, #fff 0%, #eef1ff 22%, #c3cdff 55%, #6f7cc4 88%, #3a4180 100%);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.55), 0 0 18px 1px rgb(220 228 255 / 0.55), 0 0 42px 4px rgb(159 176 255 / 0.28);
}

.orb-bead::after {
  background:
    radial-gradient(circle at 34% 26%, rgb(255 255 255 / 0.85), transparent 30%),
    radial-gradient(circle at 50% 50%, transparent 62%, rgb(11 12 22 / 0.35) 100%);
}

.orb-num {
  position: relative;
  z-index: 1;
  font: 600 calc(var(--bead, 48px) * 0.3)/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: #0b0c16;
}

.orb:hover,
.orb:focus-visible {
  scale: 1.18;
  box-shadow: 0 0 0 1.5px rgb(255 255 255 / 0.8), 0 0 28px 4px var(--glow), 0 10px 30px -8px rgb(0 0 0 / 0.9);
}

.orb:focus-visible { outline: none; }

.orb[aria-current="true"] {
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgb(5 2 13 / 0.55), 0 0 34px 6px var(--glow), 0 10px 26px -8px rgb(0 0 0 / 0.9);
}

.orbit:hover .orb:not(:hover),
.orbit:focus-within .orb:not(:focus-visible):not(:hover) { filter: saturate(0.75) brightness(0.72); }

/* "BORROWED LIGHT · 2026" along the inside of the beads' circle (orbit.js sets the arc). */
.orbit-label {
  position: absolute;
  left: var(--cx);
  top: var(--cy);
  width: 1px;
  height: 1px;
  overflow: visible;
}

.orbit-label text {
  fill: #eef1ff;
  font: 600 10px/1 var(--font-ui); /* size and tracking: orbit.js fits them to the arc */
  text-transform: uppercase;
  text-anchor: start; /* orbit.js centres it with startOffset (WebKit misplaces a stretched middle anchor) */
  paint-order: stroke;
  stroke: rgb(5 2 13 / 0.7);
  stroke-width: 3px;
  filter: drop-shadow(0 0 6px rgb(159 176 255 / 0.9));
}

/* The pointed track's cover, large, where the figure's heart is. */
.orbit-cover {
  position: absolute;
  left: var(--cx);
  top: var(--cy);
  width: var(--cover, 160px);
  height: var(--cover, 160px);
  border-radius: 50%;
  overflow: hidden;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.3), 0 0 46px 6px rgb(var(--accent-rgb) / 0.45), 0 0 120px 20px rgb(5 2 13 / 0.85);
  animation: orbit-cover-in 0.9s var(--ease-out) 0.15s backwards;
}

.orbit-cover[data-empty] { display: none; }

.orbit-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.orbit-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, transparent 60%, rgb(5 2 13 / 0.5) 100%);
}

/* Centre readout (wide screens, tablets): cover and caption stacked on the
   heart (orbit.js measures the pair: --cover-dy, --caption-dy). */
.orbit[data-readout="centre"] .orbit-cover { top: calc(var(--cy) + var(--cover-dy, 0px)); }

.orbit[data-readout="centre"] .orbit-caption {
  left: calc(var(--cx) - var(--readout-w, 240px) / 2);
  top: calc(var(--cy) + var(--caption-dy, 0px));
  bottom: auto;
  width: var(--readout-w, 240px);
  gap: 7px;
  transform: none;
}

.orbit[data-readout="centre"] .orbit-cover,
.orbit[data-readout="centre"] .orbit-caption { transition: top 0.35s var(--ease-out); } /* re-centring when the caption's height changes */

.orbit[data-readout="centre"] .ro-title { font-size: clamp(18px, calc(var(--readout-w, 240px) * 0.075), 30px); }
.orbit[data-readout="centre"] .ro-title[data-long="true"] { font-size: clamp(16px, calc(var(--readout-w, 240px) * 0.062), 25px); }

/* Block readout (phones): the caption sits where the now-playing title lives. */
.orbit-caption {
  position: absolute;
  left: var(--block-left);
  top: var(--block-top);
  width: var(--block-width);
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  pointer-events: none;
  animation: orbit-text-in 0.7s var(--ease-out) 0.3s backwards;
}

[data-layout="portrait"] .orbit-caption {
  top: auto;
  bottom: calc(var(--block-bottom) + 34px);
}

.ro-index {
  font: 600 11px/1 var(--font-ui);
  letter-spacing: 0.26em;
  white-space: nowrap;
  text-transform: uppercase;
  color: var(--muted);
  text-shadow: var(--halo);
}

.ro-title {
  font: 600 clamp(20px, calc(var(--r) * 0.1), 36px)/1.12 var(--font-display);
  color: #fff;
  text-shadow: var(--halo), var(--glow-text);
  text-wrap: balance;
}

.ro-title[data-long="true"] { font-size: clamp(18px, calc(var(--r) * 0.085), 30px); }

.ro-meta {
  font: 500 13px/1 var(--font-ui);
  letter-spacing: 0.05em;
  color: var(--muted);
  text-shadow: var(--halo);
}

.ro-meta .num { color: var(--text); }

.ro-ico {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  vertical-align: 0;
}

.ro-state {
  margin-top: 2px;
  font: 600 10.5px/1 var(--font-ui);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent-3);
  text-shadow: var(--halo), 0 0 12px rgb(var(--accent-rgb) / 0.8);
}

.orbit-hint {
  position: absolute;
  left: var(--block-left);
  bottom: max(14px, calc(env(safe-area-inset-bottom) + 8px));
  width: var(--block-width);
  text-align: center;
  font: 500 12px/1.5 var(--font-ui);
  letter-spacing: 0.16em;
  color: var(--muted);
  text-shadow: var(--halo);
  pointer-events: none;
  animation: orbit-text-in 0.7s var(--ease-out) 0.5s backwards;
}

[data-layout="portrait"] .orbit-hint { bottom: var(--block-bottom); }

.orbit.is-closing .orbit-caption,
.orbit.is-closing .orbit-hint,
.orbit.is-closing .orbit-cover,
.orbit.is-closing .orbit-label {
  opacity: 0;
  transition: opacity 0.2s;
}

/* The orbit replaces the HUD and the dormant type (the wordmark, the album
   line): they fade out rather than cut. */
[data-orbit] .now,
[data-orbit] .heart,
[data-orbit] .intro.is-in,
[data-orbit] .release.is-in {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease-out), visibility 0s linear 0.3s;
}

[data-orbit] .heart { transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), visibility 0s linear 0.3s; }

/* Closing (main.js, for the readout's fade): still dark, but focusable again
   at once, so keyboard focus can return to the control that opened it. */
[data-orbit="closing"] .now,
[data-orbit="closing"] .heart,
[data-orbit="closing"] .intro.is-in,
[data-orbit="closing"] .release.is-in {
  visibility: visible;
  transition: opacity 0.3s var(--ease-out);
}

/* ---------------------------------------------------------------- cursor */

.cursor { display: none; }

.has-cursor .cursor {
  display: block;
  position: fixed;
  z-index: 60;
  left: 0;
  top: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}

.cursor.is-visible { opacity: 1; }

.cursor-dot,
.cursor-ring {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
}

.cursor-dot::before {
  content: "";
  position: absolute;
  left: -3px;
  top: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px 2px rgb(var(--accent-rgb) / 0.9);
  transition: transform 0.3s var(--ease-out), opacity 0.3s;
}

.cursor-halo {
  position: absolute;
  left: -32px;
  top: -32px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid rgb(255 255 255 / 0.6);
  box-shadow: 0 0 14px rgb(var(--accent-rgb) / 0.4), inset 0 0 14px rgb(var(--accent-rgb) / 0.25);
  transform: scale(0.56);
  opacity: 0.5;
  transition: transform 0.45s var(--ease-out), opacity 0.35s, border-color 0.35s;
}

.cursor-glyph {
  position: absolute;
  left: -7px;
  top: -7px;
  width: 14px;
  height: 14px;
  fill: #fff;
  opacity: 0;
  filter: drop-shadow(0 0 1.5px rgb(5 2 13 / 0.95)) drop-shadow(0 0 6px rgb(var(--accent-rgb) / 0.95));
  transition: opacity 0.3s;
}

.cursor-label {
  position: absolute;
  left: 14px;
  top: -30px;
  font: 600 12.5px/1 var(--font-ui);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: #fff;
  text-shadow: var(--halo), 0 0 10px rgb(var(--accent-rgb) / 0.9);
  opacity: 0;
  transition: opacity 0.2s;
}

.cursor[data-zone="field"] .cursor-halo { animation: cursor-ripple 2.8s ease-out infinite; }
.cursor[data-zone="figure"] .cursor-halo { transform: scale(1); opacity: 0.9; }
.cursor[data-zone="figure"] .cursor-dot::before { transform: scale(0); }
.cursor[data-zone="figure"][data-glyph="play"] .g-play,
.cursor[data-zone="figure"][data-glyph="pause"] .g-pause { opacity: 1; }
.cursor[data-zone="ring"] .cursor-halo { transform: scale(0.34); opacity: 0.95; border-color: #fff; }
.cursor[data-zone="ring"] .cursor-label { opacity: 1; }
.cursor.is-pressed .cursor-halo { transform: scale(0.42); }
.cursor.is-pressed[data-zone="figure"] .cursor-halo { transform: scale(0.84); }

/* ---------------------------------------------------------------- coach marks */

.coach {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.hint {
  position: absolute;
  inset: 0;
  opacity: 0;
  filter: blur(6px);
  transition: opacity 0.6s var(--ease-out), filter 0.6s var(--ease-out);
}

.hint.is-on { opacity: 1; filter: blur(0); }

.hint-glyph {
  position: absolute;
  left: var(--hx, 50%);
  top: var(--hy, 30%);
}

.hint-glyph::before,
.hint-glyph::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}

/* the fingertip */
.hint-glyph::before {
  left: -5px;
  top: -5px;
  width: 10px;
  height: 10px;
  background: #fff;
  box-shadow: 0 0 12px 3px rgb(var(--accent-rgb) / 0.9);
}

/* its ripple / charge ring */
.hint-glyph::after {
  left: -16px;
  top: -16px;
  width: 32px;
  height: 32px;
  border: 1px solid rgb(255 255 255 / 0.7);
  opacity: 0;
}

.hint-text {
  position: absolute;
  left: var(--tx, 50%);
  top: var(--ty, 30%);
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font: 600 11px/1 var(--font-ui);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: var(--halo), 0 0 12px rgb(var(--accent-rgb) / 0.85);
}

.hint[data-kind="ring"] .hint-glyph {
  transform-origin: 0 var(--ring);
  animation: hint-ring 2.4s ease-in-out infinite;
}

.hint[data-kind="swipe"] .hint-glyph { animation: hint-swipe 1.6s cubic-bezier(.5, 0, .2, 1) infinite; }
.hint[data-kind="like"] .hint-glyph::after { animation: hint-tap 1.4s ease-out infinite; }
.hint[data-kind="hold"] .hint-glyph::after { animation: hint-hold 2s ease-in infinite; }

/* ---------------------------------------------------------------- bubble, toast */

.bubble {
  position: fixed;
  z-index: 4;
  left: 0;
  top: 0;
  width: 96px;
  margin: -24px 0 0 -48px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  font: 600 18px/24px var(--font-ui);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: var(--halo), 0 0 14px rgb(var(--accent-rgb) / 0.95);
}

.bubble.is-shown { opacity: 1; }

.toast {
  position: fixed;
  z-index: 5;
  left: 50%;
  top: calc(max(10px, env(safe-area-inset-top)) + 56px);
  width: max-content; /* shrink-to-fit would stop at the 50% left offset */
  max-width: min(92vw, 520px);
  transform: translate(-50%, -6px);
  text-align: center;
  font: 500 14px/1.4 var(--font-ui);
  color: var(--text);
  text-shadow: var(--halo), 0 0 14px rgb(var(--accent-rgb) / 0.6);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s, transform 0.35s var(--ease-out);
}

.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- auto-hide */

[data-hud="hidden"] .top {
  opacity: 0;
  transform: translateY(-8px);
}

[data-hud="hidden"] .now:not(.is-lingering) {
  opacity: 0;
  translate: 0 10px;
}

[data-hud="hidden"] .top *,
[data-hud="hidden"] .now:not(.is-lingering) * { pointer-events: none !important; }

/* ---------------------------------------------------------------- About veil */

.veil {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--text);
  background: rgb(5 2 13 / 0.9);
  -webkit-user-select: text;
  user-select: text;
}

.veil::backdrop { background: transparent; }

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .veil {
    background: radial-gradient(120% 90% at 50% 40%, rgb(16 8 36 / 0.74), rgb(5 2 13 / 0.88));
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    backdrop-filter: blur(16px) saturate(120%);
  }
}

/* The veil is the only thing on screen: the HUD and the heart step back
   instead of showing through the text (the dialog keeps them inert anyway). */
[data-about] .top,
[data-about] .now,
[data-about] .heart,
[data-about] .coach,
[data-about] .bubble,
[data-about] .intro.is-in,
[data-about] .release.is-in {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0s linear 0.3s;
}

.veil-close {
  position: fixed;
  z-index: 1;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
}

.veil-body {
  min-height: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 26px;
  padding: max(76px, env(safe-area-inset-top)) 24px max(44px, env(safe-area-inset-bottom));
  text-align: center;
}

.veil-kicker {
  font: 600 11px/1 var(--font-ui);
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--accent-3);
  text-shadow: var(--halo);
}

.veil-title {
  margin: -12px 0 -6px;
  font: 700 clamp(30px, 6vw, 56px)/1.05 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 8px rgb(255 255 255 / 0.5), 0 0 30px rgb(196 181 253 / 0.75), 0 0 70px rgb(139 92 246 / 0.6);
}

.veil-tagline { color: var(--muted); letter-spacing: 0.06em; }

.veil-bio {
  max-width: 34ch;
  font: 400 clamp(18px, 2.4vw, 23px)/1.5 var(--font-ui);
  color: rgb(245 243 255 / 0.92);
  text-wrap: balance;
}

.genres {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 22px;
  font: 600 12px/1 var(--font-ui);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--violet-light);
}

.veil-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 34px;
}

.veil-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  font: 600 clamp(17px, 2.2vw, 21px)/1 var(--font-display);
  letter-spacing: 0.02em;
  text-decoration: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)) left calc(100% - 8px) / 0 1.5px no-repeat;
  transition: background-size 0.45s var(--ease-out), text-shadow 0.3s;
}

.veil-links a:hover {
  background-size: 100% 1.5px;
  text-shadow: 0 0 16px rgb(var(--accent-rgb) / 0.8);
}

.veil-links svg { width: 14px; height: 14px; opacity: 0.7; }

.veil-visitors {
  font: 500 15px/1.4 var(--font-ui);
  color: var(--muted);
}

.veil-visitors .num {
  font: 700 1.5em/1 var(--font-display);
  color: var(--accent-3);
  text-shadow: 0 0 16px rgb(var(--accent-rgb) / 0.7);
  margin-right: 4px;
}

/* Track list, grouped: the album first, then the singles. Type only, no rows or boxes. */
.tracklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr));
  gap: 26px 44px;
  width: 100%;
  text-align: left;
}

.tl-head {
  margin-bottom: 8px;
  font: 600 11px/1.2 var(--font-ui);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--accent-3);
}

.tl-group:first-child:not(:last-child) .tl-head {
  color: #eef1ff;
  text-shadow: 0 0 12px rgb(159 176 255 / 0.8);
}

.tl-year { letter-spacing: 0.2em; color: var(--muted); text-shadow: none; }

.tl-group ol { counter-reset: tl; }
.tl-group li { counter-increment: tl; }

.tl-track {
  display: flex;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 6px 0;
  text-align: left;
  color: rgb(245 243 255 / 0.86);
  transition: color 0.25s, text-shadow 0.25s;
}

.tl-n {
  flex: none;
  width: 1.7em;
  font: 600 11px/1 var(--font-ui);
  letter-spacing: 0.08em;
  color: var(--muted);
}

.tl-n::before { content: counter(tl, decimal-leading-zero); }

.tl-title {
  flex: 1;
  min-width: 0;
  font: 500 15px/1.3 var(--font-display);
}

.tl-dur {
  flex: none;
  font-size: 12.5px;
  color: var(--muted);
}

.tl-track:hover { color: #fff; text-shadow: 0 0 14px rgb(var(--accent-rgb) / 0.8); }

.tl-track[aria-current="true"] { color: #fff; }
.tl-track[aria-current="true"] .tl-n::before { content: "\25B6\FE0E"; color: var(--accent); }

/* Visual sync: one slider centred on zero; the lit segment is the offset
   (right of centre holds the visuals back behind the sound). */
.sync {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(100%, 420px);
}

.sync-label {
  font: 600 11px/1 var(--font-ui);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--accent-3);
}

.sync-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.sync-range {
  --fill: 50%;
  flex: 1;
  min-width: 0;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.sync-range::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, rgb(245 243 255 / 0.2) 0 min(50%, var(--fill)), var(--accent) min(50%, var(--fill)) max(50%, var(--fill)), rgb(245 243 255 / 0.2) max(50%, var(--fill)));
}

.sync-range::-moz-range-track {
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(90deg, rgb(245 243 255 / 0.2) 0 min(50%, var(--fill)), var(--accent) min(50%, var(--fill)) max(50%, var(--fill)), rgb(245 243 255 / 0.2) max(50%, var(--fill)));
}

.sync-range::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -8px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px 2px rgb(var(--accent-rgb) / 0.9);
  -webkit-appearance: none;
  appearance: none;
}

.sync-range::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px 2px rgb(var(--accent-rgb) / 0.9);
}

.sync-range:focus-visible { outline-offset: 2px; }

.sync-out {
  flex: none;
  min-width: 4.6em;
  font: 600 15px/1 var(--font-ui);
  color: var(--text);
  text-align: right;
}

.sync-help {
  max-width: 38ch;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  text-wrap: balance;
}

.sync-help kbd { font: 600 1em var(--font-ui); color: var(--text); }

.sync-reset {
  min-height: 32px;
  padding: 0 10px;
  font: 600 11px/1 var(--font-ui);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.sync-reset:hover { color: var(--text); }

/* This device's controls: keys with a mouse, gestures on touch. */
.keys,
.gestures {
  display: grid;
  grid-template-columns: repeat(2, auto);
  justify-content: center;
  gap: 8px 30px;
  font: 400 13px/1.3 var(--font-ui);
  color: var(--muted);
  text-align: left;
}

.keys div,
.gestures div { display: flex; gap: 12px; align-items: baseline; }

.keys dt,
.gestures dt {
  min-width: 5.2em;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
  text-align: right;
}

.gestures dt { min-width: 8.4em; }

.keys kbd { font: inherit; }

.gestures { display: none; }

@media (hover: none), (pointer: coarse) {
  .keys,
  .sync-help .when-keys { display: none; }
  .gestures { display: grid; }
}

.veil-foot {
  display: grid;
  gap: 4px;
  font-size: 12.5px;
  line-height: 1.5;
  color: rgb(165 161 194 / 0.85);
}

/* ---------------------------------------------------------------- layouts */

[data-layout="portrait"] .now { --title-size: clamp(20px, 6.2vw, 34px); }

[data-layout="landscape"] .now {
  --title-size: clamp(22px, 3.6vw, 34px);
  transform: translateY(-50%);
}

[data-layout="landscape"] .intro {
  top: var(--block-top);
  transform: translateY(-50%);
}

[data-layout="landscape"] .intro { --mark: min(calc(var(--block-width) / 10.6), 34px); }

[data-layout="landscape"] .orbit-caption { transform: translateY(-50%); }

[data-layout="landscape"] .toast {
  left: calc(var(--block-left) + var(--block-width) / 2);
  max-width: min(520px, var(--block-width));
}

@media (max-width: 600px) {
  .top-actions .social { display: none; }
}

@media (max-width: 520px) {
  .meta { gap: 8px; font-size: 13px; }
}

@media (max-width: 440px) {
  .live-label { display: none; }
}

@media (max-width: 370px) {
  .brand {
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.22em;
    font-size: 12px;
  }
}

@media (max-width: 560px) {
  .keys,
  .gestures { grid-template-columns: auto; }
}

/* ---------------------------------------------------------------- keyframes */

@keyframes spin { to { transform: rotate(360deg); } }

@keyframes live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.8); }
}

@keyframes heart-breathe {
  0%, 100% { transform: scale(0.94); opacity: 0.7; }
  50% { transform: scale(1.06); opacity: 1; }
}

@keyframes heart-inhale {
  0%, 100% { transform: scale(0.9); opacity: 0.6; }
  60% { transform: scale(1.12); opacity: 1; }
}

@keyframes glyph-breathe {
  0%, 100% { opacity: 0.55; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes buffering {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes cursor-ripple {
  0% { transform: scale(0.5); opacity: 0.55; }
  70% { transform: scale(0.72); opacity: 0.18; }
  100% { transform: scale(0.5); opacity: 0.55; }
}

@keyframes orbit-cover-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); filter: blur(10px); }
  to { opacity: 1; transform: translate(-50%, -50%); filter: blur(0); }
}

@keyframes orbit-text-in {
  from { opacity: 0; filter: blur(8px); }
  to { opacity: 1; filter: blur(0); }
}

@keyframes hint-ring {
  0%, 100% { transform: rotate(-16deg); }
  50% { transform: rotate(16deg); }
}

@keyframes hint-swipe {
  0% { transform: translateX(-46px); opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateX(46px); opacity: 0; }
}

@keyframes hint-tap {
  0% { transform: scale(0.3); opacity: 0.9; }
  30% { transform: scale(1.1); opacity: 0; }
  31% { transform: scale(0.3); opacity: 0.9; }
  62% { transform: scale(1.1); opacity: 0; }
  100% { transform: scale(1.1); opacity: 0; }
}

@keyframes hint-hold {
  0% { transform: scale(1.5); opacity: 0; }
  70% { transform: scale(0.45); opacity: 1; }
  78% { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

@keyframes fallback-breathe {
  0%, 100% { opacity: 0.8; transform: translate(-50%, -50%) scale(0.98); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.02); }
}

@keyframes failsafe-in { to { opacity: 1; } }

@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  :root { transition: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .orb:hover, .orb:focus-visible { scale: none; }
  [data-mode="awakening"] .now { transition-delay: 0.3s; }
}

/* ---------------------------------------------------------------- 404 */

.void {
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  overflow: hidden;
}

.void-main {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 460px;
  text-align: center;
}

.void-art {
  width: min(56vmin, 300px);
  aspect-ratio: 1;
  background: url("../img/fallback.svg") center / contain no-repeat;
  opacity: 0.85;
  animation: breathe 7s ease-in-out infinite;
}

.void-code {
  font: 700 0.8rem var(--font-display);
  letter-spacing: 0.5em;
  margin-right: -0.5em;
  color: var(--gold);
}

.void-title {
  font: 700 clamp(1.4rem, 1rem + 2.4vw, 2.2rem)/1.15 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(214, 200, 255, 0.6), 0 0 36px var(--glow);
}

.void-text { color: var(--muted); }

.void-home {
  margin-top: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  color: var(--on-accent);
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px -10px var(--glow), 0 0 22px var(--glow-soft);
}
