/* =========================================================
   US POLITICS DESK — broadcast studio design system
   Palette: ink navy #0A0E17 / panel #10151F / hairline #232A3A
            text primary #EDEFF3 / text secondary #8992A6
            signal red #E63946 (live/breaking)
            brass gold #D8B34A (anchor desk accent / karaoke word)
   Type: Oswald (masthead/eyebrows, condensed caps like a lower-third)
         Inter (teleprompter body, highly legible for TTS reading)
         IBM Plex Mono (clock/timestamps/data)
   ========================================================= */

:root{
  --ink:        #0A0E17;
  --panel:      #10151F;
  --panel-2:    #141A26;
  --line:       #232A3A;
  --text:       #EDEFF3;
  --text-dim:   #8992A6;
  --red:        #E63946;
  --gold:       #D8B34A;
  --gold-dim:   #8A7333;
  --green:      #3FC97E;

  --font-display: 'Teko', 'Arial Narrow', sans-serif;
  --font-body:    'Noto Sans Devanagari', -apple-system, sans-serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;

  --masthead-h: 7vh;
  --banner-h:   38vh;
  --lower-h:    9vh;
}

*{ box-sizing: border-box; }
html, body{
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  overflow: hidden; /* single screen, no scroll */
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------------- Start overlay ---------------- */
.start-overlay{
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #131A28 0%, var(--ink) 70%);
  z-index: 100;
}
.start-card{
  text-align: center;
  max-width: 560px;
  padding: 48px 40px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(216,179,74,0.06), 0 30px 80px rgba(0,0,0,0.6);
}
.seal{
  position: relative; display: flex; flex-shrink: 0;
  align-items: center; justify-content: center;
  width: 84px; height: 84px; min-width: 84px; min-height: 84px; max-width: 84px; max-height: 84px;
  margin: 0 auto 20px;
  box-sizing: border-box;
}
.seal-ring{
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  border: 2px solid var(--gold); border-radius: 50%;
  box-sizing: border-box;
  pointer-events: none;
}
.seal-ring::before{
  content:'';
  position:absolute; top: 6px; left: 6px; right: 6px; bottom: 6px;
  border: 1px solid var(--gold-dim); border-radius: 50%;
  box-sizing: border-box;
}
.seal-text{ position: relative; font-family: var(--font-display); font-weight: 700; font-size: 28px; letter-spacing: 1px; color: var(--text); }
.start-card h1{
  font-family: var(--font-display); font-weight: 600; letter-spacing: .3px;
  font-size: 34px; margin: 0 0 8px;
}
.start-sub{ color: var(--text-dim); font-size: 14px; margin: 0 0 28px; letter-spacing: .3px; }
.start-btn{
  font-family: var(--font-display); letter-spacing: .3px; font-size: 18px; font-weight: 600;
  background: var(--red); color: #fff; border: none; border-radius: 3px;
  padding: 14px 36px; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: 0 8px 24px rgba(230,57,70,0.35);
}
.start-btn:hover{ background: #ff4351; transform: translateY(-1px); }
.start-btn:active{ transform: translateY(0); }
.start-hint{ margin-top: 18px; font-size: 12px; color: var(--text-dim); }

/* ---------------- Studio shell ---------------- */
.studio{
  position: fixed; inset: 0;
  display: none;
  flex-direction: column;
  background: var(--ink);
}
.studio.visible{ display: flex; }

/* ---------------- Masthead ---------------- */
.masthead{
  height: var(--masthead-h);
  min-height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  background: linear-gradient(180deg, var(--panel-2) 0%, var(--panel) 100%);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.masthead-left{ display: flex; align-items: center; gap: 12px; }
.seal.small{ width: 34px; height: 34px; min-width: 34px; min-height: 34px; max-width: 34px; max-height: 34px; margin: 0; }
.seal.small .seal-text{ font-size: 12px; }
.seal.small .seal-ring::before{ top: 3px; left: 3px; right: 3px; bottom: 3px; }
.masthead-title{
  font-family: var(--font-display); font-weight: 600; letter-spacing: .3px;
  font-size: clamp(16px, 2vw, 22px); color: var(--text);
}
.masthead-center{ display: flex; align-items: center; gap: 14px; }
.live-badge{
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-display); font-weight: 600; letter-spacing: 1.5px;
  font-size: 13px; color: #fff;
  background: var(--red); padding: 5px 12px 5px 8px; border-radius: 2px;
}
.live-dot{ width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite ease-in-out; }
@keyframes pulse{ 0%,100%{ opacity: 1; } 50%{ opacity: .25; } }

.waveform{ display: inline-flex; align-items: center; gap: 3px; height: 18px; }
.waveform i{
  width: 3px; background: var(--gold); border-radius: 1px; height: 4px;
  animation: wave 1.1s infinite ease-in-out;
  animation-play-state: paused;
}
.waveform.speaking i{ animation-play-state: running; }
.waveform i:nth-child(1){ animation-delay: 0s; }
.waveform i:nth-child(2){ animation-delay: .08s; }
.waveform i:nth-child(3){ animation-delay: .16s; }
.waveform i:nth-child(4){ animation-delay: .24s; }
.waveform i:nth-child(5){ animation-delay: .32s; }
.waveform i:nth-child(6){ animation-delay: .4s; }
.waveform i:nth-child(7){ animation-delay: .48s; }
@keyframes wave{
  0%,100%{ height: 4px; opacity: .5; }
  50%{ height: 17px; opacity: 1; }
}
.masthead-right .clock{
  font-family: var(--font-mono); font-size: 14px; color: var(--text-dim); letter-spacing: .5px;
}
.masthead-right{ display: flex; align-items: center; gap: 14px; }
.archive-link{
  font-family: var(--font-display); font-weight: 500; letter-spacing: .3px;
  font-size: 13px; color: var(--text-dim);
  text-decoration: none; border: 1px solid var(--line); border-radius: 2px;
  padding: 4px 8px;
  transition: color .15s ease, border-color .15s ease;
}
.archive-link:hover{ color: var(--gold); border-color: var(--gold); }

/* ---------------- Banner ---------------- */
.banner{
  position: relative;
  height: var(--banner-h);
  flex-shrink: 0;
  overflow: hidden;
  background: #05070C;
  border-bottom: 1px solid var(--line);
}
.banner-media{
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: saturate(1.05) contrast(1.02);
  transition: opacity .6s ease;
}
.banner-media.no-image{
  background:
    radial-gradient(ellipse 60% 90% at 15% 20%, rgba(216,179,74,0.16), transparent 60%),
    radial-gradient(ellipse 60% 90% at 85% 80%, rgba(230,57,70,0.14), transparent 60%),
    linear-gradient(135deg, #0D1220 0%, #171E2E 100%);
}
.banner-fade{
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,14,23,0) 35%, rgba(10,14,23,0.92) 100%);
}
.banner-overlay{
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 26px 18px;
  display: flex; flex-direction: column; gap: 6px;
}
.banner-tag{
  align-self: flex-start;
  font-family: var(--font-display); font-weight: 600; letter-spacing: .3px;
  font-size: 13px; color: var(--ink);
  background: var(--gold); padding: 3px 9px; border-radius: 2px;
}
.banner-headline{
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(20px, 3vw, 34px); line-height: 1.15;
  margin: 0; color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  max-width: 92%;
}
.banner-source{
  font-family: var(--font-body); font-weight: 500; font-size: 13px; color: var(--gold); letter-spacing: .2px;
}

/* ---------------- Teleprompter ---------------- */
.prompter{
  flex: 1;
  display: flex; flex-direction: column;
  padding: 3.5vh 8vw 2vh;
  overflow: hidden;
  min-height: 0;
}
.prompter-eyebrow{
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
  font-family: var(--font-display); font-weight: 500; letter-spacing: .3px;
  font-size: 13px; color: var(--text-dim); margin-bottom: 14px;
}
.prompter-eyebrow span#story-index,
.prompter-eyebrow span#story-total{ color: var(--gold); }
.depth-tag{
  font-family: var(--font-body); font-weight: 600; font-size: 11px; letter-spacing: .3px;
  color: var(--ink); background: var(--text-dim);
  padding: 2px 7px; border-radius: 2px;
}
.depth-tag.full{ background: var(--gold); }

/* Viewport is the fixed window; the text block inside it translates
   upward as speech progresses, so completed lines scroll off the top
   and new lines continuously arrive from the bottom — no user scroll. */
.prompter-viewport{
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.prompter-fade-bottom{
  position: absolute; left: 0; right: 0; bottom: 0; height: 14%;
  background: linear-gradient(180deg, rgba(10,14,23,0) 0%, var(--ink) 100%);
  pointer-events: none;
}
.prompter-text{
  position: absolute; left: 0; right: 0; top: 0;
  font-family: var(--font-body); font-weight: 500;
  font-size: clamp(19px, 2.4vw, 30px);
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0;
  transition: transform .45s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}
.prompter-text .w{
  transition: color .08s ease;
}
.prompter-text .w.spoken{ color: var(--text); }
.prompter-text .w.active{
  color: var(--ink);
  background: var(--gold);
  font-weight: 700;
  border-radius: 3px;
  padding: 0 2px;
  box-shadow: 0 0 0 2px var(--gold);
}

/* ---------------- Lower third ---------------- */
.lower-third{
  height: var(--lower-h);
  min-height: 46px;
  flex-shrink: 0;
  display: flex; align-items: center;
  gap: 18px;
  padding: 0 22px;
  background: var(--panel-2);
  border-top: 1px solid var(--line);
}
.lower-left{
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-body); font-size: 13px; color: var(--text-dim);
  flex-shrink: 0; white-space: nowrap;
}
.anchor-source{ color: var(--gold); font-weight: 600; }
.dot-sep{ opacity: .5; }

.ticker-wrap{
  flex: 1; display: flex; align-items: center; gap: 10px;
  min-width: 0; overflow: hidden;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding: 0 16px;
  height: 60%;
}
.ticker-label{
  font-family: var(--font-display); font-weight: 600; letter-spacing: .3px;
  font-size: 13px; color: var(--red); flex-shrink: 0;
}
.ticker-track{
  display: flex; gap: 60px; white-space: nowrap;
  animation: ticker 32s linear infinite;
}
.ticker-item{ font-size: 13px; color: var(--text-dim); }
.ticker-item::after{ content: '•'; margin-left: 60px; color: var(--gold); }
@keyframes ticker{
  0%{ transform: translateX(0); }
  100%{ transform: translateX(-50%); }
}

.lower-right{ flex-shrink: 0; }
.status-pill{
  font-family: var(--font-body); font-weight: 600; font-size: 12px; letter-spacing: .2px;
  padding: 4px 10px; border-radius: 2px; border: 1px solid var(--line);
}
.status-pill.ok{ color: var(--green); border-color: rgba(63,201,126,0.35); }
.status-pill.warn{ color: var(--gold); border-color: rgba(216,179,74,0.4); }
.status-pill.err{ color: var(--red); border-color: rgba(230,57,70,0.4); }

/* ---------------- Responsive ---------------- */
@media (max-width: 720px){
  :root{ --banner-h: 30vh; --lower-h: 12vh; }
  .banner-headline{ max-width: 100%; }
  .ticker-wrap{ display: none; }
  .lower-third{ justify-content: space-between; }
  .prompter{ padding: 2.5vh 6vw 1.5vh; }
}

/* Focus visibility */
button:focus-visible{ outline: 2px solid var(--gold); outline-offset: 2px; }
