:root {
  --bg: #070b14;
  --bg-elev: #0e1626;
  --bg-card: rgba(14, 22, 38, 0.88);
  --bg-soft: #131d31;
  --border: #1e293b;
  --border-bright: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --emerald: #34d399;
  --emerald-dark: #059669;
  --cyan: #38bdf8;
  --amber: #f59e0b;
  --crimson: #f43f5e;
  --radius: 14px;
  --radius-sm: 10px;
  --max-w: 1120px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  background:
    radial-gradient(900px 420px at 15% -5%, rgba(56, 189, 248, 0.12), transparent 60%),
    radial-gradient(800px 400px at 85% 0%, rgba(52, 211, 153, 0.11), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

/* Sticky Navbar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(7, 11, 20, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.24), rgba(56, 189, 248, 0.24));
  border: 1px solid rgba(52, 211, 153, 0.55);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--emerald);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.1);
  color: var(--emerald) !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
}

/* Hero & Telemetry */
.hero {
  padding: 46px 0 28px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 14px 0 12px;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.hero-sub {
  max-width: 700px;
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: 1.06rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-bright);
  background: var(--bg-soft);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
  text-decoration: none;
}

.btn:hover {
  border-color: var(--cyan);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--emerald), #10b981);
  border-color: transparent;
  color: #03150e;
}

.btn-primary:hover {
  filter: brightness(1.06);
  border-color: transparent;
}

.btn-cyan {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.5);
  color: #e0f2fe;
}

.btn-amber {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.55);
  color: #fef3c7;
}

/* Profile Telemetry Strip */
.profile-strip {
  margin: 18px 0 30px;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  align-items: center;
}

.metric-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-label {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--emerald);
}

/* Filter Bar & Lab Grid */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-tab {
  min-height: 36px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-tab.active {
  border-color: var(--emerald);
  background: rgba(52, 211, 153, 0.14);
  color: var(--emerald);
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 16px;
  margin-bottom: 42px;
}

.test-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.test-card:hover {
  border-color: rgba(56, 189, 248, 0.6);
  transform: translateY(-2px);
}

.test-card.hidden {
  display: none;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.cat-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  border: 1px solid var(--border-bright);
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.08);
}

.score-pill {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-dim);
}

.score-pill.has-score {
  color: var(--emerald);
  font-weight: 600;
}

.test-card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.test-card p {
  margin: 0 0 16px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(30, 41, 59, 0.8);
  font-size: 0.84rem;
  color: var(--text-dim);
}

.card-link {
  font-weight: 600;
  color: var(--emerald);
}

/* Test Page Stage */
.breadcrumbs {
  padding: 18px 0 8px;
  font-size: 0.86rem;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.test-hero {
  padding: 6px 0 18px;
}

.test-hero h1 {
  margin: 8px 0 8px;
  font-size: clamp(1.75rem, 3.4vw, 2.45rem);
  letter-spacing: -0.025em;
}

.test-hero p {
  margin: 0;
  color: var(--text-muted);
  max-width: 740px;
}

.stage-shell {
  margin: 18px 0 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border-bright);
  border-radius: 18px;
  padding: 22px;
  min-height: 410px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.45);
}

.stage-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--text-muted);
}

.hud-group {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.hud-pill {
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  color: var(--text);
}

.stage-center {
  text-align: center;
  padding: 18px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 300px;
}

.reaction-pad {
  width: 100%;
  min-height: 320px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  cursor: pointer;
  user-select: none;
  border: 1px solid var(--border-bright);
  transition: background-color 0.08s ease;
}

.reaction-pad.idle {
  background: rgba(56, 189, 248, 0.1);
}

.reaction-pad.waiting {
  background: rgba(244, 63, 94, 0.22);
  border-color: var(--crimson);
}

.reaction-pad.ready {
  background: rgba(52, 211, 153, 0.28);
  border-color: var(--emerald);
}

.reaction-pad.early {
  background: rgba(245, 158, 11, 0.22);
  border-color: var(--amber);
}

.reaction-big {
  font-family: var(--font-mono);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Grids for Memory / Vision / Chimp */
.tile-grid {
  display: grid;
  gap: 10px;
  margin: 0 auto;
  width: 100%;
  max-width: 390px;
}

.tile-btn {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1px solid var(--border-bright);
  background: #132038;
  cursor: pointer;
  transition: transform 0.08s ease, background-color 0.12s ease, border-color 0.12s ease;
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
}

.tile-btn:hover:not(:disabled) {
  border-color: var(--cyan);
}

.tile-btn.lit {
  background: var(--emerald);
  border-color: #a7f3d0;
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.55);
  color: #03150e;
}

.tile-btn.good {
  background: rgba(52, 211, 153, 0.28);
  border-color: var(--emerald);
}

.tile-btn.bad {
  background: rgba(244, 63, 94, 0.35);
  border-color: var(--crimson);
}

.tile-btn.masked {
  background: #1e293b;
  color: transparent;
  border-color: #475569;
}

/* Stroop & Number Inputs */
.stroop-word {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: 12px;
  background: rgba(7, 11, 20, 0.85);
  border: 1px solid var(--border);
}

.stroop-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 180px));
  gap: 12px;
}

.digit-display {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--cyan);
  word-break: break-all;
}

.progress-track {
  width: 100%;
  max-width: 340px;
  height: 8px;
  border-radius: 999px;
  background: #1e293b;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--emerald));
  width: 100%;
  transition: width 0.08s linear;
}

.lab-input {
  width: 100%;
  max-width: 320px;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-bright);
  background: #070b14;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.35rem;
  text-align: center;
  letter-spacing: 0.12em;
}

.lab-input:focus {
  outline: 2px solid var(--cyan);
  border-color: transparent;
}

/* Result Card */
.result-card {
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  padding: 22px;
  border-radius: 14px;
  background: rgba(7, 11, 20, 0.86);
  border: 1px solid rgba(52, 211, 153, 0.45);
  text-align: center;
}

.result-kicker {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cyan);
}

.result-score {
  margin: 6px 0 4px;
  font-family: var(--font-mono);
  font-size: clamp(2.1rem, 4.5vw, 3rem);
  font-weight: 800;
  color: var(--emerald);
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 14px;
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

.badge-percentile {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: var(--emerald);
}

.badge-best {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: var(--amber);
}

.bell-wrap {
  margin: 8px auto 14px;
  max-width: 420px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}

/* CLS-Safe Ad Slot */
.ad-slot-shell {
  margin: 22px 0;
  min-height: 100px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(51, 65, 85, 0.65);
  background: rgba(14, 22, 38, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.ad-slot-shell[data-ad-active="false"] {
  min-height: 0;
  height: 0;
  margin: 0;
  border: 0;
  overflow: hidden;
}

/* Content Sections, Science & FAQ */
.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin: 24px 0 34px;
}

.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.panel h2, .panel h3 {
  margin-top: 0;
  letter-spacing: -0.015em;
}

.panel p {
  color: var(--text-muted);
  margin-bottom: 10px;
}

.panel p:last-child {
  margin-bottom: 0;
}

.faq-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 38px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.faq-item p {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 0.94rem;
}

/* Prose Pages */
.prose {
  padding: 30px 0 54px;
  max-width: 820px;
}

.prose h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  margin-bottom: 14px;
}

.prose h2 {
  margin-top: 28px;
  font-size: 1.3rem;
}

.prose p, .prose li {
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(7, 11, 20, 0.92);
  padding: 28px 0 36px;
  margin-top: 32px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a {
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .stage-shell {
    padding: 14px;
    min-height: 360px;
  }
  .stroop-choices {
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .nav-links {
    gap: 12px;
  }
}
