/* ============================================================
   SPECTRUM — Orientation Test
   Design language adapted from portfolio: dark oklch glass UI,
   rise/fade-up animations, spotlight cards, glow borders,
   dock nav, cursor glow, grain — injected with pride palette.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Geist+Mono:wght@100..900&display=swap');

:root {
  color-scheme: dark;

  /* base monochrome (from portfolio) */
  --background: oklch(0.085 0 0);
  --foreground: oklch(0.97 0 0);
  --card: oklch(0.12 0 0);
  --muted: oklch(0.16 0 0);
  --muted-foreground: oklch(0.66 0 0);
  --border: oklch(1 0 0 / 9%);
  --input: oklch(1 0 0 / 14%);
  --ring: oklch(0.96 0 0 / 60%);
  --radius: 1rem;

  /* pride palette (vivid, tuned for dark bg) */
  --c1: #ff4d6d; /* red/pink */
  --c2: #ff9e3d; /* orange */
  --c3: #ffe75e; /* yellow */
  --c4: #3ddc84; /* green */
  --c5: #45c4ff; /* blue */
  --c6: #b78cff; /* violet */

  --pride-gradient: linear-gradient(
    90deg, var(--c1), var(--c2), var(--c3), var(--c4), var(--c5), var(--c6)
  );
}

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

html {
  scroll-behavior: smooth;
  background: var(--background);
}

body {
  font-family: 'Geist', ui-sans-serif, system-ui, sans-serif;
  background: var(--background);
  color: var(--foreground);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection {
  background: var(--c1);
  color: #fff;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; }

.mono { font-family: 'Geist Mono', ui-monospace, monospace; }

/* ============ keyframes (from portfolio globals) ============ */
@keyframes rise {
  from { opacity: 0; transform: translateY(110%); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); filter: blur(6px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(6%, -8%) scale(1.08); }
  66% { transform: translate(-6%, 6%) scale(0.95); }
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.6); opacity: 0; }
}
@keyframes shimmer {
  from { background-position: 200% center; }
  to { background-position: -200% center; }
}
@keyframes word-in {
  from { opacity: 0; transform: translateY(60%) rotateX(-70deg); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes caret-blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes scan {
  from { transform: translateY(-100%); }
  to { transform: translateY(400%); }
}
@keyframes spin-angle { to { --angle: 360deg; } }
@keyframes pop {
  0% { transform: scale(0.96); opacity: 0; }
  60% { transform: scale(1.01); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes bar-grow { from { width: 0; } }

/* ============ utilities ============ */
.animate-rise { animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both; }
.animate-fade-up { animation: fade-up 0.8s cubic-bezier(0.22, 1, 0.36, 1) both; }
.animate-drift { animation: drift 18s ease-in-out infinite; }
.animate-marquee { animation: marquee 28s linear infinite; }
.animate-pulse-ring { animation: pulse-ring 1.8s cubic-bezier(0.22, 1, 0.36, 1) infinite; }
.animate-float { animation: float 3.2s ease-in-out infinite; }
.animate-caret { animation: caret-blink 1s step-end infinite; }
.animate-pop { animation: pop 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }

.text-shimmer {
  background-image: linear-gradient(
    110deg,
    var(--foreground) 35%,
    var(--c5) 50%,
    var(--foreground) 65%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 4s linear infinite;
}

.text-pride {
  background-image: var(--pride-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.grain {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: overlay;
}

.bg-grid {
  background-image:
    linear-gradient(to right, oklch(1 0 0 / 4.5%) 1px, transparent 1px),
    linear-gradient(to bottom, oklch(1 0 0 / 4.5%) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

/* spotlight card (from skills-section) */
.spotlight { position: relative; }
.spotlight::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: inherit;
  background: radial-gradient(
    320px circle at var(--x, 50%) var(--y, 50%),
    color-mix(in oklch, var(--skill, var(--c5)) 18%, transparent),
    transparent 70%
  );
  z-index: 0;
}
.spotlight:hover::before { opacity: 1; }

/* conic glow border (from .glow-border, pride version) */
@property --angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.glow-border { position: relative; }
.glow-border::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: conic-gradient(
    from var(--angle),
    transparent 0deg,
    var(--c1) 50deg,
    var(--c2) 80deg,
    var(--c3) 110deg,
    transparent 160deg,
    transparent 200deg,
    var(--c5) 250deg,
    var(--c6) 280deg,
    transparent 330deg
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spin-angle 6s linear infinite;
}

/* reveal on scroll (from .reveal) */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
  transition:
    opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal[data-visible='true'] {
  opacity: 1;
  transform: none;
  filter: none;
}

.cursor-glow {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s;
  background: radial-gradient(
    500px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in oklch, var(--c5) 8%, transparent),
    transparent 70%
  );
}

/* ============ header (fixed floating pill nav) ============ */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 0.9rem 1rem;
  pointer-events: none;
}

.site-header > * { pointer-events: auto; }

.header-pill {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(100%, 54rem);
  padding: 0.5rem 0.6rem 0.5rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in oklch, #000 62%, transparent);
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 44px -16px rgb(0 0 0 / 0.85), inset 0 1px 0 rgb(255 255 255 / 0.05);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 0.95rem;
  white-space: nowrap;
}
.brand .dot {
  width: 0.5em; height: 0.5em; border-radius: 999px;
  background: var(--pride-gradient);
  box-shadow: 0 0 12px color-mix(in oklch, var(--c5) 60%, transparent);
}

.site-nav {
  display: flex;
  gap: 0.15rem;
  align-items: center;
  margin-left: auto;
  padding: 0.2rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: oklch(1 0 0 / 3%);
}
.site-nav a {
  position: relative;
  font-family: 'Geist Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.3s, background-color 0.3s, box-shadow 0.3s;
}
.site-nav a:hover { color: var(--foreground); }
.site-nav a.active {
  color: var(--background);
  background: var(--foreground);
  box-shadow: 0 0 22px -4px var(--c5);
}

@media (max-width: 640px) {
  .header-pill { border-radius: 1.2rem; }
  .site-nav a { font-size: 0.66rem; padding: 0.4rem 0.6rem; }
  .brand { font-size: 0.85rem; }
}

/* ============ hero ============ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 7rem 1.5rem 4rem;
  overflow: hidden;
}

.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-bg .orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(120px);
}
.orb-1 { top: -10%; left: -10%; width: 60vmax; height: 60vmax; background: color-mix(in oklch, var(--c1) 14%, transparent); }
.orb-2 { right: -15%; bottom: -20%; width: 50vmax; height: 50vmax; background: color-mix(in oklch, var(--c5) 16%, transparent); animation-delay: -9s; }
.orb-3 { top: 30%; left: 40%; width: 34vmax; height: 34vmax; background: color-mix(in oklch, var(--c6) 12%, transparent); animation-delay: -4s; }

.hero-inner { width: 100%; max-width: 72rem; margin: 0 auto; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border: 1px solid var(--border);
  background: color-mix(in oklch, var(--card) 60%, transparent);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-family: 'Geist Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}
.badge .ping { position: relative; display: inline-flex; width: 0.55rem; height: 0.55rem; }
.badge .ping i { position: absolute; inset: 0; border-radius: 999px; background: var(--c4); }
.badge .ping i:first-child { animation: var(--animate-pulse-ring); }
.badge .ping i:last-child { position: relative; }

.hero-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  font-size: clamp(3.6rem, 16vw, 12rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 0.9;
}
.hero-title .letter {
  display: inline-block;
  cursor: default;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), color 0.3s, text-shadow 0.3s;
}
.hero-title .letter:hover {
  transform: translateY(-0.8rem) rotate(-3deg);
  color: var(--c1);
  text-shadow: 0 0 40px var(--c1);
}
.hero-title .dot {
  display: inline-block;
  width: 0.18em; height: 0.18em;
  border-radius: 999px;
  background: var(--pride-gradient);
  margin-left: 0.08em;
}

.hero-sub {
  margin-top: 1.6rem;
  font-size: clamp(1.35rem, 4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.rotating { display: inline-flex; align-items: baseline; perspective: 600px; }
.rotating .word { display: inline-block; }
.rotating .caret {
  display: inline-block;
  height: 0.9em; width: 3px;
  margin-left: 4px;
  translate: 0 0.1em;
  background: var(--c1);
}

.hero-row {
  margin-top: 2.6rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}
.hero-desc { max-width: 34rem; color: var(--muted-foreground); font-size: 1.05rem; }
.hero-desc strong { color: var(--foreground); font-weight: 600; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: 999px;
  padding: 0.85rem 1.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.3s, background-color 0.3s, border-color 0.3s, color 0.3s, box-shadow 0.3s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--foreground);
  color: var(--background);
  box-shadow: 0 0 32px -6px color-mix(in oklch, var(--c5) 55%, transparent);
}
.btn-primary:hover { box-shadow: 0 0 44px -4px var(--c5); }
.btn-ghost {
  border-color: var(--border);
  color: var(--foreground);
  background: color-mix(in oklch, var(--card) 50%, transparent);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { border-color: color-mix(in oklch, var(--c1) 50%, transparent); }

.scroll-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Geist Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.scroll-hint svg { transition: transform 0.3s; }
.scroll-hint:hover svg { transform: translate(2px, 2px); }
.scroll-hint:hover { color: var(--foreground); }

/* ============ marquee ============ */
.marquee {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--border);
  padding: 1.4rem 0;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}
.marquee-track { display: flex; width: max-content; gap: 2.5rem; }
.marquee-track span {
  display: inline-flex;
  align-items: center;
  gap: 2.5rem;
  font-size: clamp(1.6rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: color-mix(in oklch, var(--muted-foreground) 45%, transparent);
  white-space: nowrap;
}
.marquee-track i { width: 0.5rem; height: 0.5rem; border-radius: 999px; background: var(--pride-gradient); }

/* ============ sections ============ */
.section { padding: 6rem 1.5rem; scroll-margin: 4rem; }
.section-inner { max-width: 72rem; margin: 0 auto; }

.section-label {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: 'Geist Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}
.section-label .idx { color: var(--c1); }
.section-label .rule { height: 1px; width: 2.5rem; background: var(--border); }

.section-head {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  align-items: flex-start;
}
.section-title { font-size: clamp(2rem, 6vw, 3.6rem); font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; text-wrap: balance; }
.section-note { max-width: 26rem; color: var(--muted-foreground); font-size: 0.95rem; }

/* ============ mode cards ============ */
.mode-grid { margin-top: 3.5rem; display: grid; gap: 1.1rem; }
@media (min-width: 640px) { .mode-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .mode-grid { grid-template-columns: repeat(3, 1fr); } }

.mode-card {
  --skill: var(--c5);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: 1.4rem;
  background: var(--card);
  padding: 2rem 1.8rem;
  overflow: hidden;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.5s;
}
.mode-card:hover { transform: translateY(-6px); border-color: color-mix(in oklch, var(--skill) 45%, transparent); }
.mode-card .num { font-family: 'Geist Mono', monospace; font-size: 0.72rem; color: color-mix(in oklch, var(--muted-foreground) 70%, transparent); }
.mode-card .icon {
  display: grid; place-items: center;
  width: 3.4rem; height: 3.4rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--skill);
  transition: transform 0.5s;
}
.mode-card:hover .icon { transform: scale(1.1) rotate(-6deg); box-shadow: 0 0 26px -4px var(--skill); }
.mode-card h3 { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
.mode-card p { color: var(--muted-foreground); font-size: 0.95rem; }
.mode-card .meta {
  margin-top: auto;
  padding-top: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Geist Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted-foreground);
  border-top: 1px solid var(--border);
}
.mode-card .meta .go { color: var(--skill); display: inline-flex; align-items: center; gap: 0.4rem; transition: gap 0.3s; }
.mode-card:hover .meta .go { gap: 0.8rem; }

/* ============ stats strip ============ */
.stat-strip {
  display: grid;
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: 1.4rem;
  overflow: hidden;
  background: var(--border);
}
@media (min-width: 640px) { .stat-strip { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .stat-strip { grid-template-columns: repeat(4, 1fr); } }
.stat-cell { background: var(--card); padding: 2rem 1.6rem; }
.stat-cell .val {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  background: var(--pride-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-cell .lbl { margin-top: 0.3rem; font-family: 'Geist Mono', monospace; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-foreground); }

/* ============ feature cards ============ */
.feature-grid { margin-top: 3.5rem; display: grid; gap: 1.1rem; }
@media (min-width: 640px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
.feature {
  --skill: var(--c6);
  border: 1px solid var(--border);
  border-radius: 1.2rem;
  background: var(--card);
  padding: 1.8rem;
  transition: border-color 0.4s, transform 0.4s;
}
.feature:hover { transform: translateY(-4px); border-color: color-mix(in oklch, var(--skill) 40%, transparent); }
.feature .icon { display: grid; place-items: center; width: 2.8rem; height: 2.8rem; border-radius: 0.8rem; border: 1px solid var(--border); color: var(--skill); }
.feature h4 { margin-top: 1.1rem; font-size: 1.15rem; font-weight: 650; letter-spacing: -0.01em; }
.feature p { margin-top: 0.5rem; color: var(--muted-foreground); font-size: 0.92rem; }

/* ============ notice card ============ */
.notice {
  position: relative;
  border: 1px solid color-mix(in oklch, var(--c3) 35%, transparent);
  border-radius: 1.4rem;
  background: color-mix(in oklch, var(--c3) 7%, var(--card));
  padding: 2.2rem;
  display: grid;
  gap: 1.2rem;
}
.notice h3 { display: flex; align-items: center; gap: 0.7rem; font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; }
.notice p { color: var(--muted-foreground); }
.notice strong { color: var(--foreground); }

/* ============ CTA ============ */
.cta {
  position: relative;
  border-radius: 2rem;
  border: 1px solid var(--border);
  background: var(--card);
  padding: 4.5rem 2rem;
  text-align: center;
  overflow: hidden;
}
.cta h2 { font-size: clamp(2.2rem, 7vw, 4.5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; }
.cta p { margin: 1.2rem auto 0; max-width: 34rem; color: var(--muted-foreground); }
.cta .actions { margin-top: 2.4rem; display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; }

/* ============ footer ============ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 1.5rem;
  display: grid;
  gap: 1.6rem;
}
.site-footer .row { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 1.2rem; font-family: 'Geist Mono', monospace; font-size: 0.75rem; color: var(--muted-foreground); }
.site-footer .links a:hover { color: var(--foreground); }
.site-footer .legal { font-family: 'Geist Mono', monospace; font-size: 0.72rem; color: color-mix(in oklch, var(--muted-foreground) 80%, transparent); max-width: 46rem; }

/* ============ quiz engine ============ */
.quiz-page { min-height: 100svh; padding: 7.5rem 1.25rem 5rem; }
.quiz-shell { max-width: 46rem; margin: 0 auto; }

.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.quiz-mode-tag { font-family: 'Geist Mono', monospace; font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted-foreground); }
.quiz-counter { font-family: 'Geist Mono', monospace; font-size: 0.8rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.quiz-counter b { color: var(--foreground); }

.progress-track { height: 3px; background: var(--muted); border-radius: 999px; overflow: hidden; }
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--pride-gradient);
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.quiz-card {
  margin-top: 1.8rem;
  border: 1px solid var(--border);
  border-radius: 1.6rem;
  background: var(--card);
  padding: 2.2rem 1.8rem;
}
.quiz-q { font-size: clamp(1.3rem, 4vw, 1.8rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; }

.options { margin-top: 1.6rem; display: grid; gap: 0.75rem; }
.option {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: color-mix(in oklch, var(--muted) 55%, transparent);
  color: var(--foreground);
  padding: 1rem 1.2rem;
  font-size: 1rem;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s, background-color 0.3s;
}
.option:hover, .option:focus-visible {
  transform: translateX(5px);
  border-color: color-mix(in oklch, var(--c5) 55%, transparent);
  background: color-mix(in oklch, var(--c5) 8%, var(--muted));
  outline: none;
}
.option .key {
  display: grid; place-items: center;
  width: 1.9rem; height: 1.9rem;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 0.6rem;
  font-family: 'Geist Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  transition: color 0.3s, border-color 0.3s;
}
.option:hover .key { color: var(--c5); border-color: color-mix(in oklch, var(--c5) 50%, transparent); }
.option.chosen {
  border-color: var(--c4);
  background: color-mix(in oklch, var(--c4) 12%, var(--muted));
}
.option.chosen .key { color: var(--c4); border-color: var(--c4); }

.quiz-foot { margin-top: 1.6rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.quiz-foot .ghost {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-foreground);
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
  transition: color 0.3s, border-color 0.3s;
}
.quiz-foot .ghost:hover:not(:disabled) { color: var(--foreground); border-color: var(--input); }
.quiz-foot .ghost:disabled { opacity: 0.35; cursor: not-allowed; }
.quiz-foot .next {
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.5rem;
  font-weight: 600;
  background: var(--foreground);
  color: var(--background);
  transition: transform 0.3s, box-shadow 0.3s;
}
.quiz-foot .next:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 0 32px -6px var(--c5); }
.quiz-foot .next:disabled { opacity: 0.35; cursor: not-allowed; }

.fade-swap { animation: pop 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* ============ results ============ */
.result-hero { text-align: center; margin-top: 2rem; }
.result-hero .kicker { font-family: 'Geist Mono', monospace; font-size: 0.75rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--muted-foreground); }
.result-hero h2 {
  margin-top: 0.6rem;
  font-size: clamp(2.4rem, 8vw, 4.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
}
.result-hero .match-val {
  font-size: clamp(1rem, 3vw, 1.3rem);
  margin-top: 0.6rem;
  color: var(--muted-foreground);
  font-family: 'Geist Mono', monospace;
}
.result-hero .match-val b { color: var(--foreground); font-size: 1.3em; }

.spectrum { margin-top: 2.4rem; display: grid; gap: 1.05rem; }
.spec-row .spec-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.4rem; }
.spec-row .spec-name { font-weight: 650; font-size: 0.98rem; }
.spec-row .spec-pct { font-family: 'Geist Mono', monospace; font-size: 0.8rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.spec-track { height: 10px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.spec-fill { height: 100%; border-radius: 999px; width: 0; transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1); }

.result-note {
  margin-top: 2.4rem;
  border: 1px solid color-mix(in oklch, var(--c3) 35%, transparent);
  background: color-mix(in oklch, var(--c3) 7%, var(--card));
  border-radius: 1.2rem;
  padding: 1.6rem;
  color: var(--muted-foreground);
  font-size: 0.92rem;
}
.result-note strong { color: var(--foreground); }

.result-actions { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }

/* ============ calculating animation ============ */
.calculating {
  display: none;
  place-items: center;
  min-height: 60svh;
  text-align: center;
  padding: 2rem;
}
.calc-inner {
  width: min(100%, 26rem);
  border: 1px solid var(--border);
  border-radius: 1.6rem;
  background: var(--card);
  padding: 3rem 2rem;
  position: relative;
  overflow: hidden;
}
.calc-orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.5;
}
.calc-orb.a { top: -60px; left: -60px; width: 180px; height: 180px; background: var(--c1); }
.calc-orb.b { bottom: -60px; right: -60px; width: 180px; height: 180px; background: var(--c5); }
.calc-orb.a, .calc-orb.b { animation: drift 6s ease-in-out infinite; }
.calc-orb.b { animation-delay: -3s; }

.calc-mark {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto;
  border-radius: 999px;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    var(--pride-gradient) border-box;
  display: grid;
  place-items: center;
  font-size: 2rem;
  animation: float 2.4s ease-in-out infinite;
}
.calc-status {
  position: relative;
  margin-top: 1.6rem;
  font-weight: 650;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  min-height: 1.6em;
}
.calc-sub {
  position: relative;
  margin-top: 0.4rem;
  font-family: 'Geist Mono', monospace;
  font-size: 0.72rem;
  color: var(--muted-foreground);
}
.calc-track {
  position: relative;
  margin-top: 1.6rem;
  height: 4px;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
}
.calc-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--pride-gradient);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.calc-pct {
  position: relative;
  margin-top: 0.7rem;
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  color: var(--muted-foreground);
  font-variant-numeric: tabular-nums;
}
/* pride scan line sweeping the card while calculating */
.calc-scan {
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 28%;
  background: linear-gradient(180deg, transparent, color-mix(in oklch, var(--c5) 12%, transparent), transparent);
  animation: scan 2s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  pointer-events: none;
}

/* ============ sound toggle (inside top pill nav) ============ */
.sound-toggle {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  margin-left: 0.35rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-foreground);
  transition: color 0.3s, background-color 0.3s;
}
.sound-toggle:hover { color: var(--foreground); background: oklch(1 0 0 / 8%); }

/* ============ misc pages (disclaimer/stats/quiz hub) ============ */
.page-hero { padding: 8rem 1.5rem 3rem; }
.page-hero-inner { max-width: 72rem; margin: 0 auto; }
.page-title { font-size: clamp(2.4rem, 8vw, 5rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; }
.page-sub { margin-top: 1rem; max-width: 42rem; color: var(--muted-foreground); font-size: 1.05rem; }

.prose { max-width: 46rem; margin: 0 auto; display: grid; gap: 1.4rem; }
.prose h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; margin-top: 1rem; }
.prose p, .prose li { color: var(--muted-foreground); }
.prose li { padding-left: 1.2rem; position: relative; }
.prose li::before { content: '—'; position: absolute; left: 0; color: var(--c1); }
.prose strong { color: var(--foreground); }
.prose .quote { font-size: 1.3rem; color: var(--foreground); font-weight: 600; letter-spacing: -0.01em; }

.reveal-host { display: contents; }

/* 404 */
.nf { min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 2rem; position: relative; overflow: hidden; }
.nf .code { font-size: clamp(6rem, 26vw, 16rem); font-weight: 800; letter-spacing: -0.06em; line-height: 1; }

/* reduced motion (from portfolio) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; filter: none; }
}

/* ============================================================
   SCROLL-DRIVEN ANIMATIONS — desktop pointer:fine only
   Native CSS scroll timelines (Chrome/Edge 115+). Mobile and
   unsupported browsers fall back to the JS .reveal system.
   ============================================================ */
@keyframes sd-rise {
  from { opacity: 0; transform: translateY(70px) scale(0.97); filter: blur(10px); }
  60%  { opacity: 1; }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes sd-side {
  from { opacity: 0; transform: translateX(-56px); }
  60%  { opacity: 1; }
  to   { opacity: 1; transform: none; }
}
@keyframes sd-orb-a {
  from { transform: translateY(-70px) scale(1); }
  to   { transform: translateY(140px) scale(1.12); }
}
@keyframes sd-orb-b {
  from { transform: translateY(90px) scale(1.05); }
  to   { transform: translateY(-60px) scale(0.95); }
}
@keyframes sd-progress {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}
@keyframes sd-marquee-shift {
  from { transform: translateX(-6px); }
  to   { transform: translateX(6px); }
}

@supports (animation-timeline: view()) {
  @media (pointer: fine) and (min-width: 721px) {
    /* pride scroll-progress bar pinned to very top */
    .scroll-progress {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: 2.5px;
      z-index: 80;
      background: var(--pride-gradient);
      transform-origin: 0 50%;
      will-change: transform;
      animation: sd-progress linear both;
      animation-timeline: scroll(root block);
    }

    /* sections rise into view as you scroll */
    .section-title,
    .page-title,
    .stat-strip,
    .feature-grid,
    .notice,
    .cta,
    .prose > .reveal,
    .result-hero,
    .spectrum,
    .result-note,
    .result-actions {
      animation: sd-rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }

    /* section labels + notes slide in from the left */
    .section-label,
    .section-note,
    .page-sub,
    .calc-status {
      animation: sd-side linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 50%;
    }

    /* hero orbs parallax as the hero scrolls away */
    .hero-bg .orb-1 { animation: sd-orb-a linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
    .hero-bg .orb-2 { animation: sd-orb-b linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
    .hero-bg .orb-3 { animation: sd-orb-b linear both; animation-timeline: view(); animation-range: exit 0% exit 90%; }

    /* grid + marquee gentle scroll-linked shift */
    .hero-bg .bg-grid { animation: sd-marquee-shift linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
  }
}