/* Foralis reference survey — v3
   Dark neutral "light box": references are judged on a neutral ground so their own colours read true.
   Display: Archivo (variable width/weight). Utility: DM Mono. One accent. */

:root {
  --bg: #0c0c0b;
  --bg-2: #141413;
  --bg-3: #1b1b19;
  --line: #262624;
  --line-2: #3a3a36;
  --ink: #f2f0ea;
  --muted: #8f8d86;
  --dim: #5f5e59;
  --accent: #ddf25c;
  --accent-ink: #12130a;
  --danger: #ff7a59;
  --font: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --pad: clamp(16px, 3vw, 40px);
  --head-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  font-variation-settings: 'wdth' 100;
  -webkit-font-smoothing: antialiased;
  min-height: 100svh;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 700; text-wrap: balance; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.mono { font-family: var(--mono); font-size: 12px; line-height: 1.4; letter-spacing: .04em; text-transform: uppercase; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ───────── header ───────── */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: var(--head-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding: 0 var(--pad);
  background: linear-gradient(var(--bg) 60%, rgba(12, 12, 11, 0));
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.brand img { width: 22px; height: 22px; object-fit: contain; }
.top .center { text-align: center; }
.counter { justify-self: end; display: flex; align-items: baseline; gap: 10px; font-variant-numeric: tabular-nums; }
.counter b { font-family: var(--mono); font-weight: 500; font-size: 12px; color: var(--ink); }
.progress { position: fixed; z-index: 21; top: var(--head-h); left: var(--pad); right: var(--pad); height: 1px; background: var(--line); }
.progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); transition: width .6s var(--ease); }

/* ───────── screens ───────── */
main { position: relative; }
.screen {
  display: none;
  min-height: 100svh;
  padding: calc(var(--head-h) + clamp(28px, 5vh, 64px)) var(--pad) 0;
  flex-direction: column;
}
.screen.active { display: flex; }
.screen-body { flex: 1; width: 100%; max-width: 1480px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 40px); row-gap: 32px; }

.reveal { display: block; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.reveal > span { display: block; }

/* footer nav */
.nav {
  position: sticky; bottom: 0; z-index: 10;
  width: 100%; max-width: 1480px; margin: 40px auto 0;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 0 22px;
  background: linear-gradient(rgba(12, 12, 11, 0), var(--bg) 35%);
  border-top: 1px solid var(--line);
}
.nav .hint { text-align: center; flex: 1; }
.nav .side { display: flex; align-items: center; gap: 14px; }

/* buttons */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 0 26px; border-radius: 999px;
  font-weight: 600; font-size: 15px; letter-spacing: -.005em;
  background: var(--ink); color: var(--bg);
  transition: background .2s, color .2s, opacity .2s, transform .2s var(--ease);
  white-space: nowrap; text-decoration: none;
}
.btn:hover { background: #fff; }
.btn:active { transform: scale(.98); }
.btn .arr { display: inline-block; transition: transform .3s var(--ease); }
.btn:hover .arr { transform: translateX(3px); }
.btn.back:hover .arr { transform: translateX(-3px); }
.btn.accent { background: var(--accent); color: var(--accent-ink); }
.btn.accent:hover { background: #ebff7a; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.btn[aria-disabled='true'] { opacity: .32; cursor: not-allowed; }
.btn[aria-disabled='true']:hover { background: var(--ink); }
.btn.accent[aria-disabled='true']:hover { background: var(--accent); }
.btn.big { min-height: 64px; padding: 0 34px; font-size: 17px; }

.need { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.need.ok { color: var(--accent); }
.shake { animation: shake .4s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* ───────── intro ───────── */
.intro-title {
  grid-column: 1 / -1;
  font-size: clamp(56px, 11.2vw, 196px);
  line-height: .86; letter-spacing: -.055em; font-weight: 800;
  font-variation-settings: 'wdth' 92;
  margin-top: 8px;
}
.intro-title .l2 { color: var(--dim); }
.intro-lead { grid-column: 1 / span 6; font-size: clamp(17px, 1.35vw, 20px); line-height: 1.5; color: var(--muted); max-width: 54ch; }
.intro-form { grid-column: 8 / span 5; display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 10px; }
.field-line {
  font: inherit; font-size: clamp(22px, 2vw, 30px); font-weight: 500; letter-spacing: -.02em;
  color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0;
  padding: 6px 0 12px; width: 100%; transition: border-color .2s;
}
.field-line::placeholder { color: var(--dim); }
.field-line:hover { border-color: var(--muted); }
.field-line:focus { outline: none; border-color: var(--accent); }
.start-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }

.reel { grid-column: 1 / -1; margin: clamp(28px, 6vh, 72px) calc(var(--pad) * -1) 0; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.reel-track { display: flex; gap: 14px; width: max-content; animation: reel 60s linear infinite; padding: 0 0 8px; }
.reel:hover .reel-track { animation-play-state: paused; }
@keyframes reel { to { transform: translateX(-50%); } }
.reel figure { margin: 0; width: clamp(220px, 22vw, 340px); display: flex; flex-direction: column; gap: 10px; }
.reel img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 4px; background: var(--bg-3); }
.reel figcaption { display: flex; gap: 10px; }

/* ───────── site screen ───────── */
.stage { grid-column: 1 / span 8; display: flex; flex-direction: column; gap: 14px; }
.shot {
  position: relative; display: block; overflow: hidden; border-radius: 6px;
  background: var(--bg-3); aspect-ratio: 16 / 10;
  box-shadow: 0 0 0 1px var(--line), 0 40px 80px -40px rgba(0, 0, 0, .8);
}
.shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform 1.2s var(--ease), filter .4s; }
.shot:hover img { transform: scale(1.012); }
.shot .open {
  position: absolute; right: 14px; bottom: 14px;
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px;
  background: rgba(12, 12, 11, .78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--ink); font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  transform: translateY(4px); opacity: .9; transition: transform .3s var(--ease), opacity .3s, background .2s;
}
.shot:hover .open { transform: none; opacity: 1; background: var(--accent); color: var(--accent-ink); }
.stage-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.stage-meta a { text-decoration: none; }
.stage-meta a:hover { color: var(--ink); }
.big-index {
  font-size: clamp(64px, 7vw, 120px); font-weight: 800; letter-spacing: -.06em; line-height: .8;
  font-variation-settings: 'wdth' 80; color: var(--line-2); font-variant-numeric: tabular-nums;
}

.panel { grid-column: 9 / span 4; display: flex; flex-direction: column; gap: 28px; }
.panel-head { display: flex; flex-direction: column; gap: 12px; }
.panel-head h2 { font-size: clamp(30px, 2.7vw, 44px); line-height: 1; letter-spacing: -.035em; font-weight: 700; }
.panel-head p:not(.mono) { color: var(--muted); max-width: 42ch; }

.rates { display: flex; flex-direction: column; }
.rate { display: flex; flex-direction: column; gap: 10px; padding: 14px 0 16px; border-top: 1px solid var(--line); }
.rate:last-child { border-bottom: 1px solid var(--line); }
.rate-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.rate-top b { font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.rate.cur .rate-top b::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin: 0 8px 2px 0; vertical-align: middle; }
.dots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.dot {
  height: 44px; border-radius: 6px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--mono); font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums;
  transition: background .18s, color .18s, box-shadow .18s, transform .18s var(--ease);
}
.dot:hover { box-shadow: inset 0 0 0 1px var(--muted); color: var(--ink); }
.dot.fill { background: #2a2a27; color: var(--ink); box-shadow: inset 0 0 0 1px #2a2a27; }
.dot.on { background: var(--accent); color: var(--accent-ink); box-shadow: none; transform: translateY(-1px); }
.scale-legend { display: flex; justify-content: space-between; }

.note-toggle { align-self: flex-start; font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 4px 0; }
.note-toggle:hover { color: var(--ink); }
textarea {
  font: inherit; font-size: 15px; color: var(--ink); width: 100%; resize: vertical; min-height: 84px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; transition: border-color .2s;
}
textarea::placeholder { color: var(--dim); }
textarea:hover { border-color: var(--line-2); }
textarea:focus { outline: none; border-color: var(--accent); }

/* ───────── section head (personality / adjectives / compare / final) ───────── */
.sec-head { grid-column: 1 / span 5; display: flex; flex-direction: column; gap: 18px; align-self: start; position: sticky; top: calc(var(--head-h) + 40px); }
.sec-head h1 { font-size: clamp(40px, 5.2vw, 88px); line-height: .92; letter-spacing: -.05em; font-weight: 800; font-variation-settings: 'wdth' 92; }
.sec-head p:not(.mono) { color: var(--muted); max-width: 40ch; font-size: 17px; }
.sec-body { grid-column: 7 / span 6; }

/* personality */
.axes { display: flex; flex-direction: column; }
.axis { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: clamp(10px, 2vw, 24px); padding: 22px 0; border-top: 1px solid var(--line); }
.axis:last-child { border-bottom: 1px solid var(--line); }
.axis .w { font-size: clamp(18px, 1.6vw, 24px); font-weight: 600; letter-spacing: -.02em; color: var(--dim); transition: color .25s; }
.axis .w.r { text-align: right; }
.axis .w.hot { color: var(--ink); }
.pips { position: relative; display: flex; gap: clamp(8px, 1.4vw, 18px); align-items: center; }
.pips::before { content: ''; position: absolute; left: 8px; right: 8px; top: 50%; height: 1px; background: var(--line-2); }
.pip { position: relative; width: 22px; height: 22px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2); transition: transform .2s var(--ease), background .2s, box-shadow .2s; }
.pip:nth-child(3) { width: 14px; height: 14px; margin: 0 4px; }
.pip:hover { box-shadow: inset 0 0 0 1px var(--ink); transform: scale(1.12); }
.pip.on { background: var(--accent); box-shadow: 0 0 0 6px rgba(221, 242, 92, .14); }

/* adjectives */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px 13px; border-radius: 999px;
  font-size: clamp(20px, 2vw, 30px); font-weight: 600; letter-spacing: -.025em; line-height: 1.1;
  box-shadow: inset 0 0 0 1px var(--line-2); color: var(--muted);
  transition: background .2s, color .2s, box-shadow .2s, transform .2s var(--ease);
}
.chip:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.chip.on { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.chip .n { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.chip.off { opacity: .35; }
.chip-count { margin-top: 22px; }

/* compare */
.duel { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr auto 1fr; gap: clamp(12px, 2vw, 28px); align-items: start; }
.duel-vs { align-self: center; font-size: clamp(28px, 3vw, 48px); font-weight: 800; letter-spacing: -.04em; color: var(--line-2); font-variation-settings: 'wdth' 80; }
.pick { display: flex; flex-direction: column; gap: 14px; text-align: left; border-radius: 8px; padding: 10px; margin: -10px; transition: background .25s; }
.pick .shot { pointer-events: none; transition: box-shadow .25s, transform .4s var(--ease); }
.pick:hover .shot { box-shadow: 0 0 0 1px var(--ink), 0 40px 80px -40px rgba(0, 0, 0, .8); }
.pick.on .shot { box-shadow: 0 0 0 3px var(--accent), 0 40px 80px -40px rgba(0, 0, 0, .8); }
.pick.lost { opacity: .4; }
.pick-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pick-meta b { font-size: clamp(20px, 1.8vw, 28px); font-weight: 600; letter-spacing: -.025em; }
.key { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line-2); font-family: var(--mono); font-size: 12px; color: var(--muted); }
.pick.on .key { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.duel-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }
.duel-head h1 { font-size: clamp(36px, 4.4vw, 72px); line-height: .95; letter-spacing: -.045em; font-weight: 800; font-variation-settings: 'wdth' 92; }
.rounds { display: flex; gap: 6px; }
.rounds i { width: 28px; height: 4px; border-radius: 2px; background: var(--line-2); }
.rounds i.done { background: var(--ink); }
.rounds i.now { background: var(--accent); }

/* final */
.qblock { display: flex; flex-direction: column; gap: 14px; margin-bottom: 40px; }
.qtitle { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.qtitle b { font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.favs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.fav { display: flex; flex-direction: column; gap: 8px; text-align: left; border-radius: 6px; }
.fav img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 4px; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s, opacity .2s; }
.fav:hover img { box-shadow: 0 0 0 1px var(--ink); }
.fav.on img { box-shadow: 0 0 0 3px var(--accent); }
.fav .fav-name { font-size: 14px; font-weight: 500; line-height: 1.25; }
.fav .fav-sub { display: flex; justify-content: space-between; gap: 8px; }
.fav .lead-tag { color: var(--accent); }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg button { min-height: 52px; border-radius: 6px; background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 15px; font-weight: 500; color: var(--muted); transition: background .18s, color .18s, box-shadow .18s; padding: 0 10px; }
.seg button:hover { color: var(--ink); box-shadow: inset 0 0 0 1px var(--muted); }
.seg button.on { background: var(--accent); color: var(--accent-ink); box-shadow: none; }

/* review */
.page-title { font-size: clamp(40px, 5.2vw, 88px); line-height: .92; letter-spacing: -.05em; font-weight: 800; font-variation-settings: 'wdth' 92; }
.review { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2.4vw, 40px); row-gap: 40px; }
.review-table { grid-column: 1 / span 8; }
.review-side { grid-column: 9 / span 4; display: flex; flex-direction: column; gap: 28px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 400; padding: 0 10px 10px 0; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
td { padding: 14px 10px 14px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
td.site { display: flex; align-items: center; gap: 12px; font-weight: 500; }
td.site img { width: 56px; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 3px; }
td.num { font-family: var(--mono); font-size: 14px; }
td.avg { font-family: var(--mono); font-size: 14px; color: var(--accent); }
.edit { font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .04em; }
.edit:hover { color: var(--ink); }
.kv { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.kv .v { font-size: 18px; font-weight: 500; letter-spacing: -.01em; }
.submit-card { background: var(--bg-2); box-shadow: inset 0 0 0 1px var(--line); border-radius: 10px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.submit-card .btn { width: 100%; }
.status { min-height: 20px; font-size: 14px; color: var(--muted); }
.status.err { color: var(--danger); }

/* thanks */
.thanks { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: flex-start; gap: 28px; padding-top: 6vh; }
.thanks h1 { font-size: clamp(64px, 13vw, 230px); line-height: .84; letter-spacing: -.06em; font-weight: 800; font-variation-settings: 'wdth' 90; }
.thanks p { font-size: clamp(18px, 1.5vw, 22px); color: var(--muted); max-width: 46ch; }
.thanks .mark { width: 56px; height: 56px; object-fit: contain; }

/* ───────── responsive ───────── */
@media (max-width: 1080px) {
  .stage, .panel, .sec-head, .sec-body, .review-table, .review-side, .intro-lead, .intro-form { grid-column: 1 / -1; }
  .sec-head { position: static; }
  .intro-form { max-width: 560px; }
}
@media (max-width: 760px) {
  :root { --head-h: 56px; }
  .top { grid-template-columns: 1fr auto; }
  .top .center { display: none; }
  .duel { grid-template-columns: 1fr; }
  .duel-vs { justify-self: center; }
  .seg { grid-template-columns: 1fr 1fr; }
  .nav .hint { display: none; }
  .btn { padding: 0 20px; }
  .axis { grid-template-columns: 1fr 1fr; row-gap: 14px; }
  .axis .pips { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; }
  .review-table { overflow-x: auto; }
  td.site img { display: none; }
  .big-index { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reel-track { animation: none; flex-wrap: wrap; width: auto; }
}

/* programmatic focus on headings after a step change: no ring */
[tabindex='-1']:focus { outline: none; }
.lc { text-transform: none; letter-spacing: 0; }
