/* Skill A/B compare — a fixed recording stage, 1080×1920 (9:16) or
   1920×1080 (16:9). Same tokens as the debut A/B page: grey is the control,
   orange is the skill, teal is a blind song. In 9:16 content keeps clear of
   the Reels/TikTok overlays (bottom ~300px, right ~120px). Stage text is at
   least 26px. */

:root {
  color-scheme: dark;
  --paper: #0c1016;
  --panel: #151b23;
  --panel-2: #1b222c;
  --ink: #eef1f5;
  --ink-2: #b6bfca;
  --ink-3: #8b95a1;
  --rule: #2a323d;
  --arm-a: #9ba3ad;
  --arm-b: #f07a3e;
  --blind: #5cc8c0;
  --font: "Archivo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
[hidden] { display: none !important; }
.viewport { position: fixed; inset: 0; }

.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center;
  background: var(--paper);
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: 22px;
}
.stage[data-format="portrait"] {
  width: 1080px;
  height: 1920px;
  padding: 56px 144px 0 72px;
  grid-template-columns: 1fr;
}
.stage[data-format="landscape"] {
  width: 1920px;
  height: 1080px;
  padding: 64px 88px;
  grid-template-columns: 1fr 1.05fr;
  grid-template-rows: auto 1fr auto;
  column-gap: 64px;
  row-gap: 22px;
}
.stage[data-format="landscape"] .head { grid-column: 1; grid-row: 1; }
.stage[data-format="landscape"] .diff,
.stage[data-format="landscape"] .poll { grid-column: 1; grid-row: 2; align-self: start; }
.stage[data-format="landscape"] .media { grid-column: 2; grid-row: 1 / span 2; }
.stage[data-format="landscape"] .foot { grid-column: 1 / span 2; grid-row: 3; }
.media { display: grid; gap: 18px; align-content: start; }

/* ---- header ---- */
.kicker {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
h1 {
  margin: 0;
  font-size: 70px;
  line-height: 0.98;
  font-weight: 800;
  font-variation-settings: "wdth" 70;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 .accent { color: var(--arm-b); }
.is-blind h1 .accent { color: var(--blind); }
.model-line { margin: 16px 0 0; font-size: 30px; line-height: 1.3; color: var(--ink-2); }
.model-line b { color: var(--ink); font-weight: 800; }

/* ---- remix request ---- */
.request { display: grid; gap: 14px; }
.ask { margin: 0; font-size: 34px; line-height: 1.25; font-weight: 600; }
.ask .label {
  display: block;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.ask q { quotes: "“" "”"; }

/* ---- song cards ---- */
.songs { display: grid; gap: 18px; }
.song {
  --arm: var(--ink-3);
  background: var(--panel);
  border: 3px solid var(--rule);
  border-radius: 20px;
  padding: 18px 24px 16px;
  transition: border-color 300ms ease, background-color 300ms ease, opacity 300ms ease;
}
.song[data-tone="a"] { --arm: var(--arm-a); }
.song[data-tone="b"] { --arm: var(--arm-b); }
.song[data-tone="blind"] { --arm: var(--blind); }
.song.original { --arm: var(--ink-2); padding-bottom: 12px; border-style: dashed; }
.song.is-playing { border-color: var(--arm); background: var(--panel-2); }
.is-running .song:not(.is-playing) { opacity: 0.55; }
.song.is-missing { opacity: 0.5; }

.song-top { display: flex; align-items: center; gap: 18px; }
.chip {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--arm);
  border-radius: 999px;
  padding: 6px 16px;
  white-space: nowrap;
}
.original .chip { background: transparent; color: var(--ink-2); border: 2px solid var(--rule); }
.song .song-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 44px;
  font-weight: 800;
  font-variation-settings: "wdth" 85;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.original .song-title { font-size: 36px; }
.play {
  flex: none;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid var(--arm);
  background: transparent;
  color: var(--arm);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.play:disabled { opacity: 0.4; cursor: default; }
.play:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.play svg { width: 28px; height: 28px; pointer-events: none; }

.wave { position: relative; margin-top: 14px; height: 112px; }
.song:has(.marker) .wave { margin-top: 48px; }
.original .wave { height: 72px; }
.wave canvas { width: 100%; height: 100%; display: block; }
.marker {
  position: absolute;
  top: -4px;
  bottom: -4px;
  border-left: 2px dashed var(--arm);
  opacity: 0.85;
}
.marker span {
  position: absolute;
  left: 6px;
  top: -36px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--arm);
  background: var(--panel);
  padding: 0 4px;
  white-space: nowrap;
}
.song.is-playing .marker span { background: var(--panel-2); }
.clip-zone {
  position: absolute;
  inset: 0 auto 0 0;
  border-right: 2px solid var(--ink-3);
  background: rgba(238, 241, 245, 0.04);
  pointer-events: none;
  display: none;
}
.is-running .clip-zone { display: block; }
.meta { display: flex; justify-content: space-between; gap: 16px; margin: 10px 0 0; font-size: 26px; color: var(--ink-3); min-height: 30px; }
.meta .count { color: var(--arm); font-weight: 700; }
.missing { margin: 14px 0 4px; font-size: 28px; color: var(--ink-3); }

/* ---- prompt diff ---- */
.diff { background: var(--panel); border-radius: 20px; padding: 22px 26px 20px; }
.diff-head, .rows li {
  display: grid;
  grid-template-columns: 1fr 210px 230px;
  align-items: center;
  column-gap: 16px;
}
.stage[data-format="landscape"] .diff-head,
.stage[data-format="landscape"] .rows li { grid-template-columns: 1fr 240px 270px; }
.diff-head { padding-bottom: 12px; border-bottom: 2px solid var(--rule); }
.diff h2 { margin: 0; font-size: 34px; font-weight: 800; line-height: 1.1; font-variation-settings: "wdth" 85; }
.col { font-size: 28px; font-weight: 800; }
.col[data-arm="a"] { color: var(--arm-a); }
.col[data-arm="b"] { color: var(--arm-b); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { padding: 14px 0; border-bottom: 2px solid var(--rule); font-size: 30px; line-height: 1.15; }
.rows .label { color: var(--ink-2); }
.rows .v { font-weight: 700; }
.rows .v[data-arm="a"] { color: var(--ink-2); }
.rows .v[data-arm="b"] { color: var(--arm-b); }
.same { margin: 14px 0 0; font-size: 26px; line-height: 1.35; color: var(--ink-3); }
.same b { color: var(--ink-2); font-weight: 600; }
.is-running .rows li, .is-running .same { opacity: 0; transform: translateY(10px); transition: opacity 400ms ease, transform 400ms ease; }
.is-running .rows li.shown, .is-running .same.shown { opacity: 1; transform: none; }
.is-running .diff.is-waiting { opacity: 0; }

/* ---- poll ---- */
.poll { background: var(--panel); border: 3px solid var(--blind); border-radius: 20px; padding: 26px 28px; }
.poll .q { margin: 0; font-size: 46px; line-height: 1.05; font-weight: 800; font-variation-settings: "wdth" 80; text-wrap: balance; }
.choices { display: flex; gap: 16px; margin-top: 20px; }
.choice {
  flex: 1;
  border-radius: 16px;
  border: 3px solid var(--arm);
  color: var(--arm);
  padding: 16px 18px;
  font-size: 34px;
  font-weight: 800;
  text-align: center;
}
.choice[data-tone="a"] { --arm: var(--arm-a); }
.choice[data-tone="b"] { --arm: var(--arm-b); }
.choice[data-tone="blind"] { --arm: var(--blind); }
.choice.is-picked { background: var(--arm); color: var(--paper); }
.cta { margin: 16px 0 0; font-size: 28px; color: var(--ink-2); }

.foot { margin: 0; font-size: 26px; line-height: 1.35; color: var(--ink-2); }
.stage[data-format="portrait"] .foot { margin-top: 4px; }

/* ---- control panel (outside the stage) ---- */
.controls {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 280px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: rgba(21, 27, 35, 0.96);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 14px;
  font-size: 13px;
  color: var(--ink-2);
  display: grid;
  gap: 12px;
  z-index: 10;
}
.controls.is-hidden { display: none; }
.ctl { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; }
.ctl legend { padding: 0; margin-bottom: 6px; font-weight: 600; color: var(--ink); }
.ctl > label, .two label { display: grid; gap: 4px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.check { display: flex !important; align-items: center; gap: 8px; }
.controls select, .controls input[type="number"] {
  font: inherit;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 6px;
  width: 100%;
}
.controls button {
  font: inherit;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
}
.controls button[aria-pressed="true"] { background: var(--arm-b); border-color: var(--arm-b); color: var(--paper); }
.controls button:disabled { opacity: 0.4; cursor: default; }
.rate-row, .pick { display: flex; align-items: center; gap: 4px; }
.rate-row span, .pick span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rate-row button { width: 28px; padding: 4px 0; }
.keys { margin: 0; font-size: 12px; color: var(--ink-3); line-height: 1.4; }

.start { position: fixed; inset: 0; display: grid; place-content: center; gap: 12px; background: rgba(12, 16, 22, 0.85); z-index: 20; text-align: center; }
.start button { font: 700 28px var(--font); padding: 16px 44px; border-radius: 999px; border: 0; background: var(--arm-b); color: var(--paper); cursor: pointer; }
.start p { margin: 0; color: var(--ink-2); font-size: 16px; }

@media (prefers-reduced-motion: reduce) {
  .song, .is-running .rows li, .is-running .same { transition: none; }
}


/* ---- fit tuning per frame and experiment ---- */
.diff-head, .rows li { grid-template-columns: 1fr 200px 290px; }
.stage[data-format="landscape"] .diff-head,
.stage[data-format="landscape"] .rows li { grid-template-columns: 1fr 230px 320px; }
.stage[data-exp="remix"][data-format="portrait"] { gap: 16px; }
.stage[data-exp="remix"][data-format="portrait"] .wave { height: 84px; }
.stage[data-exp="remix"][data-format="portrait"] .original .wave { height: 56px; }
.stage[data-exp="remix"][data-format="portrait"] .song { padding: 14px 22px 10px; }
.stage[data-exp="remix"][data-format="portrait"] .meta { display: none; }
.stage[data-exp="remix"][data-format="portrait"] .ask { font-size: 30px; }
.stage[data-exp="remix"][data-format="portrait"] .rows li { padding: 11px 0; }
.stage[data-format="landscape"] .wave { height: 210px; }
.stage[data-format="landscape"][data-exp="remix"] .wave { height: 120px; }
.stage[data-format="landscape"][data-exp="remix"] .original .wave { height: 80px; }
.stage[data-format="landscape"] .songs { gap: 24px; }
.stage[data-format="landscape"] .poll { padding: 36px 36px; }
.stage[data-format="landscape"] .poll .q { font-size: 56px; }
.stage[data-format="landscape"] .choice { font-size: 40px; padding: 24px 18px; }
.diff h2 { grid-column: 1 / -1; margin-bottom: 12px; }
.diff-head .col[data-arm="a"] { grid-column: 2; }
.diff-head .col[data-arm="b"] { grid-column: 3; }
.stage[data-format="landscape"] .diff-head,
.stage[data-format="landscape"] .rows li { grid-template-columns: 1fr 200px 290px; }
.stage[data-format="landscape"] .foot { grid-column: 1; align-self: end; }

/* ---- now playing (fills the stage while clips play) ---- */
.now {
  --arm: var(--ink-2);
  display: grid;
  gap: 10px;
  padding: 30px 32px;
  border-radius: 20px;
  border: 3px solid var(--arm);
  background: var(--panel);
}
.now[data-tone="a"] { --arm: var(--arm-a); }
.now[data-tone="b"] { --arm: var(--arm-b); }
.now[data-tone="blind"] { --arm: var(--blind); }
.now .label { font-size: 26px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.now .who { font-size: 64px; line-height: 1; font-weight: 800; font-variation-settings: "wdth" 75; color: var(--arm); }
.now .count { font-size: 34px; font-weight: 700; color: var(--ink-2); }
.stage[data-format="landscape"] .now { grid-column: 1; grid-row: 2; align-self: start; }
.is-running .diff.is-waiting { display: none; }

/* Way back to the site; never in a recording. */
.home-link {
  position: fixed; bottom: 12px; left: 12px; z-index: 20;
  padding: 10px 14px; border-radius: 999px; background: rgba(23, 29, 37, 0.85);
  color: #eef1f5; font: 600 15px/1 "Archivo", system-ui, sans-serif; text-decoration: none;
}
.home-link:hover { background: #232b36; }
.is-running .home-link, .is-demo .home-link, .is-capture .home-link { display: none; }
