/* TOBY TV
   Layout: the whole viewport is a broadcast screen; a news ticker runs along the bottom.
   The about page is the "station information" card: same palette, read like a TV guide. */
:root {
  --ink: #08090b;          /* off-air black */
  --phosphor: #f1efe6;     /* warm CRT white */
  --dim: #9a978c;          /* secondary text */
  --signal: #ffb21a;       /* ticker / broadcast amber */
  --tally: #ff3b30;        /* LIVE tally light */
  --panel: rgba(8, 9, 11, .78);
  --rule: rgba(241, 239, 230, .18);

  --f-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --f-osd: "VT323", ui-monospace, "SF Mono", Menlo, monospace;

  --ticker-h: 46px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--phosphor);
  font-family: var(--f-display);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

/* ───────── Channel ───────── */
.channel { overflow: hidden; }

.tv {
  position: fixed;
  inset: 0 0 calc(var(--ticker-h) + env(safe-area-inset-bottom, 0px)) 0;
  overflow: hidden;
  background: #000;
}

.screen { position: absolute; inset: 0; overflow: hidden; }
.screen iframe, .screen #yt {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  border: 0;
  /* size set by JS to cover (landscape) or contain (portrait) */
}

.glass { position: absolute; inset: 0; z-index: 6; cursor: pointer; }
.glass:focus-visible { outline-offset: -6px; }
.tv.sound-on .glass { cursor: default; }

.crt {
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,.16) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 58%, rgba(0,0,0,.55) 100%);
  mix-blend-mode: multiply;
}

.static {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 4; pointer-events: none;
  image-rendering: pixelated;
  opacity: 0; transition: opacity .25s;
}
.static.on { opacity: 1; transition: none; }

/* On-screen display */
.osd, .bug, .lower-third, .sound, .info { z-index: 7; }
.osd-tl {
  position: absolute; top: max(18px, env(safe-area-inset-top, 0px)); left: 22px;
  display: flex; gap: 18px; align-items: baseline;
  font-family: var(--f-osd); font-size: 30px; line-height: 1;
  color: #7dff8a; text-shadow: 0 0 6px rgba(125,255,138,.55), 2px 2px 0 rgba(0,0,0,.6);
  pointer-events: none;
}
.osd-ch b { font-weight: 400; }
.osd-clock { color: var(--phosphor); text-shadow: 0 0 6px rgba(241,239,230,.35), 2px 2px 0 rgba(0,0,0,.6); }

.bug {
  position: absolute; top: max(16px, env(safe-area-inset-top, 0px)); right: 22px;
  display: flex; align-items: center; gap: 10px; pointer-events: none;
  opacity: .9;
}
.bug-mark {
  font-weight: 900; font-stretch: 70%; font-size: 26px; letter-spacing: .01em; line-height: 1;
  text-shadow: 0 1px 8px rgba(0,0,0,.5);
}
.bug-mark em {
  font-style: normal; margin-left: 3px; padding: 1px 5px 0;
  background: var(--phosphor); color: var(--ink); border-radius: 3px;
}
.bug-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-stretch: 85%; font-size: 12px; letter-spacing: .14em;
  padding: 4px 8px; background: rgba(0,0,0,.45); border-radius: 3px;
}
.bug-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--tally); box-shadow: 0 0 8px var(--tally); animation: tally 1.6s steps(2) infinite; }
@keyframes tally { 50% { opacity: .35; } }

/* Lower third */
.lower-third {
  position: absolute; left: 22px; bottom: 26px; max-width: min(760px, calc(100% - 44px));
  display: flex; align-items: stretch; pointer-events: none;
  animation: lt-in .5s cubic-bezier(.2,.8,.2,1) both;
}
.lt-tag {
  background: var(--signal); color: var(--ink);
  font-weight: 900; font-stretch: 75%; text-transform: uppercase; letter-spacing: .06em;
  font-size: 15px; padding: 8px 12px; display: flex; align-items: center;
}
.lt-title {
  background: var(--panel); backdrop-filter: blur(6px);
  font-weight: 600; font-stretch: 90%; font-size: 19px; padding: 8px 14px; min-width: 0;
  text-wrap: balance;
}
@keyframes lt-in { from { transform: translateX(-24px); opacity: 0; } }

/* Info card */
.info {
  position: absolute; left: 22px; bottom: 26px; width: min(440px, calc(100% - 44px));
  background: var(--panel); backdrop-filter: blur(10px);
  border-top: 4px solid var(--signal);
  padding: 18px 20px 20px;
  display: grid; gap: 12px;
  animation: lt-in .3s cubic-bezier(.2,.8,.2,1) both;
}
.info-kicker {
  margin: 0; font-weight: 700; font-stretch: 85%; font-size: 12px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--signal);
}
.info-title { margin: 0; font-weight: 800; font-stretch: 80%; font-size: 26px; line-height: 1.08; text-wrap: balance; }
.info-meta { margin: 0; display: grid; gap: 6px; }
.info-meta div { display: grid; grid-template-columns: 112px 1fr; gap: 10px; align-items: baseline; }
.info-meta dt { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.info-meta dd { margin: 0; font-size: 15px; min-width: 0; }
.info-link {
  justify-self: start; text-decoration: none;
  font-weight: 700; font-stretch: 85%; font-size: 14px; letter-spacing: .04em; text-transform: uppercase;
  padding: 9px 14px; border: 1px solid var(--phosphor); border-radius: 2px;
}
.info-link:hover { background: var(--phosphor); color: var(--ink); }
.tv.show-info .lower-third { display: none; }

/* Sound button */
.sound {
  position: absolute; right: 22px; bottom: 26px;
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 13px/1 var(--f-display); font-stretch: 85%; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); background: var(--phosphor);
  border: 0; border-radius: 2px; padding: 11px 14px; cursor: pointer;
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
.sound-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tally); }
.tv.sound-on .sound { background: rgba(0,0,0,.5); color: var(--phosphor); opacity: 0; transition: opacity .3s; }
.tv.sound-on .sound-dot { background: #7dff8a; }
.tv.sound-on.show-info .sound, .tv.sound-on .sound:focus-visible { opacity: 1; }

/* Ad breaks */
.break { position: absolute; inset: 0; z-index: 3; overflow: hidden; background: var(--ink); }
.spot { position: absolute; inset: 0; display: grid; padding: clamp(24px, 6vw, 96px); }
.spot-kicker { font-weight: 700; font-stretch: 85%; font-size: clamp(12px, 1.3vw, 17px); letter-spacing: .2em; text-transform: uppercase; }
.spot-headline { margin: 0; font-weight: 900; line-height: .95; text-wrap: balance; }
.spot-body { margin: 0; font-size: clamp(16px, 1.9vw, 26px); line-height: 1.3; max-width: 34ch; }
.spot-cta { font-weight: 700; font-stretch: 85%; font-size: clamp(13px, 1.4vw, 18px); letter-spacing: .14em; text-transform: uppercase; }
.spot * { animation-fill-mode: both; animation-timing-function: cubic-bezier(.2,.8,.2,1); }

.spot-block { background: var(--signal); color: var(--ink); align-content: center; gap: clamp(14px, 2vw, 28px); }
.spot-block .spot-headline { font-stretch: 62%; font-size: clamp(54px, 11vw, 190px); text-transform: uppercase; max-width: 12ch; animation-name: rise; animation-duration: .9s; }
.spot-block .spot-body { animation-name: fade; animation-duration: 1s; animation-delay: 1.2s; }
.spot-block .spot-cta { animation-name: fade; animation-duration: .6s; animation-delay: 4s; border-top: 3px solid var(--ink); padding-top: 12px; justify-self: start; }

.spot-split { grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 64px); align-items: center; background: var(--phosphor); color: var(--ink); }
.spot-split .spot-left { display: grid; gap: 18px; align-content: center; height: 100%; border-right: 6px solid var(--ink); padding-right: clamp(20px, 4vw, 64px); }
.spot-split .spot-headline { font-stretch: 75%; font-size: clamp(40px, 6.6vw, 112px); animation-name: rise; animation-duration: .9s; }
.spot-split .spot-right { display: grid; gap: 22px; }
.spot-split .spot-body { animation-name: fade; animation-duration: 1s; animation-delay: 1.5s; }
.spot-split .spot-cta { color: var(--tally); animation-name: fade; animation-duration: .6s; animation-delay: 3.5s; }

.spot-award { background: radial-gradient(ellipse at 50% 40%, #2a2210 0%, var(--ink) 70%); color: var(--phosphor); place-content: center; text-align: center; gap: 18px; }
.spot-award .spot-kicker { color: var(--signal); animation-name: fade; animation-duration: 1s; }
.spot-award .spot-headline { font-stretch: 110%; font-weight: 800; font-size: clamp(40px, 7.5vw, 128px); animation-name: zoom; animation-duration: 1.6s; animation-delay: .4s; }
.spot-award .spot-body { margin-inline: auto; font-stretch: 90%; color: var(--signal); animation-name: fade; animation-duration: 1s; animation-delay: 1.8s; }
.spot-award .spot-cta { color: var(--dim); animation-name: fade; animation-duration: 1s; animation-delay: 4s; }
.spot-award .laurel { justify-self: center; width: 70px; height: 4px; background: var(--signal); animation: grow 1.2s 1.2s both; }

.spot-credits { background: var(--ink); color: var(--phosphor); align-content: end; gap: 20px; }
.spot-credits .spot-kicker { color: var(--dim); animation-name: fade; animation-duration: .8s; }
.spot-credits .spot-headline { font-stretch: 62%; font-size: clamp(44px, 9vw, 150px); text-transform: uppercase; animation-name: rise; animation-duration: 1.1s; animation-delay: .3s; }
.spot-credits .spot-body { color: var(--dim); animation-name: fade; animation-duration: 1s; animation-delay: 2s; }
.spot-credits .spot-cta { color: var(--signal); animation-name: fade; animation-duration: 1s; animation-delay: 3.5s; }

/* Break bumpers */
.bumper { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 18px; padding: 24px;
  background: repeating-linear-gradient(90deg, #111 0 2px, var(--ink) 2px 9px); }
.bumper-mark { font-weight: 900; font-stretch: 62%; font-size: clamp(64px, 14vw, 220px); line-height: 1; letter-spacing: -.01em; animation: zoom 1.2s both; }
.bumper-mark em { font-style: normal; display: inline-block; line-height: .9; background: var(--phosphor); color: var(--ink); padding: .04em .12em 0; margin-left: .06em; border-radius: .05em; }
.bumper-line { font-family: var(--f-osd); font-size: clamp(22px, 2.6vw, 36px); color: var(--signal); animation: fade .8s .6s both; }
.bumper-next { font-size: clamp(15px, 1.6vw, 21px); color: var(--dim); max-width: 46ch; margin-inline: auto; animation: fade .8s 1.2s both; text-wrap: balance; }

@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes zoom { from { transform: scale(.86); opacity: 0; } }
@keyframes grow { from { transform: scaleX(0); } }

/* Stand-by test card */
.standby { position: absolute; inset: 0; z-index: 3; background: var(--ink); display: grid; place-content: center; text-align: center; gap: 10px; }
.bars { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, 1fr); opacity: .9; }
.bars i:nth-child(1){background:#c0c0c0}.bars i:nth-child(2){background:#c0c000}.bars i:nth-child(3){background:#00c0c0}
.bars i:nth-child(4){background:#00c000}.bars i:nth-child(5){background:#c000c0}.bars i:nth-child(6){background:#c00000}.bars i:nth-child(7){background:#0000c0}
.standby-text, .standby-sub { position: relative; margin: 0; background: var(--ink); justify-self: center; }
.standby-text { font-weight: 900; font-stretch: 62%; font-size: clamp(40px, 7vw, 96px); text-transform: uppercase; padding: 4px 22px 0; }
.standby-sub { font-family: var(--f-osd); font-size: 24px; color: var(--signal); padding: 4px 16px; }

/* Ticker */
.ticker {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  height: calc(var(--ticker-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; text-decoration: none;
  background: var(--signal); color: var(--ink);
}
.ticker-label {
  flex: none; display: flex; align-items: center; gap: 6px; padding: 0 16px;
  background: var(--ink); color: var(--phosphor);
  font-weight: 900; font-stretch: 70%; font-size: 18px; text-transform: uppercase; letter-spacing: .02em;
}
.ticker-label b { color: var(--signal); font-weight: 900; }
.ticker-window { flex: 1; overflow: hidden; position: relative; display: flex; align-items: center; min-width: 0; }
.ticker-track { display: inline-flex; white-space: nowrap; will-change: transform; }
.ticker-item { font-weight: 700; font-stretch: 85%; font-size: 17px; text-transform: uppercase; letter-spacing: .03em; padding-right: 22px; }
.ticker-item::after { content: "■"; padding-left: 22px; font-size: 9px; vertical-align: middle; }
.ticker:hover .ticker-label, .ticker:focus-visible .ticker-label { background: var(--tally); }
.ticker:focus-visible { outline-offset: -3px; outline-color: var(--ink); }

/* Small screens */
@media (max-width: 640px) {
  :root { --ticker-h: 40px; }
  .osd-tl { font-size: 24px; left: 16px; gap: 12px; }
  .bug { right: 16px; }
  .bug-mark { font-size: 21px; }
  .bug-live { display: none; }
  .lower-third, .info { left: 16px; bottom: 74px; max-width: calc(100% - 32px); width: calc(100% - 32px); }
  .lt-title { font-size: 16px; }
  .info-title { font-size: 21px; }
  .info-meta div { grid-template-columns: 96px 1fr; }
  .sound { right: 16px; bottom: 18px; }
  .spot-split { grid-template-columns: 1fr; align-content: center; }
  .spot-split .spot-left { border-right: 0; border-bottom: 6px solid var(--ink); padding: 0 0 20px; height: auto; }
  .ticker-label { font-size: 15px; padding: 0 12px; }
  .ticker-item { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition: none !important; }
}

/* ───────── About page ───────── */
.station { min-height: 100%; padding-bottom: calc(var(--ticker-h) + env(safe-area-inset-bottom, 0px)); }
.station-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 24px 14px;
  background: var(--ink); border-bottom: 1px solid var(--rule);
}
.station-bar .bug-mark { font-size: 24px; }
.back { font-family: var(--f-osd); font-size: 24px; color: #7dff8a; text-decoration: none; }
.back:hover { text-decoration: underline; }

.station-main { max-width: 1080px; margin: 0 auto; padding: 56px 24px 80px; display: grid; gap: 72px; }
.station-hero { display: grid; gap: 20px; }
.station-hero .eyebrow { font-family: var(--f-osd); font-size: 26px; color: var(--signal); margin: 0; }
.station-hero h1 { margin: 0; font-weight: 900; font-stretch: 62%; font-size: clamp(56px, 11vw, 148px); line-height: .88; text-transform: uppercase; text-wrap: balance; }
.station-hero p.lede { margin: 0; font-size: clamp(18px, 2vw, 22px); line-height: 1.5; max-width: 60ch; color: var(--phosphor); }

.guide { display: grid; gap: 0; border-top: 2px solid var(--phosphor); }
.guide h2 { margin: 0; padding: 14px 0; font-weight: 800; font-stretch: 75%; font-size: 15px; letter-spacing: .16em; text-transform: uppercase; color: var(--signal); border-bottom: 1px solid var(--rule); }
.guide-row { display: grid; grid-template-columns: 200px 1fr; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.guide-row dt { font-family: var(--f-osd); font-size: 22px; color: var(--dim); }
.guide-row dd { margin: 0; font-size: 17px; line-height: 1.5; max-width: 62ch; min-width: 0; }
.guide-row dd strong { font-weight: 700; font-stretch: 90%; font-size: 20px; display: block; color: var(--phosphor); }

.contact { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; border-top: 2px solid var(--phosphor); padding-top: 28px; }
.contact h2 { margin: 0 0 12px; font-weight: 900; font-stretch: 62%; font-size: clamp(44px, 6vw, 80px); line-height: .9; text-transform: uppercase; }
.contact-side p { margin: 0 0 14px; font-size: 17px; line-height: 1.5; color: var(--dim); max-width: 40ch; }
.contact-email { font-family: var(--f-osd); font-size: 28px; color: var(--signal); word-break: break-all; }

form.enquiry { display: grid; gap: 18px; min-width: 0; }
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field label { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.field input, .field select, .field textarea {
  font: 400 17px/1.4 var(--f-display); color: var(--phosphor);
  background: #121316; border: 1px solid var(--rule); border-radius: 2px; padding: 12px 14px; width: 100%;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 1px var(--signal); }
.hp { position: absolute; left: -9999px; }
.send {
  justify-self: start; font: 800 16px/1 var(--f-display); font-stretch: 80%; letter-spacing: .1em; text-transform: uppercase;
  background: var(--signal); color: var(--ink); border: 0; border-radius: 2px; padding: 16px 26px; cursor: pointer;
}
.send:hover { background: var(--phosphor); }
.send[disabled] { opacity: .6; cursor: wait; }
.form-status { margin: 0; font-size: 16px; min-height: 1.4em; }
.form-status.ok { color: #7dff8a; }
.form-status.err { color: var(--tally); }

@media (max-width: 760px) {
  .guide-row { grid-template-columns: 1fr; gap: 4px; }
  .contact { grid-template-columns: 1fr; gap: 28px; }
  .field-row { grid-template-columns: 1fr; }
  .station-main { padding-top: 36px; gap: 56px; }
  .station-bar { padding-inline: 16px; }
  .station-main { padding-inline: 16px; }
}
