:root {
  --ink: #07090d;
  --panel: #0d1117;
  --paper: #e7e1d5;
  --muted: #96999e;
  --red: #ed1b2f;
  --gold: #f1c55a;
  --line: rgba(255, 255, 255, 0.14);
  --display: "Bebas Neue", sans-serif;
  --body: "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--paper);
  background:
    radial-gradient(circle at 78% 32%, rgba(237, 27, 47, 0.11), transparent 27rem),
    linear-gradient(135deg, #0c1017 0%, var(--ink) 48%, #050608 100%);
  font-family: var(--body);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
}

button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.noise {
  position: fixed;
  inset: 0;
  opacity: .035;
  pointer-events: none;
  z-index: 10;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

.scanline {
  position: fixed;
  left: 0;
  right: 0;
  height: 120px;
  z-index: 9;
  opacity: .08;
  pointer-events: none;
  background: linear-gradient(transparent, var(--red), transparent);
  animation: scan 8s linear infinite;
}

.site-header, footer {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 4vw;
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--muted);
}

.site-header { top: 0; }
footer { bottom: 0; }

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--paper);
  text-decoration: none;
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: .12em;
  line-height: .9;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  background: var(--red);
  color: white;
  font: 24px/1 var(--display);
  transform: skew(-8deg);
}

.clearance { display: flex; align-items: center; gap: 8px; }
.clearance i { width: 6px; height: 6px; border-radius: 50%; background: #3bd47c; box-shadow: 0 0 10px #3bd47c; }

main { min-height: 100vh; }

.screen {
  display: none;
  min-height: 100vh;
  padding: 110px 7vw 90px;
}

.screen.is-active { display: flex; animation: screenIn .65s cubic-bezier(.2,.8,.2,1) both; }

.intro-screen { align-items: center; justify-content: space-between; gap: 5vw; }
.intro-copy { width: min(610px, 55vw); position: relative; z-index: 2; }

.eyebrow {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
}

.eyebrow span { color: var(--red); }

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(78px, 10.4vw, 164px);
  line-height: .78;
  letter-spacing: -.01em;
  font-weight: 400;
  text-transform: uppercase;
}

h1 em { display: inline-block; color: var(--red); font-style: normal; text-shadow: 8px 8px 0 rgba(237,27,47,.12); }

.intro-lead {
  width: min(520px, 90%);
  margin: 34px 0 30px;
  color: #b9b8b4;
  line-height: 1.9;
  font-size: 15px;
}

.primary-btn {
  border: 0;
  display: inline-flex;
  align-items: stretch;
  padding: 0;
  color: white;
  background: var(--red);
  cursor: pointer;
  box-shadow: 7px 7px 0 rgba(237,27,47,.18);
  transition: transform .2s, box-shadow .2s;
}

.primary-btn span { padding: 18px 28px; font-weight: 900; letter-spacing: .08em; }
.primary-btn b { display: grid; place-items: center; width: 57px; border-left: 1px solid rgba(255,255,255,.25); font-size: 23px; }
.primary-btn:hover { transform: translate(-2px,-2px); box-shadow: 11px 11px 0 rgba(237,27,47,.2); }
.primary-btn:focus-visible, .answer-btn:focus-visible, .secondary-btn:focus-visible, .back-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.meta { margin: 18px 0 0; color: #696d74; font-size: 10px; letter-spacing: .12em; }

.reactor {
  position: relative;
  width: min(38vw, 500px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.reactor::before, .reactor::after { content: ""; position: absolute; inset: 6%; border: 1px solid var(--line); border-radius: 50%; }
.reactor::after { inset: 14%; border-style: dashed; animation: rotate 18s linear infinite reverse; }

.reactor-core {
  position: relative;
  width: 48%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(237,27,47,.22), rgba(237,27,47,.03) 48%, transparent 49%);
  border: 1px solid rgba(237,27,47,.7);
  box-shadow: inset 0 0 40px rgba(237,27,47,.13), 0 0 80px rgba(237,27,47,.08);
  clip-path: polygon(50% 0, 86% 14%, 100% 50%, 86% 86%, 50% 100%, 14% 86%, 0 50%, 14% 14%);
}

.reactor-core strong { font: 100px/.8 var(--display); color: var(--red); }
.reactor-core span, .reactor-core small { font-size: 8px; letter-spacing: .25em; color: var(--muted); }

.orbit { position: absolute; inset: 0; border: 1px solid rgba(255,255,255,.06); border-radius: 50%; animation: rotate 10s linear infinite; }
.orbit-two { inset: 25%; animation-duration: 6s; animation-direction: reverse; }
.orbit i { position: absolute; left: 50%; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 12px var(--red); }
.orbit-two i:last-child { top: auto; bottom: -3px; }
.coordinate { position: absolute; color: #484c53; font: 9px var(--body); letter-spacing: .15em; }
.c1 { left: -5%; top: 34%; transform: rotate(-90deg); }
.c2 { right: -5%; bottom: 30%; transform: rotate(90deg); }

.quiz-screen { width: min(1080px, 100%); margin: auto; flex-direction: column; justify-content: center; }
.quiz-topline { display: flex; justify-content: space-between; margin-bottom: 12px; color: var(--muted); font: 11px var(--body); letter-spacing: .17em; }
.quiz-topline b { color: var(--red); font-size: 18px; }
.progress-track { width: 100%; height: 2px; background: #272b31; margin-bottom: 70px; overflow: hidden; }
.progress-track i { display: block; width: 12.5%; height: 100%; background: var(--red); box-shadow: 0 0 12px var(--red); transition: width .5s ease; }
.question-stage.is-changing { animation: questionSwap .38s ease both; }
.question-tag { margin: 0 0 14px; color: var(--red); font: 12px var(--body); letter-spacing: .2em; }
.question-stage h2 { width: min(820px, 100%); margin: 0 0 38px; font-size: clamp(30px, 4vw, 55px); line-height: 1.24; letter-spacing: -.03em; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.answer-btn {
  position: relative;
  border: 1px solid var(--line);
  padding: 20px 25px 20px 64px;
  min-height: 74px;
  color: #c9c8c3;
  background: rgba(255,255,255,.025);
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s, transform .2s;
}

.answer-btn::before { content: attr(data-key); position: absolute; left: 23px; top: 20px; color: #5e6269; font: 20px var(--display); }
.answer-btn::after { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 3px; background: var(--red); transform: scaleY(0); transition: transform .2s; }
.answer-btn:hover, .answer-btn.is-selected { border-color: rgba(237,27,47,.55); color: white; background: rgba(237,27,47,.07); transform: translateX(4px); }
.answer-btn:hover::after, .answer-btn.is-selected::after { transform: scaleY(1); }
.answer-btn.is-selected::before { color: var(--red); }

.quiz-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 36px; color: #555a61; font-size: 10px; letter-spacing: .1em; }
.back-btn, .secondary-btn { border: 0; background: none; color: #777b82; cursor: pointer; }
.back-btn:disabled { opacity: .2; cursor: default; }

.loading-screen { flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.scanner { width: 140px; height: 140px; position: relative; display: grid; place-items: center; margin-bottom: 40px; }
.scanner-ring { position: absolute; inset: 0; border: 1px solid #343840; border-top-color: var(--red); border-bottom-color: var(--red); border-radius: 50%; animation: rotate 1.2s linear infinite; }
.scanner-ring::after { content: ""; position: absolute; inset: 14px; border: 1px dashed #343840; border-left-color: var(--gold); border-radius: 50%; }
.scanner-core { display: grid; place-items: center; width: 65px; height: 65px; background: var(--red); font: 48px var(--display); transform: skew(-8deg); }
.loading-screen h2 { margin: 0 0 34px; font-size: clamp(25px, 4vw, 44px); }
.loading-track { width: min(420px, 80vw); height: 3px; background: #262a30; overflow: hidden; }
.loading-track i { display: block; width: 100%; height: 100%; background: var(--red); transform-origin: left; animation: loading 2.4s ease both; }
.loading-screen > p:last-child { color: var(--muted); font-size: 11px; letter-spacing: .14em; }
.dots { display: inline-block; width: 1em; overflow: hidden; vertical-align: bottom; animation: dots 1.2s steps(4,end) infinite; }

.result-screen { align-items: center; justify-content: center; gap: clamp(45px, 8vw, 130px); }
.result-visual { --hero: var(--red); position: relative; width: min(38vw, 460px); min-width: 360px; aspect-ratio: .82; display: grid; place-items: center; border: 1px solid var(--line); background: radial-gradient(circle at 50% 44%, color-mix(in srgb, var(--hero) 20%, transparent), transparent 45%), #0a0d12; overflow: hidden; }
.result-visual::before { content: ""; position: absolute; inset: 20px; border: 1px solid color-mix(in srgb, var(--hero) 40%, transparent); clip-path: polygon(0 0, 27% 0, 27% 1px, 1px 1px, 1px 23%, 0 23%, 0 100%, 100% 100%, 100% 76%, calc(100% - 1px) 76%, calc(100% - 1px) calc(100% - 1px), 73% calc(100% - 1px), 73% 100%, 0 100%); }
.result-visual::after { content: ""; position: absolute; width: 140%; height: 35%; background: linear-gradient(transparent, color-mix(in srgb, var(--hero) 13%, transparent), transparent); animation: resultScan 4s linear infinite; }
.result-index { position: absolute; top: 34px; left: 38px; color: var(--muted); font-size: 10px; letter-spacing: .2em; }
.result-index b { color: var(--hero); }
.hero-code { position: absolute; left: 38px; bottom: 34px; font-size: 9px; color: var(--muted); letter-spacing: .18em; }

.hero-sigil { position: relative; width: 230px; aspect-ratio: 1; display: grid; place-items: center; filter: drop-shadow(0 0 35px color-mix(in srgb, var(--hero) 33%, transparent)); }
.hero-sigil::before, .hero-sigil::after, .hero-sigil span { content: ""; position: absolute; border: 4px solid var(--hero); }
.hero-sigil::before { inset: 5%; border-radius: 50%; border-width: 2px; opacity: .45; }
.hero-sigil::after { width: 42%; height: 42%; transform: rotate(45deg); background: color-mix(in srgb, var(--hero) 14%, transparent); }
.hero-sigil span { width: 22%; height: 22%; border-radius: 50%; background: var(--hero); box-shadow: 0 0 30px var(--hero); }
.hero-sigil[data-symbol="star"]::after { width: 54%; height: 54%; border: 0; background: var(--hero); clip-path: polygon(50% 0,61% 35%,98% 35%,68% 56%,79% 91%,50% 70%,21% 91%,32% 56%,2% 35%,39% 35%); transform: none; }
.hero-sigil[data-symbol="hammer"]::after { width: 42%; height: 64%; border: 0; background: var(--hero); clip-path: polygon(7% 0,93% 0,100% 30%,59% 35%,59% 100%,41% 100%,41% 35%,0 30%); transform: rotate(-38deg); }
.hero-sigil[data-symbol="spider"]::after { width: 48%; height: 68%; border-radius: 48%; transform: none; background: var(--hero); clip-path: polygon(42% 0,58% 0,60% 24%,75% 7%,83% 14%,66% 32%,70% 40%,98% 28%,100% 38%,74% 49%,74% 57%,98% 70%,94% 80%,69% 65%,63% 72%,77% 100%,66% 100%,50% 77%,34% 100%,23% 100%,37% 72%,31% 65%,6% 80%,2% 70%,26% 57%,26% 49%,0 38%,2% 28%,30% 40%,34% 32%,17% 14%,25% 7%,40% 24%); }
.hero-sigil[data-symbol="hourglass"]::after { width: 55%; height: 68%; border: 0; background: var(--hero); clip-path: polygon(0 0,100% 0,62% 50%,100% 100%,0 100%,38% 50%); transform: none; }
.hero-sigil[data-symbol="hex"]::after { width: 60%; height: 68%; transform: none; background: none; clip-path: polygon(25% 0,75% 0,100% 50%,75% 100%,25% 100%,0 50%); }

.result-copy { width: min(520px, 47vw); }
.result-prefix { margin: 0; color: #777b82; font-size: 13px; letter-spacing: .1em; }
.result-copy h2 { margin: 2px 0 0; color: var(--hero-color, var(--red)); font: clamp(62px, 7vw, 106px)/.95 var(--display); letter-spacing: .01em; }
.hero-alias { margin: 8px 0 26px; color: var(--muted); font: 15px var(--body); letter-spacing: .18em; }
.hero-quote { margin: 0 0 20px; padding-left: 18px; border-left: 3px solid var(--hero-color, var(--red)); font-size: 18px; font-weight: 700; line-height: 1.7; }
.hero-description { color: #a8a9aa; font-size: 13px; line-height: 1.9; }
.traits { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.traits span { padding: 7px 12px; border: 1px solid var(--line); color: #b7b7b3; font-size: 10px; letter-spacing: .12em; }
.stats { display: grid; gap: 10px; margin: 25px 0 32px; }
.stat { display: grid; grid-template-columns: 55px 1fr 32px; align-items: center; gap: 12px; color: #777b82; font-size: 9px; letter-spacing: .1em; }
.stat-track { height: 3px; background: #272b31; }
.stat-track i { display: block; height: 100%; width: var(--value); background: var(--hero-color, var(--red)); animation: statGrow .9s .35s ease both; transform-origin: left; }
.stat b { color: #b7b7b3; font-size: 9px; }
.result-actions { display: flex; align-items: center; gap: 20px; }
.primary-btn.compact span { padding: 13px 19px; font-size: 11px; }
.primary-btn.compact b { width: 43px; font-size: 16px; }
.secondary-btn { padding: 12px 2px; border-bottom: 1px solid #42464d; font-size: 11px; letter-spacing: .1em; }
.toast { position: fixed; left: 50%; bottom: 75px; z-index: 20; padding: 12px 20px; color: white; background: #242931; font-size: 12px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; transition: .3s ease; }
.toast.is-visible { transform: translate(-50%,0); opacity: 1; }

@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes scan { from { transform: translateY(-130px); } to { transform: translateY(100vh); } }
@keyframes screenIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes questionSwap { 0% { opacity: .1; transform: translateX(18px); } 100% { opacity: 1; transform: translateX(0); } }
@keyframes loading { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes dots { 0% { width: 0; } 100% { width: 1em; } }
@keyframes resultScan { from { transform: translateY(-200%); } to { transform: translateY(200%); } }
@keyframes statGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (max-width: 800px) {
  .site-header { padding: 20px; }
  footer { position: static; padding: 25px 20px; flex-direction: column; gap: 8px; text-align: center; }
  .screen { min-height: calc(100vh - 70px); padding: 95px 22px 55px; }
  .intro-screen { flex-direction: column; justify-content: center; align-items: flex-start; overflow: hidden; }
  .intro-copy { width: 100%; }
  h1 { font-size: clamp(58px, 16vw, 94px); }
  .intro-lead { margin-top: 26px; }
  .reactor { position: absolute; width: 420px; right: -230px; top: 18%; opacity: .42; }
  .clearance { font-size: 0; }
  .quiz-screen { justify-content: flex-start; padding-top: 105px; }
  .progress-track { margin-bottom: 50px; }
  .answers { grid-template-columns: 1fr; }
  .answer-btn { min-height: 67px; padding-top: 17px; padding-bottom: 17px; }
  .quiz-footer span { display: none; }
  .result-screen { flex-direction: column; gap: 35px; padding-top: 90px; }
  .result-visual { width: min(100%, 390px); min-width: 0; aspect-ratio: 1; }
  .hero-sigil { width: 190px; }
  .result-copy { width: min(100%, 520px); }
  .result-copy h2 { font-size: clamp(70px, 20vw, 100px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
