/* Reader survey. One committed look: a night-blue page, warm white type, a single gold accent.
   Phone first, one reading column. Fonts are served from this site (no outside font service). */
@font-face { font-family: "Instrument Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/instrument-serif-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Instrument Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url("/fonts/instrument-serif-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("/fonts/manrope-latin-wght-normal.woff2") format("woff2"); }

:root {
  --bg: #0c0e17;
  --glow: rgba(116, 104, 255, 0.20);
  --surface: #151929;
  --surface-2: #1c2136;
  --ink: #f5f1e8;
  --muted: #a9aec4;
  --line: rgba(255, 255, 255, 0.11);
  --gold: #f2bd4b;
  --gold-ink: #1b1404;
  --gold-soft: rgba(242, 189, 75, 0.13);
  --bad: #ff9186;
  --display: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --text: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font: 500 17px/1.55 var(--text);
  background: radial-gradient(900px 440px at 50% -140px, var(--glow), transparent 72%), var(--bg);
  background-repeat: no-repeat;
}
.wrap { max-width: 44rem; margin: 0 auto; padding: 40px max(18px, env(safe-area-inset-right, 0px)) 64px max(18px, env(safe-area-inset-left, 0px)); display: grid; gap: 32px; }
.wrap.wide { max-width: 62rem; }

.head { display: grid; gap: 14px; }
.eyebrow { margin: 0; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold); }
h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(2.5rem, 10.5vw, 3.9rem); line-height: 1.02; letter-spacing: -0.01em; text-wrap: balance; }
h1 em { font-style: italic; color: var(--gold); }
h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 6vw, 2rem); line-height: 1.15; text-wrap: balance; }
.lede { margin: 0; color: var(--muted); font-size: 1.04rem; max-width: 58ch; }
.lede strong { color: var(--ink); font-weight: 700; }

form { display: grid; gap: 28px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 12px; }
legend { padding: 0; width: 100%; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; font-family: var(--display); font-size: 1.55rem; line-height: 1.2; }
.tally { display: inline-flex; align-items: center; gap: 10px; font: 600 0.84rem/1 var(--text); color: var(--muted); font-variant-numeric: tabular-nums; }
.pips { display: inline-flex; gap: 6px; }
.pips i { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--muted); transition: background-color 0.15s, border-color 0.15s; }
.pips i.on { background: var(--gold); border-color: var(--gold); }
.hint, .note, .saved { margin: 0; font-size: 0.86rem; color: var(--muted); }
.saved { padding-top: 4px; }

.grid { display: grid; gap: 11px; grid-template-columns: 1fr; }
@media (min-width: 660px) { .grid { grid-template-columns: 1fr 1fr; } }
.loading { margin: 0; color: var(--muted); }

.topic {
  position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: center;
  padding: 16px 16px; min-height: 76px; border-radius: 16px; cursor: pointer;
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line);
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
  animation: rise 0.45s both;
}
.topic:nth-child(2) { animation-delay: 0.03s; } .topic:nth-child(3) { animation-delay: 0.06s; }
.topic:nth-child(4) { animation-delay: 0.09s; } .topic:nth-child(5) { animation-delay: 0.12s; }
.topic:nth-child(6) { animation-delay: 0.15s; } .topic:nth-child(7) { animation-delay: 0.18s; }
.topic:nth-child(8) { animation-delay: 0.21s; } .topic:nth-child(9) { animation-delay: 0.24s; }
.topic:nth-child(10) { animation-delay: 0.27s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.topic input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.topic .badge { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.26); display: grid; place-items: center; font: 400 1.25rem/1 var(--display); color: transparent; transition: background-color 0.15s, border-color 0.15s; }
.topic .title { display: block; font-weight: 700; line-height: 1.3; }
.topic .blurb { display: block; font-size: 0.87rem; font-weight: 500; color: var(--muted); margin-top: 3px; }
@media (hover: hover) { .topic:hover { border-color: rgba(255, 255, 255, 0.3); transform: translateY(-1px); } }
.topic:has(input:checked) { border-color: var(--gold); background: linear-gradient(180deg, rgba(242, 189, 75, 0.17), var(--gold-soft)), var(--surface); box-shadow: 0 0 0 1px var(--gold), 0 10px 30px -18px var(--gold); }
.topic:has(input:checked) .badge { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.topic:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 3px; }
.topic:has(input:disabled) { opacity: 0.42; cursor: default; transform: none; }
.topic:has(input:disabled) input { cursor: default; }

.field { display: grid; gap: 8px; }
.field label { font-weight: 700; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.optional { font-weight: 600; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.field label.check { font-weight: 600; font-size: 0.95rem; align-items: center; gap: 11px; cursor: pointer; padding: 4px 0; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--gold); flex: none; }
textarea, input[type="email"], input[type="password"], input[type="text"] {
  width: 100%; font: 500 1rem/1.5 var(--text); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px;
}
textarea { resize: vertical; min-height: 5.6em; }
textarea:focus-visible, input:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
::placeholder { color: var(--muted); opacity: 0.75; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.send { font: 800 1.05rem/1.2 var(--text); padding: 17px 20px; border-radius: 999px; border: 0; background: var(--gold); color: var(--gold-ink); cursor: pointer; transition: transform 0.12s, filter 0.12s; }
@media (hover: hover) { .send:not(:disabled):hover { filter: brightness(1.08); transform: translateY(-1px); } }
.send:disabled { background: var(--surface-2); color: var(--muted); cursor: default; box-shadow: inset 0 0 0 1px var(--line); }
.error { margin: 0; color: var(--bad); font-weight: 700; }

.thanks { display: grid; gap: 16px; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: 20px; padding: 28px 22px; }
.thanks p { margin: 0; color: var(--muted); }
.picked { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: pick; }
.picked li { counter-increment: pick; display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: center; font-weight: 700; }
.picked li::before { content: counter(pick); width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; font: 400 1.25rem/1 var(--display); }
.link { justify-self: start; font: inherit; font-weight: 700; color: var(--gold); background: none; border: 0; padding: 4px 0; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
[hidden] { display: none !important; }

/* results page */
.card { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: 18px; padding: 22px 20px; display: grid; gap: 16px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn { font: 700 0.95rem/1.2 var(--text); padding: 11px 18px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rank li { display: grid; gap: 6px; }
.rank .top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 14px; align-items: baseline; }
.rank .name { font-weight: 700; }
.rank .num { color: var(--muted); font-size: 0.86rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar { height: 8px; border-radius: 4px; background: rgba(242, 189, 75, 0.16); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 0 4px 4px 0; }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 700; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.muted { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .topic { animation: none; transition: none; }
  .send, .pips i, .topic .badge { transition: none; }
}
