/* tokens, reset, background, texture */
@property --a   { syntax: '<color>'; inherits: true; initial-value: #DDAACC; }
@property --b   { syntax: '<color>'; inherits: true; initial-value: #BB88EE; }
@property --ang { syntax: '<angle>'; inherits: true; initial-value: 115deg; }
@property --s1  { syntax: '<percentage>'; inherits: true; initial-value: 58%; }
@property --sw  { syntax: '<percentage>'; inherits: true; initial-value: 14%; }
@property --gap { syntax: '<length>'; inherits: true; initial-value: 26px; }
@property --ink { syntax: '<color>'; inherits: true; initial-value: #DDAACC; }

:root {
  --bg: #051631;
  --panel: #08203f;
  --edge: #030e20;
  --text: #E4DCEC;
  --muted: #A39BBF;
  --deep: #552B9D;

  --a: #DDAACC;
  --b: #BB88EE;
  --ink: #DDAACC; /* readable accent on dark; differs from --a only when a song uses #552B9D */

  --f-display: 'Dela Gothic One', 'Arial Black', system-ui, sans-serif;
  --f-ui: 'Chakra Petch', 'Arial Narrow', system-ui, sans-serif;
  --f-body: 'Atkinson Hyperlegible', system-ui, sans-serif;

  color-scheme: dark;
  --ang: 115deg; --s1: 58%; --sw: 14%; --gap: 26px;
  transition: --a .4s ease, --b .4s ease, --ink .4s ease, --ang .6s ease, --s1 .6s ease, --sw .6s ease, --gap .6s ease;
}

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

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: clamp(15px, 1.2vw + 12px, 18px);
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

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

/* ---------- background (re-tints per song) ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    linear-gradient(var(--ang), transparent 0 var(--s1), color-mix(in srgb, var(--a) 17%, transparent) var(--s1) calc(var(--s1) + var(--sw)), transparent calc(var(--s1) + var(--sw)) calc(var(--s1) + var(--sw) + 6%), color-mix(in srgb, var(--b) 12%, transparent) calc(var(--s1) + var(--sw) + 6%) calc(var(--s1) + var(--sw) + 11%), transparent calc(var(--s1) + var(--sw) + 11%)),
    repeating-linear-gradient(var(--ang), transparent 0 var(--gap), color-mix(in srgb, var(--b) 6%, transparent) var(--gap) calc(var(--gap) + 2px)),
    var(--bg);
}

.ghost {
  position: absolute;
  right: -3vw;
  bottom: 9dvh;
  font-family: var(--f-display);
  font-size: clamp(120px, 40vw, 440px);
  line-height: .8;
  color: transparent;
  -webkit-text-stroke: 2px color-mix(in srgb, var(--a) 20%, transparent);
  white-space: nowrap;
  text-transform: uppercase;
  transform: rotate(-7deg);
  transform-origin: right bottom;
  user-select: none;
}

/* grain + scanlines sit above everything, never catch input */
.fx {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: .5;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .16) 0 1px, transparent 1px 3px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .8 0 0 0 0 .75 0 0 0 0 .9 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* views */
.view {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- glimmer: quick left-to-right sweep (decorative; also fires on focus/tap) ---------- */
:is(.btn, .key, .tagline, .s-label, .card-in) { position: relative; overflow: hidden; }
:is(.btn, .key, .tagline, .s-label, .card-in)::after {
  content: '';
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -60%;
  width: 34%;
  background: linear-gradient(100deg, transparent, rgba(240, 232, 248, .3) 50%, transparent);
  transform: skewX(-20deg);
  pointer-events: none;
}
@media (hover: hover) {
  :is(.btn, .key, .tagline, .s-label, .card-in):hover::after { left: 135%; transition: left .5s ease; }
}
:is(.btn, .key):focus-visible::after,
:is(.btn, .key):active::after { left: 135%; transition: left .5s ease; }

@keyframes glimmer { from { left: -60%; } to { left: 135%; } }
.song.is-sel .card-in::after { animation: glimmer .6s ease .08s 1 both; }
