/* Manrope, self-hosted (SIL OFL 1.1, fonts/manrope/OFL.txt): one variable file, Latin subset. */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("/fonts/manrope/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/*
Theme contract — set these on body[data-theme="…"] or :root.
Scene: --scene-bg, --scene-art, --scene-overlay, --scene-detail.
Text: --text, --muted, --faint, --link, --line, --focus-color.
Player: --player-bg, --player-border, --player-shadow, --player-glow,
        --screen-bg.
Glass: --glass-bg, --glass-border, --glass-text, --glass-shadow.
Accents: --live-color, --heart-color, --heart-mine, --heart-glow.
Layout: --meta-x (desktop horizontal offset from the viewport centre).
Heart JS inputs: --drift (a length), --delay (a time).
*/
:root {
  color-scheme: dark;
  --scene-bg: #090d16;
  --scene-art: none;
  --scene-overlay: none;
  --scene-detail: none;

  --text: #f5f6f8;
  --muted: #d5d9e0;
  --faint: #b9c0cc;
  --link: #f5f6f8;
  --line: rgb(245 246 248 / 35%);
  --focus-color: #ffffff;

  --player-bg: rgb(9 13 22 / 24%);
  --player-border: rgb(245 246 248 / 38%);
  --player-shadow: rgb(0 0 0 / 48%);
  --player-glow: 0 0 0 transparent;
  --screen-bg: rgb(9 13 22 / 52%);

  --glass-bg: rgb(9 13 22 / 78%);
  --glass-border: rgb(245 246 248 / 35%);
  --glass-text: #ffffff;
  --glass-shadow: rgb(0 0 0 / 30%);

  --live-color: #ff555c;
  --heart-color: #f5f6f8;
  --heart-mine: #ffffff;
  --heart-glow: rgb(245 246 248 / 55%);

  --meta-x: -510px;
  --drift: 0px;
  --delay: 0s;
}

* { box-sizing: border-box; }

html {
  min-width: 320px;
  background: var(--scene-bg);
}

body {
  position: relative;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  isolation: isolate;
  background: var(--scene-bg);
  color: var(--text);
  font-family: "Manrope", "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

button, a { -webkit-tap-highlight-color: transparent; }

a { color: var(--link); }

:where(a, button):focus-visible {
  outline: 2px solid var(--focus-color);
  outline-offset: 4px;
}

.stars,
.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.stars { z-index: 0; }

.scene {
  z-index: 1;
  overflow: hidden;
  background: var(--scene-art);
}

.scene::before,
.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene::before { background: var(--scene-overlay); }
.scene::after { background: var(--scene-detail); }

.stage {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
}

.player {
  --player-width: min(435px, calc((100dvh - 72px) * 9 / 16));
  position: relative;
  width: var(--player-width);
  aspect-ratio: 9 / 16;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--player-border);
  border-radius: 19px;
  background: var(--player-bg);
  box-shadow:
    0 18px 48px var(--player-shadow),
    var(--player-glow);
}

.video {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  object-fit: contain;
}

body:not([data-state="live"]):not([data-state="after"]) .video {
  visibility: hidden;
}

.meta {
  position: absolute;
  top: 50%;
  left: clamp(
    24px,
    calc(50% + var(--meta-x)),
    calc(100% - 24px - min(280px, 50vw))
  );
  width: clamp(
    150px,
    calc(50vw - min(435px, (100dvh - 72px) * 9 / 16) / 2 - 52px),
    280px
  );
  transform: translateY(-50%);
}

.meta-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(25px, 2.6vw, 39px);
  font-weight: 200;
  line-height: 1.3;
  letter-spacing: .43em;
  white-space: nowrap;
}

.meta-kicker {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: clamp(10px, 1.08vw, 15px);
  font-weight: 300;
  line-height: 1.7;
  letter-spacing: .46em;
  text-transform: uppercase;
}

.meta-logline {
  max-width: 28ch;
  margin: 32px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  letter-spacing: .1em;
}

.meta-logline:empty,
.meta-links:empty,
.also:empty { display: none; }

.meta-links {
  display: grid;
  justify-items: start;
  gap: 18px;
  margin-top: 34px;
}

.meta-links a,
.calendar {
  border-bottom: 1px solid var(--line);
  color: var(--link);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: .2em;
  text-decoration: none;
}

.meta-links a:hover,
.calendar:hover { border-bottom-color: currentColor; }

.screen {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--screen-bg);
  text-align: center;
}

body[data-state="before"] .screen-before,
body[data-state="soon"] .screen-soon,
body[data-state="ended"] .screen-ended { display: flex; }

.screen-kicker {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.7;
  letter-spacing: .3em;
  text-transform: uppercase;
}

.screen-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  letter-spacing: .12em;
}

.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(10px, 3vw, 23px);
  width: 100%;
  margin: 27px 0 30px;
}

.countdown span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

.countdown b {
  color: var(--text);
  font-size: clamp(30px, 5vw, 49px);
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.countdown i {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  letter-spacing: .17em;
  text-transform: uppercase;
}

body[data-state="after"] .screen-after {
  z-index: 2;
  top: 77px;
  bottom: auto;
  display: flex;
  height: auto;
  padding: 8px 16px;
  background: none;
  pointer-events: none;
}

.screen-after .screen-kicker { font-size: 10px; }

.pill,
.unmute,
.heart {
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: 0 4px 18px var(--glass-shadow);
  color: var(--glass-text);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.pill {
  position: absolute;
  z-index: 4;
  top: 23px;
  display: none;
  min-height: 39px;
  align-items: center;
  gap: 9px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: .24em;
  white-space: nowrap;
}

body[data-state="live"] .pill { display: flex; }

.pill-host { left: 16px; }
.pill-live { right: 16px; }

.emblem {
  display: block;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--live-color);
  box-shadow: 0 0 9px var(--live-color);
}

.viewers {
  font-variant-numeric: tabular-nums;
  letter-spacing: .1em;
}

.viewers:not(:empty)::before {
  content: "♙";
  margin-right: 7px;
  font-size: 15px;
  line-height: 0;
}

.unmute {
  position: absolute;
  z-index: 5;
  bottom: 103px;
  left: 16px;
  display: none;
  min-height: 36px;
  padding: 8px 15px;
  border-radius: 999px;
  font: inherit;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .13em;
  cursor: pointer;
}

body:is([data-state="live"], [data-state="after"]) .unmute {
  display: block;
}

.heart {
  position: absolute;
  z-index: 5;
  right: 18px;
  bottom: 49px;
  display: none;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 50%;
  color: var(--heart-color);
  cursor: pointer;
}

body[data-state="live"] .heart { display: flex; }
.heart svg { display: block; }
.heart:hover { box-shadow: 0 0 20px var(--heart-glow); }

.heart.pulse { animation: heart-pulse 480ms ease-out; }

@keyframes heart-pulse {
  50% { scale: 1.16; }
}

.hearts {
  position: absolute;
  z-index: 4;
  right: 27px;
  bottom: 105px;
  display: none;
  width: 32px;
  height: 1px;
  overflow: visible;
  pointer-events: none;
}

body[data-state="live"] .hearts { display: block; }

.hearts .h {
  position: absolute;
  right: 0;
  bottom: 0;
  display: block;
  color: var(--heart-color);
  font-size: 25px;
  line-height: 1;
  opacity: 0;
  text-shadow: 0 0 12px var(--heart-glow);
  will-change: transform, opacity;
  animation: heart-rise 2.7s ease-out var(--delay) both;
}

.hearts .h.mine { color: var(--heart-mine); }

@keyframes heart-rise {
  0%   { transform: translate3d(0, 0, 0) scale(.7); opacity: 0; }
  12%  { opacity: 1; }
  72%  { opacity: .85; }
  100% {
    transform: translate3d(var(--drift), calc(-1 * min(52vh, 440px)), 0) scale(1.2);
    opacity: 0;
  }
}

.also {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: 17px;
  left: 18px;
  display: none;
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .22em;
  text-align: center;
}

body[data-state="live"] .also:not(:empty) { display: block; }

.past {
  position: relative;
  z-index: 2;
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  color: var(--text);
}

.past[hidden] { display: none !important; }
.past h2 { font-size: 15px; font-weight: 300; letter-spacing: .24em; }
.past a { text-decoration-color: var(--line); text-underline-offset: 4px; }

@media (max-width: 899px) {
  .stage { display: block; }
  .meta { display: none; }

  .player {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .pill {
    top: calc(env(safe-area-inset-top, 0px) + 22px);
    min-height: 36px;
    padding-inline: 10px;
    font-size: 10px;
  }

  .pill-host { left: max(14px, env(safe-area-inset-left, 0px)); }
  .pill-live { right: max(14px, env(safe-area-inset-right, 0px)); }

  .heart {
    right: max(18px, env(safe-area-inset-right, 0px));
    bottom: calc(env(safe-area-inset-bottom, 0px) + 60px);
  }

  .hearts {
    right: max(27px, calc(env(safe-area-inset-right, 0px) + 9px));
    bottom: calc(env(safe-area-inset-bottom, 0px) + 116px);
  }

  .also {
    right: max(18px, env(safe-area-inset-right, 0px));
    bottom: calc(env(safe-area-inset-bottom, 0px) + 19px);
    left: max(18px, env(safe-area-inset-left, 0px));
  }

  .unmute {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 112px);
    left: max(16px, env(safe-area-inset-left, 0px));
  }

  body[data-state="after"] .screen-after {
    top: calc(env(safe-area-inset-top, 0px) + 75px);
  }
}

@media (max-width: 360px) {
  .pill { gap: 6px; padding-inline: 8px; letter-spacing: .14em; }
  .emblem { width: 17px; height: 17px; }
  .screen { padding-inline: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .hearts .h {
    will-change: opacity;
    animation: heart-fade 450ms ease-out var(--delay) both;
  }

  @keyframes heart-fade {
    0%   { opacity: 0; }
    35%  { opacity: 1; }
    100% { opacity: 0; }
  }

  .heart.pulse { animation: heart-pulse 480ms ease-out; }
}

/* Operator switches and the held-past-start case (wiring, not theme). */
body.no-hearts .heart,
body.no-hearts .hearts { display: none !important; }
body.is-due .countdown { display: none; }
/* No date set yet: no countdown and no calendar invite, so the page claims no date. */
body.undated .countdown,
body.undated .calendar { display: none; }
/* The page's identity shows in every state, not only while live (phones have no side text). */
body .pill-host { display: flex; }
