/* SME Feedback pages: recorder, player, PIN. One family (DM Sans, OFL,
   embedded), one accent reserved for "recording". The take is the moment:
   the recording screen is a studio monitor with a large timecode. */

@font-face {
  font-family: "DM Sans";
  src: url("/static/dm-sans.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  --paper: #e9eef2;
  --panel: #ffffff;
  --ink: #13212e;
  --slate: #566573;
  --rule: #c7d1da;
  --signal: #d93a3a;
  --signal-ink: #ffffff;
  --wash: #dde5ec;
  --focus: #2f6fb3;
  --bezel: #13212e;
  --screen: #1b2b3a;
  --screen-text: #eef3f7;
  --screen-muted: #a9b7c4;
  --screen-rule: #33475a;
  --screen-field: #243647;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 2.4rem;
  --step-4: 3.25rem;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0e161e;
    --panel: #15202b;
    --ink: #e4ebf1;
    --slate: #93a2b0;
    --rule: #2a3947;
    --signal: #ff6a63;
    --signal-ink: #1a0807;
    --wash: #1c2a37;
    --focus: #7fb4ea;
    --bezel: #05090d;
    --screen: #0b1219;
    --screen-text: #e4ebf1;
    --screen-muted: #93a2b0;
    --screen-rule: #26364a;
    --screen-field: #142130;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 40px 64px;
}
.page.narrow { max-width: 620px; }

/* The product name, quiet: it is a place, not a headline. */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  font-size: var(--step--1);
  color: var(--slate);
  margin: 0 0 56px;
}
.brand::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 3px solid var(--signal);
}

h1 {
  font-size: var(--step-4);
  line-height: 1.04;
  font-weight: 760;
  letter-spacing: -0.032em;
  margin: 0 0 16px;
  max-width: 14ch;
  text-wrap: balance;
}
h2 {
  font-size: var(--step-2);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 10px;
}
p { margin: 0 0 14px; max-width: 62ch; }
.muted { color: var(--slate); }
.context {
  font-size: var(--step-1);
  color: var(--slate);
  margin-bottom: 28px;
}

/* Setup: the ask on the left, the form on the right. */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 18px;
  max-width: 44ch;
}
.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 4px 14px;
  color: var(--slate);
}
.steps li::before {
  content: counter(step);
  grid-row: span 2;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: var(--step--1);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.steps b { color: var(--ink); font-weight: 650; }

/* The form sits in the monitor, on standby: the same bezel the take fills. */
.panel {
  background: var(--screen);
  color: var(--screen-text);
  border: 10px solid var(--bezel);
  border-radius: calc(var(--radius) + 8px);
  padding: 30px 32px 28px;
  --ink: var(--screen-text);
  --slate: var(--screen-muted);
  --rule: var(--screen-rule);
  --paper: var(--screen-field);
  --focus: #9cc8f2;
}
.standby {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--step--1);
  color: var(--screen-muted);
  margin: 0 0 22px;
}
.standby { display: none; }
.page:has(#setup:not([hidden])) .standby { display: flex; }
.standby::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--screen-muted); }

/* While a take is running (or after), the ask steps aside. */
.page:has(#recording:not([hidden])) .stage,
.page:has(#finishing:not([hidden])) .stage,
.page:has(#done:not([hidden])) .stage,
.page:has(#discarded:not([hidden])) .stage,
.page:has(#failed:not([hidden])) .stage {
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}
.page:has(#recording:not([hidden])) .steps,
.page:has(#finishing:not([hidden])) .steps,
.page:has(#done:not([hidden])) .steps,
.page:has(#discarded:not([hidden])) .steps,
.page:has(#failed:not([hidden])) .steps { display: none; }
.page:has(#recording:not([hidden])) h1 { font-size: var(--step-2); max-width: none; margin-bottom: 4px; }
.page:has(#recording:not([hidden])) .context { font-size: var(--step-0); margin-bottom: 0; }
.page:has(#recording:not([hidden])) .panel {
  padding: 0; border: 0; background: none; color: inherit;
  --ink: inherit; --slate: #566573; --rule: #c7d1da; --paper: inherit; --focus: #2f6fb3;
}
@media (prefers-color-scheme: dark) {
  .page:has(#recording:not([hidden])) .panel { --slate: #93a2b0; --rule: #2a3947; --focus: #7fb4ea; }
}
.page:has(#recording:not([hidden])) .standby { display: none; }

/* Form */
label { display: block; font-weight: 650; margin: 0 0 8px; }
.field { margin-bottom: 22px; }
input[type=email], input.pin {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1.5px solid var(--rule);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
input.pin {
  width: 11ch;
  text-transform: uppercase;
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
}
input::placeholder { color: var(--slate); opacity: 0.7; }
.options {
  border-top: 1px solid var(--rule);
  padding-top: 18px;
  margin: 4px 0 8px;
}
label.check {
  font-weight: 450;
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 0 12px;
  cursor: pointer;
}
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--ink); flex: none; }
.hint { color: var(--slate); font-size: var(--step--1); margin: -4px 0 12px 32px; }
.error { color: var(--signal); min-height: 1.5em; margin: 12px 0 0; font-weight: 550; }
.notice {
  background: var(--wash);
  border-radius: 10px;
  padding: 14px 16px;
}

/* Buttons: ink for going forward, signal only for stopping a take. */
button {
  font: inherit;
  font-weight: 650;
  border-radius: 999px;
  padding: 0 26px;
  height: 52px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: transform 80ms ease, background-color 120ms ease;
}
button:active { transform: translateY(1px); }
button.primary { background: var(--ink); color: var(--screen); width: 100%; margin-top: 10px; }
button.record {
  background: var(--signal);
  color: var(--signal-ink);
  width: 100%;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 56px;
  font-size: var(--step-1);
}
button.record::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: currentColor; }
button.danger { background: var(--signal); color: var(--signal-ink); padding: 0 34px; }
button.secondary { background: transparent; color: var(--ink); border-color: var(--rule); }
button.quiet { background: none; color: var(--slate); padding: 0; height: auto; text-decoration: underline; text-underline-offset: 3px; }
button:disabled { opacity: 0.55; cursor: default; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
a { color: var(--ink); text-underline-offset: 3px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 20px; }

/* The take: an on-air bar over a monitor. */
.onair {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.onair-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--signal);
  align-self: center;
}
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--signal); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
.timer {
  font-size: 4rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.limit { color: var(--slate); font-variant-numeric: tabular-nums; align-self: flex-end; padding-bottom: 6px; }
.onair .actions { margin: 0 0 0 auto; }
.monitor {
  background: var(--bezel);
  border-radius: calc(var(--radius) + 4px);
  padding: 10px;
  box-shadow: inset 0 0 0 3px var(--signal);
}
.monitor video { display: block; width: 100%; max-height: 58vh; border-radius: var(--radius); background: #000; object-fit: contain; }
.upload { margin: 14px 0 0; color: var(--slate); font-size: var(--step--1); }
.camera { max-width: 220px; display: block; border-radius: 10px; margin-top: 12px; }

/* Done */
.done-mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--screen-text);
  color: var(--screen);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 18px;
}

/* Player */
.player-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 32px; margin-bottom: 22px; }
.player-head h1 { font-size: var(--step-3); max-width: 22ch; margin: 0; }
.player .monitor { box-shadow: none; }
.player video { max-height: 70vh; }
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 44px;
  margin: 24px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--rule);
}
.facts dt { color: var(--slate); font-size: var(--step--1); }
.facts dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: break-word; }

.analysis { margin-top: 44px; display: grid; gap: 8px; }
.analysis h2 { margin-top: 28px; }
.analysis > p { font-size: var(--step-1); line-height: 1.5; }
.points { padding-left: 0; list-style: none; display: grid; gap: 10px; max-width: 70ch; }
.points li { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 16px; }
.seek { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--focus); text-decoration: none; margin-right: 6px; }
.kind { font-size: var(--step--1); border: 1px solid var(--rule); border-radius: 999px; padding: 1px 10px; margin-right: 6px; color: var(--slate); }
.kind-issue { color: var(--signal); border-color: var(--signal); }
.frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.frames figure { margin: 0; }
.frames img { width: 100%; border-radius: 10px; display: block; }
.frames figcaption { font-size: var(--step--1); color: var(--slate); margin-top: 6px; }
.transcript { white-space: pre-wrap; font: var(--step--1)/1.6 inherit; background: var(--panel); border: 1px solid var(--rule); padding: 16px; border-radius: 10px; max-width: 80ch; }

@media (max-width: 860px) {
  .page { padding: 20px 16px 48px; }
  .brand { margin-bottom: 32px; }
  .stage { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  h1 { font-size: var(--step-3); }
  .panel { padding: 22px; }
  .timer { font-size: 3rem; }
  .onair .actions { width: 100%; margin: 4px 0 0; }
  .onair #stop { order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  .dot { animation: none; }
  button { transition: none; }
}
