/* overlays · live — the stage page. standalone (not astro); studio palette, nunito + mono. */

:root {
  --paper: #f7f6f2;
  --ink: #0c0c0c;
  --pop: #ff3b1f;
  --pop-ink: #c8290f; /* text-safe accent for small type */
  --mute: #6b6a64;
  --line: rgba(12, 12, 12, 0.12);
  --card: #ffffff;
  --sans: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r-card: 22px;
  --r-pill: 999px;
  --s: 0.5; /* stage scale, set by stage.js */
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

::selection {
  background: var(--pop);
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--pop);
  outline-offset: 2px;
}

a {
  color: inherit;
}

.pop {
  color: var(--pop);
}

.skip {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--paper);
  font: 500 13px/1 var(--mono);
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

/* ─── header ───────────────────────────────────────────────────────── */

.top,
.wrap,
.foot {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 28px;
  padding-right: 28px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.wordmark {
  display: inline-block;
  border-radius: 10px;
  font-weight: 500;
  font-size: 19px;
  line-height: 0.92;
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: opacity 120ms ease;
}
.wordmark:hover {
  opacity: 0.8;
}

.back {
  font: 400 12.5px/1.3 var(--mono);
  color: var(--mute);
  text-decoration: none;
  padding: 6px 0;
  transition: color 120ms ease;
}
.back:hover {
  color: var(--ink);
}

/* ─── intro ────────────────────────────────────────────────────────── */

.wrap {
  flex: 1;
  padding-bottom: 56px;
}

.intro {
  margin: 28px 0 28px;
}

h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.lede {
  margin: 14px 0 0;
  max-width: 34ch;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.4;
  color: var(--ink);
}

/* ─── tabs ─────────────────────────────────────────────────────────── */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: rgba(12, 12, 12, 0.06);
  max-width: 100%;
}

.tab {
  appearance: none;
  border: 0;
  border-radius: var(--r-pill);
  padding: 9px 16px;
  background: transparent;
  color: var(--mute);
  font: 600 14px/1.1 var(--sans);
  cursor: pointer;
  white-space: nowrap;
  transition: color 120ms ease, background-color 120ms ease;
}
.tab:hover {
  color: var(--ink);
}
.tab[aria-selected="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(12, 12, 12, 0.08), 0 0 0 1px rgba(12, 12, 12, 0.06);
}

/* ─── the stage ────────────────────────────────────────────────────── */

.frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--r-card);
  background: #d9d4c7;
  box-shadow: inset 0 0 0 1px rgba(12, 12, 12, 0.1);
  isolation: isolate;
}
.frame:fullscreen {
  border-radius: 0;
  background: #000;
}
.frame:fullscreen::after {
  box-shadow: none;
}

.stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  transform: scale(var(--s));
  transform-origin: 0 0;
  overflow: hidden;
  color-scheme: light;
}
/* inset ring drawn above the layers so the rounded edge stays crisp */
.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(12, 12, 12, 0.1);
  pointer-events: none;
  z-index: 5;
}

.canvas {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.canvas-desk {
  background: #d9d4c7;
}
.canvas-field {
  background:
    radial-gradient(120% 80% at 50% 0%, #6f9a74 0%, transparent 60%),
    linear-gradient(180deg, #4d7a58 0%, #2f5a3c 55%, #1f3f2a 100%);
}
.blank {
  margin: 0;
  font: 500 30px/1 var(--mono);
  letter-spacing: 0.02em;
  color: rgba(12, 12, 12, 0.34);
}
.canvas-field .blank {
  color: rgba(247, 246, 242, 0.5);
}

.layer {
  position: absolute;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 260ms ease, visibility 0s linear 260ms;
}
.stage[data-scene="live"] .layer[data-in~="live"],
.stage[data-scene="starting"] .layer[data-in~="starting"],
.stage[data-scene="brb"] .layer[data-in~="brb"],
.stage[data-scene="ending"] .layer[data-in~="ending"] {
  opacity: 1;
  visibility: visible;
  transition: opacity 260ms ease, visibility 0s;
}

/* layout, in stream pixels (1920 × 1080) */
.l-full {
  inset: 0;
  width: 1920px;
  height: 1080px;
}
.l-alerts {
  left: 708px;
  top: 0;
  width: 560px;
  height: 340px;
}
.cam-slot {
  left: 60px;
  top: 52px;
  width: 480px;
  height: 270px;
  display: grid;
  place-items: center;
  background: #b9b3a4;
}
.you {
  font: 700 44px/1 var(--sans);
  letter-spacing: -0.02em;
  color: rgba(12, 12, 12, 0.72);
}
.l-cam {
  left: 56px;
  top: 48px;
  width: 520px;
  height: 360px;
}
.l-chat {
  left: 56px;
  top: 408px;
  width: 380px;
  height: 640px;
}
.l-receipt {
  right: 48px;
  top: 28px;
  width: 300px;
  height: 988px;
}
.l-ticker {
  left: 0;
  top: 1016px;
  width: 1920px;
  height: 64px;
}

/* full screen toggle, beside the tabs */
.fs {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--mute);
  font: 400 12.5px/1 var(--mono);
  cursor: pointer;
  transition: color 120ms ease, background-color 120ms ease;
}
.fs:hover {
  color: var(--ink);
  background: rgba(12, 12, 12, 0.06);
}
.fs[hidden] {
  display: none;
}

/* ─── controls ─────────────────────────────────────────────────────── */

.controls {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px 36px;
  margin-top: 20px;
  padding: 22px 24px;
  border-radius: var(--r-card);
  background: var(--card);
  box-shadow: 0 0 0 1px rgba(12, 12, 12, 0.07);
}

.group {
  min-width: 0;
}

.label {
  margin: 0 0 10px;
  font: 500 11px/1.2 var(--mono);
  letter-spacing: 0.14em;
  text-transform: lowercase;
  color: var(--mute);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  appearance: none;
  border: 1.5px solid var(--ink);
  border-radius: var(--r-pill);
  padding: 9px 16px 10px;
  background: transparent;
  color: var(--ink);
  font: 700 15px/1.1 var(--sans);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.pill:hover {
  background: rgba(12, 12, 12, 0.06);
}
.pill[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
.pill.act:hover {
  border-color: var(--pop);
  color: var(--pop-ink);
  background: rgba(255, 59, 31, 0.06);
}
.pill.act:active {
  background: var(--pop);
  border-color: var(--pop);
  color: var(--ink);
}
.pill.fired {
  background: var(--pop);
  border-color: var(--pop);
  color: var(--ink);
}

.status {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font: 400 12.5px/1.5 var(--mono);
  color: var(--mute);
}
.status b {
  font-weight: 500;
  color: var(--ink);
}

/* ─── notes ────────────────────────────────────────────────────────── */

.notes {
  margin-top: 40px;
  max-width: 62ch;
}
.notes ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.notes li {
  position: relative;
  padding-left: 18px;
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.55;
}
.notes li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pop);
}
code {
  font: 400 0.86em/1 var(--mono);
  padding: 2px 5px;
  border-radius: 6px;
  background: rgba(12, 12, 12, 0.06);
}

/* ─── footer ───────────────────────────────────────────────────────── */

.foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 22px;
  padding-bottom: 28px;
  position: relative;
  font: 400 12.5px/1.4 var(--mono);
  color: var(--mute);
}
.foot::before {
  content: "";
  position: absolute;
  top: 0;
  left: 28px;
  right: 28px;
  border-top: 1px solid var(--line);
}
.foot a {
  text-decoration: none;
  transition: color 120ms ease;
}
.foot a:hover {
  color: var(--ink);
}

/* ─── small screens ────────────────────────────────────────────────── */

@media (max-width: 760px) {
  .top,
  .wrap,
  .foot {
    padding-left: 16px;
    padding-right: 16px;
  }
  .intro {
    margin: 12px 0 22px;
  }
  .frame {
    border-radius: 16px;
  }
  .foot::before {
    left: 16px;
    right: 16px;
  }
  .controls {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 18px 16px;
    border-radius: 18px;
  }
  .pill {
    font-size: 14px;
    padding: 9px 14px 10px;
  }
  .tabs {
    display: flex;
    flex: 1;
    min-width: 0;
  }
  .bar {
    gap: 8px;
  }
  .fs {
    width: 40px;
    padding: 0;
    justify-content: center;
    background: rgba(12, 12, 12, 0.06);
  }
  .fs-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .tab {
    flex: 1;
    padding: 9px 10px;
    font-size: 13.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .layer,
  .stage[data-scene] .layer {
    transition: none !important;
  }
  .pill,
  .tab {
    transition: none;
  }
}

/* ---------- framed on the piece page ---------- */
.is-framed .top,
.is-framed .intro,
.is-framed .foot,
.is-framed .skip {
  display: none;
}
.is-framed .wrap {
  padding: 14px 14px 24px;
}
