/* ============================================================
   DataScienceDNA — theme.css
   Pinnacle-family design system. EVERYTHING reads the tokens in
   :root, so the site is re-skinned by retuning the tokens alone.
   This site carries its own brand identity — Electric Blue, Data
   Green and Alert Orange — mapped onto the shared family token
   names. Geometry, layout, type, motion and every component rule
   below the token block are the family standard.
   ============================================================ */

:root {
  /* Surfaces (deep midnight, faint blue tint — the ds_dna base) */
  --bg:#070912; --bg-grad-1:#070912; --bg-grad-2:#0b0e1d;
  --panel:#11152a; --surface:#11152a; --surface-2:#161b34; --surface-3:#1d2342;
  --border:rgba(51,148,235,.14); --border-strong:rgba(51,148,235,.30);

  /* Text */
  --text:#f5f7ff; --text-soft:#d7dcf0; --text-muted:#aab3d0; --text-dim:#7e88a8;

  /* Brand accents  ← THE SITE'S IDENTITY (electric blue · data green · alert orange) */
  --violet:#0066CC; --violet-light:#3394EB; --indigo:#0052A3; --purple:#2E7FDB;
  --hl:#00AA66;             /* "knowledge" highlight — data green */
  --amber:#00AA66; --rose:#FF6B35; --sky:#33B5D9;
  --magenta:#FF6B35; --cyan:#33B5D9; --emerald:#00AA66;

  /* Gradients (rebuilt from the brand accents) */
  --grad-brand:linear-gradient(100deg,#3394EB 0%,#00AA66 48%,#FF6B35 100%);
  --grad-cta:linear-gradient(120deg,#0066CC 0%,#FF6B35 100%);
  --grad-gold:linear-gradient(120deg,#00AA66 0%,#33B5D9 100%);
  --grad-text:linear-gradient(95deg,#66A9F2 0%,#00AA66 46%,#FF6B35 100%);
  --grad-soft:linear-gradient(120deg,rgba(51,148,235,.18),rgba(255,107,53,.14),rgba(51,181,217,.16));
  --glow-violet:0 10px 36px -10px rgba(0,102,204,.6);
  --glow-gold:0 0 0 1px rgba(0,170,102,.25),0 12px 40px -12px rgba(51,181,217,.42);

  /* Data-viz palette (charts.js reads these) */
  --viz-1:#3394EB; --viz-2:#00AA66; --viz-3:#FF6B35; --viz-4:#33B5D9;
  --viz-5:#0066CC; --viz-6:#66C28A; --viz-7:#FF9466; --viz-8:#0052A3;

  /* Semantic / geometry / layout / type / motion — family standard */
  --success:#00AA66; --warning:#fbbf24; --danger:#fb7185; --info:#38bdf8;
  --radius-sm:10px; --radius:16px; --radius-lg:22px; --radius-xl:28px; --pill:999px;
  --maxw:1200px; --maxw-prose:780px; --gutter:clamp(20px,5vw,48px); --header-h:76px;
  --font-display:'Poppins',system-ui,sans-serif;
  --font-body:'Inter',system-ui,sans-serif;
  --font-mono:'JetBrains Mono',ui-monospace,monospace;
  --ease:cubic-bezier(0.22,1,0.36,1); --dur:.5s;
}

/* ============================================================
   Reset / base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 17px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Lenis smooth scroll */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

img, svg, canvas, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  color: var(--text);
}
h1 { font-size: clamp(2.6rem, 7vw, 5rem); }
h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h3 { font-size: clamp(1.25rem, 2.2vw, 1.7rem); }
h4 { font-size: clamp(1.05rem, 1.6vw, 1.25rem); }
p  { margin: 0 0 1.1em; color: var(--text-muted); }

::selection { background: rgba(236, 72, 153, 0.35); color: #fff; }

/* Ambient washes — the family signature behind every page */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60vw 60vw at 78% -10%, rgba(139, 92, 246, 0.16), transparent 60%),
    radial-gradient(50vw 50vw at 5% 20%, rgba(34, 211, 238, 0.10), transparent 55%),
    radial-gradient(45vw 45vw at 60% 110%, rgba(236, 72, 153, 0.12), transparent 55%);
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  mask-image: radial-gradient(120vw 90vh at 50% 0, #000, transparent 75%);
}

/* Themed scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 999px; border: 3px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--violet); }

/* ============================================================
   Layout — single source of truth for margins
   ============================================================ */
.container { max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.container-prose { max-width: var(--maxw-prose); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 9vw, 128px); position: relative; }
.section--tight { padding-block: clamp(40px, 6vw, 80px); }
.center { text-align: center; }
.center-x { margin-inline: auto; }

.section-head { max-width: 720px; margin-bottom: clamp(2.4rem, 5vw, 3.6rem); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { margin-bottom: 0.5rem; }
.section-head p { font-size: clamp(1.02rem, 1.7vw, 1.2rem); color: var(--text-muted); margin: 0; }

/* Grids */
.grid { display: grid; gap: clamp(1rem, 2vw, 1.6rem); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Flex helpers */
.flex { display: flex; }
.gap { gap: 1rem; }
.wrap { flex-wrap: wrap; }
.justify-center { justify-content: center; }
.items-center { align-items: center; }

/* Spacing helpers */
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; } .mt-5 { margin-top: 2.75rem; } .mt-6 { margin-top: 3.5rem; }
.mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }

/* ============================================================
   Type fragments
   ============================================================ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--violet-light);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: linear-gradient(90deg, var(--violet), transparent);
}
.section-head.center .eyebrow, .cta-band .eyebrow { justify-content: center; }
.gradient-text {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lead { font-size: clamp(1.05rem, 2vw, 1.35rem); color: var(--text-soft); line-height: 1.6; }
.muted { color: var(--text-dim); }

/* Clip-reveal heading */
.clip-reveal { display: block; }
.clip-reveal .line { display: block; overflow: hidden; }
.clip-reveal .line > span { display: block; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 1.7rem;
  border-radius: var(--pill);
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur), background var(--dur), color var(--dur), border-color var(--dur);
  position: relative;
  overflow: hidden;
  will-change: transform;
}
.btn:hover { transform: translateY(-3px); }
.btn .arr, .btn .arrow { transition: transform .3s; }
.btn:hover .arr, .btn:hover .arrow { transform: translateX(4px); }
.btn-sm { padding: 0.62rem 1.15rem; font-size: 0.86rem; }

.btn-primary {
  background: var(--grad-brand);
  color: #0a0a16;
  box-shadow: var(--glow-violet);
}
.btn-primary:hover { box-shadow: 0 16px 44px -10px rgba(236, 72, 153, 0.6); }

.btn-ghost {
  background: rgba(255,255,255,0.03);
  border-color: var(--border-strong);
  color: var(--text);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover { border-color: var(--violet-light); background: rgba(0,102,204,0.10); }

.btn-gold {
  background: var(--grad-gold);
  color: #04140e;
  box-shadow: var(--glow-gold);
}
.btn-gold:hover { box-shadow: 0 16px 44px -10px rgba(34, 211, 238, 0.5); }

/* Arrow link */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 0.92rem;
  color: var(--text);
}
.link-arrow .arr { transition: transform .3s var(--ease); color: var(--violet-light); }
.link-arrow:hover .arr { transform: translateX(5px); }

/* ============================================================
   Cards
   ============================================================ */
.card {
  position: relative;
  display: block;
  background: linear-gradient(160deg, var(--surface), var(--bg-grad-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 2.6vw, 2.2rem);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur), box-shadow var(--dur);
  will-change: transform;
  color: inherit;
}
.card::before {
  content: ""; position: absolute; inset: 0;
  background: var(--grad-soft); opacity: 0; transition: opacity var(--dur); pointer-events: none;
}
.card::after {
  content: ""; position: absolute; left: 0; top: 0; height: 100%; width: 3px;
  background: var(--accent, var(--grad-brand)); transform: scaleY(0); transform-origin: 50% 0;
  transition: transform var(--dur) var(--ease);
}
.card:hover { border-color: var(--border-strong); transform: translateY(-5px); box-shadow: 0 30px 60px -40px rgba(0,102,204,.6); }
.card:hover::before { opacity: 0.7; }
a.card:hover::after, .card-link:hover::after { transform: scaleY(1); }
.card > * { position: relative; z-index: 1; }
.card h3, .card h4 { margin-bottom: .55rem; }
.card p { color: var(--text-muted); margin: 0; }
.card p + .link-arrow, .card p + .card-link { margin-top: 1.1rem; }

/* Accent variants set the icon colour + edge accent */
.card.acc-violet  { --accent: linear-gradient(180deg, var(--violet-light), var(--violet)); --acc: var(--violet-light); }
.card.acc-indigo  { --accent: linear-gradient(180deg, #818cf8, var(--indigo)); --acc: #818cf8; }
.card.acc-gold    { --accent: linear-gradient(180deg, var(--emerald), var(--cyan)); --acc: var(--emerald); }
.card.acc-rose    { --accent: linear-gradient(180deg, var(--rose), #b8316f); --acc: var(--rose); }
.card.acc-sky     { --accent: linear-gradient(180deg, var(--sky), #0ea5b7); --acc: var(--sky); }

.card-icon {
  width: 58px; height: 58px; border-radius: 15px;
  display: grid; place-items: center; margin-bottom: 1.3rem;
  font-size: 1.7rem; line-height: 1;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--acc, var(--violet-light));
}
.card-icon svg { width: 28px; height: 28px; }

/* Numbered steps */
.numbered { display: grid; gap: clamp(1rem, 2vw, 1.5rem); }
.numbered .card { display: flex; gap: 1.2rem; align-items: flex-start; }
.num-chip {
  flex: none;
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1.15rem;
  color: #0a0a16; background: var(--grad-brand);
}

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.34rem 0.7rem; border-radius: var(--pill);
  border: 1px solid var(--border-strong); color: var(--text-soft);
  background: rgba(255,255,255,.03);
}
.badge-violet { color: var(--violet-light); border-color: rgba(51,148,235,.4); }
.badge-gold   { color: var(--emerald); border-color: rgba(0,170,102,.4); }
.badge-sky    { color: var(--sky); border-color: rgba(51,181,217,.4); }
.badge-rose   { color: var(--rose); border-color: rgba(255,107,53,.4); }

/* ============================================================
   Stats / counters
   ============================================================ */
.stat { padding: 0.4rem 0; }
.stat-num {
  font-family: var(--font-display); font-weight: 700; line-height: 1;
  font-size: clamp(2rem, 4vw, 3rem);
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-label { margin-top: 0.55rem; font-size: 0.86rem; color: var(--text-dim); line-height: 1.4; }
.grid-4 .stat, .grid-3 .stat { text-align: center; }

/* ============================================================
   Prose (long-form)
   ============================================================ */
.prose { max-width: var(--maxw-prose); margin-inline: auto; }
.prose.wide { max-width: 900px; }
.prose > * { margin-inline: auto; }
.prose p, .prose li { color: var(--text-muted); line-height: 1.8; }
.prose h2 { margin-top: 2.6rem; }
.prose h3 { margin-top: 2rem; color: var(--violet-light); }
.prose strong { color: var(--text); }
.prose a { color: var(--sky); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(51,181,217,.4); }
.prose a:hover { text-decoration-color: var(--sky); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .55rem; }
.prose blockquote {
  margin: 2rem 0; padding: 1.3rem 1.6rem;
  border-left: 3px solid var(--violet);
  background: linear-gradient(120deg, rgba(0,102,204,.10), transparent);
  border-radius: 0 14px 14px 0; color: var(--text-soft); font-size: 1.08rem;
}

/* Checklist */
.checklist { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: .85rem; }
.checklist li { position: relative; padding-left: 2rem; color: var(--text-soft); line-height: 1.55; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: 0.12em;
  width: 1.25rem; height: 1.25rem; border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a0a16' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center / 0.8rem no-repeat,
    var(--grad-gold);
}

/* ============================================================
   Figure / table
   ============================================================ */
.figure {
  background: linear-gradient(160deg, var(--surface), var(--bg-grad-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.7rem;
  margin: 2.2rem 0;
}
.figure img { border-radius: var(--radius-sm); width: 100%; }
.figure figcaption { margin-top: 1rem; font-size: 0.82rem; color: var(--text-dim); line-height: 1.5; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); margin: 2rem 0; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
table.data th, table.data td { text-align: left; padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--border); }
table.data thead th {
  color: var(--violet-light); font-family: var(--font-mono);
  font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500;
  background: rgba(255,255,255,.02);
}
table.data td { color: var(--text-muted); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: rgba(255,255,255,.02); }

/* ============================================================
   Marquee
   ============================================================ */
.marquee { overflow: hidden; border-block: 1px solid var(--border); padding-block: 1.3rem; white-space: nowrap; }
.marquee-track { display: inline-flex; gap: 0; will-change: transform; }
.marquee-chip {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1rem, 2vw, 1.35rem); color: var(--text-soft);
  padding: 0 1.6rem;
}
.marquee-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grad-brand); flex: none; }

/* ============================================================
   CTA band
   ============================================================ */
.cta-band {
  position: relative;
  border-radius: var(--radius-xl);
  padding: clamp(2.5rem, 6vw, 5rem);
  text-align: center;
  background: linear-gradient(135deg, rgba(0,102,204,.18), rgba(51,181,217,.12));
  border: 1px solid var(--border-strong);
  overflow: hidden;
}
.cta-band::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(50% 120% at 50% 0, rgba(255,107,53,.16), transparent 70%);
  pointer-events: none;
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { margin-bottom: 1rem; }
.cta-band .lead { max-width: 620px; margin-inline: auto; margin-bottom: 2rem; }
.cta-band .flex { justify-content: center; }

/* ============================================================
   Glass panel
   ============================================================ */
.glass {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px) saturate(130%);
  padding: clamp(1.4rem, 2.4vw, 2rem);
}

/* ============================================================
   Hero
   ============================================================ */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
  overflow: hidden;
}
.hero canvas#aurora { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; }
.hero .container { position: relative; z-index: 2; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.hero-copy h1 { margin-bottom: 1rem; }
.hero-copy .lead { max-width: 42ch; margin-bottom: 2.2rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 3rem; }
.hero .grid-3 { gap: 1.5rem; max-width: 560px; }

.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1.04;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(22,27,52,0.9), rgba(11,14,29,0.6));
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 40px 90px -40px rgba(0,102,204,.5);
}
.hero-visual canvas, .hero-visual #hero-3d { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.hero-visual .badge { position: absolute; left: 16px; top: 16px; z-index: 3; }

/* Compact hero for detail pages */
.hero--page { min-height: auto; padding-top: calc(var(--header-h) + clamp(2.5rem, 7vw, 5rem)); padding-bottom: clamp(1.5rem, 4vw, 3rem); }
.hero--page .hero-grid { grid-template-columns: 1fr; }
.back-link { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-mono); font-size: .8rem; color: var(--text-dim); margin-bottom: 1.4rem; }
.back-link:hover { color: var(--text); }
.meta-row { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; color: var(--text-dim); font-size: .85rem; font-family: var(--font-mono); margin-top: 1.2rem; }

.scroll-hint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 3; display: flex; flex-direction: column; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .66rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--text-dim);
}
.scroll-hint svg { width: 20px; height: 20px; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(8px)} }

/* ============================================================
   Header / nav (injected by include.js)
   ============================================================ */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  transform: scaleX(0); transform-origin: 0 50%;
  background: var(--grad-brand); z-index: 120;
  box-shadow: 0 0 12px rgba(255,107,53,.6);
}
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  transition: transform .4s var(--ease), background .4s, backdrop-filter .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(7, 9, 18, 0.72);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--border);
}
.site-header.hidden { transform: translateY(-100%); }
.site-header .nav {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
}
.brand {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.3rem; letter-spacing: -0.02em;
  display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text);
}
.brand .brand-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--grad-brand); box-shadow: 0 0 16px rgba(0,170,102,.7);
  animation: pulseDot 2.4s ease-in-out infinite;
}
@keyframes pulseDot { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.35);opacity:.7} }
.brand .mark { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Centre mega-nav */
.nav-menu { display: flex; gap: 0.3rem; list-style: none; margin: 0; padding: 0; }
.nav-menu > li { position: relative; }
.nav-menu > li > a {
  display: inline-flex; align-items: center; gap: .35rem;
  color: var(--text-muted); font-size: 0.95rem; font-weight: 500;
  padding: 0.6rem 0.9rem; border-radius: 10px; transition: color .3s, background .3s;
}
.nav-menu > li > a:hover, .nav-menu > li.active > a { color: var(--text); background: rgba(255,255,255,.04); }
.nav-menu > li > a .caret { width: 12px; height: 12px; opacity: .6; transition: transform .3s; }
.nav-menu > li:hover > a .caret { transform: rotate(180deg); }
/* Invisible bridge so the dropdown stays open while the cursor crosses the gap */
.nav-menu > li::after { content: ""; position: absolute; left: -8px; right: -8px; top: 100%; height: 16px; }

.nav-drop {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translate(-50%, 8px);
  min-width: 280px; padding: 0.6rem; opacity: 0; visibility: hidden; pointer-events: none;
  background: rgba(13, 16, 33, 0.94); backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 30px 60px -24px rgba(0,0,0,.7);
  transition: opacity .28s var(--ease), transform .28s var(--ease), visibility .28s;
  display: grid; gap: 2px;
}
.nav-menu > li:hover .nav-drop, .nav-menu > li:focus-within .nav-drop {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, 0);
}
.nav-drop a { display: block; padding: 0.7rem 0.9rem; border-radius: 10px; transition: background .25s; }
.nav-drop a:hover { background: rgba(255,255,255,.05); }
.nav-drop .nd-title { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: var(--text); }
.nav-drop .nd-desc { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.15rem; line-height: 1.4; }

.nav-cta { display: flex; align-items: center; gap: 0.8rem; }
.hamburger { display: none; background: none; border: 0; color: var(--text); width: 44px; height: 44px; place-items: center; }
.hamburger svg { width: 26px; height: 26px; }

/* Mobile drawer */
.mobile-drawer {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(7,9,18,0.97); backdrop-filter: blur(20px);
  transform: translateY(-100%); transition: transform .5s cubic-bezier(.7,0,.2,1);
  overflow-y: auto; padding: calc(var(--header-h) + 1.5rem) var(--gutter) 3rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.mobile-drawer.open { transform: translateY(0); }
.drawer-group { border-bottom: 1px solid var(--border); }
.drawer-group > button {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: none; border: 0; color: var(--text); font-family: var(--font-display);
  font-weight: 600; font-size: 1.3rem; padding: 1rem 0; text-align: left;
}
.drawer-group > button .caret { width: 18px; height: 18px; transition: transform .3s; }
.drawer-group.open > button .caret { transform: rotate(180deg); }
.drawer-sub { max-height: 0; overflow: hidden; transition: max-height .4s var(--ease); display: grid; }
.drawer-group.open .drawer-sub { max-height: 420px; }
.drawer-sub a { color: var(--text-muted); padding: 0.6rem 0 0.6rem 1rem; font-size: 1rem; }
.drawer-sub a:hover { color: var(--text); }
.mobile-drawer .btn { margin-top: 1.5rem; justify-content: center; }

/* ============================================================
   Footer (injected by include.js)
   ============================================================ */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-grad-2); padding-block: 4rem 2rem; position: relative; }
.site-footer::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 1px; background: var(--grad-brand); opacity: .5; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: 2.5rem; margin-bottom: 3rem; }
.footer-grid h4 { font-family: var(--font-display); font-size: 0.95rem; margin-bottom: 1.1rem; color: var(--text); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.footer-grid a { color: var(--text-dim); transition: color .3s; font-size: 0.92rem; }
.footer-grid a:hover { color: var(--text); }
.footer-brand p { color: var(--text-dim); max-width: 34ch; font-size: 0.92rem; }
.footer-newsletter { display: flex; gap: .6rem; margin-top: 1rem; }
.footer-newsletter input {
  flex: 1; background: rgba(255,255,255,.04); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: .7rem .9rem; color: var(--text); font: inherit; font-size: 0.9rem;
}
.footer-newsletter input::placeholder { color: var(--text-dim); }
.footer-newsletter input:focus { outline: none; border-color: var(--violet); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
  padding-top: 1.8rem; border-top: 1px solid var(--border); color: var(--text-dim); font-size: .84rem;
}
.footer-bottom .legal { display: flex; gap: 1.2rem; }
.footer-bottom .legal a:hover { color: var(--text); }
.kinship { font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: .06em; color: var(--text-dim); }
.kinship .mark { color: var(--violet-light); }

/* ============================================================
   Charts (rendered by charts.js into figure.chart)
   ============================================================ */
.chart {
  background: linear-gradient(160deg, var(--surface), var(--bg-grad-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  margin: 0;
}
.chart .chart-head { margin-bottom: 1.2rem; }
.chart .chart-title { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; color: var(--text); margin: 0 0 .2rem; }
.chart .chart-sub { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
.chart .chart-svg { width: 100%; overflow-x: auto; }
.chart svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.chart figcaption { margin-top: 1rem; font-size: 0.78rem; color: var(--text-dim); }
/* KPI chart */
.chart .kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 1rem; }
.chart .kpi { border: 1px solid var(--border); border-radius: 14px; padding: 1.2rem; background: rgba(255,255,255,.02); }
.chart .kpi .kv { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem,3.2vw,2.2rem); line-height: 1; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chart .kpi .kl { margin-top: .5rem; font-size: .8rem; color: var(--text-dim); line-height: 1.4; }

/* ============================================================
   Motion — reveal hooks
   ============================================================ */
[data-reveal] { opacity: 1; }
html.js [data-reveal] { opacity: 0; transform: translateY(34px); }
html.js [data-reveal="left"]  { transform: translateX(-40px); }
html.js [data-reveal="right"] { transform: translateX(40px); }
html.js [data-reveal="scale"] { transform: scale(0.94); }
html.js [data-reveal="mask"]  { clip-path: inset(0 100% 0 0); transform: none; opacity: 1; }
html.reveal-all [data-reveal] { opacity: 1 !important; transform: none !important; clip-path: none !important; }

/* ============================================================
   Accessibility & polish
   ============================================================ */
:focus-visible { outline: 2px solid var(--violet-light); outline-offset: 3px; border-radius: 4px; }
.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 200;
  background: var(--violet); color: #0a0a16; padding: 0.7rem 1.1rem; border-radius: 10px;
  font-weight: 600; transition: top .25s;
}
.skip-link:focus { top: 16px; }
[id] { scroll-margin-top: calc(var(--header-h) + 16px); }
@media (hover: none) { .btn:hover { transform: none; } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) {
  .nav-menu, .nav-cta .btn { display: none; }
  .hamburger { display: grid; }
}
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 460px; order: -1; margin: 0 auto; width: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero .grid-3 { grid-template-columns: repeat(3, 1fr); gap: .8rem; }
}
