:root {
    --bg: #0b0b0c;
    --bg-soft: #111113;
    --bg-elev: #16161a;
    --ink: #f4f1ea;
    --ink-dim: #a8a39a;
    --ink-mute: #6b675f;
    --line: #25252a;
    --accent: #d4ff3c;
    --accent-2: #ff5b2e;
    --display: 'Fraunces', 'Times New Roman', serif;
    --sans: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', 'Courier New', monospace;
    --radius-card: 4px;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-weight: 400;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

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

  ::selection { background: var(--accent); color: var(--bg); }

  /* ===== NAV ===== */
  nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    padding: 22px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(12px);
    background: rgba(11, 11, 12, 0.65);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
  }
  nav.scrolled { border-bottom-color: var(--line); }
  .logo {
    font-family: var(--display);
    font-weight: 500;
    font-size: 22px;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .logo a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 10px; }
  .logo-dot {
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--accent);
    animation: pulse 2s ease-in-out infinite;
  }
  @keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
  }
  .nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
  }
  .nav-links a {
    color: var(--ink-dim);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
  }
  .nav-links a:hover { color: var(--ink); }
  .nav-links a.active { color: var(--accent); }
  .nav-cta {
    display: inline-block;
    padding: 10px 20px;
    background: var(--ink);
    color: var(--bg);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s;
  }
  .nav-cta:hover { background: var(--accent); transform: translateY(-1px); }

  @media (max-width: 768px) {
    nav { padding: 18px 20px; }
    .nav-links { display: none; }
  }

  /* ===== BUTTONS ===== */
  .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    background: var(--accent);
    color: var(--bg);
    text-decoration: none;
    border-radius: 100px;
    font-weight: 600;
    font-size: 15px;
    border: none;
    cursor: pointer;
    font-family: var(--sans);
    transition: transform 0.25s, box-shadow 0.25s;
  }
  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(212, 255, 60, 0.25);
  }
  .btn-primary:active { transform: translateY(1px) scale(0.98); }
  .btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
  .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    background: transparent;
    color: var(--ink);
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 100px;
    font-weight: 500;
    font-size: 15px;
    cursor: pointer;
    font-family: var(--sans);
    transition: border-color 0.25s, background 0.25s, transform 0.25s;
  }
  .btn-secondary:hover { border-color: var(--ink); background: var(--bg-soft); }
  .btn-secondary:active { transform: translateY(1px) scale(0.98); }
  .btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }
  .btn-arrow {
    width: 18px; height: 18px;
    transition: transform 0.25s;
  }
  .btn-primary:hover .btn-arrow,
  .btn-secondary:hover .btn-arrow { transform: translateX(4px); }

  /* ===== SECTIONS ===== */
  section { padding: 120px 40px; position: relative; }
  .container { max-width: 1280px; margin: 0 auto; }
  .section-label {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-mute);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .section-label::before {
    content: '';
    width: 32px; height: 1px;
    background: var(--accent);
  }

  /* ===== PAGE HERO ===== */
  .page-hero {
    min-height: 62vh;
    padding: 180px 40px 80px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
  }
  .page-hero-grid {
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(var(--line) 1px, transparent 1px),
      linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.4;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black, transparent);
  }
  .page-hero .container { position: relative; z-index: 2; width: 100%; }
  .breadcrumb {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-mute);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 28px;
    opacity: 0;
    animation: fadeUp 0.8s ease 0.1s forwards;
  }
  .breadcrumb a { color: var(--ink-mute); text-decoration: none; transition: color 0.2s; }
  .breadcrumb a:hover { color: var(--accent); }
  .breadcrumb span { color: var(--accent); }
  .page-hero h1 {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(44px, 8vw, 110px);
    line-height: 0.98;
    letter-spacing: -0.04em;
    margin-bottom: 28px;
    max-width: 16ch;
    opacity: 0;
    animation: fadeUp 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s forwards;
  }
  .page-hero h1 em { font-style: italic; color: var(--accent); font-weight: 300; }
  .page-hero-sub {
    font-size: clamp(16px, 1.5vw, 20px);
    color: var(--ink-dim);
    max-width: 58ch;
    line-height: 1.55;
    opacity: 0;
    animation: fadeUp 0.8s ease 0.45s forwards;
  }
  .hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 28px;
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--ink-mute);
    opacity: 0;
    animation: fadeUp 0.8s ease 0.55s forwards;
  }
  @keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
  @media (max-width: 640px) {
    .page-hero { padding: 140px 20px 60px; min-height: 50vh; }
  }

  /* ===== QUIZ ===== */
  .quiz-section { padding-top: 80px; }
  .quiz-shell { max-width: 720px; margin: 0 auto; }
  .quiz-progress {
    height: 2px;
    background: var(--line);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 12px;
  }
  .quiz-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .quiz-count {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-mute);
    letter-spacing: 0.08em;
    margin-bottom: 28px;
  }
  .score-form { display: grid; gap: 0; }
  .score-stage {
    border: 1px solid var(--line);
    border-radius: var(--radius-card, 4px);
    background: var(--bg-soft);
    padding: 40px 36px;
    margin: 0;
    min-width: 0;
    position: relative;
    overflow: hidden;
  }
  .score-stage::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 0; height: 2px;
    background: var(--accent);
    transition: width 0.4s ease;
  }
  .score-stage.answered::before { width: 100%; }
  .score-stage legend,
  .score-q {
    font-family: var(--display);
    font-weight: 400;
    font-size: clamp(22px, 3vw, 28px);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--ink);
    padding: 0;
    margin: 0 0 8px;
  }
  .score-stage .q-help {
    font-size: 14px;
    color: var(--ink-mute);
    margin: 0 0 24px;
    line-height: 1.5;
  }
  .score-stage { animation: stage-in 0.35s cubic-bezier(0.16, 1, 0.3, 1); }
  @keyframes stage-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Option rows */
  .score-options { display: grid; gap: 12px; margin: 0; }
  .score-opt {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-card, 4px);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
  }
  .score-opt:hover { border-color: var(--ink-mute); background: var(--bg-elev); }
  .score-opt:active { transform: scale(0.99); }
  .score-opt input {
    position: absolute;
    opacity: 0;
    width: 1px; height: 1px;
  }
  .score-opt .opt-box {
    flex-shrink: 0;
    width: 20px; height: 20px;
    margin-top: 1px;
    border: 1.5px solid var(--ink-mute);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
  }
  .score-opt .opt-box::after {
    content: "";
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--bg);
    transform: scale(0);
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .score-opt.selected { border-color: var(--accent); background: rgba(212, 255, 60, 0.06); }
  .score-opt.selected .opt-box { border-color: var(--accent); background: var(--accent); }
  .score-opt.selected .opt-box::after { transform: scale(1); }
  .score-opt input:checked ~ .opt-label { color: var(--ink); }
  .score-opt input:checked + .opt-box { border-color: var(--accent); background: var(--accent); }
  .score-opt input:checked + .opt-box::after { transform: scale(1); }
  .score-opt input:focus-visible + .opt-box { outline: 2px solid var(--accent); outline-offset: 2px; }
  .score-opt .opt-label {
    font-size: 15px;
    line-height: 1.5;
    color: var(--ink-dim);
    transition: color 0.2s;
  }
  .score-opt.selected .opt-label { color: var(--ink); }

  /* Stage nav row */
  .stage-nav {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 28px;
  }
  .stage-nav .btn-primary,
  .stage-nav .btn-secondary { padding: 13px 24px; font-size: 14.5px; }
  .stage-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
  .stage-hint { font-size: 13px; color: var(--ink-mute); }
  .sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
  }

  /* Gate (email capture) — contact-form language */
  .score-gate { max-width: 720px; }
  .contact-alert {
    border-radius: var(--radius-card, 4px);
    padding: 16px 18px;
    margin-bottom: 28px;
    font-size: 15px;
    line-height: 1.5;
    border: 1px solid var(--line);
  }
  .contact-alert.ok    { border-color: var(--accent); background: rgba(212,255,60,0.08); color: var(--ink); }
  .contact-alert.error { border-color: var(--accent-2); background: rgba(255,91,46,0.08); color: var(--ink); }
  .score-gate .field { display: grid; gap: 8px; margin-bottom: 22px; }
  .score-gate .field label {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-dim);
  }
  .score-gate .field .req { color: var(--accent-2); }
  .score-gate .field .contact-note { text-transform: none; letter-spacing: 0; color: var(--ink-mute); }
  .score-gate .field input {
    width: 100%;
    box-sizing: border-box;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius-card, 4px);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    padding: 14px 16px;
    transition: border-color 0.2s, background 0.2s;
  }
  .score-gate .field input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-elev);
  }
  .score-gate .field .err { color: var(--accent-2); font-size: 13px; }
  .score-gate .hp-field,
  .score-form > .hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  .gate-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 28px; }
  .gate-fine { font-size: 13px; color: var(--ink-mute); margin-top: 18px; line-height: 1.6; }

  /* ===== RESULTS ===== */
  /* Top clearance matches .page-hero (180px) so the dial clears the fixed nav. */
  .result-section { padding: 180px 0 80px; }
  .result-shell { max-width: 720px; margin: 0 auto; text-align: center; }
  .score-eyebrow {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
  }
  .score-eyebrow::before {
    content: '';
    width: 32px; height: 1px;
    background: var(--accent);
  }
  .score-dial {
    position: relative;
    width: 180px; height: 180px;
    margin: 0 auto 28px;
    border-radius: 50%;
    background:
      conic-gradient(var(--accent) var(--val, 0%), var(--line) 0);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .score-dial::before {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: var(--bg);
  }
  .score-dial span {
    position: relative;
    z-index: 1;
    font-family: var(--mono);
    font-size: 56px;
    font-weight: 500;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
  }
  .score-band {
    font-family: var(--display);
    font-style: italic;
    font-weight: 300;
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1;
    letter-spacing: -0.03em;
    margin: 0 0 16px;
    color: var(--ink);
  }
  .score-band em { color: var(--accent); }
  .score-tagline {
    font-size: 18px;
    color: var(--ink-dim);
    margin: 0 auto 48px;
    max-width: 52ch;
    line-height: 1.6;
  }
  .score-reco { text-align: left; margin: 0 auto 48px; }
  .score-reco h2 {
    font-family: var(--display);
    font-weight: 500;
    font-size: 26px;
    letter-spacing: -0.02em;
    margin: 0 0 24px;
    color: var(--ink);
  }
  .score-reco-list { list-style: none; margin: 0; padding: 0; display: grid; }
  .score-reco-list li {
    color: var(--ink-dim);
    font-size: 15px;
    line-height: 1.65;
    padding: 18px 0 18px 22px;
    border-top: 1px solid var(--line);
    position: relative;
  }
  .score-reco-list li:last-child { border-bottom: 1px solid var(--line); }
  .score-reco-list li::before {
    content: '◆';
    position: absolute;
    left: 0;
    top: 24px;
    color: var(--accent);
    font-size: 9px;
  }
  .score-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
  .score-share-note { font-size: 13px; color: var(--ink-mute); line-height: 1.6; }

  /* ===== FOOTER ===== */
  footer {
    background: var(--bg-soft);
    border-top: 1px solid var(--line);
    padding: 64px 40px 32px;
  }
  .footer-grid {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 64px;
  }
  .footer-brand p {
    color: var(--ink-dim);
    font-size: 14px;
    margin-top: 16px;
    max-width: 36ch;
    line-height: 1.6;
  }
  .footer-col h4 {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--ink-mute);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 20px;
    font-weight: 500;
  }
  .footer-col ul { list-style: none; }
  .footer-col li { margin-bottom: 12px; }
  .footer-col a {
    color: var(--ink-dim);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
  }
  .footer-col a:hover { color: var(--accent); }
  .footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    padding-top: 32px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--ink-mute);
  }
  @media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    footer { padding: 48px 20px 24px; }
  }
  @media (max-width: 640px) {
    section { padding: 80px 20px; }
    .score-stage { padding: 28px 22px; }
    .score-cta { flex-direction: column; align-items: stretch; }
    .score-cta .btn-primary,
    .score-cta .btn-secondary { justify-content: center; }
    .gate-actions { flex-direction: column-reverse; align-items: stretch; }
    .gate-actions .btn-primary,
    .gate-actions .btn-secondary { justify-content: center; }
    .stage-nav { flex-direction: column-reverse; align-items: stretch; }
    .stage-nav .btn-primary,
    .stage-nav .btn-secondary { justify-content: center; }
  }
  @media (max-width: 480px) {
    .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    html { scroll-behavior: auto; }
  }
