/* Shared components for both themes. Colours come only from theme tokens. */

@font-face { font-family: Anton; src: url(/assets/fonts/anton.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: Silkscreen; src: url(/assets/fonts/silkscreen.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Space Grotesk"; src: url(/assets/fonts/space-grotesk.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url(/assets/fonts/space-mono.woff2) format("woff2"); font-display: swap; }

:root {
  --font-body: "Space Grotesk", system-ui, sans-serif;
  --font-display: Anton, Impact, "Arial Narrow", sans-serif;
  --font-pixel: Silkscreen, ui-monospace, monospace;
  --font-mono: "Space Mono", ui-monospace, monospace;
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-pill: 999px;
  --gutter: 20px;
  --max: 1200px;
  --player-h: 69px;
}
@media (max-width: 719.98px) { :root { --gutter: 16px; } }

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--font-body); }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; margin: 0; }
button { appearance: none; -webkit-appearance: none; background: none; border: 0; padding: 0; border-radius: 0; cursor: pointer; text-align: inherit; }
fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
main:focus { outline: none; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 100; padding: 10px 16px; border-radius: var(--r-pill); background: var(--inv-bg); color: var(--inv-text); font-weight: 500; text-decoration: none; }
.skip-link:focus { top: 12px; }

/* Type */
.display { display: inline-block; max-width: 100%; padding-right: .08em; font-family: var(--font-display); font-weight: 400; line-height: .95; letter-spacing: .3px; text-transform: uppercase; color: var(--heading); transform: skewX(-10deg); overflow-wrap: break-word; }
.display-xl { font-size: clamp(44px, 8vw, 64px); }
.display-l { font-size: clamp(30px, 6vw, 34px); }
.display-m { font-size: 26px; }
.display-s { font-size: 19px; }
.pixel { font-family: var(--font-pixel); font-size: 10px; line-height: 1.5; letter-spacing: 1px; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.accent { color: var(--accent-text); }
.warm-text { color: var(--warm-text); }
.ok-text { color: var(--ok-text); }
.heading-text { color: var(--heading); }
.lead { font-size: 16px; max-width: 46ch; }
.note { margin-top: 12px; }
.text-link { color: var(--text); font-size: 14px; text-decoration: underline; }
.text-link:hover { text-decoration-thickness: 2px; }

/* Header */
.header-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand nav langs"; align-items: center; column-gap: 16px; max-width: var(--max); margin: 0 auto; padding: 14px var(--gutter); }
.brand { grid-area: brand; display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--heading); text-decoration: none; border-radius: var(--r-sm); }
.brand .frog { width: 32px; height: 32px; flex: none; }
.wordmark { font-size: 22px; white-space: nowrap; }
.wordmark-s { font-size: 20px; white-space: nowrap; }
.wm-accent { color: var(--accent-text); }
.wm-tag { display: inline-block; margin-left: 4px; padding: 3px 6px; border: 1px solid var(--border); border-radius: var(--r-xs); font-family: var(--font-pixel); font-size: 10px; letter-spacing: 1px; line-height: 1; color: var(--muted); transform: skewX(10deg); vertical-align: 4px; }

/* Main nav: one element for every width. It scrolls by drag (ui.js), never with a scrollbar. */
.nav { grid-area: nav; justify-self: end; position: relative; max-width: 100%; overflow: hidden; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.nav ul { display: flex; gap: 4px; width: max-content; padding: 4px; }
.nav a { display: block; padding: 8px 12px; border-radius: var(--r-sm); font-size: 14px; line-height: 20px; color: var(--muted); text-decoration: none; white-space: nowrap; -webkit-user-drag: none; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current="page"], .nav a[aria-current="page"]:hover { color: var(--inv-text); background: var(--inv-bg); font-weight: 500; }
.nav.is-dragging { cursor: grabbing; }
.nav.fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
.nav.fade-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 32px), transparent); }
.nav.fade-l.fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); }

.langs { grid-area: langs; display: flex; align-items: center; }
.langs a { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; min-height: 30px; padding: 0 4px; border-radius: var(--r-xs); font-family: var(--font-pixel); font-size: 11px; letter-spacing: 1px; color: var(--muted); text-decoration: none; }
.langs a:hover { color: var(--text); }
.langs a[aria-current="true"] { color: var(--text); text-decoration: underline 2px var(--accent); text-underline-offset: 5px; }
.langs .sep { color: var(--muted); font-size: 11px; }

@media (max-width: 899.98px) {
  .header-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand langs" "nav nav"; row-gap: 8px; padding-bottom: 10px; }
  .nav { justify-self: stretch; max-width: none; margin: 0 calc(var(--gutter) * -1); }
  .nav ul { padding: 4px var(--gutter); }
}
@media (max-width: 359.98px) {
  .header-row { column-gap: 6px; }
  .brand { gap: 8px; }
  .brand .frog { width: 28px; height: 28px; }
  .wordmark { font-size: 19px; }
  .wm-tag { margin-left: 2px; padding: 3px 4px; letter-spacing: .5px; }
  .langs a { min-width: 26px; padding: 0 2px; }
}

/* Ticker */
.ticker { display: flex; align-items: stretch; background: var(--ticker-bg); color: var(--ticker-text); overflow: hidden; }
.ticker-viewport { flex: 1; min-width: 0; overflow: hidden; padding: 6px 0; }
.ticker-track { display: flex; width: max-content; white-space: nowrap; animation: ticker 90s linear infinite; }
.ticker.is-paused .ticker-track { animation-play-state: paused; }
.ticker-toggle { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; color: var(--ticker-text); border-left: 1px solid currentColor; }
.ticker-toggle .icon { width: 14px; height: 14px; }
.ticker-toggle:focus-visible { outline: 2px solid var(--ticker-text); outline-offset: -4px; }
.ticker-toggle .i-play, .ticker-toggle[aria-pressed="true"] .i-pause { display: none; }
.ticker-toggle[aria-pressed="true"] .i-play { display: block; }
@keyframes ticker { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .ticker-toggle { display: none; }
}

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 1px solid transparent; border-radius: var(--r-pill); font-size: 14px; font-weight: 500; line-height: 1.2; text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s; }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--inv-bg); color: var(--inv-text); }
.btn-primary:hover { background: var(--inv-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-3); }
.btn-light { background: #ffffff; color: #14213f; }
.btn-light:hover { background: #e8eefb; }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: 13px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn:hover { background: var(--surface-3); }
.icon-btn .icon { width: 20px; height: 20px; }
.icon-btn-sm { width: 36px; height: 36px; }
.icon-btn-sm .icon { width: 18px; height: 18px; }
[data-play] .i-pause, [data-playing] [data-play] .i-play { display: none; }
[data-playing] [data-play] .i-pause { display: block; }

/* Cards, tags, notes */
.card { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--r-md); padding: 16px; }
.card-inset { background: var(--bg); padding: 6px; }
.card-label { margin: 0 0 10px; font-size: 12px; font-weight: 500; color: var(--muted); }
.sub-label { margin: 12px 0 2px; }
.sub-label:first-of-type { margin-top: 0; }
.tag { display: inline-block; padding: 2px 6px; border: 1px solid var(--border); border-radius: var(--r-xs); font-family: var(--font-pixel); font-size: 10px; line-height: 1.4; letter-spacing: 1px; text-transform: uppercase; color: var(--text-2); white-space: nowrap; }
.sample-note { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.live-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; background: var(--accent); vertical-align: 1px; }
.ok-dot { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--ok); }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; flex: none; }
.eq i { width: 3px; height: 3px; background: var(--accent); }
[data-playing] .eq i { animation: eq .9s infinite ease-in-out; }
.eq i:nth-child(2) { animation-delay: .2s; }
.eq i:nth-child(3) { animation-delay: .45s; }
.eq i:nth-child(4) { animation-delay: .1s; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }
@media (prefers-reduced-motion: reduce) { [data-playing] .eq i { animation: none; height: 9px; } }

/* Text fields: filled, 54px, 16px text, red focus ring on the wrapper. */
.field-label { display: block; margin: 0 0 8px 2px; font-family: var(--font-pixel); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.field { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 8px 0 16px; background: var(--field-bg); border: 1px solid var(--field-border); border-radius: var(--r-lg); transition: border-color .15s, box-shadow .15s; }
.field:hover { border-color: var(--field-border-hover); }
.field:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.field-lead { width: 20px; height: 20px; color: var(--accent); }
.field input { flex: 1; min-width: 0; height: 52px; padding: 0; background: transparent; border: 0; border-radius: 0; appearance: none; -webkit-appearance: none; font: 400 16px/1.2 var(--font-body); color: var(--text); caret-color: var(--focus); text-overflow: ellipsis; }
.field input:focus { outline: none; }
.field input::placeholder { color: var(--placeholder); opacity: 1; }
.field input::-webkit-search-cancel-button, .field input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
/* Read-only value with a copy button: same shape as a field, but no field affordance. */
.code-box { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 8px 8px 16px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); }
.code-box code { flex: 1; min-width: 0; font: 400 14px/1.45 var(--font-mono); color: var(--text); overflow-wrap: anywhere; }
[data-copy] .i-done, [data-copy].is-done .i-copy { display: none; }
[data-copy].is-done .i-done { display: block; color: var(--ok-text); }

/* Native select as a pill */
.select { position: relative; display: inline-flex; align-items: center; }
.select select { height: 42px; padding: 0 40px 0 16px; border: 1px solid var(--field-border); border-radius: var(--r-pill); background: var(--surface-2); color: var(--text); appearance: none; -webkit-appearance: none; font: 500 16px/1 var(--font-body); cursor: pointer; }
.select select:hover { background: var(--surface-3); }
.select select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.select .icon { position: absolute; right: 14px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.select option { background: var(--surface); color: var(--text); }

/* Segmented control on native radios */
.seg-track { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--field-border); border-radius: var(--r-pill); }
.seg label { position: relative; display: block; }
.seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg span { display: block; padding: 7px 14px; border-radius: var(--r-pill); font-size: 13px; font-weight: 500; line-height: 1.3; color: var(--muted); white-space: nowrap; }
.seg label:hover span { background: var(--surface-3); color: var(--text); }
.seg input:checked + span, .seg label:hover input:checked + span { background: var(--inv-bg); color: var(--inv-text); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }

/* Pixel-bar volume over a native range input */
.vol { position: relative; display: inline-flex; align-items: center; flex: none; height: 32px; padding: 0 4px; border-radius: var(--r-xs); }
.vol-bars { display: flex; align-items: flex-end; gap: 3px; height: 22px; pointer-events: none; }
.vol-bars i { width: 4px; background: var(--vol-off); }
.vol-bars i.on { background: var(--text); }
.vol-bars i:nth-child(1) { height: 6px; } .vol-bars i:nth-child(2) { height: 7.5px; } .vol-bars i:nth-child(3) { height: 9px; }
.vol-bars i:nth-child(4) { height: 10.5px; } .vol-bars i:nth-child(5) { height: 12px; } .vol-bars i:nth-child(6) { height: 13.5px; }
.vol-bars i:nth-child(7) { height: 15px; } .vol-bars i:nth-child(8) { height: 16.5px; } .vol-bars i:nth-child(9) { height: 18px; }
.vol-bars i:nth-child(10) { height: 19.5px; }
.vol input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; -webkit-appearance: none; appearance: none; }
.vol input::-webkit-slider-thumb { -webkit-appearance: none; width: 4px; height: 32px; }
.vol input::-moz-range-thumb { width: 4px; height: 32px; border: 0; }
.vol:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Set cards and art */
.art { width: 100%; height: 100%; }
.set-card { display: block; text-decoration: none; border-radius: var(--r-md); }
.set-art { display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--r-sm); }
.set-card .display { margin-top: 10px; }
.set-meta { display: block; font-size: 12px; margin-top: 2px; }
.set-card:hover .set-art { outline: 2px solid var(--border); outline-offset: 2px; }
.set-card:focus-visible { outline-offset: 4px; }

/* Track lists */
.tracks { padding: 6px; }
.track { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; padding: 9px 10px; border-radius: var(--r-sm); }
.track.is-current { background: var(--accent-soft); }
.track-time { padding-top: 2px; color: var(--muted); }
.track.is-current .track-time { color: var(--accent-text); }
.track-title { font-weight: 500; }
.now-tag { font-size: 9px; white-space: nowrap; }

/* Footer */
.site-footer { margin-top: 48px; border-top: 1px solid var(--line); }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 24px; max-width: var(--max); margin: 0 auto; padding: 28px var(--gutter) 8px; }
.footer-brand p { max-width: 280px; margin: 10px 0 14px; font-size: 13px; }
.social { display: flex; gap: 8px; }
.footer-h { margin: 0 0 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.footer-links a { display: inline-flex; align-items: center; min-height: 32px; font-size: 14px; color: var(--text-2); text-decoration: none; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }
.footer-links .status-link { color: var(--ok-text); }
.footer-bottom { max-width: var(--max); margin: 0 auto; padding: 14px var(--gutter) 22px; font-size: 12px; color: var(--muted); }
.footer-bottom p { padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 719.98px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* Persistent player */
body.has-player { padding-bottom: calc(var(--player-h) + env(safe-area-inset-bottom)); }
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; flex-direction: column; }
.player-bar { display: flex; align-items: center; gap: 14px; min-height: var(--player-h); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.player-open { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; border-radius: var(--r-sm); }
.player-art { flex: none; width: 48px; height: 48px; overflow: hidden; border-radius: 6px; }
.player-meta { display: block; min-width: 0; }
.player-title { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; }
.player-title .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-sub { display: block; overflow: hidden; font-size: 12px; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.player-live { display: flex; align-items: center; white-space: nowrap; }
.play-btn { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--inv-bg); color: var(--inv-text); }
.play-btn:hover { background: var(--inv-hover); }
.play-btn .icon { width: 22px; height: 22px; }
.player-toggle .icon { transition: transform .2s; }
.player.is-open .player-toggle .icon { transform: rotate(180deg); }
.player-panel { max-height: min(72vh, 640px); overflow: auto; background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--shadow); }
.panel-inner { display: grid; grid-template-columns: 200px minmax(0, 1fr); grid-template-areas: "art head" "art body"; gap: 6px 28px; align-items: start; max-width: var(--max); margin: 0 auto; padding: 22px var(--gutter); }
.panel-art { grid-area: art; aspect-ratio: 1; overflow: hidden; border-radius: var(--r-md); }
.panel-head { grid-area: head; }
.panel-head .display { margin: 8px 0 4px; }
.panel-body { grid-area: body; margin-top: 10px; }
.panel-body .tracks { margin: 0; }
.panel-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 16px 0; }
.codec { font-size: 13px; }
.onair-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wide-only, .xl-only { display: none; }
@media (min-width: 900px) {
  .player .wide-only { display: inline-flex; }
  .player .narrow-only { display: none; }
}
@media (min-width: 1100px) { .player .xl-only { display: flex; } }
@media (max-width: 719.98px) {
  .player-bar { gap: 10px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) 8px; }
  .player-bar .eq { display: none; }
  .sub-prefix { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .panel-inner { grid-template-columns: 88px minmax(0, 1fr); grid-template-areas: "art head" "body body"; gap: 6px 16px; padding: 16px var(--gutter); }
  .panel-head .display { font-size: 30px; }
}
