/* ==========================================================================
   AleCodex Software Solutions — core stylesheet
   Dark, blue-gradient brand system. No frameworks, no build step.
   ========================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  /* Brand */
  --blue-500: #1e88ff;
  --blue-600: #0a5cff;
  --blue-400: #4fa8ff;
  --cyan-300: #7cd4ff;

  /* Surfaces */
  --bg: #04060c;
  --bg-elev: #070a13;
  --surface: rgba(255, 255, 255, 0.026);
  --surface-hi: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.08);
  --border-hi: rgba(120, 170, 255, 0.32);

  /* Type */
  --text: #e9edf6;
  --text-dim: #9aa5ba;
  --text-faint: #6b7688;

  /* Gradients */
  --grad-blue: linear-gradient(135deg, var(--blue-400) 0%, var(--blue-600) 100%);
  --grad-silver: linear-gradient(160deg, #ffffff 0%, #c3ccdc 55%, #8e99ac 100%);
  --grad-brand: linear-gradient(100deg, #ffffff 0%, #dbe4f2 38%, var(--blue-400) 62%, var(--blue-600) 100%);

  /* Shape */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.45s;

  /* Layout */
  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 48px);
  --nav-h: 74px;

  /* Fonts */
  --font-display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ---------- 2. Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* Long words, URLs and email addresses must wrap rather than push the
     layout sideways on a narrow phone. */
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: rgba(30, 136, 255, 0.16);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
}

h1 { font-size: clamp(2.05rem, 6vw, 4.1rem); }
h2 { font-size: clamp(1.62rem, 4vw, 2.85rem); }
h3 { font-size: clamp(1.08rem, 2vw, 1.35rem); }

/* Stops headings breaking with one orphaned word on a phone. */
h1, h2, h3 { text-wrap: balance; }

p { margin: 0; }

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

:focus-visible {
  outline: 2px solid var(--blue-400);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 3. Layout primitives ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* overflow:hidden keeps the blurred .glow circles from widening the page on
   narrow screens, rather than relying on body{overflow-x:hidden} to mask it. */
.section { padding-block: clamp(60px, 11vw, 132px); position: relative; overflow: hidden; }
.section--tight { padding-block: clamp(48px, 8vw, 92px); }

.section-head { max-width: 700px; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blue-400);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blue-500));
}
.section-head--center .eyebrow::before { display: none; }

.lede {
  color: var(--text-dim);
  font-size: clamp(1rem, 1.5vw, 1.09rem);
  margin-top: 20px;
  max-width: 62ch;
}
.section-head--center .lede { margin-inline: auto; }

.grad-text {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.blue-text { color: var(--blue-400); }

/* Ambient backdrops */
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  pointer-events: none;
  z-index: 0;
}
.glow--a { width: 620px; height: 620px; background: rgba(30, 136, 255, 0.16); top: -220px; right: -180px; }
.glow--b { width: 520px; height: 520px; background: rgba(10, 92, 255, 0.12); bottom: -240px; left: -200px; }

.grid-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
  pointer-events: none;
  z-index: 0;
}

.section > .wrap { position: relative; z-index: 1; }

/* ---------- 4. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
              background 0.25s var(--ease), border-color 0.25s var(--ease);
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; transition: transform 0.25s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

.btn--primary {
  background: var(--grad-blue);
  color: #fff;
  box-shadow: 0 8px 26px -8px rgba(30, 136, 255, 0.65);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px -10px rgba(30, 136, 255, 0.8);
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover {
  border-color: var(--border-hi);
  background: var(--surface-hi);
  transform: translateY(-2px);
}

.btn--sm { padding: 10px 20px; font-size: 0.86rem; }
.btn--block { width: 100%; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue-400);
}
.link-arrow svg { width: 15px; height: 15px; transition: transform 0.25s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- 5. Header ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s;
  border-bottom: 1px solid transparent;
}
.header.is-stuck {
  background: rgba(4, 6, 12, 0.82);
  backdrop-filter: blur(16px) saturate(160%);
  border-bottom-color: var(--border);
}

.header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark { width: 38px; height: 38px; flex: none; }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
}
.brand__name span { color: var(--blue-400); }
.brand__sub {
  display: block;
  font-size: 0.56rem;
  letter-spacing: 0.34em;
  color: var(--text-faint);
  margin-top: 5px;
  font-weight: 500;
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 0.92rem;
  color: var(--text-dim);
  transition: color 0.2s, background 0.2s;
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.is-active { color: var(--text); }
.nav a.is-active::after {
  content: "";
  display: block;
  height: 2px;
  width: 18px;
  margin: 3px auto -5px;
  border-radius: 2px;
  background: var(--grad-blue);
}

/* The CTA inside the nav belongs to the mobile drawer only — on desktop the
   one in .header__cta covers it, and showing both duplicates the button. */
.nav .btn { display: none; }

.header__cta { display: flex; align-items: center; gap: 12px; }

.burger {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 0;
  place-items: center;
}
.burger span {
  display: block;
  width: 17px;
  height: 1.6px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.burger span + span { margin-top: 4.5px; }
.burger.is-open span:nth-child(1) { transform: translateY(6.1px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-6.1px) rotate(-45deg); }

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(56px, 9vw, 104px));
  padding-bottom: clamp(64px, 9vw, 108px);
  overflow: hidden;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(36px, 6vw, 72px);
  align-items: center;
  position: relative;
  z-index: 1;
}
/* Without this, the code panel's long <pre> line gives its grid track an
   automatic minimum equal to that line's width, which drags the whole
   column (heading included) wider than a phone screen. min-width:0 lets the
   track shrink and the <pre> scroll inside itself instead. */
.hero__inner > * { min-width: 0; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px 7px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 26px;
}
.pill b {
  background: var(--grad-blue);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.hero h1 { margin-bottom: 24px; }
.hero__lede {
  color: var(--text-dim);
  font-size: clamp(1.03rem, 1.7vw, 1.16rem);
  max-width: 56ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 36px;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 38px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--text-faint);
}
.hero__meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero__meta svg { width: 15px; height: 15px; color: var(--blue-400); flex: none; }

/* Hero visual — code panel */
.code-panel {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(12, 18, 32, 0.9), rgba(6, 9, 16, 0.9));
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
  overflow: hidden;
  max-width: 100%;
  transform: perspective(1400px) rotateY(-7deg) rotateX(2deg);
  transition: transform 0.6s var(--ease);
}
.code-panel:hover { transform: perspective(1400px) rotateY(-3deg) rotateX(1deg); }

.code-panel__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.018);
}
.dot { width: 10px; height: 10px; border-radius: 50%; background: #2b3446; }
.dot:nth-child(3) { background: var(--blue-600); }
.code-panel__file {
  margin-left: 8px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.74rem;
  color: var(--text-faint);
}

.code-panel pre {
  margin: 0;
  padding: 22px 20px 26px;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.85;
  overflow-x: auto;
  color: #c7d2e4;
}
.c-key { color: #7cb8ff; }
.c-fn { color: #a8dcff; }
.c-str { color: #8fe3b0; }
.c-com { color: #566379; font-style: italic; }
.c-num { color: #ffb86b; }

.code-panel__foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--text-faint);
  background: rgba(30, 136, 255, 0.045);
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #35d67f;
  box-shadow: 0 0 0 0 rgba(53, 214, 127, 0.6);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 9px rgba(53, 214, 127, 0); }
  100% { box-shadow: 0 0 0 0 rgba(53, 214, 127, 0); }
}

/* ---------- 7. Pillar strip ---------- */
.pillars {
  border-block: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.014);
}
.pillars__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
}
.pillar {
  background: var(--bg);
  padding: 30px clamp(16px, 2.4vw, 30px);
  text-align: center;
  transition: background 0.3s var(--ease);
}
.pillar:hover { background: var(--bg-elev); }
.pillar svg { width: 28px; height: 28px; margin: 0 auto 14px; color: var(--blue-400); }
.pillar h3 {
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.pillar p { font-size: 0.85rem; color: var(--text-faint); line-height: 1.55; }

/* ---------- 8. Cards / services ---------- */
.cards {
  display: grid;
  /* min(300px, 100%) so a single card can never demand more width than the
     screen has — plain minmax(300px,…) overflows on phones under ~320px. */
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 20px;
}
.cards > * { min-width: 0; }

.card {
  position: relative;
  padding: 30px 28px 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.036), rgba(255, 255, 255, 0.012));
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(30, 136, 255, 0.13), transparent 62%);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--border-hi);
  box-shadow: 0 26px 60px -30px rgba(0, 0, 0, 0.9);
}
.card:hover::after { opacity: 1; }
.card > * { position: relative; z-index: 1; }

.card__icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  border: 1px solid var(--border-hi);
  background: rgba(30, 136, 255, 0.1);
  margin-bottom: 22px;
}
.card__icon svg { width: 23px; height: 23px; color: var(--blue-400); }

.card h3 { margin-bottom: 12px; }
.card p { color: var(--text-dim); font-size: 0.94rem; }

.card__list { margin-top: 20px; display: grid; gap: 9px; }
.card__list li {
  display: flex;
  gap: 10px;
  font-size: 0.87rem;
  color: var(--text-faint);
  line-height: 1.5;
}
.card__list li::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--blue-500);
}

.card__index {
  position: absolute;
  top: 22px;
  right: 26px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  opacity: 0.5;
  z-index: 1;
}

/* ---- 8b. Care plans (pricing tiers) ---- */
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
  gap: 20px;
  align-items: stretch;
}
.plan {
  display: flex;
  flex-direction: column;
  padding: 32px 28px 34px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.036), rgba(255, 255, 255, 0.012));
  position: relative;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.plan:hover { transform: translateY(-4px); border-color: var(--border-hi); }

/* Featured (middle) tier — lifted and outlined in brand blue. */
.plan--featured {
  border-color: var(--border-hi);
  background: linear-gradient(180deg, rgba(30, 136, 255, 0.1), rgba(255, 255, 255, 0.015));
  box-shadow: 0 26px 60px -34px rgba(30, 136, 255, 0.55);
}
.plan__badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--grad-blue);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 8px 20px -8px rgba(30, 136, 255, 0.7);
}
.plan__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.plan__tagline { color: var(--text-dim); font-size: 0.9rem; margin-top: 8px; min-height: 2.6em; }
.plan__price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 20px 0 4px;
}
.plan__price b {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.plan__price span { color: var(--text-faint); font-size: 0.9rem; }
.plan__meta { font-size: 0.8rem; color: var(--text-faint); margin-bottom: 22px; }
/* The offer flash supplies its own gap, so drop the meta line's. */
.plan__meta:has(+ .plan__offer) { margin-bottom: 10px; }

.plan .btn { margin-bottom: 24px; }

.plan__features { display: grid; gap: 11px; }
.plan__features li {
  position: relative;
  padding-left: 26px;
  font-size: 0.89rem;
  color: var(--text-dim);
  line-height: 1.5;
}
/* CSS-drawn tick — avoids repeating an inline SVG on every line. */
.plan__features li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 6px;
  height: 11px;
  border: solid var(--blue-400);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.plan__features li b { color: var(--text); font-weight: 600; }
.plan__features li.plan__inherit {
  padding-left: 0;
  color: var(--text-faint);
  font-style: italic;
  font-size: 0.85rem;
}
.plan__features li.plan__inherit::before { display: none; }

/* What's-not-included panel */
.exclusions {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  padding: 30px clamp(24px, 4vw, 40px);
}
.exclusions h3 { font-size: 1.05rem; margin-bottom: 6px; }
.exclusions p { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 20px; }
.exclude-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 10px 28px;
}
.exclude-list li {
  position: relative;
  padding-left: 26px;
  font-size: 0.88rem;
  color: var(--text-faint);
  line-height: 1.5;
}
.exclude-list li::before {
  content: "\00d7";
  position: absolute;
  left: 4px;
  top: -1px;
  color: #ff6b6b;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
}

/* ---------- 9. Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 20px;
}
.stat {
  padding: 30px 26px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  text-align: center;
}
.stat__num {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 4.6vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat__label {
  margin-top: 12px;
  font-size: 0.86rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ---------- 10. Process ---------- */
.steps { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.step {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: clamp(18px, 3vw, 40px);
  padding: 30px clamp(22px, 3vw, 34px);
  background: var(--bg);
  transition: background 0.3s var(--ease);
}
.step:hover { background: var(--bg-elev); }
.step__num {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px rgba(120, 170, 255, 0.55);
  line-height: 1;
}
.step h3 { margin-bottom: 10px; }
.step p { color: var(--text-dim); font-size: 0.94rem; max-width: 68ch; }

/* ---------- 11. Tech stack ---------- */
.stack-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 22px; }
.stack-group {
  padding: 26px 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.stack-group h3 {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue-400);
  margin-bottom: 18px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.028);
  font-size: 0.81rem;
  color: var(--text-dim);
  transition: border-color 0.25s, color 0.25s, transform 0.25s var(--ease);
}
.chip:hover { border-color: var(--border-hi); color: var(--text); transform: translateY(-2px); }

/* ---------- 12. Split feature ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(36px, 6vw, 72px);
  align-items: center;
}
.split > * { min-width: 0; }
.split--reverse .split__media { order: -1; }

.media-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, rgba(30, 136, 255, 0.1), rgba(255, 255, 255, 0.02));
  padding: 34px 30px;
  position: relative;
  overflow: hidden;
}
.media-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at 30% 20%, #000, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 30% 20%, #000, transparent 72%);
}
.media-card > * { position: relative; }

.check-list { display: grid; gap: 15px; margin-top: 28px; }
.check-list li { display: flex; gap: 13px; align-items: flex-start; }
.check-list svg { width: 20px; height: 20px; flex: none; color: var(--blue-400); margin-top: 2px; }
.check-list b { display: block; font-family: var(--font-display); font-weight: 600; margin-bottom: 3px; }
.check-list span { color: var(--text-dim); font-size: 0.9rem; line-height: 1.55; }

/* ---------- 13. Timeline ---------- */
.timeline { position: relative; display: grid; gap: 4px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: linear-gradient(180deg, var(--blue-500), rgba(30, 136, 255, 0.06));
}
.tl-item { position: relative; padding: 0 0 34px 40px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--blue-500);
  box-shadow: 0 0 0 4px rgba(30, 136, 255, 0.12);
}
.tl-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  margin-bottom: 8px;
}
.tl-item h3 { font-size: 1.14rem; }
.tl-item__org { color: var(--blue-400); font-size: 0.92rem; font-weight: 500; }
.tl-item__date {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.76rem;
  color: var(--text-faint);
  letter-spacing: 0.03em;
}
.tl-item ul { display: grid; gap: 8px; margin-top: 12px; }
.tl-item ul li {
  display: flex;
  gap: 10px;
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.6;
}
.tl-item ul li::before {
  content: "";
  flex: none;
  width: 5px; height: 5px;
  margin-top: 9px;
  border-radius: 50%;
  background: rgba(120, 170, 255, 0.5);
}

/* ---------- 14. Accordion (FAQ) ---------- */
.faq { display: grid; gap: 12px; max-width: 860px; margin-inline: auto; }
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.faq details[open] { border-color: var(--border-hi); background: var(--surface-hi); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 11px;
  height: 11px;
  border-right: 1.8px solid var(--blue-400);
  border-bottom: 1.8px solid var(--blue-400);
  transform: rotate(45deg);
  transition: transform 0.3s var(--ease);
  margin-top: -4px;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.faq__body { padding: 0 24px 22px; color: var(--text-dim); font-size: 0.94rem; }

/* ---------- 15. CTA band ---------- */
.cta-band {
  position: relative;
  border: 1px solid var(--border-hi);
  border-radius: var(--r-xl);
  padding: clamp(40px, 6vw, 68px) clamp(28px, 5vw, 60px);
  background: linear-gradient(135deg, rgba(30, 136, 255, 0.16), rgba(10, 92, 255, 0.05) 55%, transparent);
  overflow: hidden;
  text-align: center;
}
.cta-band::before {
  content: "";
  position: absolute;
  width: 500px; height: 500px;
  background: rgba(30, 136, 255, 0.2);
  filter: blur(120px);
  top: -260px; left: 50%;
  transform: translateX(-50%);
}
.cta-band > * { position: relative; }
.cta-band .lede { margin-inline: auto; }
.cta-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 34px;
}

/* ---------- 16. Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: start;
}
.contact-grid > * { min-width: 0; }

.info-list { display: grid; gap: 12px; margin-top: 32px; }
.info-item {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease), background 0.3s;
}
.info-item:hover { border-color: var(--border-hi); transform: translateX(4px); background: var(--surface-hi); }
.info-item__icon {
  width: 42px; height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(30, 136, 255, 0.12);
  border: 1px solid var(--border-hi);
}
.info-item__icon svg { width: 19px; height: 19px; color: var(--blue-400); }
.info-item small {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 3px;
}
.info-item strong { font-weight: 500; font-size: 0.95rem; word-break: break-word; }

/* Form */
.form-card {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
  padding: clamp(26px, 4vw, 40px);
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.field label span { color: var(--blue-400); }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: rgba(4, 6, 12, 0.6);
  color: var(--text);
  font-family: inherit;
  /* 16px minimum: anything smaller makes iOS Safari zoom in on focus and
     leaves the visitor stranded mid-form. */
  font-size: 16px;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.field textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234fa8ff' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 42px;
}
.field select option { background: #0a0e18; color: var(--text); }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(30, 136, 255, 0.16);
  background: rgba(4, 6, 12, 0.9);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.hp { position: absolute; left: -9999px; opacity: 0; }

/* Available to screen readers and search engines, invisible on screen. Used
   for section headings that the design carries visually but never spells out,
   so the h1 -> h2 -> h3 order stays unbroken. Clip rather than display:none,
   which would remove it from the accessibility tree entirely. */
.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;
}

.form-note { font-size: 0.8rem; color: var(--text-faint); margin-top: 16px; text-align: center; }

.form-status {
  margin-top: 16px;
  padding: 13px 16px;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  display: none;
}
.form-status.is-visible { display: block; }
.form-status--ok { background: rgba(53, 214, 127, 0.1); border: 1px solid rgba(53, 214, 127, 0.35); color: #8ff0bc; }
.form-status--err { background: rgba(255, 90, 90, 0.1); border: 1px solid rgba(255, 90, 90, 0.35); color: #ffb0b0; }

/* ---------- 17. Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  padding-block: clamp(48px, 7vw, 72px) 28px;
  position: relative;
}
.footer__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: clamp(28px, 4vw, 52px);
  padding-bottom: 44px;
}
.footer__about { color: var(--text-faint); font-size: 0.9rem; margin-top: 18px; max-width: 34ch; }
.footer h2 {
  font-family: var(--font-display);
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 16px;
}
.footer__links { display: grid; gap: 10px; }
.footer__links a { color: var(--text-faint); font-size: 0.9rem; transition: color 0.2s, padding-left 0.25s var(--ease); }
.footer__links a:hover { color: var(--blue-400); padding-left: 4px; }

.socials { display: flex; gap: 10px; margin-top: 20px; }
.socials a {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 0.25s, transform 0.25s var(--ease), background 0.25s;
}
.socials a:hover { border-color: var(--border-hi); transform: translateY(-3px); background: var(--surface-hi); }
.socials svg { width: 17px; height: 17px; color: var(--text-dim); }
.socials a:hover svg { color: var(--blue-400); }

.footer__bottom {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* Legal row. The cookie link is a <button> because it opens a dialog rather
   than navigating anywhere — styled to sit flush with the anchors beside it. */
.footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 20px;
}
.footer__legal a,
.footer__legal button {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--text-faint);
  transition: color 0.2s;
}
.footer__legal a:hover,
.footer__legal button:hover { color: var(--blue-400); }

@media (max-width: 720px) {
  .footer__bottom { justify-content: flex-start; }
  .footer__legal { order: -1; width: 100%; padding-bottom: 4px; }
}

/* ---------- 18. Page header (inner pages) ---------- */
.page-head {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(50px, 7vw, 82px));
  padding-bottom: clamp(44px, 6vw, 66px);
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.page-head h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
.crumbs { font-size: 0.82rem; color: var(--text-faint); margin-bottom: 18px; }
.crumbs a:hover { color: var(--blue-400); }
.crumbs span { margin-inline: 8px; opacity: 0.5; }

/* ---------- 19. Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- 20. Responsive ---------- */
@media (max-width: 1000px) {
  .hero__inner { grid-template-columns: 1fr; }
  .code-panel { transform: none; }
  .split, .contact-grid { grid-template-columns: 1fr; }
  .split--reverse .split__media { order: 0; }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .pillars__grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .burger { display: grid; }
  .header__cta .btn { display: none; }

  .nav {
    position: fixed;
    inset: var(--nav-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 16px var(--gutter) 26px;
    background: rgba(4, 6, 12, 0.97);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease), visibility 0.3s;
    max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto;
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav a { padding: 13px 14px; border-radius: var(--r-sm); font-size: 1rem; }
  .nav a.is-active::after { display: none; }
  .nav a.is-active { background: var(--surface); color: var(--blue-400); }
  .nav .btn { display: inline-flex; margin-top: 12px; }
  .nav .btn--primary { color: #fff; }
}

/* ---- Phones ---- */
@media (max-width: 620px) {
  :root { --nav-h: 64px; }

  .step { grid-template-columns: 1fr; gap: 8px; }
  .step__num { font-size: 1.35rem; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .footer__top { grid-template-columns: 1fr; gap: 30px; padding-bottom: 34px; }
  .brand__sub { display: none; }

  /* Two-up reads better than four stacked full-width blocks. */
  .pillars__grid { grid-template-columns: repeat(2, 1fr); }
  .pillar { padding: 24px 14px; }
  .pillar p { font-size: 0.8rem; }

  /* Full-width buttons are easier to hit than side-by-side ones. */
  .hero__actions .btn,
  .cta-band__actions .btn { flex: 1 1 100%; width: 100%; }

  .hero { padding-top: calc(var(--nav-h) + 44px); padding-bottom: 56px; }
  .hero__meta { gap: 8px 20px; margin-top: 30px; padding-top: 22px; font-size: 0.82rem; }
  .page-head { padding-top: calc(var(--nav-h) + 38px); padding-bottom: 34px; }

  /* The code panel is decoration on a phone: shrink it, don't let it dominate. */
  .code-panel pre { font-size: 0.68rem; padding: 16px 14px 18px; line-height: 1.7; }
  .code-panel__bar, .code-panel__foot { padding-inline: 14px; }

  .card { padding: 24px 20px 26px; }
  .card__icon { width: 44px; height: 44px; margin-bottom: 16px; }
  .card__index { top: 18px; right: 20px; }
  .media-card { padding: 24px 20px; }
  .cta-band { padding: 34px 22px; border-radius: var(--r-lg); }
  .form-card { padding: 24px 20px 28px; }
  .plan { padding: 26px 22px 28px; }
  .exclusions { padding: 24px 20px; }
  .stat { padding: 24px 18px; }
  .stat__num { font-size: clamp(2rem, 9vw, 2.6rem); }
  .info-item { padding: 14px 16px; gap: 13px; }
  .faq summary { padding: 17px 18px; font-size: 0.95rem; }
  .faq__body { padding: 0 18px 19px; font-size: 0.9rem; }
  .tl-item { padding-left: 32px; padding-bottom: 28px; }
  .stack-group { padding: 22px 18px; }

  /* 38px is below the comfortable tap target size on a touchscreen. */
  .socials a { width: 44px; height: 44px; }
}

/* ---- Small phones ---- */
@media (max-width: 420px) {
  :root { --gutter: 18px; }
  .pillars__grid { grid-template-columns: 1fr; }
  .hero__meta { flex-direction: column; gap: 9px; }
  .eyebrow { font-size: 0.68rem; letter-spacing: 0.16em; }
  .btn { padding: 13px 20px; font-size: 0.9rem; }
  .chip { font-size: 0.78rem; padding: 5px 11px; }
  .code-panel pre { font-size: 0.62rem; }
}

/* Keeps content clear of the rounded corners and notch in landscape. */
@supports (padding: max(0px)) {
  .wrap {
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
  }
  .footer { padding-bottom: max(28px, env(safe-area-inset-bottom)); }

  /* Scoped to the drawer only — on desktop .nav is a flex row and any
     padding-bottom here would stretch the header. */
  @media (max-width: 820px) {
    .nav { padding-bottom: max(26px, env(safe-area-inset-bottom)); }
  }
}

@media (prefers-reduced-motion: reduce) {
  /* animation-delay must be zeroed too: a 0.01ms animation that still waits
     600ms to start leaves the element parked on its `from` keyframe, which for
     the staggered entrances below means invisible content. */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; filter: none; }
}

/* ---------- 21. Print ---------- */
@media print {
  .header, .footer, .cta-band, .burger,
  .scroll-progress, .to-top, .cookie-banner, .cookie-modal, .legal__toc { display: none; }
  body { background: #fff; color: #000; }
  .legal { display: block; }
  .legal-table { border-color: #999; }
}

/* ==========================================================================
   22. Evidence section — cited statistics and CSS bar charts
   No charting library: each bar is a div whose width comes from a custom
   property, so the markup stays readable and the numbers stay in the text
   where screen readers and search engines can find them.
   ========================================================================== */

.figure {
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.036), rgba(255, 255, 255, 0.012));
  padding: clamp(24px, 3.5vw, 36px);
}
.figure + .figure { margin-top: 20px; }

.figure__head { margin-bottom: 26px; }
.figure__title { font-size: clamp(1.05rem, 2vw, 1.25rem); margin-bottom: 8px; }
.figure__sub { color: var(--text-dim); font-size: 0.92rem; line-height: 1.6; max-width: 62ch; }

.figures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 20px;
}
.figures-grid > * { min-width: 0; }

/* ---- Bar chart ---- */
.bar-chart { display: grid; gap: 18px; }

.bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  align-items: baseline;
}
.bar__label {
  font-size: 0.9rem;
  color: var(--text-dim);
  line-height: 1.45;
}
.bar__value {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--blue-400);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bar__track {
  grid-column: 1 / -1;
  position: relative;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  overflow: hidden;
}
.bar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  background: var(--grad-blue);
  box-shadow: 0 0 18px -4px rgba(30, 136, 255, 0.85);
  transition: width 1.1s var(--ease);
}
/* Bars fill only once the chart scrolls into view, and cascade left to right. */
.bar-chart.is-in .bar__fill { width: var(--pct, 0%); }
.bar-chart.is-in .bar:nth-child(1) .bar__fill { transition-delay: 0.05s; }
.bar-chart.is-in .bar:nth-child(2) .bar__fill { transition-delay: 0.17s; }
.bar-chart.is-in .bar:nth-child(3) .bar__fill { transition-delay: 0.29s; }
.bar-chart.is-in .bar:nth-child(4) .bar__fill { transition-delay: 0.41s; }
.bar-chart.is-in .bar:nth-child(5) .bar__fill { transition-delay: 0.53s; }

/* A muted bar for the "everyone else" comparison rows. */
.bar--muted .bar__value { color: var(--text-dim); }
.bar--muted .bar__fill {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

/* ---- Offer band ----
   Green rather than brand blue, so a promotion never reads as ordinary page
   chrome. Used for the free-first-month offer on the care plans. */
.offer-band {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-top: 28px;
  padding: 16px 20px;
  border: 1px solid rgba(53, 214, 127, 0.32);
  border-radius: var(--r-md);
  background: linear-gradient(120deg, rgba(53, 214, 127, 0.12), rgba(30, 136, 255, 0.05) 62%, transparent);
  max-width: 720px;
}
.offer-band__tag {
  flex: none;
  margin-top: 2px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #35d67f;
  color: #04120a;
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.offer-band p {
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--text-dim);
}
.offer-band strong { color: var(--text); font-weight: 600; }
.offer-band a {
  color: #8ff0bc;
  border-bottom: 1px solid rgba(143, 240, 188, 0.4);
}
.offer-band a:hover { color: #fff; border-bottom-color: #fff; }

/* Centred contexts: the band keeps its left-aligned text but centres as a block. */
.section-head--center .offer-band,
.cta-band .offer-band { margin-inline: auto; text-align: left; }

/* Per-plan flash, sitting just under the price. */
.plan__offer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #8ff0bc;
}
.plan__offer::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #35d67f;
  flex: none;
}

@media (max-width: 620px) {
  .offer-band { flex-direction: column; gap: 12px; padding: 15px 16px; }
}

/* ---- Before / after pairs ---- */
.ba { display: grid; gap: 28px; }

.ba__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 16px;
  margin-bottom: 13px;
}
.ba__label { font-size: 0.93rem; color: var(--text-dim); line-height: 1.45; }
.ba__delta {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--blue-400);
  white-space: nowrap;
}

.ba__pair { display: grid; gap: 9px; }
.ba__bar {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}
.ba__tag {
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.ba__track {
  position: relative;
  height: 24px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  overflow: hidden;
}
.ba__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 6px;
  transition: width 1.2s var(--ease);
}
/* A 240x reduction leaves a fill under half a pixel wide. The minimum keeps
   it visible; the figure beside the bar is what carries the actual value. */
.ba.is-in .ba__fill { width: max(var(--pct, 0%), 3px); }
.ba__fill--before { background: rgba(255, 255, 255, 0.17); }
.ba__fill--after {
  background: var(--grad-blue);
  box-shadow: 0 0 22px -5px rgba(30, 136, 255, 0.9);
}
.ba.is-in .ba__row:nth-child(1) .ba__fill--before { transition-delay: 0.05s; }
.ba.is-in .ba__row:nth-child(1) .ba__fill--after  { transition-delay: 0.25s; }
.ba.is-in .ba__row:nth-child(2) .ba__fill--before { transition-delay: 0.15s; }
.ba.is-in .ba__row:nth-child(2) .ba__fill--after  { transition-delay: 0.35s; }

.ba__num {
  font-family: var(--font-display);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ba__bar--before .ba__num { color: var(--text-faint); }

@media (max-width: 520px) {
  .ba__bar { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; }
  .ba__num { font-size: 0.8rem; }
}

/* ---- Citations ---- */
.stat__cite,
.figure__cite {
  display: block;
  margin-top: 12px;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--text-faint);
}
.stat__cite a,
.figure__cite a,
.sources a {
  color: var(--text-faint);
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  transition: color 0.2s, border-color 0.2s;
}
.stat__cite a:hover,
.figure__cite a:hover,
.sources a:hover { color: var(--blue-400); border-bottom-color: var(--blue-400); }

.sources {
  margin-top: 28px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.sources h3 {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.sources ol {
  display: grid;
  gap: 9px;
  counter-reset: src;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sources li {
  counter-increment: src;
  position: relative;
  padding-left: 26px;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-faint);
}
.sources li::before {
  content: "[" counter(src) "]";
  position: absolute;
  left: 0;
  font-family: ui-monospace, Consolas, monospace;
  color: var(--blue-400);
  opacity: 0.75;
}

@media (max-width: 620px) {
  .figure { padding: 22px 18px; }
  .bar__label { font-size: 0.86rem; }
  .sources { padding: 18px 16px; }
}

/* ==========================================================================
   23. Legal pages — privacy, cookies, terms
   ========================================================================== */

/* `overflow: clip` rather than the `hidden` inherited from .section: clip
   still contains the .glow circles but does NOT create a scroll container,
   so the sticky table of contents below keeps working. Browsers without
   `clip` fall back to `hidden` and simply lose the stickiness. */
.section--legal { overflow: clip; }

/* A narrower measure than the marketing pages. At the full 1180px wrap the
   body column ran to about 90 characters a line, which is well past the
   55–75 that stays comfortable to read — the single biggest reason a long
   legal page feels like hard work. */
.section--legal .wrap,
.page-head--legal .wrap { max-width: 1000px; }

.legal__stamp {
  display: block;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.legal__stamp time { color: var(--text-dim); }

.legal {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
/* The wide .legal-table sets a min-content floor of 520px, which an `auto`
   grid track has to honour — that pushed the whole column past the viewport
   on a phone. min-width:0 lets the track shrink so .table-scroll scrolls the
   table inside itself instead. */
.legal > * { min-width: 0; }

/* ---- Table of contents ---- */
.legal__toc {
  position: sticky;
  top: calc(var(--nav-h) + 20px);
  max-height: calc(100vh - var(--nav-h) - 44px);
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
}
.legal__toc h2 {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 14px;
}
.legal__toc ol {
  counter-reset: toc;
  display: grid;
  gap: 1px;
}
.legal__toc li { counter-increment: toc; }
.legal__toc a {
  display: block;
  position: relative;
  padding: 7px 12px 7px 32px;
  border-radius: var(--r-sm);
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--text-faint);
  transition: color 0.2s, background 0.2s, padding-left 0.25s var(--ease);
}
.legal__toc a::before {
  content: counter(toc);
  position: absolute;
  left: 12px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--text-faint);
  opacity: 0.7;
}
.legal__toc a:hover {
  color: var(--text);
  background: var(--surface);
  padding-left: 36px;
}
.legal__toc a.is-current {
  color: var(--blue-400);
  background: rgba(30, 136, 255, 0.09);
}
.legal__toc a.is-current::before { color: var(--blue-400); opacity: 1; }

/* ---- Prose ---- */
.legal__body { max-width: 660px; }

.legal__body > section {
  scroll-margin-top: calc(var(--nav-h) + 24px);
  padding-bottom: clamp(38px, 5vw, 54px);
  margin-bottom: clamp(38px, 5vw, 54px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}
.legal__body > section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

.legal__body h2 {
  font-size: clamp(1.28rem, 2.3vw, 1.58rem);
  line-height: 1.25;
  margin-bottom: 20px;
  scroll-margin-top: calc(var(--nav-h) + 24px);
}
/* Subheadings read as headings through weight and size, not colour — a page
   of bright blue h3s looks like a marketing deck, not a legal document. */
.legal__body h3 {
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.005em;
  margin: 36px 0 12px;
}
.legal__body p {
  color: var(--text-dim);
  font-size: 1.02rem;
  line-height: 1.8;
  margin-bottom: 18px;
  text-wrap: pretty;
}
.legal__body p:last-child { margin-bottom: 0; }
.legal__body strong { color: var(--text); font-weight: 600; }
.legal__body em { color: var(--text-dim); }

.legal__body a:not(.btn) {
  color: var(--blue-400);
  border-bottom: 1px solid rgba(120, 170, 255, 0.34);
  transition: border-color 0.2s, color 0.2s;
}
.legal__body a:not(.btn):hover { color: var(--cyan-300); border-bottom-color: var(--cyan-300); }

.legal__body ul { display: grid; gap: 11px; margin: 0 0 20px; }
.legal__body ul li {
  position: relative;
  padding-left: 24px;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1.75;
  text-wrap: pretty;
}
.legal__body ul li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(120, 170, 255, 0.65);
}

.legal__body code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.84em;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(30, 136, 255, 0.1);
  border: 1px solid var(--border);
  color: var(--cyan-300);
  white-space: nowrap;
}

.legal__links { display: grid; gap: 10px; }
.legal__related {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-faint);
}

/* ---- Callout ---- */
.legal__note {
  position: relative;
  margin: 0 0 22px;
  padding: 20px 22px 20px 24px;
  border: 1px solid var(--border-hi);
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(30, 136, 255, 0.11), rgba(255, 255, 255, 0.012));
  overflow: hidden;
}
.legal__note::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--grad-blue);
}
.legal__note p { color: var(--text-dim); margin-bottom: 10px; }
.legal__note p:last-child { margin-bottom: 0; }
.legal__note--strong { background: linear-gradient(135deg, rgba(53, 214, 127, 0.1), rgba(255, 255, 255, 0.012)); border-color: rgba(53, 214, 127, 0.34); }
.legal__note--strong::before { background: linear-gradient(180deg, #35d67f, rgba(53, 214, 127, 0.2)); }

/* ---- Definition block ---- */
.legal__contact {
  margin: 0 0 20px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.legal__contact dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(96px, auto) 1fr;
  gap: 11px 22px;
  align-items: start;
}
.legal__contact dt {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding-top: 2px;
}
.legal__contact dd {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ---- Tables ---- */
.table-scroll {
  margin: 0 0 20px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
}
.legal-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 0.88rem;
  line-height: 1.6;
}
.legal-table th,
.legal-table td {
  padding: 15px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}
.legal-table thead th {
  background: rgba(255, 255, 255, 0.028);
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}
.legal-table tbody tr { transition: background 0.25s var(--ease); }
.legal-table tbody tr:hover { background: rgba(255, 255, 255, 0.022); }
.legal-table tbody tr:last-child td { border-bottom: 0; }
.legal-table td { color: var(--text-dim); }
.legal-table td:first-child { color: var(--text); font-weight: 500; }
.legal-table__sub { display: block; color: var(--text-faint); font-weight: 400; font-size: 0.86em; margin-top: 3px; }
.legal-table__empty { text-align: center; color: var(--text-faint); font-style: italic; padding-block: 26px; }

/* ---- Live consent state panel (cookies.html) ---- */
.cookie-status {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
  padding: 8px 22px 22px;
}
.cookie-status__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}
.cookie-status__label { font-size: 0.93rem; color: var(--text); }
.cookie-status__value {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-faint);
  white-space: nowrap;
}
.cookie-status__value--on {
  border-color: rgba(53, 214, 127, 0.4);
  background: rgba(53, 214, 127, 0.12);
  color: #8ff0bc;
}
.cookie-status__value--off {
  border-color: rgba(255, 120, 120, 0.35);
  background: rgba(255, 90, 90, 0.1);
  color: #ffb0b0;
}
.cookie-status__actions { padding-top: 20px; }
.cookie-status__note { font-size: 0.83rem; color: var(--text-faint); margin-top: 14px; }

/* ---- Legal responsive ---- */
@media (max-width: 980px) {
  .legal { grid-template-columns: 1fr; gap: 30px; }
  .legal__toc {
    position: static;
    max-height: none;
    overflow: visible;
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    background: var(--surface);
    padding: 20px 18px;
  }
  .legal__toc ol { grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); display: grid; }
  .legal__body { max-width: none; }
}

@media (max-width: 620px) {
  .legal__contact { padding: 18px 16px; }
  .legal__contact dl { grid-template-columns: 1fr; gap: 3px; }
  .legal__contact dt { padding-top: 12px; }
  .legal__contact dt:first-child { padding-top: 0; }
  .legal__note { padding: 16px 16px 16px 19px; }
  .legal-table th, .legal-table td { padding: 11px 13px; }
  .cookie-status { padding: 4px 16px 18px; }
  .cookie-status__row { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ==========================================================================
   24. Cookie consent — banner and preferences dialog
   ========================================================================== */

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 300;
  padding: 0 var(--gutter) max(18px, env(safe-area-inset-bottom));
  transform: translateY(130%);
  transition: transform 0.55s var(--ease);
  pointer-events: none;
}
.cookie-banner.is-in { transform: none; }
.cookie-banner__inner {
  pointer-events: auto;
  max-width: var(--wrap);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  padding: 20px 24px;
  border: 1px solid var(--border-hi);
  border-radius: var(--r-lg);
  background: rgba(7, 10, 19, 0.92);
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.95);
}
.cookie-banner__text { flex: 1 1 auto; min-width: 0; }
.cookie-banner__text h2 {
  font-size: 1rem;
  margin-bottom: 6px;
}
.cookie-banner__text p { font-size: 0.88rem; color: var(--text-dim); line-height: 1.6; }
.cookie-banner__text a { color: var(--blue-400); border-bottom: 1px solid rgba(120, 170, 255, 0.34); }
.cookie-banner__actions {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Reject must be no harder to find than accept — same size, same weight. */
.cookie-banner__actions .btn { min-width: 108px; }

@media (max-width: 860px) {
  .cookie-banner__inner { flex-direction: column; align-items: stretch; padding: 20px; }
  .cookie-banner__actions { justify-content: stretch; }
  .cookie-banner__actions .btn { flex: 1 1 auto; }
}
@media (max-width: 440px) {
  .cookie-banner__actions { flex-direction: column-reverse; }
  .cookie-banner__actions .btn { width: 100%; }
}

/* ---- Preferences dialog ---- */
.cookie-modal {
  width: min(560px, calc(100vw - 32px));
  max-height: min(86vh, 720px);
  padding: 0;
  border: 1px solid var(--border-hi);
  border-radius: var(--r-lg);
  background: var(--bg-elev);
  color: var(--text);
  overflow: hidden;
}
.cookie-modal::backdrop {
  background: rgba(2, 4, 9, 0.72);
  backdrop-filter: blur(6px);
}
.cookie-modal[open] { animation: modalIn 0.4s var(--ease); }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
}

.cookie-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--border);
}
.cookie-modal__head h2 { font-size: 1.2rem; }
.cookie-modal__head p { font-size: 0.86rem; color: var(--text-dim); margin-top: 7px; line-height: 1.6; }
.cookie-modal__close {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-dim);
  transition: color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.cookie-modal__close:hover { color: var(--text); border-color: var(--border-hi); transform: rotate(90deg); }
.cookie-modal__close svg { width: 15px; height: 15px; }

.cookie-modal__body { padding: 6px 24px 20px; overflow-y: auto; max-height: 46vh; }

.cookie-cat { padding: 18px 0; border-bottom: 1px solid var(--border); }
.cookie-cat:last-child { border-bottom: 0; }
.cookie-cat__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cookie-cat__name { font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; }
.cookie-cat p { font-size: 0.86rem; color: var(--text-dim); margin-top: 8px; line-height: 1.65; }
.cookie-cat__locked {
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}

/* Toggle switch */
.switch { position: relative; flex: none; width: 46px; height: 26px; }
.switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.switch__track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid var(--border);
  transition: background 0.28s var(--ease), border-color 0.28s var(--ease);
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: transform 0.28s var(--ease), background 0.28s var(--ease);
}
.switch input:checked + .switch__track {
  background: var(--grad-blue);
  border-color: transparent;
}
.switch input:checked + .switch__track::after { transform: translateX(20px); background: #fff; }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--blue-400); outline-offset: 3px; }

.cookie-modal__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}
.cookie-modal__foot .btn { flex: 1 1 auto; }

@media (max-width: 480px) {
  .cookie-modal__head, .cookie-modal__body, .cookie-modal__foot { padding-inline: 18px; }
  .cookie-modal__foot { flex-direction: column-reverse; }
}

/* ==========================================================================
   25. Motion — scroll progress, entrances, ambience
   ========================================================================== */

/* ---- Scroll progress bar ---- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 200;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.04);
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--blue-600), var(--blue-400) 55%, var(--cyan-300));
  box-shadow: 0 0 14px rgba(30, 136, 255, 0.75);
}

/* ---- Back to top ---- */
.to-top {
  position: fixed;
  right: clamp(16px, 3vw, 26px);
  bottom: clamp(16px, 3vw, 26px);
  z-index: 190;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(7, 10, 19, 0.86);
  backdrop-filter: blur(12px);
  color: var(--text-dim);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.9);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease),
              visibility 0.35s, border-color 0.25s, color 0.25s;
}
.to-top.is-in { opacity: 1; visibility: visible; transform: none; }
.to-top:hover {
  border-color: var(--border-hi);
  color: var(--blue-400);
  transform: translateY(-3px);
}
.to-top svg { width: 18px; height: 18px; }

/* Nudged up while the cookie banner is showing, so they never overlap. */
body.has-cookie-banner .to-top { bottom: clamp(104px, 16vw, 118px); }

/* ---- Staggered entrance for above-the-fold content ----
   Pure CSS so it runs on first paint without waiting for JavaScript. */
@keyframes enterUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: none; }
}
[data-enter] > * {
  animation: enterUp 0.8s var(--ease) both;
}
[data-enter] > *:nth-child(1) { animation-delay: 0.05s; }
[data-enter] > *:nth-child(2) { animation-delay: 0.14s; }
[data-enter] > *:nth-child(3) { animation-delay: 0.23s; }
[data-enter] > *:nth-child(4) { animation-delay: 0.32s; }
[data-enter] > *:nth-child(5) { animation-delay: 0.41s; }
[data-enter] > *:nth-child(6) { animation-delay: 0.50s; }
[data-enter] > *:nth-child(7) { animation-delay: 0.59s; }

/* ---- Reveal variants ---- */
.reveal--left  { transform: translateX(-30px); }
.reveal--right { transform: translateX(30px); }
/* In a reversed split the media sits on the left, so it should arrive from
   the left too — otherwise it slides across the text it belongs beside. */
.split--reverse .split__media.reveal--right { transform: translateX(-30px); }
@media (max-width: 1000px) {
  /* Stacked layout: a sideways entrance reads as a glitch, so drop to a lift. */
  .reveal--left, .reveal--right,
  .split--reverse .split__media.reveal--right { transform: translateY(22px); }
}
.reveal--scale { transform: scale(0.95); }
.reveal--blur  { filter: blur(10px); transform: translateY(14px); }
.reveal.is-in  { transform: none; filter: none; }

/* Auto-stagger direct children of a revealed container. */
[data-stagger] > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
[data-stagger].is-in > * { opacity: 1; transform: none; }
[data-stagger].is-in > *:nth-child(1) { transition-delay: 0.04s; }
[data-stagger].is-in > *:nth-child(2) { transition-delay: 0.11s; }
[data-stagger].is-in > *:nth-child(3) { transition-delay: 0.18s; }
[data-stagger].is-in > *:nth-child(4) { transition-delay: 0.25s; }
[data-stagger].is-in > *:nth-child(5) { transition-delay: 0.32s; }
[data-stagger].is-in > *:nth-child(6) { transition-delay: 0.39s; }
[data-stagger].is-in > *:nth-child(7) { transition-delay: 0.46s; }
[data-stagger].is-in > *:nth-child(8) { transition-delay: 0.53s; }
[data-stagger].is-in > *:nth-child(9) { transition-delay: 0.60s; }

/* ---- Drifting ambient glows ---- */
@keyframes drift {
  0%,  100% { transform: translate3d(0, 0, 0) scale(1); }
  33%       { transform: translate3d(44px, -34px, 0) scale(1.09); }
  66%       { transform: translate3d(-32px, 26px, 0) scale(0.94); }
}
.glow--a { animation: drift 26s ease-in-out infinite; will-change: transform; }
.glow--b { animation: drift 34s ease-in-out infinite reverse; will-change: transform; }

/* ---- Gradient text shimmer ---- */
@keyframes shimmer {
  to { background-position: 200% center; }
}
.grad-text {
  background-size: 220% auto;
  animation: shimmer 9s linear infinite;
}

/* ---- Primary button shine sweep ---- */
.btn--primary { position: relative; overflow: hidden; isolation: isolate; }
.btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 32%, rgba(255, 255, 255, 0.3) 50%, transparent 68%);
  transform: translateX(-130%);
  transition: transform 0.75s var(--ease);
  pointer-events: none;
}
.btn--primary:hover::after { transform: translateX(130%); }

/* ---- Nav hover underline ---- */
.nav a:not(.btn) {
  background-image: linear-gradient(var(--blue-400), var(--blue-400));
  background-repeat: no-repeat;
  background-position: 50% calc(100% - 6px);
  background-size: 0% 1.5px;
  transition: color 0.2s, background-color 0.2s, background-size 0.3s var(--ease);
}
.nav a:not(.btn):hover { background-size: 42% 1.5px; }
@media (max-width: 820px) {
  /* No underline sweep in the drawer — the rows are full-width tap targets. */
  .nav a:not(.btn) { background-image: none; }
}

/* ---- Card tilt (pointer devices only; data-tilt is added by JS) ---- */
.card[data-tilt] {
  --lift: 0px;
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--lift));
  transition: transform 0.3s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.card[data-tilt]:hover { --lift: -6px; }

/* ---- Pillar icon lift ---- */
.pillar svg { transition: transform 0.35s var(--ease), color 0.35s var(--ease); }
.pillar:hover svg { transform: translateY(-4px) scale(1.1); color: var(--cyan-300); }

/* ---- Stat card hover ---- */
.stat { transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), background 0.4s var(--ease); }
.stat:hover { transform: translateY(-4px); border-color: var(--border-hi); background: var(--surface-hi); }

/* ---- Hero code panel: line-by-line reveal ----
   steps() quantises the clip-path wipe into one jump per line, which reads as
   typing without any DOM surgery on the syntax-highlighted markup.

   jump-start, not the default jump-end: with jump-end the first line does not
   appear until one full interval has elapsed, so the panel sits visibly empty
   for the first ~125ms and looks broken to anyone who arrives mid-animation. */
@keyframes typeLines {
  from { clip-path: inset(0 0 100% 0); }
  to   { clip-path: inset(0 0 0 0); }
}
.code-panel.is-typing pre code {
  animation: typeLines 1.5s steps(12, jump-start) both;
}

/* ---- The payoff: the pipeline "runs" and a small bot reports back ---- */
.code-panel__run {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 20px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(30, 136, 255, 0.05), transparent);
}

.code-run__lines {
  display: grid;
  gap: 7px;
  min-width: 0;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-faint);
}
.code-run__lines span {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
.code-panel.is-running .code-run__lines span { opacity: 1; transform: none; }
.code-panel.is-running .code-run__lines span:nth-child(1) { transition-delay: 0.10s; }
.code-panel.is-running .code-run__lines span:nth-child(2) { transition-delay: 0.45s; }
.code-panel.is-running .code-run__lines span:nth-child(3) { transition-delay: 0.85s; }
.code-run__ok { color: #8fe3b0; }

/* ---- The bot ---- */
.bot {
  flex: none;
  width: 56px;
  height: 56px;
  color: var(--blue-400);
  opacity: 0;
  transform: scale(0.55) translateY(6px);
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease);
  transition-delay: 1.05s;
  overflow: visible;
}
.code-panel.is-running .bot {
  opacity: 1;
  transform: none;
  animation: botFloat 3.6s ease-in-out 1.7s infinite;
}
@keyframes botFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* fill-box so the transform origin is the eye itself, not the whole SVG */
.bot__eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: botBlink 4.2s ease-in-out 2.2s infinite;
}
.bot__eye--r { animation-delay: 2.26s; }
@keyframes botBlink {
  0%, 90%, 100% { transform: scaleY(1); }
  95%           { transform: scaleY(0.12); }
}

.bot__spark {
  transform-box: fill-box;
  transform-origin: center;
  animation: botSpark 1.9s ease-in-out 1.7s infinite;
}
@keyframes botSpark {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50%      { opacity: 1;    transform: scale(1.15); }
}

/* Waves when you hover the panel — a reward for poking at it, not a loop. */
.bot__arm--r {
  transform-box: fill-box;
  transform-origin: 10% 90%;
}
.code-panel:hover .bot__arm--r { animation: botWave 0.9s ease-in-out 2; }
@keyframes botWave {
  0%, 100% { transform: rotate(0deg); }
  30%      { transform: rotate(-24deg); }
  60%      { transform: rotate(6deg); }
}

@media (max-width: 620px) {
  .code-panel__run { padding: 12px 14px; gap: 12px; }
  .code-run__lines { font-size: 0.66rem; gap: 5px; }
  .bot { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .code-run__lines span { opacity: 1; transform: none; }
  .bot { opacity: 1; transform: none; animation: none; transition: none; }
  .bot__eye, .bot__spark, .bot__arm--r { animation: none; }
}

/* ---- Typing caret for the hero code panel ---- */
.code-caret {
  display: inline-block;
  width: 7px;
  height: 1.05em;
  vertical-align: -0.18em;
  margin-left: 1px;
  background: var(--blue-400);
  animation: caretBlink 1.05s step-end infinite;
}
@keyframes caretBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ---- Section heading accent line ---- */
.section-head .eyebrow::before { transition: width 0.6s var(--ease); }
.reveal.is-in .eyebrow::before { width: 26px; }

/* ---- Cursor spotlight over the hero ----
   Sits under .hero__inner (which carries z-index 1) so it lights the grid
   without washing out the text. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    560px circle at var(--spot-x, 50%) var(--spot-y, 0%),
    rgba(30, 136, 255, 0.11),
    transparent 62%
  );
  transition: opacity 0.5s var(--ease);
}
.hero.has-spot::after { opacity: 1; }

/* ---- Magnetic buttons ----
   JS writes --mgx/--mgy; the button drifts a few pixels toward the cursor as
   it approaches. Deliberately small — this should register as responsiveness,
   not as the button running away. */
.btn[data-magnetic] {
  transform: translate3d(var(--mgx, 0px), var(--mgy, 0px), 0);
  transition: transform 0.3s var(--ease), box-shadow 0.25s var(--ease),
              background 0.25s var(--ease), border-color 0.25s var(--ease);
}

/* ---- Card icon reacts with the card ---- */
.card__icon {
  transition: transform 0.45s var(--ease), border-color 0.45s var(--ease),
              background 0.45s var(--ease);
}
.card:hover .card__icon {
  transform: translateY(-3px) rotate(-6deg) scale(1.06);
  background: rgba(30, 136, 255, 0.18);
}

/* ---- Timeline dots draw in with their entry ---- */
.tl-item::before {
  transform: scale(0.2);
  opacity: 0;
  transition: transform 0.55s var(--ease), opacity 0.4s var(--ease);
}
.timeline.is-in .tl-item::before { transform: scale(1); opacity: 1; }
.timeline.is-in .tl-item:nth-child(1)::before { transition-delay: 0.10s; }
.timeline.is-in .tl-item:nth-child(2)::before { transition-delay: 0.20s; }
.timeline.is-in .tl-item:nth-child(3)::before { transition-delay: 0.30s; }
.timeline.is-in .tl-item:nth-child(4)::before { transition-delay: 0.40s; }
.timeline.is-in .tl-item:nth-child(5)::before { transition-delay: 0.50s; }

/* ---- Tech chips pop in behind their group ---- */
.stack-groups .chip {
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease),
              border-color 0.25s, color 0.25s;
}
.stack-groups.is-in .chip { opacity: 1; transform: none; }
.stack-groups.is-in .chip:nth-child(n + 2)  { transition-delay: 0.04s; }
.stack-groups.is-in .chip:nth-child(n + 4)  { transition-delay: 0.09s; }
.stack-groups.is-in .chip:nth-child(n + 6)  { transition-delay: 0.14s; }
.stack-groups.is-in .chip:nth-child(n + 8)  { transition-delay: 0.19s; }
.stack-groups.is-in .chip:hover { transform: translateY(-2px); }

@media (prefers-reduced-motion: reduce) {
  .glow--a, .glow--b, .grad-text, .code-caret { animation: none; }
  .card[data-tilt] { transform: none; }
  [data-stagger] > * { opacity: 1; transform: none; }
  .scroll-progress { display: none; }
  .hero::after { display: none; }
  .btn[data-magnetic] { transform: none; }
  .tl-item::before { transform: scale(1); opacity: 1; }
  .stack-groups .chip { opacity: 1; transform: none; }
  .glow { translate: none !important; }
}
