/* Scrobble Deck — the web deck's design system. Tokens, themes, ground, components, motion.
   Same names and values as the iOS DeckTokens/ThemeStore; if a number differs, the app is right. */

@font-face { font-family: "Archivo"; font-weight: 700; font-display: swap; src: url("/fonts/Archivo-Bold.ttf") format("truetype"); }
@font-face { font-family: "Archivo"; font-weight: 800; font-display: swap; src: url("/fonts/Archivo-ExtraBold.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url("/fonts/IBMPlexMono-Regular.ttf") format("truetype"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url("/fonts/IBMPlexMono-Medium.ttf") format("truetype"); }

/* ---- Tokens and themes ------------------------------------------------------------------- */

:root {
  --ink: #0c0c0e; --ground: linear-gradient(180deg, #0c0c0e, #0c0c0e); --panel: #16161a; --panel-lift: #1d1d24; --line: #26262c;
  --bone: #efeff2; --mute: #86868f; --accent: #f5813f; --on-accent: #0c0c0e;
  --tint: var(--accent);                     /* the ambient glow: cover on air, else the accent */
  --amber: #f5b32f; --destructive: #d51007; --warning: #e2703a;   /* fixed in every theme */
  --display: "Archivo", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --card-radius: 24px; --control-radius: 16px; --control-height: 48px;
  --shadow: 0 18px 36px -22px rgba(0,0,0,.85);
  --vignette: .22; --grain: .03; --glow: .16;
  --strip-h: 44px; --tabs-h: 64px;
  color-scheme: dark;
}
/* Theme values arrive as inline variables (theme.js sets them, boot.js replays them before paint).
   The scheme flag is what the light looks change beyond colour. */
[data-scheme="light"] { color-scheme: light; --vignette: .066; --shadow: 0 14px 30px -22px rgba(40,30,20,.35); --grain: .02;
  /* Amber and warning are fixed in meaning, but on a light ground they need darker ink to read. */
  --amber: #9a6400; --warning: #b04a17; }
[data-contrast="high"] { --line: color-mix(in srgb, var(--line) 40%, var(--mute)); --mute: color-mix(in srgb, var(--mute) 50%, var(--bone)); }
[data-controls="large"] { --control-height: 58px; }

/* ---- Base ---------------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100%;
  font-family: var(--body); font-size: 16px; line-height: 1.45; color: var(--bone);
  background: var(--ink);
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
img { display: block; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Ground: gradient, two drifting glows, grain, vignette, the five-capsule mark ------- */

.ground { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: var(--ground); background-color: var(--ink); transition: background .6s ease; }
.ground .glow { position: absolute; width: 440px; height: 440px; border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--tint) calc(var(--glow) * 100%), transparent), transparent);
  transition: background 1.2s ease; animation: drift 40s ease-in-out infinite alternate; }
.ground .glow.a { left: calc(15% - 220px); top: calc(22% - 220px); }
.ground .glow.b { left: calc(90% - 220px); top: calc(62% - 220px); opacity: .7; animation-direction: alternate-reverse; }
.ground .grain { position: absolute; inset: 0; opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='128'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='128' height='128' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px; }
.ground .vignette { position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0,0,0,var(--vignette)) 100%); }
.ground .mark { position: absolute; right: 48px; bottom: 120px; display: flex; align-items: flex-end; gap: 12px; height: 200px; }
.ground .mark i { display: block; width: 22px; border-radius: 11px; background: var(--accent); opacity: .06; }
@keyframes drift { from { transform: translate(-36px, 36px); } to { transform: translate(36px, -36px); } }

/* ---- Type ---------------------------------------------------------------------------------- */

h1, h2, h3, .display { font-family: var(--display); font-weight: 800; letter-spacing: -0.01em; margin: 0; line-height: 1.1; }
h1 { font-size: 34px; } h2 { font-size: 24px; } h3 { font-size: 18px; }
.lede { color: var(--mute); font-size: 17px; margin: 10px 0 0; }
.mono { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .15em; text-transform: uppercase; color: var(--mute); }
.mono.bone { color: var(--bone); } .mono.amber { color: var(--amber); } .mono.accent { color: var(--accent); }
.header { font-size: 13px; font-weight: 600; color: var(--mute); margin: 0 0 12px; }   /* DeckHeader: sentence case */
.note { color: var(--mute); font-size: 14px; margin: 8px 0 0; }
.error { color: var(--destructive); }
.num { font-variant-numeric: tabular-nums; }

/* ---- Layout -------------------------------------------------------------------------------- */

#view { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(var(--tabs-h) + 24px + env(safe-area-inset-bottom)); }
.page { max-width: 720px; margin: 0 auto; padding: 16px 16px 64px; }
.spacer { flex: 1; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }

/* ---- Signal strip -------------------------------------------------------------------------- */

.strip { position: sticky; top: 0; z-index: 20; height: var(--strip-h); display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: color-mix(in srgb, var(--ink) 78%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line); }
.strip .back { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px 0 6px; margin-left: -8px; border: 0; border-radius: 10px; background: transparent; color: var(--bone); font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.strip .back:hover { background: var(--panel-lift); }
.strip .back svg { width: 16px; height: 16px; }
.strip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mute); flex: none; transition: background .3s; }
.strip .dot.live { background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: pulse 1.6s ease-in-out infinite; }
.strip .dot.lost { background: var(--amber); animation: none; box-shadow: none; }
.strip .status { color: var(--bone); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip .vu { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.strip .vu.on { display: flex; }
.strip .vu i { width: 3px; height: 100%; background: var(--amber); border-radius: 2px; transform-origin: bottom; animation: vu 1.1s ease-in-out infinite; }
.strip .vu i:nth-child(2) { animation-delay: -.35s; } .strip .vu i:nth-child(3) { animation-delay: -.7s; }
.strip .tags { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.strip .search { width: 32px; height: 32px; border: 0; background: transparent; border-radius: 10px; display: grid; place-items: center; color: var(--mute); }
.strip .search:hover { background: var(--panel-lift); color: var(--bone); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes vu { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

/* ---- Tab bar ------------------------------------------------------------------------------- */

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; gap: 4px;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--ink) 80%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line); }
.tabs a { flex: 1; max-width: 160px; display: grid; justify-items: center; gap: 3px; padding: 6px 4px; border-radius: 14px;
  text-decoration: none; color: var(--mute); font-size: 11px; font-weight: 600; transition: color .2s, background .2s; }
.tabs a svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a[aria-current="page"] { color: var(--accent); }
.tabs a:active { transform: scale(.96); }

/* ---- Cards --------------------------------------------------------------------------------- */

.card { position: relative; border-radius: var(--card-radius); padding: 20px; margin-top: 12px;
  background: linear-gradient(180deg, var(--panel-lift), var(--panel)); box-shadow: var(--shadow); }
.card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bone) 10%, transparent), transparent 26px);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
[data-contrast="high"] .card { box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.card.tight { padding: 14px 16px; }
.card > .header:first-child { margin-top: 0; }

/* ---- Controls ------------------------------------------------------------------------------ */

.btn { height: var(--control-height); padding: 0 20px; border-radius: var(--control-radius); border: 1px solid transparent;
  font-family: var(--display); font-weight: 700; font-size: 16px; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  transition: transform .12s ease, opacity .12s ease, background .2s ease; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn.primary { color: var(--on-accent); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 78%, white), var(--accent)); }
.btn.outline { color: var(--bone); border-color: var(--line); background: transparent; }
.btn.outline:hover { background: var(--panel-lift); }
.btn.danger { color: #fff; background: var(--destructive); }
.btn.ghost { color: var(--mute); background: transparent; padding: 0 10px; }
.btn.small { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn .check { display: none; } .btn.confirmed .check { display: inline; animation: pop .4s ease; } .btn.confirmed .label { display: none; }
@keyframes pop { 0% { transform: scale(.4); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

.field { width: 100%; height: var(--control-height); padding: 0 14px; border-radius: var(--control-radius);
  border: 1px solid var(--line); background: var(--ink); color: var(--bone); outline: none; transition: border-color .15s; }
.field:focus { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.field::placeholder { color: color-mix(in srgb, var(--mute) 70%, transparent); }
textarea.field { height: auto; min-height: 140px; padding: 12px 14px; resize: vertical; font-family: var(--mono); font-size: 13px; letter-spacing: 0; }
select.field { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
label.stack { gap: 6px; } label.stack > span { font-size: 13px; color: var(--mute); }

.segments { display: inline-flex; padding: 4px; gap: 2px; border-radius: var(--control-radius); background: var(--ink); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; }
.segments button { height: 36px; padding: 0 14px; border: 0; border-radius: 12px; background: transparent; color: var(--mute); font-weight: 600; white-space: nowrap; transition: background .2s, color .2s; }
.segments button[aria-selected="true"] { background: var(--panel-lift); color: var(--bone); }

.switch { position: relative; width: 50px; height: 30px; border-radius: 15px; border: 0; background: var(--line); transition: background .2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--bone); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--on-accent); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  background: var(--ink); color: var(--mute); border: 1px solid var(--line); white-space: nowrap; }
.chip.ok { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.chip.warn { color: var(--warning); } .chip.bad { color: var(--destructive); } .chip.amber { color: var(--amber); }
.chip.solid { color: var(--on-accent); background: var(--accent); border-color: transparent; }

.rowlink { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; color: var(--bone); }
.rowlink:last-child { border-bottom: 0; }
.rowlink .sub { color: var(--mute); font-size: 14px; }
.rowlink .chev { margin-left: auto; color: var(--mute); }

/* ---- Stat blocks, lists, art -------------------------------------------------------------- */

.stat { background: var(--ink); border-radius: var(--control-radius); padding: 12px 14px; min-width: 0; }
.stat b { display: block; font-family: var(--display); font-size: 24px; font-weight: 800; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat.lift { background: color-mix(in srgb, var(--accent) 12%, var(--ink)); }

.tracks { list-style: none; margin: 0; padding: 0; }
.tracks li { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tracks li:last-child { border-bottom: 0; }
.tracks .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tracks .sub { color: var(--mute); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tracks .when { text-align: right; }
.tracks .love { border: 0; background: none; color: var(--mute); padding: 6px; border-radius: 8px; }
.tracks .love.on { color: var(--destructive); }
.art { width: 44px; height: 44px; border-radius: 10px; background: var(--ink); object-fit: cover; flex: none; }
.art.lg { width: 112px; height: 112px; border-radius: 16px; }
.art.xl { width: 100%; aspect-ratio: 1; height: auto; border-radius: 16px; }
.art.empty { display: grid; place-items: center; color: var(--mute); }
.day { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 4px; }
.day .mono { flex: none; }
.day::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.lockcard { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--panel-lift)), var(--panel)); }

/* ---- Sheets and toasts --------------------------------------------------------------------- */

dialog.sheet { border: 0; padding: 0; margin: 0; width: min(100vw, 560px); max-width: 100vw; max-height: 90dvh;
  position: fixed; left: 50%; bottom: 0; top: auto; transform: translateX(-50%);
  background: linear-gradient(180deg, var(--panel-lift), var(--panel)); color: var(--bone);
  border-radius: var(--card-radius) var(--card-radius) 0 0; box-shadow: 0 -20px 60px -20px rgba(0,0,0,.8); }
dialog.sheet[open] { animation: sheet-in .28s cubic-bezier(.2,.8,.2,1); }
dialog.sheet::backdrop { background: rgba(0,0,0,.5); backdrop-filter: blur(4px); }
dialog.sheet .inner { padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); overflow: auto; max-height: 90dvh; }
dialog.sheet .grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 10px; }
dialog.sheet .sheet-head { display: flex; align-items: center; gap: 8px; margin: 0 0 10px -10px; }
dialog.sheet .sheet-head h2 { margin: 0; font-size: 20px; }
@media (min-width: 720px) { dialog.sheet { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: var(--card-radius); } }
@keyframes sheet-in { from { transform: translate(-50%, 40px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
@media (min-width: 720px) { @keyframes sheet-in { from { transform: translate(-50%, calc(-50% + 20px)); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } } }

.toasts { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 10px 14px; border-radius: 14px; background: var(--panel-lift); color: var(--bone); box-shadow: var(--shadow); font-size: 14px; border: 1px solid var(--line); animation: rise .25s ease; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- Skeletons ----------------------------------------------------------------------------- */

.skel { background: linear-gradient(90deg, var(--ink) 25%, var(--panel-lift) 50%, var(--ink) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 8px; color: transparent !important; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---- Motion: entrances and view transitions ---------------------------------------------- */

.enter > * { animation: enter .42s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.bar { transform-origin: left center; animation: grow .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 30ms); }
.bar.v { transform-origin: bottom center; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bar.v { animation-name: grow-v; } @keyframes grow-v { from { transform: scaleY(0); } to { transform: scaleY(1); } }
::view-transition-old(root) { animation: fade-out .14s ease both; }
::view-transition-new(root) { animation: fade-in .22s ease both; }
@keyframes fade-out { to { opacity: 0; } } @keyframes fade-in { from { opacity: 0; transform: translateY(6px); } }
/* The chrome holds still while the view changes: each piece needs its own name. */
.strip { view-transition-name: strip; } .tabs { view-transition-name: tabs; } .ground { view-transition-name: ground; }
::view-transition-old(strip), ::view-transition-new(strip), ::view-transition-old(tabs), ::view-transition-new(tabs),
::view-transition-old(ground), ::view-transition-new(ground) { animation: none; }

/* ---- Splash -------------------------------------------------------------------------------- */

#splash { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--ink); transition: opacity .35s ease; }
#splash.out { opacity: 0; pointer-events: none; }
#splash .mark { display: flex; align-items: flex-end; gap: 10px; height: 120px; }
#splash .mark i { display: block; width: 16px; border-radius: 8px; background: var(--accent); transform-origin: bottom; animation: rise-in .9s cubic-bezier(.2,.8,.2,1) both; box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 35%, transparent); }
#splash .mark i:nth-child(1) { height: 43%; animation-delay: .05s; } #splash .mark i:nth-child(2) { height: 70%; animation-delay: .12s; }
#splash .mark i:nth-child(3) { height: 100%; animation-delay: .19s; } #splash .mark i:nth-child(4) { height: 60%; animation-delay: .26s; }
#splash .mark i:nth-child(5) { height: 33%; animation-delay: .33s; }
#splash .word { position: absolute; bottom: 18vh; left: 0; right: 0; text-align: center; letter-spacing: .5em; animation: word-in .9s cubic-bezier(.2,.8,.2,1) .45s both; }
#splash .sweep { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: linear-gradient(90deg, transparent, var(--amber), transparent); opacity: 0; animation: sweep 1.1s ease .2s both; }
@keyframes rise-in { from { transform: scaleY(0); opacity: 0; } to { transform: scaleY(1); opacity: 1; } }
@keyframes word-in { from { opacity: 0; letter-spacing: .8em; } to { opacity: 1; letter-spacing: .15em; } }
@keyframes sweep { 0% { opacity: 0; transform: translateY(-120px) scaleX(.2); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(120px) scaleX(1); } }

/* ---- Welcome ------------------------------------------------------------------------------- */

#view.wide { max-width: 980px; padding-bottom: 40px; }
.landing { display: grid; gap: 72px; padding-top: 24px; }
.eyebrow { display: inline-block; margin-bottom: 14px; }
.big { font-size: clamp(34px, 6vw, 60px); letter-spacing: -0.02em; line-height: 1.02; max-width: 14ch; }
h2.big { font-size: clamp(28px, 4.6vw, 44px); }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; min-height: calc(86dvh - var(--strip-h)); perspective: 1200px; }
.hero .lede { max-width: 48ch; }
.hero .w { display: inline-block; margin-right: .26em; animation: word .8s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 80ms + 120ms); }
@keyframes word { from { opacity: 0; transform: translateY(22px) rotate(1.5deg); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.hero .hero-text > * { animation: enter .7s cubic-bezier(.2,.8,.2,1) both; }
.hero .hero-text > .eyebrow { animation-delay: 0ms; } .hero .hero-text > .lede { animation-delay: 420ms; } .hero .hero-text > .cta { animation-delay: 540ms; } .hero .hero-text > .note { animation-delay: 640ms; }
.cta { margin-top: 26px; gap: 12px; }
.btn.lift { box-shadow: 0 10px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent); transition: transform .18s ease, box-shadow .18s ease; }
.btn.lift:hover { transform: translateY(-1px); box-shadow: 0 16px 36px -10px color-mix(in srgb, var(--accent) 80%, transparent); }

.mock { transform-style: preserve-3d; transition: transform .25s ease; animation: mock-in 1s cubic-bezier(.2,.8,.2,1) .35s both; }
@keyframes mock-in { from { opacity: 0; transform: translateY(28px) scale(.96); } to { opacity: 1; transform: none; } }
.mock-card { margin: 0; padding: 18px; }
.mock-strip { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.mock-strip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); animation: pulse 1.6s ease-in-out infinite; }
.mock-strip .vu { display: flex; align-items: flex-end; gap: 2px; height: 14px; margin-left: auto; }
.mock-strip .vu i { width: 3px; height: 100%; background: var(--amber); border-radius: 2px; transform-origin: bottom; animation: vu 1.1s ease-in-out infinite; }
.mock-strip .vu i:nth-child(2) { animation-delay: -.35s; } .mock-strip .vu i:nth-child(3) { animation-delay: -.7s; }
.mock-card .now { grid-template-columns: 96px 1fr; }
.mock-card .cover { width: 96px; height: 96px; border-radius: 14px; object-fit: cover; box-shadow: 0 12px 28px -12px rgba(0,0,0,.8); animation: swap .5s cubic-bezier(.2,.8,.2,1) both; }
.mock-card { box-shadow: var(--shadow), 0 0 80px -20px color-mix(in srgb, var(--tint) 55%, transparent); transition: box-shadow .8s ease; }
.mock-card .title, .mock-card .sub { transition: opacity .3s, transform .3s; }
.mock-card.swap .title, .mock-card.swap .sub { animation: swap .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes swap { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.disc { --hue: 18; width: 96px; height: 96px; border-radius: 50%; position: relative; flex: none;
  background: radial-gradient(circle at 50% 50%, var(--ink) 0 11%, hsl(var(--hue) 40% 18%) 12% 14%, #111 15% 100%),
    repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,.05) 0 1px, transparent 1px 4px);
  background-blend-mode: normal, screen; box-shadow: 0 10px 24px -12px rgba(0,0,0,.8), inset 0 0 0 1px rgba(255,255,255,.05); animation: spin 9s linear infinite; }
.disc::before { content: ""; position: absolute; inset: 30%; border-radius: 50%; background: conic-gradient(from 0deg, hsl(var(--hue) 70% 55%), hsl(calc(var(--hue) + 40) 70% 45%), hsl(var(--hue) 70% 55%)); transition: background .6s; }
.disc::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(120deg, rgba(255,255,255,.08), transparent 40%, transparent 60%, rgba(255,255,255,.05)); }
.disc i { position: absolute; inset: 47%; border-radius: 50%; background: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.mock .btn { pointer-events: none; }

.panel { max-width: 720px; }
.panel .lede { max-width: 60ch; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.2,.8,.2,1), transform .7s cubic-bezier(.2,.8,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; }
.feature { border-radius: var(--card-radius); padding: 20px; background: linear-gradient(180deg, var(--panel-lift), var(--panel)); box-shadow: var(--shadow); opacity: 0; transform: translateY(16px); transition: opacity .6s cubic-bezier(.2,.8,.2,1), transform .6s cubic-bezier(.2,.8,.2,1); }
.feature:nth-child(2) { transition-delay: .1s; } .feature:nth-child(3) { transition-delay: .2s; }
.feature.in { opacity: 1; transform: none; }
.feature .ficon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 14%, var(--ink)); color: var(--accent); margin-bottom: 14px; }
.feature .ficon svg { width: 24px; height: 24px; }
.feature h3 { margin-bottom: 6px; } .feature p { margin: 0; color: var(--mute); font-size: 15px; }
.connect { padding-bottom: 20px; }
.panel .swatches { margin-top: 20px; }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; min-height: 0; gap: 28px; }
  .features { grid-template-columns: 1fr; }
  .landing { gap: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .hero .w, .hero .hero-text > *, .mock { animation: none; }
  .reveal, .feature { opacity: 1; transform: none; transition: none; }
  .disc, .mock-strip .dot, .mock-strip .vu i { animation: none; }
}

/* ---- Live ---------------------------------------------------------------------------------- */

.now { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: center; }
.now .title { font-family: var(--display); font-weight: 800; font-size: 22px; line-height: 1.15; }
.now .sub { color: var(--mute); margin-top: 4px; }
.now .readout { margin-top: 10px; display: flex; gap: 10px; flex-wrap: wrap; }
.countdown { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.stations .station { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.stations .station:last-child { border-bottom: 0; }
.stations .pick { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; padding: 12px 0; border: 0; background: none; color: var(--bone); text-align: left; }
.stations .fav { flex: none; border: 0; background: none; padding: 8px; border-radius: 8px; color: var(--mute); }
.stations .fav.on { color: var(--accent); }
.stations .logo { width: 40px; height: 40px; border-radius: 10px; background: var(--ink); object-fit: cover; flex: none; }
.stations .name { font-weight: 600; } .stations .meta { color: var(--mute); font-size: 13px; }
@media (max-width: 380px) { .now { grid-template-columns: 88px 1fr; } .art.lg { width: 88px; height: 88px; } }

/* ---- Charts -------------------------------------------------------------------------------- */

.bars { display: grid; gap: 8px; }
.bars .r { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.bars .r .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .r .track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--ink); overflow: hidden; }
.bars .r .track .bar { height: 100%; background: var(--accent); border-radius: 3px; }
.heat { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.heat i { aspect-ratio: 1; border-radius: 3px; background: color-mix(in srgb, var(--accent) calc(var(--v, 0) * 100%), var(--ink)); animation: fade-in .4s ease both; }
.heat span { text-align: left; overflow: hidden; white-space: nowrap; }
.hours { display: flex; align-items: flex-end; gap: 3px; height: 72px; }
.hours i { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 2px; }

/* ---- Theme picker -------------------------------------------------------------------------- */

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.swatch { border: 2px solid transparent; border-radius: 16px; padding: 8px; background: var(--ink); color: var(--bone); text-align: left; display: grid; gap: 6px; position: relative; }
.swatch[aria-pressed="true"] { border-color: var(--accent); }
.swatch .g { height: 44px; border-radius: 10px; position: relative; overflow: hidden; }
.swatch.locked { opacity: .78; }
.swatch .lock { position: absolute; top: 12px; left: 12px; font-family: var(--mono); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; background: rgba(0,0,0,.45); color: #fff; }
.swatch .g::after { content: ""; position: absolute; right: 8px; bottom: 8px; width: 18px; height: 18px; border-radius: 50%; }
.swatch small { font-size: 12px; font-weight: 600; }
.accents { display: flex; gap: 8px; flex-wrap: wrap; }
.accents button { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; }
.accents button[aria-pressed="true"] { border-color: var(--bone); }

/* ---- Footer -------------------------------------------------------------------------------- */

footer.site { margin-top: 32px; color: var(--mute); font-size: 13px; display: flex; gap: 14px; flex-wrap: wrap; }
footer.site a { color: var(--mute); }

/* ---- Two-column layouts (phones stack them in their own order) ---------------------------- */

.cols { display: flex; flex-direction: column; gap: 12px; }
.cols > .main, .cols > .aside { display: contents; }
.grid-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.grid-cards > .card, .cols .card { margin-top: 0; }
.tabs .brand { display: none; }

/* ---- Desktop: sidebar navigation, wider canvas, cards two across ---------------------------- */

@media (min-width: 1024px) {
  :root { --side: 248px; }
  body.nav .tabs { top: 0; bottom: 0; left: 0; right: auto; width: var(--side); flex-direction: column; justify-content: flex-start; gap: 4px;
    padding: 22px 14px; border-top: 0; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 62%, transparent); }
  body.nav .tabs .brand { display: flex; align-items: center; gap: 12px; padding: 6px 12px 22px; color: var(--bone); }
  body.nav .tabs .brand .mark { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
  body.nav .tabs .brand .mark i { display: block; width: 4px; border-radius: 2px; background: var(--accent); }
  body.nav .tabs .brand b { font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
  body.nav .tabs .brand small { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: .15em; text-transform: uppercase; color: var(--mute); margin-top: 2px; }
  body.nav .tabs a { flex: 0 0 auto; max-width: none; width: 100%; grid-template-columns: 24px 1fr; justify-items: start; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; font-size: 15px; }
  body.nav .tabs a[aria-current="page"] { background: var(--panel-lift); }
  body.nav .tabs a:hover { color: var(--bone); }
  body.nav .strip { padding-left: calc(var(--side) + 28px); }
  body.nav #view { max-width: none; margin: 0; padding: 28px 40px 64px calc(var(--side) + 40px); }
  body.nav .toasts { left: calc(50% + var(--side) / 2); bottom: 28px; }
  h1 { font-size: 40px; }
  #view:not(.wide) { max-width: 1280px; }
  .cols { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px; align-items: start; }
  .cols > .main, .cols > .aside { display: grid; gap: 12px; min-width: 0; }
  .cols > .aside { position: sticky; top: calc(var(--strip-h) + 20px); }
  .cols > .main > *, .cols > .aside > * { order: 0 !important; }
  .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .grid-cards > .row, .grid-cards > .span2, .grid-cards > .lockcard { grid-column: 1 / -1; }
  .grid-cards > .row { margin-top: 8px; }
  .grid3 .stat b { font-size: 28px; }
  .tracks li { padding: 12px 0; }
  .now { grid-template-columns: 128px 1fr; } .art.lg { width: 128px; height: 128px; }
}
@media (min-width: 1400px) {
  body.nav #view { padding-left: calc(var(--side) + 64px); padding-right: 64px; }
}

/* ---- Reduced motion, reduced transparency ------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .ground .glow { animation: none; transform: none; }
  .strip .dot.live { animation: none; } .strip .vu i { animation: none; transform: scaleY(.6); }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .ground .glow, .ground .grain, .ground .vignette, .ground .mark { display: none; }
  .strip, .tabs { background: var(--ink); backdrop-filter: none; }
}
