@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap");

:root {
  color-scheme: dark;
  --ink: #07090d;
  --surface: rgba(15, 20, 28, 0.86);
  --text: #f4f2ed;
  --muted: #9ca5b2;
  --faint: #707986;
  --gold: #d4b46d;
  --gold-bright: #f0d694;
  --red: #b72e3f;
  --red-bright: #ee4a5d;
  --line: rgba(255, 255, 255, 0.09);
  --line-gold: rgba(212, 180, 109, 0.25);
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.5);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--ink);
  color: var(--text);
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(7, 9, 13, 0.55) 0, rgba(7, 9, 13, 0.88) 48rem, var(--ink) 70rem),
    linear-gradient(90deg, rgba(7, 9, 13, 0.84), rgba(7, 9, 13, 0.2) 60%, rgba(7, 9, 13, 0.58)),
    url("./assets/napoleonic-dawn.png") center top / max(100%, 1600px) auto no-repeat;
  content: "";
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.11;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.3'/%3E%3C/svg%3E");
  content: "";
  pointer-events: none;
}

a { color: inherit; }
.page-shell { width: min(1540px, 100%); margin: 0 auto; padding: 0 clamp(1rem, 3.5vw, 4rem) 2.25rem; }

.masthead {
  min-height: 104px;
  display: grid;
  grid-template-columns: minmax(270px, 1fr) auto minmax(270px, 1fr);
  gap: clamp(1rem, 3vw, 3rem);
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.station-mark { display: inline-flex; width: fit-content; align-items: center; gap: 0.85rem; text-decoration: none; }
.station-mark img { width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 9px 18px rgba(0, 0, 0, 0.45)); }
.wordmark { display: block; }
.wordmark strong { display: block; font-family: Manrope, sans-serif; font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 800; line-height: 1; letter-spacing: -0.045em; text-transform: uppercase; }
.wordmark strong i { margin-left: 0.2rem; color: var(--gold); font-style: normal; }
.wordmark small, .clock small { display: block; margin-top: 0.35rem; color: var(--faint); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; }

.primary-nav { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.25rem); }
.primary-nav a { position: relative; color: #c5cbd2; font-size: 0.83rem; font-weight: 600; text-decoration: none; }
.primary-nav a::after { position: absolute; right: 0; bottom: -0.55rem; left: 0; height: 2px; background: var(--gold); content: ""; opacity: 0; transform: scaleX(0.5); transition: 160ms ease; }
.primary-nav a:hover::after, .primary-nav a:focus-visible::after { opacity: 1; transform: scaleX(1); }
.header-tools { display: flex; justify-content: flex-end; align-items: center; gap: 1.25rem; }

.station-state, .on-air-label { display: inline-flex; align-items: center; gap: 0.55rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.station-state { padding: 0.55rem 0.8rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(9, 12, 17, 0.55); color: #c1c7cf; backdrop-filter: blur(14px); }
.signal-dot, .on-air-label span, .player-bar i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #757e89; }
.signal-dot.live, .on-air-label span, .player-bar i { background: var(--red-bright); box-shadow: 0 0 0 4px rgba(238, 74, 93, 0.12), 0 0 16px rgba(238, 74, 93, 0.46); }
.clock { min-width: 74px; text-align: right; }
.clock strong { display: block; font-family: Manrope, sans-serif; font-size: 1.15rem; line-height: 1; font-variant-numeric: tabular-nums; }

main { padding-top: clamp(2.25rem, 6vw, 5.5rem); }
.broadcast-stage { position: relative; }
.stage-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 1.35rem; }
.stage-heading h1 { margin: 0; font-family: Manrope, sans-serif; font-size: clamp(2.2rem, 5vw, 4.8rem); font-weight: 700; line-height: 0.98; letter-spacing: -0.055em; }
.stage-heading > p { max-width: 31rem; margin: 0 0 0.35rem; color: #b3bbc5; font-size: 0.95rem; text-align: right; }
.eyebrow, .offline-kicker { margin: 0 0 0.6rem; color: var(--gold); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.17em; text-transform: uppercase; }

.broadcast-grid { display: grid; grid-template-columns: minmax(0, 1.86fr) minmax(310px, 0.72fr); overflow: hidden; border: 1px solid var(--line-gold); border-radius: var(--radius); background: rgba(10, 13, 18, 0.84); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.player-frame { min-width: 0; padding: 0.65rem; border-right: 1px solid var(--line); background: #05070a; }
.player-bar { min-height: 40px; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0 0.55rem; color: #8f98a4; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; }
.player-bar span:first-child { display: inline-flex; align-items: center; gap: 0.55rem; color: #dbe0e5; }
.player-slot { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 10px; background: #05070a; }
.player-slot iframe { width: 100%; height: 100%; border: 0; }

.offline-card { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; padding: 2rem; background: linear-gradient(90deg, transparent 49.8%, rgba(212, 180, 109, 0.12) 50%, transparent 50.2%), linear-gradient(transparent 49.8%, rgba(212, 180, 109, 0.12) 50%, transparent 50.2%), radial-gradient(circle at center, #17202c 0 18%, #0a0f16 18.2% 43%, #06080b 43.2%); text-align: center; }
.test-mark { position: relative; width: clamp(74px, 8vw, 112px); aspect-ratio: 1; display: grid; place-items: center; margin: 0.7rem 0; border: 1px solid var(--gold); border-radius: 50%; font-family: Manrope, sans-serif; font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 800; }
.test-mark i { position: absolute; inset: 10%; border: 1px solid rgba(212, 180, 109, 0.4); transform: rotate(45deg); }
.offline-card h2 { margin: 0; font-family: Manrope, sans-serif; font-size: clamp(1.5rem, 3vw, 2.5rem); letter-spacing: -0.04em; }
.offline-card p { max-width: 34rem; margin: 0.75rem 0 0; color: var(--muted); }

.now-panel { display: flex; min-width: 0; flex-direction: column; padding: clamp(1.45rem, 3vw, 2.65rem); background: linear-gradient(150deg, rgba(23, 30, 41, 0.94), rgba(12, 16, 22, 0.98)); }
.on-air-label { width: fit-content; margin-bottom: clamp(2rem, 5vw, 5rem); padding: 0.5rem 0.7rem; border: 1px solid rgba(238, 74, 93, 0.24); border-radius: 999px; background: rgba(183, 46, 63, 0.1); color: #f4d8dc; }
.now-panel h2, .series-banner h2, .section-heading h2 { font-family: Manrope, sans-serif; letter-spacing: -0.045em; }
.now-panel h2 { margin: 0; font-size: clamp(2rem, 3.3vw, 3.25rem); line-height: 1; }
.programme-copy { max-width: 32rem; min-height: 3rem; margin: 1rem 0 1.5rem; color: var(--muted); font-size: 0.92rem; }
.progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, 0.09); }
.progress-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red), var(--gold-bright)); transition: width 400ms ease; }
.time-row { display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.7rem; color: var(--faint); font-size: 0.76rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.next-card { margin-top: auto; padding: 1.25rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, 0.025); }
.next-card h3 { margin: 0; font-size: 1.05rem; }
.next-card p:last-child { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.82rem; }

.series-banner { position: relative; display: grid; grid-template-columns: minmax(260px, 0.8fr) minmax(210px, 0.45fr) minmax(300px, 1fr); gap: clamp(1.25rem, 3vw, 3.25rem); align-items: center; margin-top: 1rem; padding: 1.2rem clamp(1.2rem, 3vw, 2.25rem); overflow: hidden; border: 1px solid rgba(183, 46, 63, 0.2); border-radius: 14px; background: linear-gradient(100deg, rgba(103, 22, 33, 0.66), rgba(19, 24, 33, 0.85) 48%, rgba(12, 16, 22, 0.9)); backdrop-filter: blur(18px); }
.series-banner::after { position: absolute; top: -80px; right: 18%; width: 230px; height: 230px; border: 1px solid rgba(212, 180, 109, 0.11); border-radius: 50%; content: ""; }
.series-title { display: flex; align-items: center; gap: 1rem; }
.series-number { color: rgba(255, 255, 255, 0.15); font-family: Manrope, sans-serif; font-size: 2.8rem; font-weight: 800; line-height: 1; }
.series-banner h2, .section-heading h2 { margin: 0; font-size: clamp(1.65rem, 3vw, 2.5rem); line-height: 1.05; }
.series-banner > strong { position: relative; z-index: 1; color: var(--gold-bright); font-size: 0.95rem; }
.series-banner > p { position: relative; z-index: 1; margin: 0; color: #aeb6c0; font-size: 0.83rem; }

.guide { padding: clamp(4rem, 8vw, 7rem) 0 2.5rem; }
.section-heading { display: flex; justify-content: space-between; gap: 2rem; align-items: end; margin-bottom: 1.6rem; }
.guide-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.7rem; color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
.guide-meta > span { padding: 0.5rem 0.75rem; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.02); }
.draft-badge { color: var(--gold); }
.guide-grid { display: grid; gap: 0.65rem; }
.guide-day { display: grid; grid-template-columns: minmax(120px, 0.35fr) 2fr; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: rgba(14, 18, 25, 0.66); backdrop-filter: blur(16px); transition: border-color 160ms ease, transform 160ms ease; }
.guide-day:hover { border-color: var(--line-gold); transform: translateY(-1px); }
.day-name { display: flex; align-items: center; padding: 1.2rem; border-right: 1px solid var(--line); color: var(--gold-bright); font-family: Manrope, sans-serif; font-size: 0.95rem; font-weight: 700; }
.day-blocks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.guide-block { min-width: 0; padding: 1rem 1.1rem; border-left: 1px solid var(--line); }
.guide-block:first-child { border-left: 0; }
.guide-block.current { background: linear-gradient(180deg, rgba(183, 46, 63, 0.22), rgba(183, 46, 63, 0.04)); box-shadow: inset 0 3px var(--red-bright); }
.guide-block time { display: block; margin-bottom: 0.35rem; color: var(--faint); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.guide-block strong { display: block; overflow: hidden; color: #dde1e6; font-size: 0.84rem; line-height: 1.35; text-overflow: ellipsis; }

footer { display: flex; justify-content: space-between; gap: 2rem; padding-top: 1.3rem; border-top: 1px solid var(--line); color: var(--faint); font-size: 0.76rem; }
footer p { margin: 0; }
.footer-links { display: flex; gap: 1.2rem; }
footer a { color: var(--gold); text-underline-offset: 0.25rem; }

@media (max-width: 1050px) {
  .masthead { grid-template-columns: 1fr auto; }
  .primary-nav { display: none; }
  .broadcast-grid { grid-template-columns: 1fr; }
  .player-frame { border-right: 0; border-bottom: 1px solid var(--line); }
  .now-panel { min-height: 350px; }
  .on-air-label { margin-bottom: 2rem; }
  .series-banner { grid-template-columns: 1fr 1fr; }
  .series-banner > p { grid-column: 1 / -1; }
  .day-blocks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-block:nth-child(3) { border-top: 1px solid var(--line); border-left: 0; }
  .guide-block:nth-child(4) { border-top: 1px solid var(--line); }
}

@media (max-width: 720px) {
  body::before { background-size: auto 720px; background-position: 64% top; }
  .page-shell { padding-inline: 0.8rem; }
  .masthead { min-height: 88px; gap: 0.65rem; }
  .station-mark { gap: 0.55rem; }
  .station-mark img { width: 44px; height: 44px; }
  .wordmark small { display: none; }
  .header-tools { gap: 0.6rem; }
  .station-state { display: none; }
  .clock { min-width: 64px; }
  main { padding-top: 2.5rem; }
  .stage-heading { align-items: start; flex-direction: column; gap: 0.8rem; }
  .stage-heading > p { max-width: 27rem; text-align: left; font-size: 0.88rem; }
  .broadcast-grid { margin-inline: -0.8rem; border-inline: 0; border-radius: 0; }
  .player-frame { padding: 0; }
  .player-bar { padding: 0 0.8rem; }
  .player-slot { border-radius: 0; }
  .player-bar span:last-child { display: none; }
  .offline-card { padding: 1rem; }
  .offline-kicker, .test-mark { display: none; }
  .offline-card p { font-size: 0.84rem; }
  .now-panel { min-height: 330px; }
  .series-banner { grid-template-columns: 1fr; padding: 1.2rem; }
  .series-banner > p { grid-column: auto; }
  .series-number { font-size: 2rem; }
  .section-heading { align-items: start; flex-direction: column; gap: 1rem; }
  .guide-meta { justify-content: flex-start; }
  .guide-day { grid-template-columns: 1fr; }
  .day-name { padding: 0.85rem 1rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .day-blocks { grid-template-columns: 1fr; }
  .guide-block { border-top: 1px solid var(--line); border-left: 0; }
  .guide-block:first-child { border-top: 0; }
  footer { flex-direction: column; gap: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .progress-track span, .guide-day, .primary-nav a::after { transition: none; }
}
