/* w2w.channel — broadcast-dark. The video is the design; the chrome is the dial. */
:root {
  --void: #0A0A0C;        /* stage */
  --tube: #141418;        /* surfaces */
  --phosphor: #E8E6E1;    /* primary text */
  --static: #78787f;      /* secondary text */
  --signal: #FFB454;      /* on-air amber */
  --line: #232329;
  --tube-w: min(100vw, 430px);
  --font-display: 'Archivo Black', system-ui, sans-serif;
  --font-mono: 'Space Mono', ui-monospace, monospace;
  --font-body: system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--void);
  color: var(--phosphor);
  font-family: var(--font-body);
  overflow: hidden;
}

/* ---------- masthead ---------- */
.masthead {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 12px) 18px 10px;
  pointer-events: none;
}
.wordmark {
  font-family: var(--font-display);
  font-size: 1.05rem; letter-spacing: .02em;
  color: var(--phosphor); text-decoration: none;
  pointer-events: auto;
  text-shadow: 0 1px 8px rgba(0,0,0,.8);
}
.wordmark .dot { color: var(--signal); }
.onair {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .18em;
  color: var(--signal);
  display: flex; align-items: center; gap: 7px;
}
.onair-lamp {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 8px var(--signal);
  animation: lamp 2.4s ease-in-out infinite;
}
@keyframes lamp { 50% { opacity: .45; box-shadow: 0 0 3px var(--signal); } }

/* ---------- stage & tube ---------- */
.stage { height: 100dvh; display: flex; align-items: stretch; justify-content: center; }
.tube {
  position: relative;
  width: var(--tube-w);
  height: 100%;
  background: #000;
}
.feed {
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  outline: none;
}
.feed::-webkit-scrollbar { display: none; }

.slide {
  position: relative;
  height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow: hidden;
  background: #000;
}
.player-slot, .player-slot iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}
/* landscape videos: blurred thumb backfill, video letterboxed by YT itself */
.slide[data-orientation="landscape"] .player-slot { top: 50%; height: 56.25vw; max-height: 60%; transform: translateY(-50%); }
.slide .backfill {
  position: absolute; inset: -20px;
  background-size: cover; background-position: center;
  filter: blur(28px) brightness(.35) saturate(.8);
}

.slide-scrim {
  position: absolute; inset: auto 0 0 0; height: 45%;
  background: linear-gradient(to top, rgba(0,0,0,.82), transparent);
  pointer-events: none;
}

/* ---------- channel badge (the signature) ---------- */
.ch-badge {
  position: absolute; top: calc(env(safe-area-inset-top) + 52px); left: 16px;
  font-family: var(--font-mono); font-weight: 700;
  font-size: .82rem; letter-spacing: .14em;
  color: var(--signal);
  background: rgba(10,10,12,.55);
  border: 1px solid rgba(255,180,84,.35);
  padding: 4px 9px;
  text-shadow: 0 0 10px rgba(255,180,84,.5);
}

/* ---------- meta overlay ---------- */
.slide-meta {
  position: absolute; left: 16px; right: 76px;
  bottom: calc(env(safe-area-inset-bottom) + 22px);
  display: grid; gap: 6px;
}
.show-name {
  font-family: var(--font-display);
  font-size: 1.35rem; line-height: 1.1;
  text-shadow: 0 1px 10px rgba(0,0,0,.9);
}
.clip-title {
  font-size: .88rem; color: var(--phosphor); opacity: .92;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.broadcast-line {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em;
  color: var(--static);
}
.providers { display: flex; flex-wrap: wrap; gap: 6px; }
.provider-chip {
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .08em;
  color: var(--void); background: var(--signal);
  padding: 3px 8px;
}

/* ---------- action rail ---------- */
.actions {
  position: absolute; right: 10px;
  bottom: calc(env(safe-area-inset-bottom) + 30px);
  display: grid; gap: 16px;
}
.act {
  width: 50px; height: 50px; border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(20,20,24,.72);
  color: var(--phosphor);
  display: grid; place-items: center;
  cursor: pointer;
  transition: transform .12s ease, color .12s ease, border-color .12s ease;
}
.act:active { transform: scale(.9); }
.act.is-on { color: var(--signal); border-color: var(--signal); }
.act:focus-visible, .wordmark:focus-visible, .sound-gate:focus-visible {
  outline: 2px solid var(--signal); outline-offset: 2px;
}

/* ---------- static veil (channel-change flicker) ---------- */
.static-veil {
  position: absolute; inset: 0; z-index: 30;
  opacity: 0; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.09) 0 1px, transparent 1px 3px),
    radial-gradient(circle at 30% 40%, rgba(255,255,255,.14), transparent 60%),
    #101013;
}
.static-veil.zap { animation: zap .22s steps(4) 1; }
@keyframes zap {
  0% { opacity: .95; transform: translateY(-1%) }
  50% { opacity: .7; transform: translateY(1%) }
  100% { opacity: 0; transform: none }
}
@media (prefers-reduced-motion: reduce) {
  .static-veil.zap { animation: none; opacity: 0; }
  .onair-lamp { animation: none; }
}

/* ---------- sound gate ---------- */
.sound-gate {
  position: absolute; z-index: 35;
  left: 50%; bottom: 18%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: .78rem; letter-spacing: .14em;
  color: var(--void); background: var(--signal); border: 0;
  padding: 10px 18px; cursor: pointer;
}

/* ---------- desktop rail ---------- */
.rail { display: none; }
@media (min-width: 900px) {
  .stage { gap: 40px; align-items: center; padding: 24px 0; }
  .tube {
    height: min(92dvh, 860px);
    border: 1px solid var(--line);
    box-shadow: 0 0 0 1px #000, 0 30px 80px rgba(0,0,0,.6);
  }
  .slide { height: 100%; }
  .rail {
    display: block; width: 300px;
    font-size: .9rem; color: var(--static);
  }
  .rail h3 { font-family: var(--font-display); color: var(--phosphor); font-size: 1.15rem; margin-bottom: 8px; }
  .rail .rail-overview { line-height: 1.55; margin: 10px 0 14px; }
  .rail .rail-genres, .rail .rail-kbd { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; }
  .rail .rail-kbd { margin-top: 26px; color: #55555c; }
  .rail-hint { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; line-height: 1.7; }
}

/* ---------- empty state ---------- */
.empty {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-content: center; text-align: center; gap: 10px;
  background: var(--void); padding: 24px;
}
.empty-ch { font-family: var(--font-mono); font-weight: 700; letter-spacing: .2em; color: var(--signal); }
.empty h2 { font-family: var(--font-display); font-size: 1.4rem; }
.empty p { color: var(--static); max-width: 42ch; }
.empty code { font-family: var(--font-mono); color: var(--phosphor); }
