:root {
  --paper: #f7f1e6;
  --ink: #1b1714;
  --muted: #62594e;
  --line: #ded4c3;
  --panel: #fffaf1;
  --coral: #ff7a59;
  --blue: #6fb1ff;
  --on-colour: #1b1714;
  --blend: multiply;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #17130f;
    --ink: #f7f1e6;
    --muted: #b5aa9b;
    --line: #3a332b;
    --panel: #221d17;
    --blend: screen;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

button, input { font: inherit; color: inherit; }

button { cursor: pointer; }

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

h1, h2, p { margin: 0; }

.page {
  width: 100%;
  max-width: 460px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(28px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page.centred { justify-content: center; }

.wordmark {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.title {
  font-size: clamp(2.75rem, 13vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.heading {
  font-size: clamp(2rem, 9vw, 2.75rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.lede { font-size: 1.1875rem; line-height: 1.4; color: var(--muted); }

.small { font-size: 0.9375rem; line-height: 1.45; color: var(--muted); }

.stack { display: flex; flex-direction: column; gap: 12px; }

.button {
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 1.125rem;
  font-weight: 700;
  transition: transform 120ms ease;
}

.button:active { transform: scale(0.98); }

.button.secondary {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--line);
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field label { font-size: 0.9375rem; font-weight: 600; }

.field input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  font-size: 1.125rem;
}

.field input:focus { outline: none; border-color: var(--ink); }

.status { min-height: 1.4em; font-size: 0.9375rem; line-height: 1.4; color: var(--muted); }

.status.error { color: #c0341b; }

@media (prefers-color-scheme: dark) { .status.error { color: #ff9c85; } }

.people { display: flex; flex-direction: column; gap: 8px; padding: 0; margin: 0; list-style: none; }

.people li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--panel);
}

.people .count { color: var(--muted); white-space: nowrap; }

.footnote { margin-top: auto; }

/* Question screen: the whole viewport is the two answers. */
.question {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr 1fr;
  grid-template-columns: 1fr;
}

.question-top {
  padding: max(16px, env(safe-area-inset-top)) 20px 18px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  row-gap: 14px;
}

.question-prompt {
  grid-column: 1 / -1;
  text-align: center;
  font-size: clamp(1.375rem, 5.5vw, 1.875rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
  outline: none;
}

.back {
  justify-self: start;
  min-height: 44px;
  padding: 8px 8px 8px 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.9375rem;
}

.dots { display: flex; gap: 7px; }

.dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--line);
}

.dots span.done { background: var(--ink); }

.option {
  border: 0;
  padding: 24px;
  color: var(--on-colour);
  font-size: clamp(2rem, 9.5vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  font-weight: 800;
  overflow-wrap: anywhere;
  transition: filter 160ms ease, transform 160ms ease;
}

.option.long { font-size: clamp(1.625rem, 7vw, 2.75rem); line-height: 1.08; }

.option.a { background: var(--coral); }

.option.b { background: var(--blue); padding-bottom: max(24px, env(safe-area-inset-bottom)); }

.option:focus-visible { outline-offset: -8px; outline-color: var(--on-colour); }

.question.answered .option:not(.chosen) { filter: grayscale(1) opacity(0.45); }

.question.answered .option.chosen { transform: scale(1.015); }

@media (min-width: 760px) {
  .question { grid-template-rows: auto 1fr; grid-template-columns: 1fr 1fr; }
  .question-top { grid-column: 1 / -1; padding: 22px 32px 24px; }
  .option { padding: 40px; }
  .option.b { padding-bottom: 40px; }
}

/* Result */
.venn { width: 100%; max-width: 280px; height: auto; align-self: center; overflow: visible; }

.venn circle { transition: transform 900ms cubic-bezier(0.2, 0.9, 0.25, 1); }

.venn .left { fill: var(--coral); transform: translateX(calc(var(--apart) * -1)); }

.venn .right { fill: var(--blue); mix-blend-mode: var(--blend); transform: translateX(var(--apart)); }

.score-line { display: flex; flex-direction: column; gap: 6px; text-align: center; }

.score-number {
  font-size: clamp(3.5rem, 18vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 800;
}

.rows { display: flex; flex-direction: column; padding: 0; margin: 0; list-style: none; }

.rows li {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.rows .prompt { font-size: 0.875rem; color: var(--muted); }

.rows .picks { font-weight: 600; font-size: 1.0625rem; line-height: 1.3; }

.rows .mark {
  grid-column: 2;
  grid-row: 1 / span 2;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--on-colour);
  background: var(--line);
}

.rows .mark.same { background: var(--coral); }

@media (prefers-color-scheme: dark) {
  .rows .mark:not(.same) { color: var(--ink); }
}

.linkbox {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  font-size: 0.875rem;
}

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