/* ── BASE ───────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--black);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: var(--fw-body);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: auto;
  /* Light-on-dark type renders THINNER under grayscale antialiasing. Pin
     smoothing to the platform default so nothing downstream sets
     `antialiased` and quietly bleeds weight out of every page. */
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
}

/* ── TYPE SCALE ─────────────────────────────────────────────────────── */
/* These normalise a long tail of per-page font sizes (11–13px) that were
   set before the scale existed, so `!important` is load-bearing here —
   dropping it drops those elements back to their old smaller values. */

/* Body copy. Weight 500, not 400: IBM Plex Mono's Regular is thin-stemmed
   and reads gray on black. Leading tightened from ~1.9 to 1.7 — wide
   leading on small mono scatters a paragraph into loose stripes. */
/* Scoped away from elements with their own typography:
   · nav/menu `li`s carry the nav links — an unscoped rule pushed them to
     body size and leaked it into the anchors via inheritance, which is why
     nav type never matched its own spec;
   · the uppercase tracked taglines (`.cs-tagline`, `.page-hero-sub`) are <p>
     by markup but labels by design, and set at body size they turn into
     blocky slabs. `.hero-sub` used to be in this group and is deliberately
     no longer: it is the only sentence in the home hero, so it wants the
     body rule, not the label rule;
   · `.quote-text` is the pull quote — a <p> by markup, display type by
     design. It asks for clamp(19px, 2.8vw, 27px) and was silently losing to
     this rule, so the strip read as a stray sentence marooned in 100px of
     padding instead of a quote.
   · legal documents use their own reading and print typography.
   Excluding them here rather than out-specifying them below: this rule
   carries !important, so the label rule cannot win on specificity alone. */
body :is(p, li):not(
  nav li, .nav-center li, .menu-links li, .footer-socials li,
  .legal-content p, .legal-content li,
  .cs-tagline, .page-hero-sub, .quote-text
) {
  font-size: 16px !important;
  font-weight: var(--fw-body);
  line-height: 1.65;
  letter-spacing: 0.2px;
}

/* Uppercase micro-labels. Wide tracking is the instrument-panel voice and
   stays — but tracked-out caps go weak fast, so they carry 600.
   The `*-sub` entries are <p> elements, so the body rule above was sizing
   them as body copy — but they are uppercase and tracked 3–4px, and set at
   body size they turn into big blocky slabs. They belong here. */
body :is(
  .bottom-ticker-item,
  .section-label,
  .page-hero-label,
  .page-hero-sub,
  .cs-tagline,
  .drop-tagline,
  .drop-meta,
  .story-label,
  .pm-label,
  .pm-formats,
  .pm-price-note,
  .spec-key,
  .footer-tagline,
  .footer-socials a,
  .footer-copy,
  .footer-legal
) {
  font-size: 12px !important;
  font-weight: var(--fw-med);
}

body :is(.spec-val) {
  font-size: 14px !important;
  font-weight: var(--fw-body);
}

body :is(button, .buy-btn, .try-btn, .buy-btn-lg, .try-btn-lg, .drop-link) {
  font-size: 13px !important;
  font-weight: var(--fw-bold);
}

/* Nothing on the site should render at Light — it is the main reason body
   copy reads washed out. Catches the handful of per-page `font-weight:300`
   rules without needing to hunt each one down. */
body :is(.quote-text, .story-body, .np-tip, .hw-sub) {
  font-weight: var(--fw-body);
}

/* ── DISPLAY TYPE ───────────────────────────────────────────────────── */
/* Bebas Neue ships ONE weight (400). Anything asking for 700 — `h1` does
   by default — gets browser synthetic bold, which smears the glyphs and
   makes headings inconsistent with each other. Turn synthesis off and buy
   the weight back with a hairline same-color stroke instead: it scales
   with font-size and keeps the counters clean.
   Tracking comes down too — condensed caps read HEAVIER set tight; the
   old 3–4px spacing was pulling the stems apart and thinning the line.
   NOTE: add new Bebas-using classes here, or give them `.display`.
   `.giant-text` is deliberately excluded — it uses a purple outline. */
body :is(
  .display,
  .cs-logo,
  .hero-title,
  .hw-title,
  .page-hero-title,
  .story-title,
  .drop-name,
  .value-num,
  .prose-inner h2,
  .product-meta h1,
  .pm-price,
  .kc-name,
  .account-title,
  .purchase-name,
  .checkout-title,
  .checkout-panel h2,
  .duo-title,
  .try-hero h1,
  .dl-stage .dl-name,
  .tc-price,
  .tf-name,
  .po-name,
  .sf-meta h2,
  .engine-title,
  .sheet-head h1,
  .logo-word,
  .footer-logo
) {
  font-family: var(--font-display);
  font-weight: 400;
  font-synthesis-weight: none;
  -webkit-text-stroke: var(--display-stroke) currentColor;
  paint-order: stroke fill;
}

/* `.giant-text` is the one display element that must NOT take the stroke —
   its whole effect is a hollow purple outline. It still has to opt out of
   synthetic bold, or it inherits body weight 500 and Bebas gets smeared. */
body .giant-text {
  font-weight: 400;
  font-synthesis-weight: none;
}

/* Display faces must not inherit the 1.6 body leading — condensed caps set
   on body leading float apart and read as a list, not a headline. Only
   applied where the class does not already set its own line-height. */
body :is(.prose-inner h2, .value-num, .kc-name, .checkout-panel h2, .purchase-name, .engine-title, .tf-name, .po-name) {
  line-height: 1.02;
}

/* Large display sizes: pull the tracking in further. Prefixed with `body`
   so these beat the equally-specific per-page rules they supersede. */
body :is(.cs-logo, .hero-title, .hw-title, .page-hero-title, .try-hero h1, .checkout-title, .account-title) {
  letter-spacing: 1.5px;
}
body :is(.story-title, .drop-name, .product-meta h1, .sf-meta h2, .dl-stage .dl-name, .duo-title, .prose-inner h2) {
  letter-spacing: 1px;
}

/* ── TYPE ALIGNMENT ─────────────────────────────────────────────────── */
/* Balanced rag on display headings and centered measures on hero copy so
   multi-line text sits as one coherent block on every page. */
:is(.hero-title, .page-hero-title, .story-title, .drop-name, .quote-text) {
  text-wrap: balance;
}
:is(.hero-sub, .cs-tagline, .page-hero-sub, .drop-body) {
  text-wrap: pretty;
}
.hero-sub, .cs-tagline, .quote-text {
  margin-left: auto; margin-right: auto;
}

/* ── FOCUS / PRESSED STATES ─────────────────────────────────────────── */
:is(a, button, [role="link"]):focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
}
:is(.buy-btn, .try-btn, .buy-btn-lg, .try-btn-lg):active {
  transform: translateY(0);
  transition-duration: .06s;
}

/* ── SCROLLBAR ──────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--pu-low); }

/* ── ANIMATIONS ─────────────────────────────────────────────────────── */
@keyframes fadein  { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:none; } }
@keyframes fadein2 { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:none; } }
@keyframes fadein3 { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:none; } }
@keyframes tickerscroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Slow attention blink — used by the hero ".point" period and pill dot */
@keyframes dotblink {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 16px rgba(77,255,170,0.65)); }
  50%      { opacity: 0.2; filter: drop-shadow(0 0 0 rgba(77,255,170,0)); }
}
/* Touch devices get the blink without the animated glow. This runs on the
   hero's neon period — a glyph set at up to 190px, on the screen a phone lands
   on — and an animated `filter` repaints it on the main thread every frame for
   as long as the hero is in view. The opacity half of the blink is what
   actually reads; the compositor handles that on its own. The glow stays, it
   just stops moving. */
@keyframes dotblink-flat {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.2; }
}
/* `body` prefix for the same reason the type rules above carry one: the rule
   this supersedes lives in index.html's own <style>, which is later in the
   cascade and equally specific. */
@media (pointer: coarse), (max-width: 620px) {
  body .hero-title .ht-point em {
    animation-name: dotblink-flat;
    filter: drop-shadow(0 0 12px rgba(77,255,170,0.5));
  }
}

/* Smoother, staggered scroll-reveal. Overrides the per-page inline
   `.js-reveal .reveal` rule via the extra `html` in the selector;
   --reveal-delay is set per element by main.js. */
html.js-reveal .reveal {
  transition:
    opacity .7s cubic-bezier(0.22, 1, 0.36, 1),
    transform .7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0s);
}

/* Cards that both reveal on scroll AND lift on hover need one transition list
   covering both, or this rule's `transition-delay` applies to the hover too —
   which is why hovering a drop card used to lag by up to 360ms of stagger.
   Per-property delays keep the reveal staggered while the hover stays instant,
   and the hover lift uses `translate` so it never collides with the reveal's
   own `transform`. */
html.js-reveal :is(.drop-card, .value-tile, .duo-tile, .engine-tile, .knob-cell, .tf-cell, .poll-option) {
  transition:
    opacity .7s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0s),
    transform .7s cubic-bezier(0.22, 1, 0.36, 1) var(--reveal-delay, 0s),
    translate .22s ease,
    background .22s ease,
    box-shadow .22s ease,
    border-color .22s ease;
}

/* Slow drifting starfield — two layers move in opposite diagonals for parallax */
@keyframes drift-a { from { transform: translate3d(0,0,0); } to { transform: translate3d(-30px,-22px,0); } }
@keyframes drift-b { from { transform: translate3d(0,0,0); } to { transform: translate3d(26px,18px,0); } }

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