/* ===== Content evaluation shell =====
   Styling for the two opening pages (/ and /menu). The study interface has its
   own styles.css; both share the Elicitation study's theme. */

:root {
  --bg: #090910;
  --bg-panel: #0e0e16;
  --bg-input: #1a1a24;
  --line: #23232f;
  --text: #e7e7ee;
  --text-dim: #9a9aac;
  --accent: #474bd4;
  --accent-2: #813af6;
  --accent-deep: #383cc4;
  --accent-ink: #ffffff;
}

/* Light theme — the "warm paper" surface set shared with the Spatial Video
   Broadcast dashboard: an off-white page, white panels, warm hairline borders,
   near-black type, and ONE steel blue accent spent on the badge and the primary
   button rather than sprinkled around. The dark theme above is untouched. */
[data-theme="light"] {
  --bg: #edebe5;
  --bg-panel: #f7f5f1;
  --bg-input: #f7f5f1;
  --surface-2: #e4e1d9;   /* hover / inset wells */
  --line: #d8d4cb;
  --line-2: #c7c2b7;      /* borders that must read as an edge, e.g. controls */
  --text: #1a1a18;
  --text-2: #4a4740;
  --text-dim: #6f6b62;
  --accent: #4f7a96;      /* steel blue — primary action, focus */
  --accent-2: #4f7a96;
  --accent-deep: #3f6880;
  --accent-sf: #dfe9f0;   /* accent tint surface */
  --accent-ln: #b9cedc;   /* accent hairline */
  --err: #9c3d29;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(26, 26, 24, .04);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "SF Pro Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Only one screen is visible at a time. */
.screen { position: fixed; inset: 0; display: none; }
.screen.is-active { display: block; }
.screen.intro.is-active { display: flex; align-items: center; justify-content: center; }

/* ---------- Blank opening page ---------- */
.intro {
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(129, 58, 246, 0.18), transparent 60%),
    radial-gradient(900px 520px at 50% 120%, rgba(71, 75, 212, 0.16), transparent 60%),
    var(--bg);
}

.intro__card {
  text-align: center;
  max-width: 620px;
  animation: introIn .4s ease both;
}

@keyframes introIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.intro__badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 22px;
}

.intro__title {
  margin: 0 0 16px;
  font-size: clamp(28px, 4.6vw, 50px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.05;
  white-space: nowrap;
}

.intro__text {
  margin: 0 auto 34px;
  max-width: 520px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-dim);
}

/* Research-use / copyright notice shown above the Start button.
   Base text stays neutral; only the key phrases are emphasized so the
   highlighting keeps its meaning. */
.intro__notice {
  max-width: 560px;
  font-weight: 400;
}
.intro__notice strong { font-weight: 700; color: var(--text); }
.intro__notice strong.intro__hot { color: #e5484d; }

/* Where the finished response landed, shown on the thank-you page. */
.intro__filed {
  margin: 18px auto 0;
  font-size: 13px;
  color: var(--text-dim);
  opacity: .8;
}

.intro__btn {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  border: 1px solid var(--accent-deep);
  border-radius: 10px;
  padding: 14px 40px;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}
.intro__btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.intro__btn:active { transform: translateY(0); }
.intro__btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.intro__btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; filter: none; }

/* ---------- Entry form (name + clip) ---------- */
.gate__form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}
/* Clip picker + Start share a row beneath the name field. */
.gate__row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.gate__row .gate__input {
  flex: 1 1 200px;
  min-width: 0;
}
.gate__input {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  min-width: 220px;
  text-align: center;
}
.gate__input:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
}
.gate__error {
  margin: 16px auto 0;
  color: #ff8095;
  font-size: 14px;
}

/* ---------- Clip menu ---------- */
.menu__card { max-width: 880px; }
.menu__title { font-size: clamp(24px, 3.4vw, 38px); margin-bottom: 12px; }
.menu__text { margin-bottom: 26px; max-width: 580px; font-size: 15px; min-height: 1.6em; }

.menu__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}

.menu__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 78px;
  padding: 12px;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.2px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.menu__btn:hover { border-color: var(--accent-2); transform: translateY(-1px); }
.menu__btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }

/* A finished clip stays on the page but is plainly out of play. */
.menu__btn.is-done {
  opacity: .4;
  cursor: not-allowed;
  border-style: dashed;
}
.menu__btn.is-done:hover { border-color: var(--line); transform: none; }

.menu__btn__sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.menu__note { margin: 26px auto 0; font-size: 15px; color: var(--text-dim); }
.menu__note.hidden { display: none; }

/* Participant name, parked in the corner so it is confirmable but not loud. */
.user-corner {
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 40;
  font-size: 11px;
  letter-spacing: .2px;
  color: var(--text-dim);
  opacity: .6;
  pointer-events: none;
  user-select: none;
}

/* ---------- Theme toggle (light / dark) ---------- */
/* Deliberately invisible: it occupies the top-right corner and still responds to
   a click, but a participant is never shown a control they have no reason to
   touch. The organiser knows where it is. */
.theme-toggle--silent {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  width: 46px;
  height: 46px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  outline: none;
  cursor: default;
  -webkit-appearance: none;
  appearance: none;
}

/* ============================================================================
   LIGHT THEME — broadcast-dashboard styling
   Everything below is scoped to [data-theme="light"] and never affects dark.
   The page becomes paper: no glow, hairline edges, a card for the content, and
   colour spent only where it carries meaning.
   ========================================================================= */

/* No purple bloom behind the card — a page that is read for an hour must not
   glow. Flat warm paper instead. */
[data-theme="light"] .intro { background: var(--bg); }

/* The opening pages become a panel on that paper, like the dashboard's cards. */
[data-theme="light"] .intro__card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 42px 44px 44px;
  max-width: 640px;
}

/* "RESEARCH STUDY" / "COMPLETE" read as status pills: a tint, a hairline and
   coloured mono text — never a slab of colour. */
[data-theme="light"] .intro__badge {
  font: 650 12.5px/1 var(--mono);
  letter-spacing: .09em;
  color: var(--accent);
  background: var(--accent-sf);
  border-color: var(--accent-ln);
  border-radius: 5px;
  padding: 8px 11px;
}

[data-theme="light"] .intro__title { letter-spacing: -.015em; }
[data-theme="light"] .intro__notice strong.intro__hot { color: var(--err); }

/* Primary action: solid steel blue, square-roundy like the dashboard buttons —
   a wide lozenge reads as a toy next to a dense control surface. */
[data-theme="light"] .intro__btn {
  background: var(--accent);
  border-color: var(--accent);
  border-radius: 6px;
  padding: 12px 34px;
  font-size: 16px;
}
[data-theme="light"] .intro__btn:hover { background: var(--accent-deep); filter: none; }
[data-theme="light"] .intro__btn:focus-visible { outline-color: var(--accent-ln); }

/* Fields sit as inset wells in the white card and turn to paper on focus. */
[data-theme="light"] .gate__input {
  background: var(--bg);
  border-color: var(--line-2);
  border-radius: 6px;
}
[data-theme="light"] .gate__input::placeholder { color: var(--text-dim); }
[data-theme="light"] .gate__input:focus-visible {
  background: var(--bg-panel);
  outline: 2px solid var(--accent-ln);
  outline-offset: -1px;
}
[data-theme="light"] .gate__error { color: var(--err); }

/* Clip buttons: paper tiles, steel-blue edge on hover, and a finished one reads
   as a spent ticket rather than a live control. */
[data-theme="light"] .menu__btn {
  background: var(--bg);
  border-color: var(--line-2);
  border-radius: 6px;
}
[data-theme="light"] .menu__btn:hover {
  background: var(--surface-2);
  border-color: var(--accent);
}
[data-theme="light"] .menu__btn.is-done {
  background: var(--surface-2);
  border-color: var(--line);
  opacity: .55;
}
[data-theme="light"] .menu__btn.is-done:hover { border-color: var(--line); }
