:root {
  --bg: #f4f1ec;
  --bg-2: #ebe6de;
  --card: rgba(255, 255, 255, 0.78);
  --ink: #1d1b19;
  --ink-2: #5d5750;
  --ink-3: #8c857c;
  --line: rgba(29, 27, 25, 0.10);
  --accent: #8a6a3b;
  --accent-ink: #fffaf2;
  --good: #3f7a55;
  --bad: #a4483c;
  --focus: #b48a4a;
  --shadow: 0 30px 60px -30px rgba(40, 30, 15, 0.35), 0 2px 6px rgba(40, 30, 15, 0.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12110f;
    --bg-2: #1b1916;
    --card: rgba(34, 31, 27, 0.82);
    --ink: #f1ece4;
    --ink-2: #b9b0a4;
    --ink-3: #847b70;
    --line: rgba(241, 236, 228, 0.10);
    --accent: #d2ac6e;
    --accent-ink: #1a1408;
    --good: #7fbf93;
    --bad: #e08a7c;
    --focus: #e3c38c;
    --shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(255, 255, 255, 0.04) inset;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12110f; --bg-2: #1b1916; --card: rgba(34, 31, 27, 0.82); --ink: #f1ece4; --ink-2: #b9b0a4;
  --ink-3: #847b70; --line: rgba(241, 236, 228, 0.10); --accent: #d2ac6e; --accent-ink: #1a1408;
  --good: #7fbf93; --bad: #e08a7c; --focus: #e3c38c; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1200px 700px at 85% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  background-attachment: fixed;
  color: var(--ink);
  font: 16px/1.5 ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

main {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 32px 28px 28px;
  animation: rise 520ms cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }

.mark {
  width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  margin-bottom: 22px;
}
.mark svg { width: 22px; height: 22px; }

.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 6px; }
h1 {
  font: 600 27px/1.18 ui-serif, "New York", "Iowan Old Style", Charter, Georgia, serif;
  letter-spacing: -0.01em; margin: 0 0 10px;
}
p.lede { color: var(--ink-2); margin: 0 0 22px; }

.facts { list-style: none; padding: 0; margin: 0 0 24px; border-top: 1px solid var(--line); }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.facts span:first-child { color: var(--ink-3); }
.facts span:last-child { text-align: right; overflow-wrap: anywhere; }

.label { font-size: 14px; color: var(--ink-2); margin: 0 0 10px; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.choice {
  appearance: none; border: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 3%, transparent);
  color: var(--ink); border-radius: 18px; height: 78px; cursor: pointer;
  font: 600 32px/1 ui-rounded, "SF Pro Rounded", ui-sans-serif, system-ui, sans-serif;
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.choice:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.choice:active { transform: scale(.97); }
.choice[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent), 0 10px 24px -12px var(--accent);
}

.number-show {
  text-align: center; margin: 4px 0 22px; padding: 20px 0 18px;
  border: 1px solid var(--line); border-radius: 22px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.number-show b { display: block; font: 600 56px/1 ui-rounded, "SF Pro Rounded", ui-sans-serif, system-ui, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.number-show small { color: var(--ink-3); font-size: 13px; }

button.primary, button.quiet, a.primary {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 54px; border-radius: 16px; font-family: inherit; font-size: 16px; font-weight: 600; line-height: 1; cursor: pointer;
  text-decoration: none; transition: filter .2s ease, transform .12s ease, opacity .2s;
}
button.primary, a.primary { border: 0; background: var(--accent); color: var(--accent-ink); }
button.primary:hover, a.primary:hover { filter: brightness(1.06); }
button.primary:active { transform: scale(.985); }
button.primary:disabled { opacity: .45; cursor: default; }
button.quiet { margin-top: 10px; border: 1px solid var(--line); background: transparent; color: var(--ink-2); }
button:focus-visible, .choice:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

.field { display: block; margin-bottom: 14px; }
.field input {
  width: 100%; height: 52px; border-radius: 14px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--ink) 3%, transparent); color: var(--ink);
  padding: 0 16px; font-family: inherit; font-size: 18px; font-weight: 500; letter-spacing: .08em;
}

.status { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; margin-bottom: 18px; font-size: 15px;
  background: color-mix(in srgb, var(--ink) 4%, transparent); color: var(--ink-2); }
.status.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.status.bad { background: color-mix(in srgb, var(--bad) 13%, transparent); color: var(--bad); }
.status[hidden] { display: none; }

.steps { list-style: none; padding: 0; margin: 0 0 22px; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--ink-3); }
.steps li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; flex: none; }
.steps li.done { color: var(--good); }
.steps li.done::before { background: currentColor; }
.steps li.now { color: var(--ink); }
.steps li.now::before { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }

.timer { height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; margin: -6px 0 22px; }
.timer i { display: block; height: 100%; background: var(--accent); transform-origin: left; transition: transform 1s linear; }

.foot { margin: 22px 0 0; font-size: 12.5px; color: var(--ink-3); text-align: center; }
[hidden] { display: none !important; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { main, .spinner { animation: none; } .timer i { transition: none; } }
