/* Minimal, photo-first. Dark by default (beamer-friendly), light when the
   device prefers it. All colours are tokens so the two themes stay in sync. */
:root {
  --bg: #0b0b0c;
  --surface: #141416;
  --surface-2: #1c1c1f;
  --line: #2a2a2e;
  --text: #f4f4f5;
  --muted: #9a9aa3;
  --accent: #3b82f6;
  --ok: #22c55e;
  --ok-tint: rgba(34, 197, 94, .14);
  --bad: #ef4444;
  --bad-tint: rgba(239, 68, 68, .12);
  --radius: 14px;
  --gutter: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafafa;
    --surface: #ffffff;
    --surface-2: #f1f1f3;
    --line: #e4e4e7;
    --text: #111113;
    --muted: #6b6b74;
    --accent: #1d4ed8;
    --ok: #16a34a;
    --ok-tint: rgba(22, 163, 74, .10);
    --bad: #dc2626;
    --bad-tint: rgba(220, 38, 38, .08);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }

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

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Top bar ---------- */

.topbar {
  /* Absolute, not fixed: it scrolls away instead of sitting on the photo. */
  position: absolute; inset: 0 0 auto 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: max(14px, env(safe-area-inset-top)) var(--gutter) 14px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.brand {
  font-weight: 650; font-size: 14px; letter-spacing: .02em;
  text-decoration: none;
}

.progress { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.progress li {
  width: 26px; height: 3px; border-radius: 2px;
  background: color-mix(in srgb, var(--text) 22%, transparent);
  transition: background .3s;
}
.progress li.done { background: var(--text); }
.progress li.current { background: var(--accent); }

/* On the intro the bar sits on the photo, which is dark in both themes. */
body.on-photo .topbar { color: #fff; }
body.on-photo .progress { visibility: hidden; }

/* ---------- Screens ---------- */

#app { outline: none; }

.screen { animation: enter .5s cubic-bezier(.2, .7, .2, 1) both; }

@keyframes enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(26px, 6.4vw, 44px); line-height: 1.12; font-weight: 700;
  letter-spacing: -.02em;
  text-wrap: balance;
}

.lead { text-wrap: pretty; margin: 16px 0 0; color: var(--muted); font-size: 18px; max-width: 34em; }

.credit {
  position: absolute; right: 10px; bottom: 8px;
  font-size: 11px; color: rgba(255, 255, 255, .75);
  text-decoration: none; text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}
.credit:hover { color: #fff; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  border: 0; border-radius: 999px;
  background: var(--text); color: var(--bg);
  font-weight: 650; cursor: pointer;
  transition: transform .15s, opacity .15s;
}
.btn:hover { opacity: .9; }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }

/* ---------- Intro / outro (full-bleed photo) ---------- */

.hero {
  position: relative;
  min-height: 100dvh;
  display: flex; align-items: flex-end;
  color: #fff;
}
.hero > img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 40%;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,.55) 60%, rgba(0,0,0,.92) 100%);
}
.hero-body {
  position: relative; z-index: 1;
  width: 100%; max-width: 760px;
  padding: 0 var(--gutter) max(40px, env(safe-area-inset-bottom));
}
.hero .eyebrow, .hero .lead { color: rgba(255, 255, 255, .78); }
.hero .btn { margin-top: 28px; background: #fff; color: #0b0b0c; }
.hero .credit { z-index: 1; }
/* The outro carries more text than the intro, so it needs a darker scrim. */
.hero.outro::after {
  background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,.2) 20%, rgba(0,0,0,.8) 50%, rgba(0,0,0,.95) 100%);
}

@media (min-width: 900px) {
  .hero-body { padding: 0 64px 72px; }
}

/* ---------- Question screen ---------- */

.round {
  display: grid;
  padding-top: 56px;
}

.round-media {
  position: relative;
  margin: 0 var(--gutter);
  border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 4 / 3; max-height: 42dvh; width: auto;
  background: var(--surface-2);
}
.round-media img { width: 100%; height: 100%; object-fit: cover; }

.round-body { padding: 24px var(--gutter) 40px; max-width: 640px; }

.options { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }

.option {
  width: 100%;
  display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 14px;
  padding: 14px 16px; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .2s, background .2s, opacity .3s, transform .15s;
}
.option:hover:not(:disabled) { border-color: color-mix(in srgb, var(--text) 40%, var(--line)); }
.option:active:not(:disabled) { transform: scale(.985); }
.option:disabled { cursor: default; }

.option-key {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface-2);
  font-weight: 700; font-size: 15px;
  transition: background .25s, color .25s, transform .3s;
}
.option-key svg { width: 22px; height: 22px; }
.option-text { font-weight: 600; line-height: 1.3; }
.option-note { display: block; margin-top: 2px; font-weight: 400; font-size: 14px; color: var(--muted); }

/* Answered: the right option turns into a green box with a check, a wrong
   pick turns red, the rest step back. */
.answered .option { opacity: .45; }
.answered .option.is-correct,
.answered .option.is-picked { opacity: 1; }

.option.is-correct { border-color: var(--ok); background: var(--ok-tint); }
.option.is-correct .option-key { background: var(--ok); color: #fff; animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }

.option.is-wrong { border-color: var(--bad); background: var(--bad-tint); animation: shake .4s; }
.option.is-wrong .option-key { background: var(--bad); color: #fff; }

@keyframes pop { 0% { transform: scale(.6); } 100% { transform: scale(1); } }
@keyframes shake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* ---------- Answer reveal ---------- */

.reveal { margin-top: 28px; animation: enter .5s .15s cubic-bezier(.2, .7, .2, 1) both; }

.verdict {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--bad); }

.reveal h2 { margin: 0; font-size: 24px; line-height: 1.2; letter-spacing: -.01em; }
.reveal p { margin: 10px 0 0; color: var(--muted); text-wrap: pretty; }

.reveal-media {
  position: relative; margin-top: 20px;
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 2;
}
.reveal-media img { width: 100%; height: 100%; object-fit: cover; }

.next { margin-top: 28px; }

/* Desktop: photo left, sticky and tall; questions right. */
@media (min-width: 900px) {
  .round {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 56px; align-items: start;
    padding: 0 48px 0 0; min-height: 100dvh;
  }
  .round-media {
    position: sticky; top: 0;
    margin: 0; height: 100dvh; max-height: none; aspect-ratio: auto;
    border-radius: 0;
  }
  .round-body { padding: 120px 0 64px; }
  body.on-round .brand { color: #fff; }
}

/* ---------- Outro ---------- */

.facts { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 10px; }
.facts li {
  display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start;
  font-size: 18px;
}
.facts svg { width: 22px; height: 22px; margin-top: 3px; color: var(--ok); }

.score { margin: 20px 0 0; color: rgba(255, 255, 255, .78); }
.score strong { color: #fff; }

/* ---------- Confetti & misc ---------- */

.confetti {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 20;
}

.noscript { padding: 80px var(--gutter); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
