/*
 * Your Guess vs. Your Answers — phone-first, calm, one accent.
 * Brand colours are placeholders until Marguerite picks hers:
 * change the values below and the whole page follows.
 */
:root {
  --bg: #ecefed;          /* page: pale mineral grey-green */
  --surface: #f8f9f8;     /* answer panels and form */
  --ink: #1c2729;         /* text */
  --muted: #56656a;       /* secondary text */
  --line: #c8d0ce;        /* hairlines and borders */
  --accent: #2c5a4e;      /* the ONE accent: buttons, progress, selection */
  --accent-ink: #ffffff;  /* text on the accent */
  --accent-tint: #dde7e3; /* pressed / chosen rows (a tint of the accent) */
  --danger: #8a2e24;      /* form error text */

  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --gutter: 16px;
  --measure: 34rem;
  --tap: 52px;
  --radius: 10px;

  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem; /* 17px: comfortable on a phone, no iOS input zoom */
  line-height: 1.55;
  overflow-x: hidden;
}

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

/* ---------- frame */

.page {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 3.25rem max(var(--gutter), env(safe-area-inset-right)) 3rem max(var(--gutter), env(safe-area-inset-left));
  min-height: 100svh;
}

.screen { animation: arrive 260ms ease-out both; }
@keyframes arrive { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 2;
  background: var(--line);
}
.progress-fill {
  height: 100%; width: 0; background: var(--accent);
  transition: width 300ms ease;
}

/* ---------- type */

h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1:focus, h2:focus { outline: none; }

.title {
  font-size: clamp(2.2rem, 10vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
}
.title-line { display: block; }
.title-line + .title-line { padding-left: 0.6em; } /* the answer sits offset from the guess */

.subtitle {
  font-family: var(--serif);
  font-size: 1.25rem;
  line-height: 1.4;
  color: var(--muted);
  margin: 1rem 0 0;
  max-width: 26rem;
}

.question {
  font-size: clamp(1.45rem, 6.2vw, 1.75rem);
  line-height: 1.22;
  margin-top: 0.25rem;
}
.helper { color: var(--muted); margin: 0.5rem 0 0; }
.lede { color: var(--muted); margin: 0.75rem 0 0; }

strong { font-weight: 650; }

/* ---------- opening */

.host {
  display: flex; align-items: center; gap: 0.9rem;
  margin: 2.25rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.photo {
  flex: none; width: 64px; height: 64px; border-radius: 50%;
  overflow: hidden; background: var(--accent-tint);
  display: grid; place-items: center;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-initial { font-family: var(--serif); font-size: 1.75rem; color: var(--accent); line-height: 1; }
.host-line { margin: 0; }

.briefing { list-style: none; margin: 1.25rem 0 2rem; padding: 0; }
.briefing li { padding: 0.55rem 0 0.55rem 1.1rem; position: relative; }
.briefing li::before {
  content: ""; position: absolute; left: 0; top: 1.35rem;
  width: 6px; height: 1px; background: var(--muted);
}

.privacy { color: var(--muted); font-size: 0.9375rem; margin: 1.25rem 0 0; }
.note { color: var(--muted); }

/* ---------- top bar on question screens */

.topbar { display: flex; align-items: center; justify-content: space-between; min-height: var(--tap); margin: -0.75rem 0 1rem; }
.count { color: var(--muted); font-size: 0.9375rem; font-variant-numeric: tabular-nums; }

.back {
  appearance: none; border: 0; background: none; color: var(--ink);
  font: inherit; min-height: var(--tap); min-width: var(--tap);
  padding: 0 0.75rem 0 0; margin-left: 0; cursor: pointer; text-align: left;
  text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 0.25em;
}
.back:disabled { color: var(--muted); cursor: default; }

/* ---------- answers: one panel, rows separated by hairlines */

.options {
  list-style: none; margin: 1.5rem 0 0; padding: 0;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.options li + li { border-top: 1px solid var(--line); }

.option {
  appearance: none; display: block; width: 100%;
  min-height: var(--tap);
  padding: 0.85rem 1rem;
  border: 0; border-radius: 0; background: transparent;
  color: var(--ink); font: inherit; line-height: 1.35; text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.option:active { background: var(--accent-tint); }
.option[aria-pressed="true"] {
  background: var(--accent-tint);
  box-shadow: inset 4px 0 0 var(--accent);
  font-weight: 600;
}
.option:disabled { cursor: default; color: var(--muted); }

/* ---------- buttons and fields */

.button {
  appearance: none; display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 0 1.4rem;
  border-radius: var(--radius); border: 1px solid var(--accent);
  font: inherit; font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none;
  cursor: pointer;
}
.button-primary { background: var(--accent); color: var(--accent-ink); width: 100%; }
.button-quiet { background: transparent; color: var(--accent); width: 100%; }
.button:disabled { opacity: 0.45; cursor: default; }

.actions { display: grid; gap: 0.75rem; margin-top: 1.25rem; }

.field { display: block; margin-top: 1.25rem; }
.field-label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.field-hint { color: var(--muted); font-weight: 400; }
.input {
  display: block; width: 100%; min-height: var(--tap);
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font: inherit;
}
.input::placeholder { color: var(--muted); opacity: 0.8; }

.check { display: flex; gap: 0.75rem; align-items: flex-start; margin-top: 1rem; min-height: var(--tap); padding-top: 0.6rem; cursor: pointer; }
.check input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--accent); }

/* Visible focus for keyboard users, everywhere */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.option:focus-visible { outline-offset: -3px; }

/* ---------- waiting */

.waiting { display: flex; align-items: center; gap: 0.85rem; margin-top: 2rem; color: var(--muted); }
.dot-pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; flex: none; }
@keyframes pulse { 0%, 100% { opacity: 0.25; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }

/* ---------- result */

.writeup { margin-top: 1.5rem; }
.writeup p { margin: 0 0 1.1rem; }
.writeup p:first-child { font-size: 1.125rem; }

.book-wrap { margin: 1.5rem 0 1.75rem; }
.button-book {
  width: 100%; min-height: 60px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 1.125rem;
}

.contact {
  margin-top: 2.25rem; padding: 1.25rem 1rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.contact h2 { font-size: 1.3rem; }
.contact .actions { margin-top: 1.25rem; }
.form-msg { margin: 0.9rem 0 0; }
.form-msg.error { color: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  .progress-fill { transition: none; }
  .dot-pulse { animation: none; opacity: 1; }
}

@media (min-width: 640px) {
  .page { padding-top: 5rem; }
}

/* ---------- result lists and the bot check */
.writeup ul { margin: 0.5rem 0 1rem; padding-left: 1.25rem; }
.writeup li { margin: 0.35rem 0; }
.ts-box { display: flex; justify-content: center; padding: 0 var(--gutter) 2rem; }
.ts-box:empty { display: none; }
/* When Cloudflare needs a tap, pin the box to the bottom of the screen so it is seen. */
.ts-box.ts-asking {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  flex-direction: column; align-items: center;
  background: var(--bg); box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.18);
  padding: 1rem var(--gutter) calc(1rem + env(safe-area-inset-bottom));
}
.ts-box.ts-asking::before { content: "One quick check: tap the box."; font-weight: 600; margin-bottom: 0.75rem; }

/* ---------- first-yes: one name (screen only, never stored) */
.name-widget { margin-top: 1.5rem; }
.name-line { font-weight: 600; margin: 0.5rem 0 0; min-height: 1.5em; }
