:root {
  --bg: #fdf3ec;
  --blob1: #f9c6c9;
  --blob2: #ffd9a8;
  --blob3: #c9e4de;
  --surface: rgba(255, 255, 255, .72);
  --surface-solid: #fffaf6;
  --ink: #3a2a2a;
  --muted: #8a7270;
  --line: #f0dcd2;
  --accent: #d9576b;
  --accent-ink: #ffffff;
  --accent-soft: #fde3e3;
  --focus: #d9576b55;
  --shadow: 0 8px 24px rgba(160, 80, 70, .10);
  --serif: "Fraunces", Georgia, serif;
  --hand: "Caveat", "Segoe Script", cursive;
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1f1719;
    --blob1: #5a2a35;
    --blob2: #5a3d22;
    --blob3: #1f4440;
    --surface: rgba(48, 34, 37, .72);
    --surface-solid: #2a1f21;
    --ink: #f6e9e6;
    --muted: #b79c98;
    --line: #4a3639;
    --accent: #f07c8e;
    --accent-ink: #1f1719;
    --accent-soft: #4a2a31;
    --focus: #f07c8e55;
    --shadow: 0 8px 24px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  --bg: #1f1719; --blob1: #5a2a35; --blob2: #5a3d22; --blob3: #1f4440;
  --surface: rgba(48, 34, 37, .72); --surface-solid: #2a1f21; --ink: #f6e9e6; --muted: #b79c98;
  --line: #4a3639; --accent: #f07c8e; --accent-ink: #1f1719; --accent-soft: #4a2a31; --focus: #f07c8e55;
  --shadow: 0 8px 24px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
/* soft sunset blobs */
body::before, body::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .7;
  pointer-events: none;
}
body::before { width: 60vmax; height: 60vmax; top: -25vmax; right: -20vmax; background: radial-gradient(circle, var(--blob1), transparent 70%); }
body::after { width: 55vmax; height: 55vmax; bottom: -25vmax; left: -20vmax; background: radial-gradient(circle, var(--blob2), transparent 70%); }

.progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; background: transparent; z-index: 10; }
.progress-bar { height: 100%; width: 0; background: var(--accent); border-radius: 0 4px 4px 0; transition: width .5s ease; }

.shell {
  max-width: 600px;
  margin: 0 auto;
  padding: 48px 16px 64px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.screen { animation: fade .5s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.eyebrow {
  font-family: var(--hand);
  font-size: 24px;
  line-height: 1.2;
  color: var(--accent);
  margin: 0 0 6px;
}
h1, h2 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 18px;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(42px, 10vw, 62px); }
h2 { font-size: clamp(25px, 6vw, 32px); }
p { margin: 0 0 16px; }
.lede { font-size: 19px; }
.muted { color: var(--muted); }
.small { font-size: 15px; }
.sig { font-family: var(--hand); font-size: 34px; color: var(--accent); margin-top: 8px; }
.heart { display: inline-block; color: var(--accent); }

.options { display: grid; gap: 12px; margin: 24px 0 8px; }
.option {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  border: 2px solid transparent;
  border-radius: 20px;
  padding: 16px 20px;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color .15s, background .15s, transform .12s;
}
.option:hover { border-color: var(--accent); transform: translateY(-1px); }
.option:active { transform: scale(.99); }
.option:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.option[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }

textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  background: var(--surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ink);
  border: 2px solid transparent;
  border-radius: 20px;
  padding: 18px 20px;
  font: inherit;
  font-size: 17px;
  line-height: 1.6;
  margin-top: 8px;
  box-shadow: var(--shadow);
}
textarea:focus { outline: none; border-color: var(--accent); }
.counter { font-size: 14px; color: var(--muted); text-align: right; margin-top: 6px; min-height: 1.2em; }

.nav { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 28px; }
.btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 14px 30px;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 6px 16px rgba(217, 87, 107, .3);
  transition: opacity .15s, transform .12s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; transform: none; }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn.ghost { background: transparent; color: var(--muted); padding: 14px 6px; font-weight: 600; box-shadow: none; }
.btn.ghost:hover { color: var(--ink); }

.divider { height: 0; border: 0; border-top: 2px dashed var(--line); margin: 28px 0; }
.note {
  background: var(--surface);
  border-radius: 16px;
  padding: 12px 16px;
  color: var(--muted);
  margin: 20px 0;
}
.error { color: var(--accent); font-size: 15px; margin-top: 12px; min-height: 1em; }

/* ---------- Results ---------- */
.card {
  background: var(--surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 22px;
  padding: 22px;
  margin: 16px 0;
  box-shadow: var(--shadow);
}
.row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px dashed var(--line); font-size: 15px; }
.row:first-child { border-top: 0; }
.row .q { flex: 1; }
.row .pts { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
.quote { font-family: var(--serif); font-size: 21px; line-height: 1.5; white-space: pre-wrap; margin: 8px 0 14px; font-style: italic; }
.flag { color: var(--accent); font-size: 15px; margin: 4px 0; }
select, input[type="password"], input[type="text"] {
  font: inherit; font-size: 15px; color: var(--ink); background: var(--surface-solid);
  border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; max-width: 100%;
}
.tag { display: inline-block; font-size: 13px; padding: 3px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 700; }

.outcome {
  text-align: center;
  padding: 40px 8px 24px;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.outcome .art { width: 150px; height: 150px; margin-bottom: 18px; }
.outcome h1 { margin-bottom: 10px; }
.outcome .lede { max-width: 30em; }
.outcome .meter { width: 100%; max-width: 320px; height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 18px auto 6px; }
.outcome .meter span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.outcome .scroll { margin-top: 24px; font-family: var(--hand); font-size: 22px; color: var(--muted); }
.demo-bar { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 8px; }
.demo-bar a {
  text-decoration: none; font-size: 14px; font-weight: 700; color: var(--accent);
  background: var(--surface); padding: 6px 14px; border-radius: 99px; box-shadow: var(--shadow);
}
.demo-bar a.on { background: var(--accent); color: var(--accent-ink); }

#unlockInput { color: var(--ink); font-family: var(--sans); }
#unlockInput:focus { outline: none; border-color: var(--accent) !important; }
