/* ============================================================================
   FREQ1C — VOID.FM · styles.css
   Shell Engineer. Dark cosmic editorial radio station.
   Tokens (:root) are pasted VERBATIM from BUILD_CONTRACT §2 and are LAW.
   ========================================================================== */

:root{
  /* ---- COLOR: near-monochrome void + ONE accent ---- */
  --bg:            #05050A;   /* deep-space black page ground */
  --bg-2:          #07070D;   /* player slab / sticky chrome ground */
  --surface:       #0B0B12;   /* cards, rows, panels resting on bg */
  --elevated:      #11111A;   /* hovered/active surface, menus */
  --line:          #1C1C28;   /* default 1px hairline rule/border */
  --line-strong:   #2A2A3A;   /* stronger divider when needed */
  --text:          #F2F2F7;   /* primary text (electric white) */
  --text-dim:      #8A8AA0;   /* secondary text */
  --text-mute:     #5A5A70;   /* mono labels at rest, captions */
  --accent:        #8A6BFF;   /* Cosmic Violet — the ONE accent */
  --accent-hover:  #A98CFF;   /* lighter violet for hover/active glow */
  --accent-dim:    rgba(138,107,255,0.16); /* hairline frames, fills-at-rest */
  --accent-glow:   rgba(138,107,255,0.45); /* bloom halos */
  --spark:         #F0A35E;   /* Amber Star — RARE second spark: ON AIR dot only */
  --on-bad:        #FF6B6B;   /* error/pending emphasis if ever needed */

  /* ---- TYPE ---- */
  --font-display: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono:    "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  /* modular scale (root 16px). Use rem everywhere. */
  --fs-display: 4.25rem;   /* 68px — masthead / hero wordmark (clamp below) */
  --fs-h1:      2.25rem;   /* 36px — view titles */
  --fs-h2:      1.5rem;    /* 24px — section/state names */
  --fs-h3:      1.125rem;  /* 18px — track title in detail, state name in row */
  --fs-body:    1rem;      /* 16px — prose, lyrics */
  --fs-sm:      0.875rem;  /* 14px — secondary */
  --fs-label:   0.75rem;   /* 12px — mono labels (STATE • YEAR • CH • TX) */
  --fs-micro:   0.6875rem; /* 11px — micro mono (ticker, captions, tile meta) */
  --tracking-label: 0.18em;/* letter-spacing for mono UPPERCASE labels */
  --tracking-wide:  0.06em;/* mild tracking for display caps */
  --lh-tight: 1.1;
  --lh-body:  1.6;         /* lyrics + prose */

  /* fluid masthead — engineers MUST use this for the hero wordmark */
  --fs-masthead: clamp(2.75rem, 9vw, 7rem);

  /* ---- SPACING (4px base) ---- */
  --s-1: 0.25rem;  /* 4  */
  --s-2: 0.5rem;   /* 8  */
  --s-3: 0.75rem;  /* 12 */
  --s-4: 1rem;     /* 16 */
  --s-5: 1.5rem;   /* 24 */
  --s-6: 2rem;     /* 32 */
  --s-7: 3rem;     /* 48 */
  --s-8: 4rem;     /* 64 */
  --s-9: 6rem;     /* 96 */
  --grid-gap: 0.625rem;   /* 10px — TIGHT NTS-style grid gutter (the void between portholes) */

  /* ---- RADII (broadcast rigor: sharp everywhere) ---- */
  --radius: 0px;          /* GLOBAL: border-radius:0 on essentially everything */
  --radius-pill: 0px;     /* chips are square too; no pills */

  /* ---- BORDERS ---- */
  --border:        1px solid var(--line);
  --border-accent: 1px solid var(--accent);
  --border-frame:  1px solid var(--accent-dim);  /* porthole hairline frame at rest */

  /* ---- SHADOWS / GLOWS (compositor-friendly only: box-shadow, no filter:blur on big nodes) ---- */
  --glow-tile:  0 0 60px -10px var(--accent-glow); /* hover bloom on a tile */
  --glow-soft:  0 0 40px -12px var(--accent-glow); /* player cover ring, focal lift */
  --vignette:   radial-gradient(120% 80% at 50% 0%, transparent 55%, rgba(0,0,0,0.55) 100%); /* wall/void vignette */
  --core-glow:  radial-gradient(60% 50% at 50% 100%, rgba(138,107,255,0.10), transparent 70%); /* violet core-glow behind hero + player */
  --scrim:      linear-gradient(to top, rgba(5,5,10,0.92) 0%, rgba(5,5,10,0.0) 60%); /* tile caption scrim */

  /* ---- MOTION ---- */
  --dur-fast:   140ms;
  --dur:        240ms;
  --dur-slow:   600ms;   /* tile glow bloom "wakes up" */
  --dur-tune:   400ms;   /* state retune reflow stagger */
  --ease:       cubic-bezier(.2,.6,.2,1);
  --ease-bloom: cubic-bezier(.16,1,.3,1);  /* slow wake-up, no snap */
  --ease-out:   cubic-bezier(0,0,.2,1);

  /* ---- LAYOUT CONSTANTS ---- */
  --player-h: 76px;          /* desktop transmission bar height */
  --player-h-mobile: 64px;
  --header-h: 56px;          /* top nav + ON AIR rail */
  --maxw: 1440px;            /* content max width; grid may go edge-to-edge inside */
  --gutter: clamp(1rem, 4vw, 3rem);
}

/* ============================================================================
   GLOBAL RESET — border-radius:0 is LAW (§2 rule 2); border-box everywhere
   ========================================================================== */
*,*::before,*::after{
  box-sizing: border-box;
  border-radius: var(--radius);
  margin: 0;
  padding: 0;
}

html{ -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  /* static void fallback so the dark reads even if the starfield canvas is cut */
  background-image:
    radial-gradient(1px 1px at 18% 32%,  rgba(242,242,247,0.55), transparent),
    radial-gradient(1px 1px at 72% 18%,  rgba(242,242,247,0.40), transparent),
    radial-gradient(1px 1px at 44% 68%,  rgba(242,242,247,0.35), transparent),
    radial-gradient(1px 1px at 88% 54%,  rgba(138,107,255,0.55), transparent),
    radial-gradient(1px 1px at 9%  76%,  rgba(242,242,247,0.30), transparent),
    radial-gradient(1px 1px at 61% 88%,  rgba(242,242,247,0.28), transparent),
    var(--core-glow);
  background-attachment: fixed;
}

img{ display:block; max-width:100%; }
a{ color: inherit; text-decoration: none; }
button{ font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input{ font: inherit; }
canvas{ display:block; }
ul,ol{ list-style: none; }

::selection{ background: var(--accent); color: #05050A; }

/* Starfield substrate — fixed behind everything */
#starfield{
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;   /* track the visible viewport as mobile URL bars show/hide */
  z-index: -1;
  pointer-events: none;
}

/* Skip link */
.skip-link{
  position: fixed;
  top: -100px;
  left: var(--s-4);
  z-index: 1000;
  background: var(--accent);
  color: #05050A;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  padding: var(--s-2) var(--s-4);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus{ top: var(--s-3); }

/* ============================================================================
   SHARED MONO LABEL
   ========================================================================== */
.mono-label{
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 400;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  /* AA contrast: these mono labels are frequently the ONLY conveyor of metadata
     (CH/TX/STATE/YEAR), so the rest color is --text-dim (6.03:1, passes) rather
     than --text-mute (3.03:1, fails). Decorative duplicates may re-mute locally. */
  color: var(--text-dim);
  line-height: 1.2;
}
.mono-time{
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.04em;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* Boxed section label (§6.7) — reused everywhere */
.seclabel{
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-dim);
  padding: var(--s-2) var(--s-3);
  border-left: 1px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-dim), transparent 60%);
}

/* Generic pending block (§4.3) */
.pending-block{
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px dashed var(--line-strong);
  background: var(--surface);
  padding: var(--s-6) var(--s-5);
  text-align: center;
}

/* Ghost button (hero CTA / detail back) */
.btn-ghost{
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-dim);
  border: var(--border);
  padding: var(--s-3) var(--s-4);
  transition: color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              background var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.btn-ghost:hover{
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: var(--glow-soft);
}

/* ============================================================================
   HEADER / NAV  (persistent, sticky)
   ========================================================================== */
#site-header{
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: var(--s-5);
  height: var(--header-h);
  padding: 0 var(--gutter);
  background: rgba(7,7,13,0.82);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
  border-bottom: var(--border);
}

#brand{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  /* emits light */
  text-shadow: 0 0 1px var(--accent), 0 0 18px var(--accent-glow);
  -webkit-text-stroke: 0.4px rgba(138,107,255,0.55);
  white-space: nowrap;
  transition: text-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
}
#brand:hover{
  color: #fff;
  text-shadow: 0 0 2px var(--accent), 0 0 26px var(--accent-glow);
}

#site-nav{
  display: flex;
  align-items: center;
  gap: var(--s-5);
  margin-right: auto;
  padding-left: var(--s-5);
  border-left: var(--border);
  height: 100%;
}

.nav-link{
  position: relative;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-dim);   /* AA: primary mode links must read at rest */
  transition: color var(--dur) var(--ease);
  white-space: nowrap;
}
/* frequency tick prefix */
.nav-link::before{
  content: "· ";
  color: var(--accent);
  opacity: 0.45;
  transition: opacity var(--dur) var(--ease);
}
.nav-link:hover{ color: var(--text); }
.nav-link:hover::before{ opacity: 1; }

.nav-link[data-active]{
  color: var(--accent);
}
.nav-link[data-active]::before{ opacity: 1; }
.nav-link[data-active]::after{
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

#site-social{
  display: flex;
  align-items: center;
  gap: var(--s-4);
}
.social-link{
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-dim);   /* AA: IG/TT links legible at rest */
  transition: color var(--dur) var(--ease);
}
.social-link:hover{ color: var(--accent); }

/* ============================================================================
   ON AIR RAIL + MARQUEE  (§6.6)
   ========================================================================== */
#onair-rail{
  position: sticky;
  top: var(--header-h);
  z-index: 85;
  display: flex;
  align-items: center;
  height: 30px;
  background: var(--bg-2);
  border-bottom: var(--border);
  overflow: hidden;
}

#onair{
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex: 0 0 auto;
  height: 100%;
  padding: 0 var(--s-4);
  border-right: var(--border);
  background: var(--surface);
}
#onair-label{
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-dim);   /* AA: "ON AIR" status label at rest */
  transition: color var(--dur) var(--ease);
}
#onair-dot{
  width: 7px; height: 7px;
  background: var(--text-mute);
  box-shadow: none;
  flex: 0 0 auto;
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
/* LIVE only while actually playing (§5). The amber spark is the ONLY amber. */
#onair[data-live="true"] #onair-dot{
  background: var(--spark);
  box-shadow: 0 0 8px var(--spark), 0 0 16px rgba(240,163,94,0.6);
  animation: onair-pulse 1.6s var(--ease) infinite;
}
#onair[data-live="true"] #onair-label{ color: var(--spark); }

@keyframes onair-pulse{
  0%,100%{ opacity: 1;   transform: scale(1); }
  50%    { opacity: 0.45; transform: scale(0.8); }
}

#marquee-viewport{
  position: relative;
  flex: 1 1 auto;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
#player-marquee{
  display: inline-block;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
  will-change: transform;
  animation: marquee 50s linear infinite;
}
#player-marquee .mq-live{ color: var(--spark); }
#player-marquee .mq-accent{ color: var(--accent); }

@keyframes marquee{
  from{ transform: translateX(0); }
  to{   transform: translateX(-50%); }
}

/* ============================================================================
   APP / VIEWS
   ========================================================================== */
#app{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.view{
  padding-top: var(--s-7);
  /* fixed player must never overlap the last row (§8) */
  padding-bottom: calc(var(--player-h) + var(--s-7));
  animation: view-in var(--dur) var(--ease-out);
}
.view[hidden]{ display: none; }

@keyframes view-in{
  from{ opacity: 0; transform: translateY(6px); }
  to{   opacity: 1; transform: translateY(0); }
}

/* Generic view-title (JS may use for tuned headers etc.) */
.view-title{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h1);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  line-height: var(--lh-tight);
}

/* Block rhythm helpers the renderer can lean on */
.block{ margin-top: var(--s-7); }
.block:first-child{ margin-top: 0; }
.block__head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-4);
  margin-bottom: var(--s-5);
  flex-wrap: wrap;
}
.block__sub{
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-dim);   /* AA: sole metadata count ("06 FRESH SIGNALS") */
}

/* ============================================================================
   HERO  (NEW view masthead) — VOID.FM concept: type wordmark + figure in the void
   ========================================================================== */
.hero{
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,1.15fr) minmax(0,0.85fr);
  align-items: center;
  gap: var(--s-6);
  min-height: clamp(360px, 52vh, 560px);
  padding: var(--s-7) 0 var(--s-8);
  border-bottom: var(--border);
  overflow: hidden;
}
.hero__core{
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 140%;
  background: var(--core-glow);
  pointer-events: none;
  z-index: 0;
}
.hero__copy{
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-4);
}
.hero__kicker{ margin-bottom: var(--s-2); }

.hero__wordmark{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-masthead);
  line-height: 0.92;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 0 2px var(--accent-dim), 0 0 60px rgba(138,107,255,0.25);
}
.hero__tagline{
  max-width: 44ch;
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.45;
  color: var(--text-dim);
  font-weight: 400;
}
.hero__meta{
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
  color: var(--text-dim);   /* AA: "19 TRANSMISSIONS · 08 STATES · EST. 2026" */
}
.hero__dot{ color: var(--accent); }
.hero__cta{
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  margin-top: var(--s-3);
}

.hero__figure{
  position: relative;
  z-index: 1;
  align-self: stretch;
  min-height: clamp(340px, 48vh, 520px);
  border-left: var(--border);
  overflow: hidden;
  /* Single hooded-figure hero portrait, painted as a background so it crops
     cleanly to the column at any aspect (<img> below is hidden preload). */
  background-image: url("assets/img/gen/hero-portrait-3.jpg");
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center 16%;
}
/* dim + desaturate + dissolve the painted figure into the void */
.hero__figure::after{
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--bg) 0%, rgba(5,5,10,0) 30%, rgba(5,5,10,0) 78%, rgba(5,5,10,0.85) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(5,5,10,0) 18%, rgba(5,5,10,0) 80%, var(--bg) 100%),
    rgba(5,5,10,0.12);
  pointer-events: none;
}
/* keep the asset in the document (preload + semantics) but out of visual flow */
.hero__figure img{
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}
.hero__figcap{
  position: absolute;
  left: var(--s-4);
  bottom: var(--s-4);
  z-index: 2;
  color: var(--text-dim);   /* AA: "CH.00 · VOID · TX-000" caption */
  background: rgba(5,5,10,0.55);
  padding: var(--s-1) var(--s-2);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* ============================================================================
   TILE GRID  (§6.1, §8) — the dense porthole wall
   ========================================================================== */
.tile-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--grid-gap);
}

/* TILE — the porthole. <button>. */
.tile{
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  background: transparent;
  color: var(--text);
  isolation: isolate;
}

.tile__frame{
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;          /* every porthole square regardless of source ratio */
  overflow: hidden;
  border: var(--border-frame);
  background: var(--surface);
  /* inner vignette */
  box-shadow: inset 0 0 60px -20px rgba(0,0,0,0.9);
  transition: border-color var(--dur-slow) var(--ease-bloom),
              box-shadow var(--dur-slow) var(--ease-bloom);
}

.tile__cover{
  width: 100%;
  height: 100%;
  object-fit: cover;             /* CRITICAL — uniform portholes from mixed-aspect art */
  object-position: center;
  filter: brightness(0.82) saturate(0.92);
  transition: filter var(--dur-slow) var(--ease-bloom),
              transform var(--dur-slow) var(--ease-bloom);
}

.tile__scrim{
  position: absolute;
  inset: 0;
  background: var(--scrim);
  opacity: 0.65;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}

/* center play glyph */
.tile__play{
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: var(--text);
  background: rgba(5,5,10,0.55);
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 1px rgba(5,5,10,0.4), var(--glow-soft);
  opacity: 0;
  pointer-events: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: opacity var(--dur) var(--ease),
              transform var(--dur) var(--ease-bloom),
              color var(--dur) var(--ease);
}

/* tally — STBY ↔ ON AIR */
.tile__tally{
  position: absolute;
  top: var(--s-2);
  left: var(--s-2);
  z-index: 3;
  font-size: var(--fs-micro);
  color: var(--text-dim);   /* AA: sole broadcast-status label on the tile */
  background: rgba(5,5,10,0.6);
  padding: 2px var(--s-2);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

/* pending chip — only when data-playable="false" */
.tile__pending{
  position: absolute;
  top: var(--s-2);
  right: var(--s-2);
  z-index: 3;
  display: none;
  font-size: var(--fs-micro);
  color: var(--text-dim);
  background: rgba(5,5,10,0.6);
  border: 1px solid var(--line-strong);
  padding: 2px var(--s-2);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.tile[data-playable="false"] .tile__pending{ display: block; }

/* caption below the porthole */
.tile__cap{
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--s-3) 0 var(--s-2);
}
.tile__title{
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--fs-sm);
  line-height: 1.2;
  color: var(--text);
  letter-spacing: 0.01em;
  /* clamp to one line, ellipsis */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--dur) var(--ease);
}
.tile__meta{
  font-size: var(--fs-micro);
  color: var(--text-dim);   /* AA: sole CH/STATE/TX metadata under the porthole */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- THE SPOTLIGHT LAW (§6.1): hover/focus lifts this tile, dims siblings ---- */
.tile:hover,
.tile:focus-visible{
  outline: none; /* ring handled below on the frame for nicer fit */
}
.tile:hover .tile__frame,
.tile:focus-visible .tile__frame{
  border-color: var(--accent);
  box-shadow: var(--glow-tile), inset 0 0 60px -24px rgba(0,0,0,0.7);
}
.tile:hover .tile__cover,
.tile:focus-visible .tile__cover{
  filter: brightness(1.05) saturate(1.05);
}
.tile:hover .tile__scrim,
.tile:focus-visible .tile__scrim{ opacity: 0.35; }
.tile:hover .tile__play,
.tile:focus-visible .tile__play{
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.tile:hover .tile__title,
.tile:focus-visible .tile__title{ color: #fff; }

/* sibling-dim: the room redirects its light (keep subtle ~10–12%) */
.tile-grid:hover .tile:not(:hover),
.tile-grid:focus-within .tile:not(:focus-within){
  filter: brightness(0.7);
  transition: filter var(--dur-slow) var(--ease-bloom);
}

/* pending tiles: dim/disable the play glyph */
.tile[data-playable="false"] .tile__play{
  color: var(--text-mute);
  border-color: var(--line-strong);
  box-shadow: none;
}
.tile[data-playable="false"] .tile__play::after{
  /* struck-through feel */
  content: "";
  position: absolute;
  left: 12%; right: 12%; top: 50%;
  height: 1px;
  background: var(--text-mute);
  transform: rotate(-32deg);
}

/* Album entries: the porthole IS a live destination (plays the whole album), so it
   keeps the accent play glyph — never the pending "dimmed + struck" treatment. The
   "ALBUM" chip reuses the pending-chip slot top-right. */
.tile[data-album="true"] .tile__play{
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(5,5,10,0.4), var(--glow-soft);
}
.tile[data-album="true"] .tile__play::after{ display: none; }
.seq-row[data-album="true"] .seq-row__thumb::before{ display: none; }

/* CURRENT (loaded/playing) tile highlight — applies in every grid it appears in */
.tile[data-current="true"] .tile__frame{
  border-color: var(--accent);
  box-shadow: var(--glow-tile);
}
.tile[data-current="true"] .tile__tally,
.seq-row[data-current="true"] .seq-row__tally{
  color: var(--spark);
}
.tile[data-current="true"] .tile__title{ color: #fff; }

/* ============================================================================
   NEW-RAIL  (§6.5) — horizontal scroll-snap of the isNew set
   ========================================================================== */
.new-rail{
  display: flex;
  gap: var(--grid-gap);
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  padding-bottom: var(--s-3);
  /* hide scrollbar tastefully */
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.new-rail::-webkit-scrollbar{ display: none; }

.new-rail .tile{
  flex: 0 0 auto;
  width: clamp(180px, 24vw, 260px);
  scroll-snap-align: start;
}

/* ============================================================================
   SEQ ROW  (§6.3) — the in-sequence channel log
   ========================================================================== */
.seq-list{
  border-top: var(--border);
}
.seq-row{
  display: grid;
  grid-template-columns: 2.5rem 56px 1fr auto auto;
  align-items: center;
  gap: var(--s-4);
  min-height: 68px;
  padding: var(--s-3) var(--s-2);
  border-bottom: var(--border);
  background: transparent;
  transition: background var(--dur) var(--ease);
}
.seq-row:hover{ background: var(--surface); }

.seq-row__index{
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--text-dim);   /* AA: sole track-number label */
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.seq-row:hover .seq-row__index{ color: var(--accent); }

.seq-row__thumb{
  position: relative;
  width: 56px; height: 56px;
  overflow: hidden;
  border: var(--border-frame);
  background: var(--surface);
  flex: 0 0 auto;
}
.seq-row__thumb img{
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  filter: brightness(0.82) saturate(0.92);
  transition: filter var(--dur) var(--ease);
}
.seq-row__thumb::before{
  /* play glyph overlay */
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent var(--text);
  opacity: 0;
  filter: drop-shadow(0 0 6px var(--accent-glow));
  transition: opacity var(--dur) var(--ease);
  z-index: 2;
}
.seq-row__thumb::after{
  content: "";
  position: absolute; inset: 0;
  background: rgba(5,5,10,0.45);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.seq-row:hover .seq-row__thumb::before,
.seq-row__thumb:focus-visible::before{ opacity: 1; }
.seq-row:hover .seq-row__thumb::after,
.seq-row__thumb:focus-visible::after{ opacity: 1; }
.seq-row:hover .seq-row__thumb img{ filter: brightness(1.02) saturate(1.02); }

/* tally dot on the thumb */
.seq-row__tally{
  position: absolute;
  top: 4px; right: 4px;
  z-index: 3;
  width: 6px; height: 6px;
  background: transparent;
}
.seq-row[data-current="true"] .seq-row__tally{
  background: var(--spark);
  box-shadow: 0 0 8px var(--spark);
}

.seq-row__main{
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.seq-row__title{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-h3);
  line-height: 1.2;
  color: var(--text);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--dur) var(--ease);
}
.seq-row__main:hover .seq-row__title{ color: var(--accent-hover); }
.seq-row__essence{
  font-size: var(--fs-sm);
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60ch;
}
.seq-row__state{
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  color: var(--text-dim);   /* AA: sole state label on the row */
  text-align: right;
  white-space: nowrap;
}
.seq-row__tx{
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.08em;
  color: var(--text-dim);   /* AA: sole TX-id label on the row */
  text-align: right;
  white-space: nowrap;
  min-width: 4.5rem;
}
.seq-row[data-current="true"]{ background: var(--elevated); }
.seq-row[data-current="true"] .seq-row__title{ color: #fff; }
.seq-row[data-current="true"] .seq-row__state{ color: var(--accent); }

/* pending row: strike the play affordance */
.seq-row[data-playable="false"] .seq-row__thumb::before{
  border-left-color: var(--text-mute);
}

/* ============================================================================
   STATE CARD  (§6.2) — the tuner index
   ========================================================================== */
.state-grid{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gap);
}

.state-card{
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "num   name   glyph"
    "tag   tag    meta";
  align-items: center;
  gap: var(--s-2) var(--s-4);
  padding: var(--s-5);
  background: var(--surface);
  border: var(--border);
  overflow: hidden;
  transition: background var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.state-card::before{
  /* accent left rail that lights on hover */
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  z-index: 2;
  background: var(--accent-dim);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
/* per-state portrait backdrop — dimmed so the card text stays AA-readable */
.state-card__bg{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  z-index: 0;
  opacity: 0.20;
  filter: saturate(1.1) contrast(1.02);
  transition: opacity var(--dur) var(--ease), transform 600ms var(--ease);
  pointer-events: none;
}
.state-card:hover .state-card__bg{ opacity: 0.38; transform: scale(1.04); }
/* lift real content above the backdrop */
.state-card > :not(.state-card__bg){ position: relative; z-index: 1; }
.state-card:hover{
  background: var(--elevated);
  border-color: var(--accent);
  box-shadow: var(--glow-soft);
}
.state-card:hover::before{
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.state-card__num{
  grid-area: num;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  color: var(--text-dim);   /* AA: sole channel-number label */
  font-variant-numeric: tabular-nums;
}
.state-card:hover .state-card__num{ color: var(--accent); }

.state-card__name{
  grid-area: name;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-h2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1;
  transition: color var(--dur) var(--ease), text-shadow var(--dur) var(--ease);
}
.state-card:hover .state-card__name{
  color: var(--accent-hover);
  text-shadow: 0 0 24px var(--accent-glow);
}

.state-card__glyph{
  grid-area: glyph;
  width: 120px;
  height: 40px;
  opacity: 0.85;
  justify-self: end;
}

.state-card__tag{
  grid-area: tag;
  font-size: var(--fs-sm);
  color: var(--text-dim);
  line-height: 1.3;
}
.state-card__freq,
.state-card__count{
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  color: var(--text-dim);   /* AA: sole TX-count label (freq is re-accented in meta) */
}
.state-card__meta{
  grid-area: meta;
  display: flex;
  gap: var(--s-3);
  align-items: center;
  justify-self: end;
  white-space: nowrap;
}
/* if the renderer places freq/count directly in the meta column */
.state-card__meta .state-card__freq{ color: var(--accent); }

/* ============================================================================
   TUNED STATE HEADER (#/states/:id)  (§3) + retune transition
   ========================================================================== */
.tuned-head{
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-5) 0 var(--s-6);
  border-bottom: var(--border);
  margin-bottom: var(--s-6);
}
.tuned-head__top{
  display: flex;
  align-items: center;
  gap: var(--s-4);
  flex-wrap: wrap;
  justify-content: space-between;
}
.tuned-head__label{ /* uses .seclabel */ }
.tuned-head__desc{
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: var(--accent-hover);
  max-width: 70ch;
}
.scan-all{
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text-dim);   /* AA: "SCAN ALL" action link */
  transition: color var(--dur) var(--ease);
}
.scan-all:hover{ color: var(--accent); }

/* retune reflow: grid children fade/slide in with a tiny stagger */
.is-retuning .tile{
  animation: retune var(--dur-tune) var(--ease-bloom) both;
}
@keyframes retune{
  from{ opacity: 0; transform: translateY(10px) scale(0.99); filter: brightness(0.5); }
  to{   opacity: 1; transform: none; filter: none; }
}

/* ============================================================================
   TRACK DETAIL  (§6.4)
   ========================================================================== */
.detail{
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr);
  gap: var(--s-8);
  align-items: start;
}

/* LEFT — cover block */
.detail__left{
  position: sticky;
  top: calc(var(--header-h) + 30px + var(--s-5));
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}
.detail__cover{
  position: relative;
  width: 100%;
  /* honor the real art here (the one place) */
  border: var(--border-frame);
  background: var(--surface);
  overflow: hidden;
}
.detail__cover img{
  width: 100%;
  height: auto;
  display: block;
  filter: brightness(0.92) saturate(0.98);
}
/* playing treatment: glow ring */
.detail__cover[data-current="true"]{
  border-color: var(--accent);
  box-shadow: var(--glow-soft);
}
.detail__cover[data-current="true"]::after{
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid var(--accent);
  box-shadow: inset 0 0 40px -12px var(--accent-glow);
  pointer-events: none;
  animation: ring-breathe 3.2s var(--ease) infinite;
}
@keyframes ring-breathe{
  0%,100%{ opacity: 0.55; }
  50%    { opacity: 1; }
}

.detail__play{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  width: 100%;
  padding: var(--s-4) var(--s-5);
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--text);
  background: var(--accent-dim);
  border: var(--border-accent);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease), color var(--dur) var(--ease);
}
.detail__play:hover{
  background: rgba(138,107,255,0.26);
  box-shadow: var(--glow-soft);
  color: #fff;
}
.detail__play svg{ width: 16px; height: 16px; fill: currentColor; }
.detail__play[disabled],
.detail__play.is-pending{
  color: var(--text-dim);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  cursor: default;
  box-shadow: none;
}

/* fielded metadata block */
.detail__fields{
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-3);
  align-items: center;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.06em;
  color: var(--text-dim);
}
.detail__fields .sep{ color: var(--accent); opacity: 0.6; }
.detail__pending-chip{
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--spark);
  border: 1px solid rgba(240,163,94,0.4);
  background: rgba(240,163,94,0.08);
  padding: 2px var(--s-2);
}

/* RIGHT — essence / sonic / lyrics */
.detail__right{
  display: flex;
  flex-direction: column;
  gap: var(--s-6);
  min-width: 0;
}
.detail__eyebrow{
  display: flex;
  align-items: center;
  gap: var(--s-3);
  flex-wrap: wrap;
}
.detail__title{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, var(--fs-display));
  line-height: 1.02;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--text);
}
/* essence as pulled lead line */
.detail__lead{
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  line-height: 1.3;
  color: var(--text-dim);
  border-left: 2px solid var(--accent);
  padding-left: var(--s-5);
}
.detail__lead em, .detail__lead .accent{ color: var(--accent-hover); font-style: normal; }

/* sonic panel */
.detail__sonic{
  background: var(--surface);
  border: var(--border);
  border-left: 1px solid var(--accent);
  padding: var(--s-4) var(--s-5);
}
.detail__sonic-body{
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--text-dim);
  white-space: pre-wrap;     /* sonic can be multi-line */
  margin-top: var(--s-3);
}

/* LYRICS */
.detail__lyrics{
  display: block;
}
.lyrics-body{
  margin-top: var(--s-4);
  white-space: pre-wrap;     /* preserve line breaks exactly */
  font-family: var(--font-display);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  max-width: 62ch;
}
/* parsed section header */
.lyric-head{
  display: block;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--accent);
  margin-top: var(--s-6);
  margin-bottom: var(--s-2);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--line);
}
.lyric-head:first-child{ margin-top: 0; }
.lyric-line{
  display: block;
  color: var(--text);
}
/* faint dim on empty lyric lines is handled by pre-wrap spacing */

.detail__back{
  margin-top: var(--s-4);
}

/* ============================================================================
   PERSISTENT PLAYER  (§4.1, §5, §8) — the transmission bar
   ========================================================================== */
#player{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 100;
  height: var(--player-h);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 2fr) minmax(180px, 1fr);
  align-items: center;
  gap: var(--s-5);
  padding: 0 var(--gutter);
  background: rgba(7,7,13,0.92);
  -webkit-backdrop-filter: blur(20px) saturate(130%);
  backdrop-filter: blur(20px) saturate(130%);
  border-top: var(--border);
}
/* violet core-glow bleeding up behind the bar */
#player::before{
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 180%;
  background: var(--core-glow);
  pointer-events: none;
  z-index: -1;
}
/* the bar wakes a touch when something is loaded/playing */
#player[data-state="playing"]{ border-top-color: var(--accent-dim); }

/* LEFT zone: cover + meta */
#player-left{
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-width: 0;
}
#player-cover-link{
  position: relative;
  flex: 0 0 auto;
  width: 52px; height: 52px;
  display: block;
  border: var(--border-frame);
  overflow: hidden;
  background: var(--surface);
}
#player-cover{
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  filter: brightness(0.9) saturate(0.95);
}
.player-cover__ring{
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
#player[data-state="playing"] #player-cover-link{ border-color: var(--accent); }
#player[data-state="playing"] .player-cover__ring{
  border-color: var(--accent);
  box-shadow: var(--glow-soft);
}

#player-meta{ min-width: 0; display: flex; flex-direction: column; gap: 3px; }
#player-title{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}
#player-state{
  color: var(--text-dim);   /* AA: idle "NO SIGNAL" / CH·STATE readout */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#player[data-state="playing"] #player-state{ color: var(--accent); }

/* CENTER zone: transport + scrub */
#player-center{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s-2);
  min-width: 0;
}
#player-transport{
  display: flex;
  align-items: center;
  gap: var(--s-3);
}
.player-btn{
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  color: var(--text-dim);
  border: 1px solid transparent;
  transition: color var(--dur) var(--ease),
              background var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.player-btn:hover{ color: var(--text); }
.player-btn:disabled{ color: var(--text-mute); opacity: 0.4; cursor: default; }
.player-icon{ width: 20px; height: 20px; fill: currentColor; display: block; }

.player-btn--play{
  width: 44px; height: 44px;   /* ≥44px touch target */
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-dim);
}
.player-btn--play:hover{
  color: #fff;
  background: rgba(138,107,255,0.26);
  box-shadow: var(--glow-soft);
}
.player-btn--play .player-icon{ width: 22px; height: 22px; }
/* toggle glyph swap driven by data-playing */
.player-icon--pause{ display: none; }
.player-btn--play[data-playing="true"] .player-icon--play{ display: none; }
.player-btn--play[data-playing="true"] .player-icon--pause{ display: block; }

#player-scrub{
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  max-width: 560px;
}

/* CENTER readouts */
#player-elapsed, #player-remaining{ flex: 0 0 auto; min-width: 3.2em; }
#player-remaining{ text-align: right; }

/* RIGHT zone: channel + volume */
#player-right{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s-4);
  min-width: 0;
}
#player-channel{
  color: var(--text-dim);
  white-space: nowrap;
  letter-spacing: 0.1em;
}
#player[data-state="playing"] #player-channel{ color: var(--accent); }
.player-vol{
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.player-vol__icon{
  width: 18px; height: 18px;
  fill: var(--text-mute);
  flex: 0 0 auto;
}

/* ---- RANGE INPUTS (seek + volume) — styled, themed, square ---- */
input[type="range"]{
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 16px;
  background: transparent;
  cursor: pointer;
}
#player-seek{ flex: 1 1 auto; }
#player-volume{ width: 92px; flex: 0 0 auto; }

/* track */
input[type="range"]::-webkit-slider-runnable-track{
  height: 3px;
  background: var(--line-strong);
  border: none;
}
input[type="range"]::-moz-range-track{
  height: 3px;
  background: var(--line-strong);
  border: none;
}
/* progress fill (accent) */
#player-seek{
  --seek: 0%;
  background:
    linear-gradient(var(--accent), var(--accent)) 0/var(--seek) 100% no-repeat;
}
#player-volume{
  --vol: 80%;
  background:
    linear-gradient(var(--accent), var(--accent)) 0/var(--vol) 100% no-repeat;
}
/* recolor the runnable-track behind the fill (WebKit paints track above bg gradient,
   so emulate by making the track translucent and letting the bg gradient show through) */
#player-seek::-webkit-slider-runnable-track,
#player-volume::-webkit-slider-runnable-track{ background: transparent; }
#player-seek::-moz-range-progress,
#player-volume::-moz-range-progress{ height: 3px; background: var(--accent); }

/* thumb */
input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 12px; height: 12px;
  margin-top: -5px;
  background: var(--text);
  border: 1px solid var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  transition: transform var(--dur-fast) var(--ease);
}
input[type="range"]::-moz-range-thumb{
  width: 12px; height: 12px;
  background: var(--text);
  border: 1px solid var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
input[type="range"]:hover::-webkit-slider-thumb{ transform: scale(1.2); }
input[type="range"]:active::-webkit-slider-thumb{ transform: scale(1.35); }

/* ============================================================================
   FOOTER  (§3) — player floats over it, so pad the bottom
   ========================================================================== */
#site-footer{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--s-7) var(--gutter);
  padding-bottom: calc(var(--player-h) + var(--s-7));
  border-top: var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "brand  social"
    "nav    nav"
    "signup signup"
    "legal  legal";
  gap: var(--s-5) var(--s-6);
  align-items: center;
}
.footer__brand{ grid-area: brand; display: flex; flex-direction: column; gap: var(--s-2); }
.footer__mark{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: 0 0 16px var(--accent-glow);
}
.footer__line{ color: var(--text-dim); }   /* AA: footer tagline prose */
.footer__nav{
  grid-area: nav;
  display: flex;
  gap: var(--s-5);
  flex-wrap: wrap;
  padding-top: var(--s-4);
  border-top: var(--border);
}
.footer__social{
  grid-area: social;
  display: flex;
  align-items: center;
  gap: var(--s-4);
}
.footer__handle{ color: var(--text-dim); }   /* AA: "@FREQ1C.MUSIC" handle */
.footer__legal{
  grid-area: legal;
  color: var(--text-dim);   /* AA: copyright line */
  padding-top: var(--s-4);
  border-top: var(--border);
}

/* Email capture (footer) */
.signup{
  grid-area: signup;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  max-width: 420px;
  padding-top: var(--s-4);
  border-top: var(--border);
}
.signup__label{ color: var(--text-dim); letter-spacing: 0.16em; }
.signup__row{ display: flex; gap: var(--s-2); }
.signup__input{
  flex: 1;
  min-width: 0;
  background: #0b0b12;
  border: var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  padding: 0.7em 0.9em;
}
.signup__input::placeholder{ color: var(--text-dim); }
.signup__input:focus-visible{ outline: 2px solid var(--accent); outline-offset: 1px; }
.signup__msg{ color: var(--accent); min-height: 1.1em; margin: 0; }
.signup__hp{ position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Spotify follow accent */
.btn-spotify{ border-color: var(--accent); }

/* ============================================================================
   NO-JS NOTE
   ========================================================================== */
.noscript-note{
  margin: var(--s-7) var(--gutter);
  padding: var(--s-6);
  border: var(--border);
  border-left: 2px solid var(--accent);
  background: var(--surface);
  color: var(--text-dim);
  font-size: var(--fs-sm);
  line-height: 1.6;
  max-width: 60ch;
}
.noscript-note strong{
  color: var(--text);
  letter-spacing: 0.18em;
  font-family: var(--font-display);
}

/* ============================================================================
   FOCUS-VISIBLE RINGS  (§9) — never remove without replacing
   ========================================================================== */
:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* skip-link target: #app gets tabindex=-1 + focus() from JS (never via the hash
   router). Show a visible ring so the jump is perceivable to keyboard/SR users. */
#app:focus{ outline: 2px solid var(--accent); outline-offset: 4px; }
#app:focus:not(:focus-visible){ outline: 2px solid var(--accent); outline-offset: 4px; }
.tile:focus-visible{ outline: none; } /* handled on the frame; keep a fallback below */
.tile:focus-visible .tile__frame{ outline: 2px solid var(--accent); outline-offset: 2px; }
/* range thumbs get a visible focus ring */
input[type="range"]:focus-visible{ outline: 2px solid var(--accent); outline-offset: 4px; }

/* ============================================================================
   RESPONSIVE  (§8)
   ========================================================================== */

/* Honor the contract's column ladder explicitly: 6 at desktop, 4 at tablet,
   2 at mobile (the auto-fill base remains the ultimate fallback). At --maxw the
   auto-fill min produced 7; pin it to 6 so the portholes match the design. */
/* ── LISTEN ON SPOTIFY (detail) ────────────────────────────────────── */
.detail__spotify{
  display: inline-flex; align-items: center; gap: .45em;
  margin-top: var(--s-4);
  font-family: var(--font-mono); font-size: var(--fs-label);
  letter-spacing: var(--tracking-label); text-transform: uppercase;
  color: var(--text-dim); border: var(--border); padding: .6em 1em;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.detail__spotify:hover{ color: var(--text); border-color: var(--accent); background: var(--accent-glow); }

/* ── LISTENING ROOM (#/room) ───────────────────────────────────────── */
.room-intro{ max-width: 64ch; margin: 0 0 var(--s-5); }
.room-empty{ padding: var(--s-7) 0; color: var(--text-dim); }

/* ── BIO (#/bio) ───────────────────────────────────────────────────── */
.bio{ display:grid; grid-template-columns: minmax(0,0.82fr) minmax(0,1.18fr); gap: var(--s-7); align-items:start; padding: var(--s-6) 0 var(--s-7); }
.bio__media{ position:relative; margin:0; border:var(--border); overflow:hidden; }
.bio__media img{ display:block; width:100%; height:auto; filter:contrast(1.04) saturate(1.02); }
.bio__figcap{ position:absolute; left:0; bottom:0; padding:.5em .8em; background:rgba(5,5,10,.72); }
.bio__copy{ max-width:62ch; }
.bio__title{ font-family:var(--font-display); font-weight:700; font-size:var(--fs-h1, 3rem); line-height:1.03; margin:.4em 0 .7em; letter-spacing:.005em; }
.bio__copy p{ color:var(--text-dim); font-size:var(--fs-body, 1.05rem); line-height:1.72; margin:0 0 1.1em; }
.bio__charge{ color:var(--text) !important; font-family:var(--font-display); font-weight:600; font-size:var(--fs-h2, 1.55rem); line-height:1.15; text-shadow:0 0 20px var(--accent-glow); margin-top:var(--s-5) !important; }
.bio__tag{ color:var(--accent); margin-top:var(--s-4); }
.bio__cta{ display:flex; gap:var(--s-3); flex-wrap:wrap; margin-top:var(--s-6); }
@media (max-width:767px){ .bio{ grid-template-columns:1fr; gap:var(--s-5); } }

/* ── ANALYTICS CONSENT ─────────────────────────────────────────────── */
.consent{ position:fixed; left:var(--gutter,1.5rem); bottom:calc(var(--player-h,72px) + var(--s-3)); z-index:120; width:min(360px, calc(100vw - 2*var(--gutter,1.5rem))); background:#0b0b12; border:var(--border); padding:var(--s-4); box-shadow:0 14px 48px rgba(0,0,0,.6); }
.consent[hidden]{ display:none; }
.consent__text{ color:var(--text-dim); font-size:var(--fs-label, .82rem); line-height:1.5; margin:0 0 var(--s-3); }
.consent__actions{ display:flex; gap:var(--s-2); }
@media (max-width:639px){ .consent{ left:var(--gutter,1rem); bottom:calc(var(--player-h-mobile,64px) + var(--s-3)); } }
.nav-room-sm{ display: none; }   /* abbreviated "ROOM" label — shown only on mobile */

@media (min-width: 1024px){
  .tile-grid{ grid-template-columns: repeat(6, 1fr); }
}
@media (min-width: 640px) and (max-width: 1023px){
  .tile-grid{ grid-template-columns: repeat(4, 1fr); }
}

/* Tablet: tighten hero */
@media (max-width: 1023px){
  .hero{
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .hero__figure{
    order: -1;
    min-height: 260px;
    border-left: none;
    border-bottom: var(--border);
    background-size: cover;
    background-position: center 14%;
  }
  /* on stacked layout, fade top+bottom into the void (no left seam needed) */
  .hero__figure::after{
    background:
      linear-gradient(0deg, var(--bg) 0%, rgba(5,5,10,0) 20%, rgba(5,5,10,0) 82%, var(--bg) 100%),
      rgba(5,5,10,0.3);
  }
  .detail{ gap: var(--s-7); }
}

/* Detail collapses to one column at 800px */
@media (max-width: 800px){
  .detail{ grid-template-columns: 1fr; }
  .detail__left{ position: static; }
}

/* Tablet seq row reads tight in the 640–767px band: drop the essence a bit
   earlier so the title + state get room (essence is dropped on mobile anyway). */
@media (max-width: 767px){
  .seq-row__essence{ display: none; }
}

/* Mobile ≤639px */
@media (max-width: 639px){
  :root{ --gutter: 1rem; }

  /* The brand + three mono nav links must all stay reachable at 320–414px
     (§8). Tighten the header gap, shrink/de-track the wordmark, and reduce the
     nav tracking so NEW · IN SEQUENCE · BY STATE fit without clipping. */
  #site-header{ gap: var(--s-3); }
  #brand{ font-size: 1rem; letter-spacing: 0.12em; }
  #site-nav{ gap: var(--s-3); padding-left: var(--s-3); }
  /* keep the three mode links reachable; hide social to save room */
  #site-social{ display: none; }
  .nav-link{ font-size: var(--fs-micro); letter-spacing: 0.08em; }
  .nav-link::before{ content: ""; }   /* drop the "· " tick prefix on mobile to save width */
  /* 4th nav item (Listening Room): abbreviate to ROOM, and let the nav scroll
     horizontally if the four labels still exceed a narrow viewport (§8). */
  .nav-room-lg{ display: none; }
  .nav-room-sm{ display: inline; }
  #site-nav{ overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
  #site-nav::-webkit-scrollbar{ display: none; }

  /* Match the bottom inset to the SHORTER mobile player so the dense archive
     doesn't carry ~60px of desktop-player dead space under the last row (§8). */
  .view{ padding-bottom: calc(var(--player-h-mobile) + var(--s-5)); }
  #site-footer{ padding-bottom: calc(var(--player-h-mobile) + var(--s-5)); }

  .tile-grid{ grid-template-columns: repeat(2, 1fr); }
  .state-grid{ grid-template-columns: 1fr; }

  /* On the 1-col state grid the fixed 120px glyph + the freq/count meta column
     crushed long names (RESILIENCE/DETACHMENT/ABUNDANCE). Restructure the card so
     the NAME spans its own full-width row (num + name together), with the glyph
     shrunk and the tag/meta below — long channel names now read in full. */
  .state-card{
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "num  name  glyph"
      "tag  tag   tag"
      "meta meta  meta";
  }
  .state-card__glyph{ width: 64px; }
  .state-card__name{
    font-size: var(--fs-h3);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
  .state-card__meta{ justify-self: start; }

  .new-rail .tile{ width: clamp(150px, 64vw, 220px); }

  /* SEQ ROW compact: [thumb][title+state][TX] — drop index + essence */
  .seq-row{
    grid-template-columns: 48px 1fr auto;
    gap: var(--s-3);
    min-height: 60px;
  }
  .seq-row__index{ display: none; }
  .seq-row__essence{ display: none; }
  .seq-row__thumb{ width: 48px; height: 48px; }
  .seq-row__state{ display: none; } /* state shown via TX/meta; keep row tight */
  .seq-row__title{ font-size: var(--fs-body); }

  /* hero wordmark already fluid via clamp */
  .hero__cta{ width: 100%; }
  .btn-ghost{ flex: 1 1 auto; justify-content: center; }

  .detail__lead{ font-size: 1.2rem; padding-left: var(--s-4); }

  .footer__social{ flex-wrap: wrap; }

  /* ---- PLAYER COLLAPSE (§8) ---- */
  #player{
    height: var(--player-h-mobile);
    grid-template-columns: 1fr auto;   /* left meta | transport */
    gap: var(--s-3);
    padding: 0 var(--s-4);
  }
  /* hide the FM plate + volume; rely on device volume */
  #player-right{ display: none; }
  /* seek becomes a thin 2px line pinned to the very top edge of the player */
  #player-center{
    flex-direction: row;
    align-items: center;
    gap: var(--s-2);
    order: 2;
  }
  #player-transport{ gap: var(--s-2); }
  #player-left{ order: 1; }
  #player-cover-link{ width: 36px; height: 36px; }   /* small cover */

  #player-scrub{
    position: absolute;
    top: 0; left: 0; right: 0;
    width: 100%;
    max-width: none;
    height: 2px;
    gap: 0;
    pointer-events: none;     /* let the seek input below re-enable itself */
  }
  /* hide the time readouts on the narrowest widths; keep the seek line */
  #player-elapsed, #player-remaining{ display: none; }
  #player-seek{
    pointer-events: auto;
    height: 8px;              /* tighter hit band hugging the 2px visual line */
    margin: -3px 0 0;         /* so it clears the tops of the transport buttons */
  }
  #player-seek::-webkit-slider-runnable-track{ height: 2px; }
  #player-seek::-moz-range-track{ height: 2px; }

  /* prev/next get comfortable touch size; play stays the ≥44px primary target.
     Order matters: generic .player-btn first, .player-btn--play override last
     (equal specificity → source order wins). */
  .player-btn{ width: 40px; height: 40px; }
  .player-btn--play{ width: 46px; height: 46px; }
}

/* Narrowest phones: drop the decorative (aria-hidden) state glyph so the channel
   NAME — the meaningful label — gets the full cell and reads in full. */
@media (max-width: 399px){
  .state-card__glyph{ display: none; }
}

/* Coarse pointers: enlarge range thumbs everywhere */
@media (pointer: coarse){
  input[type="range"]::-webkit-slider-thumb{ width: 16px; height: 16px; margin-top: -7px; }
  input[type="range"]::-moz-range-thumb{ width: 16px; height: 16px; }
}

/* ============================================================================
   PREFERS-REDUCED-MOTION  (§9) — functionality intact, motion stilled
   ========================================================================== */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  /* freeze the marquee but keep it readable (duplicated content => seamless) */
  #player-marquee{ animation: none !important; transform: none; }
  /* static ON AIR dot (no breathing) */
  #onair[data-live="true"] #onair-dot{ animation: none !important; }
  /* no sibling-dim "wake up", no retune slide, no view-in slide */
  .tile-grid:hover .tile:not(:hover),
  .tile-grid:focus-within .tile:not(:focus-within){ filter: none; }
  .is-retuning .tile{ animation: none !important; }
  .view{ animation: none !important; }
  .detail__cover[data-current="true"]::after{ animation: none !important; opacity: 0.7; }
}
