/* ─────────────────────────────────────────────────────
   AOP Personality Quiz — Laboratory Brutalism
   SideLineLabs · "Science, not startup"
   ───────────────────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=IBM+Plex+Mono:wght@300;400;500;600&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #060608;
  --surface:     #0d0d10;
  --surface-2:   #131318;
  --surface-3:   #1a1a22;
  --border:      #1e1e28;
  --border-hi:   #2a2a38;
  --text:        #e8e8ec;
  --text-dim:    #8888a0;
  --text-ghost:  #4a4a5c;
  --accent:      #7ab648;
  --accent-dim:  #5a8a34;
  --accent-glow: rgba(122, 182, 72, 0.15);
  --accent-line: rgba(122, 182, 72, 0.4);
  --copper:      #b87333;
  --gold:        #c9a83e;
  --blue:        #0088ff;
  --purple:      #8b5cf6;
  --cyan:        #00cccc;
  --rose:        #b76e79;
  --orange:      #e8753a;
  --mono:        'IBM Plex Mono', 'SF Mono', monospace;
  --display:     'Outfit', sans-serif;
  --serif:       'Instrument Serif', Georgia, serif;
  --radius:      4px;
  --radius-lg:   8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--display);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Grain overlay — subtle film texture ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

/* ── Scan line — the laser ── */
body::after {
  content: '';
  position: fixed;
  left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--accent-line) 20%, var(--accent) 50%, var(--accent-line) 80%, transparent 100%);
  top: 0;
  animation: scan-line 8s ease-in-out infinite;
  opacity: 0.3;
  z-index: 9998;
  pointer-events: none;
}

@keyframes scan-line {
  0%   { top: 0; opacity: 0; }
  5%   { opacity: 0.3; }
  95%  { opacity: 0.3; }
  100% { top: 100%; opacity: 0; }
}

/* ── Typography ── */

h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }

/* ── Layout ── */

.container { max-width: 680px; margin: 0 auto; padding: 0 24px; }
section { padding: 80px 0; position: relative; }

/* Grid lines — subtle vertical measurement lines */
section::before {
  content: '';
  position: absolute;
  left: calc(50% - 340px);
  top: 0; bottom: 0;
  width: 1px;
  background: repeating-linear-gradient(to bottom, transparent, transparent 7px, var(--border) 7px, var(--border) 8px);
  opacity: 0.3;
  pointer-events: none;
}

/* ─────────────────────────────────────────────────────
   Section 1 — Hero
   ───────────────────────────────────────────────────── */

#hero {
  padding: 140px 0 100px;
  text-align: center;
  position: relative;
}

/* Möbius mark — using Unicode ∞ as stand-in, styled as measurement reticle */
.hero-mark {
  margin-bottom: 40px;
  display: flex;
  justify-content: center;
  user-select: none;
  position: relative;
}

.hero-mark svg {
  animation: mobius-breathe 4s ease-in-out infinite;
  filter: drop-shadow(0 0 12px rgba(122, 182, 72, 0.2));
}

@keyframes mobius-breathe {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 12px rgba(122, 182, 72, 0.2)); }
  50%      { opacity: 0.85; filter: drop-shadow(0 0 24px rgba(122, 182, 72, 0.4)); }
}

.hero-mark::before,
.hero-mark::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}
.hero-mark::before { top: -16px; }
.hero-mark::after { bottom: -16px; }

#hero h1 {
  font-size: clamp(32px, 5.5vw, 56px);
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--text) 20%, var(--accent) 60%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#hero .subhead {
  font-family: var(--serif);
  font-size: clamp(16px, 2.5vw, 20px);
  font-style: italic;
  color: var(--text-dim);
  max-width: 440px;
  margin: 0 auto 48px;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--orange));
  color: #000;
  box-shadow: 0 0 0 1px var(--accent), 0 0 30px var(--accent-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #8ac858, var(--orange));
  box-shadow: 0 0 0 1px #8ac858, 0 0 40px rgba(122, 182, 72, 0.3), 0 2px 20px rgba(232, 117, 58, 0.15);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-hi);
}
.btn-secondary:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text-ghost);
  border: 1px solid var(--border);
  font-size: 11px;
  padding: 10px 18px;
}
.btn-ghost:hover { color: var(--text-dim); border-color: var(--border-hi); }

/* ─────────────────────────────────────────────────────
   Section 2 — Quiz
   ───────────────────────────────────────────────────── */

#quiz { padding: 20px 0 80px; }

/* Progress — measurement scale, not dots */
.progress-bar {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-bottom: 48px;
  position: relative;
}

.progress-pip {
  width: 48px;
  height: 2px;
  background: var(--border);
  transition: all 0.5s ease;
  position: relative;
}

/* Progress pips match their question's color */
.progress-pip.active {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.progress-pip:nth-child(1).active { background: var(--cyan); box-shadow: 0 0 8px rgba(0, 204, 204, 0.3); }
.progress-pip:nth-child(2).active { background: var(--copper); box-shadow: 0 0 8px rgba(184, 115, 51, 0.3); }
.progress-pip:nth-child(3).active { background: var(--purple); box-shadow: 0 0 8px rgba(139, 92, 246, 0.3); }
.progress-pip:nth-child(1).done { background: var(--cyan); opacity: 0.4; }
.progress-pip:nth-child(2).done { background: var(--copper); opacity: 0.4; }
.progress-pip:nth-child(3).done { background: var(--purple); opacity: 0.4; }

.progress-pip.done {
  background: var(--accent-dim);
}

/* Question cards — measurement panels */
.question-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 36px 36px 36px 32px;
  margin-bottom: 12px;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  display: none;
  position: relative;
}

.question-card.visible { display: block; }

.question-card.animate-in {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
  border-left-color: var(--accent);
}

.question-card.answered {
  opacity: 0.35;
  pointer-events: none;
  border-left-color: var(--accent-dim);
}

/* Each question axis gets its own brand color */
.question-card[data-question="0"] .question-label { color: var(--cyan); }
.question-card[data-question="0"].animate-in { border-left-color: var(--cyan); }
.question-card[data-question="1"] .question-label { color: var(--copper); }
.question-card[data-question="1"].animate-in { border-left-color: var(--copper); }
.question-card[data-question="2"] .question-label { color: var(--purple); }
.question-card[data-question="2"].animate-in { border-left-color: var(--purple); }

.question-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  font-family: var(--mono);
}

.question-text {
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 28px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

/* Options — instrument buttons */
.options-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }

.option-btn {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-family: var(--display);
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
  line-height: 1.5;
}

.option-btn:hover {
  border-color: var(--accent-line);
  color: var(--text);
  background: rgba(122, 182, 72, 0.03);
  padding-left: 20px;
}

.option-btn.selected {
  border-color: var(--accent);
  background: rgba(122, 182, 72, 0.06);
  color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.option-key {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-ghost);
  min-width: 16px;
  padding-top: 3px;
  letter-spacing: 0.05em;
}

.option-btn:hover .option-key { color: var(--accent); }
.option-btn.selected .option-key { color: var(--accent); }

/* ─────────────────────────────────────────────────────
   Section 3 — Result (the readout)
   ───────────────────────────────────────────────────── */

#result {
  padding: 60px 0;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  display: none;
}

#result.visible { display: block; }
#result.animate-in { opacity: 1; transform: translateY(0); }

.result-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 44px;
  position: relative;
  overflow: hidden;
}

/* Corner measurement marks — each corner a different brand color */
.result-inner::before,
.result-inner::after {
  content: '';
  position: absolute;
  width: 24px; height: 24px;
  border-style: solid;
  border-width: 0;
}
.result-inner::before { top: 12px; left: 12px; border-top-width: 1px; border-left-width: 1px; border-color: var(--cyan); }
.result-inner::after { bottom: 12px; right: 12px; border-bottom-width: 1px; border-right-width: 1px; border-color: var(--purple); }

/* Subtle brand-colored top border gradient */
.result-inner {
  border-top: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--cyan), var(--accent), var(--orange), var(--copper), var(--purple)) 1;
}

.result-kappa {
  font-family: var(--mono);
  font-size: clamp(32px, 7vw, 52px);
  font-weight: 300;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--cyan), var(--accent), var(--orange), var(--copper), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

.result-archetype {
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.result-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-ghost);
  margin-bottom: 24px;
  letter-spacing: 0.06em;
}

.result-modes {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

/* Mode tags — each mode gets contextual color */
.mode-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent-line);
  padding: 4px 10px;
  border-radius: 2px;
}
.mode-tag:nth-child(1) { color: var(--cyan); border-color: rgba(0, 204, 204, 0.3); }
.mode-tag:nth-child(2) { color: var(--copper); border-color: rgba(184, 115, 51, 0.3); }
.mode-tag:nth-child(3) { color: var(--purple); border-color: rgba(139, 92, 246, 0.3); }

.result-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

.result-narrative {
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  color: var(--text-dim);
  line-height: 1.8;
  margin-bottom: 32px;
}

.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.share-confirm {
  font-size: 11px;
  color: var(--accent);
  font-family: var(--mono);
  opacity: 0;
  transition: opacity 0.3s ease;
  letter-spacing: 0.05em;
}
.share-confirm.show { opacity: 1; }

/* ─────────────────────────────────────────────────────
   Section 4 — Gate (the locked vault)
   ───────────────────────────────────────────────────── */

#gate {
  padding: 0 0 80px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease 0.4s, transform 0.8s ease 0.4s;
  display: none;
}

#gate.visible { display: block; }
#gate.animate-in { opacity: 1; transform: translateY(0); }

.gate-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--mono);
  margin-bottom: 16px;
}

.gate-copy {
  font-family: var(--serif);
  font-size: 16px;
  font-style: italic;
  color: var(--text-dim);
  margin-bottom: 28px;
  max-width: 520px;
  line-height: 1.7;
}

/* Card with blur — classified document aesthetic */
.persona-card-wrapper {
  position: relative;
  margin-bottom: 36px;
}

.persona-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 28px 32px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  line-height: 2;
  color: var(--text-dim);
  white-space: pre;
  overflow: hidden;
}

.card-visible-lines { color: var(--text); }

.card-blurred {
  filter: blur(8px);
  user-select: none;
  pointer-events: none;
  color: var(--text-ghost);
}

.blur-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 100px;
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none;
}

.gate-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

.btn-gumroad-primary {
  background: var(--accent);
  color: #000;
  font-size: 13px;
  padding: 16px 32px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 0 30px var(--accent-glow);
}
.btn-gumroad-primary:hover {
  background: #8ac858;
  box-shadow: 0 0 0 1px #8ac858, 0 0 40px rgba(122, 182, 72, 0.35);
  transform: translateY(-1px);
}

.btn-gumroad-secondary {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border-hi);
  font-size: 13px;
  padding: 16px 32px;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.btn-gumroad-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Bundle button gets gold accent — premium tier */
.btn-gumroad-secondary {
  border-color: rgba(201, 168, 62, 0.2);
  color: var(--gold);
  opacity: 0.8;
}
.btn-gumroad-secondary:hover { opacity: 1; }

.gate-note {
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-ghost);
  font-family: var(--mono);
  letter-spacing: 0.03em;
}

/* ─────────────────────────────────────────────────────
   Section 5 — Footer
   ───────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 48px;
  text-align: center;
}

.footer-mark {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.footer-brand {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.footer-tagline {
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
  color: var(--text-ghost);
  max-width: 480px;
  margin: 0 auto 24px;
  line-height: 1.7;
}

.footer-links {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.footer-links a {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-ghost);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.15s ease;
}
.footer-links a:hover { color: var(--accent); }

.footer-compat {
  font-size: 11px;
  color: var(--text-ghost);
  font-family: var(--mono);
  max-width: 520px;
  margin: 0 auto;
  letter-spacing: 0.02em;
}

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Responsive ── */
@media (max-width: 600px) {
  section { padding: 60px 0; }
  section::before { display: none; }
  #hero { padding: 100px 0 60px; }
  .hero-mark { font-size: 48px; }
  .result-inner { padding: 32px 20px; }
  .persona-card { padding: 20px 16px; font-size: 11px; white-space: pre-wrap; word-break: break-word; }
  .result-actions, .gate-buttons { flex-direction: column; }
  .btn, .btn-gumroad-primary, .btn-gumroad-secondary { width: 100%; justify-content: center; text-align: center; }
  .question-card { padding: 28px 20px 28px 20px; border-left-width: 2px; }
}

/* ── Animations ── */
@keyframes count-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.kappa-animate { animation: count-up 0.5s ease forwards; }
