/* ============================================================
   INTELLIGAIA · AI UX PATTERN LIBRARY · v0.2.1
   ============================================================ */

:root {
  /* Type families */
  --font-display: "Inter", "Inter Placeholder", ui-sans-serif, system-ui, sans-serif;
  --font-body:    "Inter", "Inter Placeholder", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "JetBrains Mono", "Menlo", ui-monospace, monospace;
  --font-serif:   "Newsreader", "Source Serif Pro", "Times New Roman", serif;

  /* Type scale */
  --t-display-1: clamp(44px, 5.6vw, 80px);
  --t-display-2: clamp(40px, 5.2vw, 72px);
  --t-display-3: clamp(32px, 3.6vw, 52px);
  --t-h1: 40px;
  --t-h2: 28px;
  --t-h3: 22px;
  --t-h4: 18px;
  --t-body: 16px;
  --t-sm: 14px;
  --t-mini: 12px;
  --t-eyebrow: 11px;

  /* Spacing */
  --s-1: 4px;  --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 20px; --s-6: 24px;  --s-8: 32px;  --s-10: 40px;
  --s-12: 48px; --s-16: 64px; --s-20: 80px; --s-24: 96px;
  --s-32: 128px;

  /* Radii */
  --r-1: 4px;  --r-2: 6px;  --r-3: 8px;
  --r-4: 12px; --r-5: 16px; --r-6: 24px; --r-full: 9999px;

  /* Color */
  --ink-0:    #ffffff;
  --ink-25:   #fbfbfa;
  --ink-50:   #f5f5f3;
  --ink-100:  #ebebe8;
  --ink-200:  #d8d8d2;
  --ink-300:  #b6b6ad;
  --ink-400:  #88887d;
  --ink-500:  #5d5d54;
  --ink-600:  #3f3f38;
  --ink-700:  #2a2a25;
  --ink-800:  #1a1a16;
  --ink-900:  #0c0c0a;
  --ink-950:  #050504;

  --accent:        #d97706;
  --accent-hover:  #b45309;
  --accent-soft:   #fef3c7;
  --accent-ghost:  rgba(217, 119, 6, 0.08);

  --bg:        var(--ink-25);
  --surface:   var(--ink-0);
  --border:    var(--ink-100);
  --border-strong: var(--ink-200);
  --fg:        var(--ink-950);
  --fg-alt:    var(--ink-700);
  --fg-mid:    var(--ink-500);
  --fg-muted:  var(--ink-400);

  --shadow-1: 0 1px 0 var(--ink-100);
  --shadow-2: 0 1px 2px rgba(12,12,10,0.04), 0 1px 3px rgba(12,12,10,0.06);
  --shadow-3: 0 4px 8px rgba(12,12,10,0.05), 0 8px 24px rgba(12,12,10,0.06);
  --shadow-4: 0 24px 48px rgba(12,12,10,0.10), 0 12px 24px rgba(12,12,10,0.06);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease:     cubic-bezier(0.4, 0, 0.2, 1);
  --dur-1:    150ms;
  --dur-2:    280ms;
  --dur-3:    480ms;
  --dur-4:    720ms;

  --max-w: 1320px;
  --gutter: 32px;
  --nav-h: 72px;
  --sidebar-w: 280px;
  --toc-w: 220px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}
body {
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: 1.55;
  color: var(--fg);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; background: transparent; border: 0; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--ink-950); color: var(--ink-0); }

/* Type utils */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0; letter-spacing: -0.02em; color: var(--fg); }
.t-display-1 { font-size: var(--t-display-1); line-height: 0.98; letter-spacing: -0.045em; font-weight: 600; }
.t-display-2 { font-size: var(--t-display-2); line-height: 1.02; letter-spacing: -0.035em; font-weight: 600; }
.t-display-3 { font-size: var(--t-display-3); line-height: 1.04; letter-spacing: -0.025em; font-weight: 600; }
.t-h1 { font-size: var(--t-h1); line-height: 1.08; letter-spacing: -0.02em; font-weight: 600; }
.t-h2 { font-size: var(--t-h2); line-height: 1.18; letter-spacing: -0.015em; font-weight: 600; }
.t-h3 { font-size: var(--t-h3); line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; }
.t-h4 { font-size: var(--t-h4); line-height: 1.35; font-weight: 600; }
.t-body { font-size: var(--t-body); line-height: 1.55; }
.t-sm { font-size: var(--t-sm); line-height: 1.5; }
.t-mini { font-size: var(--t-mini); line-height: 1.4; }
.t-mono { font-family: var(--font-mono); }
.t-serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.t-eyebrow {
  font-size: var(--t-eyebrow);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--fg-muted);
}
.t-muted { color: var(--fg-muted); }
.t-mid { color: var(--fg-mid); }
.t-alt { color: var(--fg-alt); }
.t-fg { color: var(--fg); }
.t-accent { color: var(--accent); }

/* Layout */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: 1480px; }

/* ============================================================
   GLOBAL NAV — intelligaia.com style
   ============================================================ */
.gnav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in oklab, var(--bg) 84%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
}
.gnav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-6);
}

/* Brand lockup — intelligaia.com style: wordmark + tagline */
.gnav .container { max-width: 1480px; }
.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  color: var(--fg);
  flex-shrink: 0;
  transition: opacity var(--dur-1) var(--ease);
}
.brand:hover { opacity: 0.75; }
.brand__word {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.045em;
  color: var(--fg);
  line-height: 1;
  font-feature-settings: "ss01" on, "cv11" on;
}
.brand__logo-img {
  height: 44px;
  width: auto;
  display: block;
  max-width: none;
}
.brand__tagline {
  font-size: 11px;
  font-weight: 400;
  color: var(--fg-mid);
  letter-spacing: 0;
  line-height: 1;
  margin-top: 4px;
}

/* Right-side actions: Download SDK + Contact Us */
.gnav__actions {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  flex-shrink: 0;
}
.gnav__sdk {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-full);
  background: var(--ink-950);
  color: var(--ink-0);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--dur-2) var(--ease);
  flex-shrink: 0;
  white-space: nowrap;
}
.gnav__sdk:hover { background: var(--ink-700); transform: translateY(-1px); }
.gnav__cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--ink-950);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--dur-2) var(--ease);
  flex-shrink: 0;
  white-space: nowrap;
}
.gnav__cta:hover { background: var(--ink-950); color: var(--ink-0); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all var(--dur-2) var(--ease);
}
.btn--solid {
  background: var(--ink-950); color: var(--ink-0); border-color: var(--ink-950);
}
.btn--solid:hover { background: var(--ink-800); border-color: var(--ink-800); transform: translateY(-1px); }
.btn--ghost {
  background: transparent; color: var(--fg); border-color: var(--border-strong);
}
.btn--ghost:hover { border-color: var(--fg); background: var(--ink-50); }
.btn__arrow { transition: transform var(--dur-2) var(--ease); }
.btn:hover .btn__arrow { transform: translateX(3px); }

/* ============================================================
   SCENE — wraps hero + framework so the particle cluster
   persists and morphs through both sections via sticky canvas.
   ============================================================ */
.scene {
  position: relative;
  isolation: isolate;
}
.scene__bg {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  z-index: 0;
  pointer-events: none;
  margin-bottom: -100vh; /* sticky placeholder doesn't push content */
}
.scene__bg #hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  display: block;
}

/* ============================================================
   HERO
   pointer-events: none on the section so the sticky canvas
   underneath captures mouse for the cluster distortion;
   interactive children explicitly re-enable.
   ============================================================ */
.hero {
  position: relative;
  z-index: 1;
  padding-top: 168px;
  padding-bottom: var(--s-20);
  pointer-events: none;
}
@media (max-width: 720px) {
  .hero { padding-top: 96px; }
}
.hero__content { position: relative; z-index: 1; }
.hero a, .hero button, .hero .btn { pointer-events: auto; }
.hero__title {
  font-size: var(--t-display-1);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 600;
  color: var(--fg);
  max-width: 1280px;
}
/* "agentic" word — same weight as siblings, gradient via background-clip */
.hero__title em {
  font-style: normal;
  font-family: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  background: linear-gradient(120deg,
    #d97706 0%,
    #e11d48 38%,
    #7c3aed 72%,
    #1e40af 100%);
  background-size: 220% 220%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  animation: agentic-shift 12s ease-in-out infinite;
}
@keyframes agentic-shift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.hero__sub {
  font-size: 20px;
  line-height: 1.45;
  color: var(--fg-mid);
  max-width: 680px;
  margin-top: var(--s-8);
  font-weight: 400;
}
.hero__actions {
  margin-top: var(--s-10);
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
}

/* Ambient bloom — animated, behind text on the left */
.hero::before {
  content: "";
  position: absolute;
  top: 5%; left: -8%;
  width: 720px; height: 720px;
  background: radial-gradient(closest-side, rgba(217,119,6,0.12), transparent 65%);
  pointer-events: none;
  z-index: -1;
  filter: blur(70px);
  animation: spot-e 18s ease-in-out infinite;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: -10%; right: 25%;
  width: 480px; height: 480px;
  background: radial-gradient(closest-side, rgba(124,58,237,0.10), transparent 70%);
  pointer-events: none;
  z-index: -1;
  filter: blur(60px);
  animation: spot-f 22s ease-in-out infinite;
}
@keyframes spot-e {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.55; }
  50%      { transform: translate(50px, 60px) scale(1.15); opacity: 1; }
}
@keyframes spot-f {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  50%      { transform: translate(-40px, -50px) scale(1.18); opacity: 0.9; }
}

/* ============================================================
   STAT BAND — with spotting gradient backdrop
   ============================================================ */
.stat-band {
  position: relative;
  margin-top: var(--s-16);
  border-top: 1px solid var(--border);
  padding-top: var(--s-8);
  isolation: isolate;
  overflow: hidden;
  border-radius: 0;
}
.stat-band::before {
  content: "";
  position: absolute;
  inset: -120px 30% auto auto;
  width: 540px; height: 240px;
  background:
    radial-gradient(closest-side, rgba(217,119,6,0.10), transparent 70%),
    radial-gradient(closest-side at 30% 50%, rgba(99,102,241,0.06), transparent 70%);
  pointer-events: none;
  z-index: -1;
  filter: blur(20px);
}
.stat-band__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-8);
}
.stat-item { display: flex; flex-direction: column; gap: 4px; }
.stat-item__k {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
  font-weight: 500;
}
.stat-item__v {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.035em;
  color: var(--fg);
}

/* ============================================================
   FRAMEWORK — overview
   No CAPS titles. Larger, sentence-case names.
   ============================================================ */
.framework {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding-block: var(--s-20);
  position: relative;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.framework a, .framework button { pointer-events: auto; }
/* Spotting blob — animated drift behind framework */
.framework::before {
  content: "";
  position: absolute;
  top: -10%;
  left: 15%;
  width: 540px; height: 540px;
  background: radial-gradient(closest-side, rgba(16,185,129,0.10), transparent 65%);
  filter: blur(60px);
  pointer-events: none;
  z-index: -1;
  animation: spot-c 20s ease-in-out infinite;
}
.framework::after {
  content: "";
  position: absolute;
  bottom: -10%;
  right: 5%;
  width: 480px; height: 480px;
  background: radial-gradient(closest-side, rgba(99,102,241,0.10), transparent 65%);
  filter: blur(60px);
  pointer-events: none;
  z-index: -1;
  animation: spot-d 24s ease-in-out infinite;
}
@keyframes spot-c {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.55; }
  50%      { transform: translate(70px, 50px) scale(1.15); opacity: 0.9; }
}
@keyframes spot-d {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  50%      { transform: translate(-60px, -40px) scale(1.12); opacity: 0.85; }
}
.framework__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-12);
  position: relative;
}
.framework__head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: var(--s-12);
  align-items: end;
  margin-bottom: var(--s-10);
}
.framework__title {
  font-size: clamp(28px, 3vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 600;
  color: var(--fg);
  max-width: 720px;
}
.framework__sub {
  font-size: 16px; line-height: 1.55;
  color: var(--fg-mid);
  max-width: 460px;
}
.framework__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-3);
}
.fw-stage {
  position: relative;
  padding: var(--s-6);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(12,12,10,0.08);
  border-radius: var(--r-4);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
          backdrop-filter: blur(20px) saturate(140%);
  transition: all var(--dur-2) var(--ease);
  display: flex; flex-direction: column;
  gap: var(--s-2);
  min-height: 220px;
  isolation: isolate;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, var(--shadow-2);
}
.fw-stage:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, var(--shadow-3);
}
.fw-stage__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
  font-weight: 500;
}
.fw-stage__name {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--fg);
}
.fw-stage__desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-mid);
}
.fw-stage__meta {
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: auto;
  padding-top: var(--s-4);
  border-top: 1px solid var(--border);
}
.fw-stage__arrow {
  position: absolute;
  top: var(--s-5);
  right: var(--s-5);
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all var(--dur-2) var(--ease);
  color: var(--fg-mid);
}
.fw-stage:hover .fw-stage__arrow {
  background: var(--ink-950);
  border-color: var(--ink-950);
  color: var(--ink-0);
  transform: translate(2px, -2px);
}

/* ============================================================
   CATEGORIES — preview panels
   No 01/04 numbering. Cleaner.
   ============================================================ */
/* ── Cats section: third block, glass + spotting + cluster fadeout ── */
.cats {
  padding-block: var(--s-24);
  position: relative;
  z-index: 1;
  background: rgba(251, 251, 250, 0.26);
  -webkit-backdrop-filter: blur(8px) saturate(130%);
          backdrop-filter: blur(8px) saturate(130%);
  border-top: 1px solid rgba(12,12,10,0.06);
  border-top-left-radius: 40px;
  border-top-right-radius: 40px;
  margin-top: -40px;
  overflow: hidden;
  pointer-events: none;
}
.cats > * { pointer-events: auto; }
.cats a, .cats button { pointer-events: auto; }

/* Spotting blobs — animated */
.cats::before {
  content: "";
  position: absolute;
  top: 8%;
  left: -15%;
  width: 680px; height: 680px;
  background: radial-gradient(closest-side, rgba(217,119,6,0.14), transparent 65%);
  filter: blur(60px);
  pointer-events: none;
  z-index: -1;
  animation: spot-a 18s ease-in-out infinite;
}
.cats::after {
  content: "";
  position: absolute;
  top: 55%;
  right: -12%;
  width: 720px; height: 720px;
  background: radial-gradient(closest-side, rgba(225,29,72,0.10), transparent 70%);
  filter: blur(70px);
  pointer-events: none;
  z-index: -1;
  animation: spot-b 22s ease-in-out infinite;
}
@keyframes spot-a {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.55; }
  50%      { transform: translate(60px, 40px) scale(1.18); opacity: 1; }
}
@keyframes spot-b {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.5; }
  50%      { transform: translate(-50px, -30px) scale(1.12); opacity: 0.95; }
}

.cats__intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s-12);
  align-items: end;
  margin-bottom: var(--s-12);
  position: relative;
}
.cats__intro h2 {
  font-size: var(--t-display-3);
  line-height: 1.04;
  letter-spacing: -0.025em;
  font-weight: 600;
  max-width: 760px;
}
.cats__intro p {
  font-size: 17px; line-height: 1.55;
  color: var(--fg-mid);
  max-width: 540px;
}

.cat {
  border-top: 1px solid var(--border);
  padding-block: var(--s-12);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--s-12);
  position: relative;
}
.cat:last-child { border-bottom: 1px solid var(--border); }
.cat__left {
  display: flex; flex-direction: column; gap: var(--s-5);
}

/* Stage icon tile — glassmorphic, subtle gradient sheen */
.cat__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  border-radius: 16px;
  background: linear-gradient(140deg, rgba(255,255,255,0.65), rgba(255,255,255,0.35));
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  border: 1px solid rgba(12,12,10,0.08);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, var(--shadow-2);
  color: var(--fg);
  position: relative;
  overflow: hidden;
  margin-bottom: 4px;
  transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.cat__icon::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 30% 0%, rgba(217,119,6,0.22), transparent 60%);
  pointer-events: none;
}
.cat__icon svg { width: 30px; height: 30px; position: relative; z-index: 1; }
.cat:hover .cat__icon { transform: translateY(-2px) rotate(-1.5deg); box-shadow: var(--shadow-3); }

/* Per-stage tint */
.cat__icon[data-stage="onboarding"]::after { background: radial-gradient(120% 80% at 30% 0%, rgba(217,119,6,0.30), transparent 60%); }
.cat__icon[data-stage="initially"]::after  { background: radial-gradient(120% 80% at 30% 0%, rgba(16,185,129,0.30), transparent 60%); }
.cat__icon[data-stage="during"]::after     { background: radial-gradient(120% 80% at 30% 0%, rgba(99,102,241,0.30), transparent 60%); }
.cat__icon[data-stage="overtime"]::after   { background: radial-gradient(120% 80% at 30% 0%, rgba(225,29,72,0.30), transparent 60%); }

.cat__name {
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.02;
}
.cat__lede {
  font-size: 18px; line-height: 1.55;
  color: var(--fg-mid);
  max-width: 560px;
}
.cat__cta {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: var(--s-3);
  color: var(--fg);
  font-weight: 500;
  font-size: 14px;
  align-self: flex-start;
  border-bottom: 1px solid var(--fg);
  padding-bottom: 2px;
  transition: gap var(--dur-2) var(--ease);
}
.cat__cta:hover { gap: 14px; }
.cat__subs {
  display: grid;
  gap: 1px;
  background: rgba(12,12,10,0.05);
  border: 1px solid rgba(12,12,10,0.06);
  border-radius: var(--r-4);
  overflow: hidden;
  -webkit-backdrop-filter: blur(18px) saturate(140%);
          backdrop-filter: blur(18px) saturate(140%);
}
.cat__sub {
  background: rgba(255, 255, 255, 0.68);
  padding: var(--s-5) var(--s-6);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  transition: background var(--dur-2) var(--ease);
}
.cat__sub:hover { background: rgba(255, 255, 255, 0.92); }
.cat__sub-name {
  font-weight: 600; font-size: 15px; letter-spacing: -0.005em;
  transition: color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
.cat__sub-desc { color: var(--fg-mid); font-size: 13.5px; }

/* Animated arrow chip — replaces the count badge.
   Sits inside a circle that brightens + the arrow translates on hover. */
.cat__sub-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(12, 12, 10, 0.08);
  color: var(--fg-mid);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  transition: all var(--dur-2) var(--ease);
}
.cat__sub-arrow svg {
  position: relative;
  z-index: 1;
  transition: transform var(--dur-2) var(--ease-out);
}
.cat__sub-arrow::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink-950);
  transform: translateX(-100%);
  transition: transform var(--dur-3) var(--ease-out);
}
.cat__sub:hover .cat__sub-arrow {
  color: var(--ink-0);
  border-color: var(--ink-950);
}
.cat__sub:hover .cat__sub-arrow::before { transform: translateX(0); }
.cat__sub:hover .cat__sub-arrow svg { transform: translateX(2px); }
.cat__sub:hover .cat__sub-name { transform: translateX(2px); }

/* ============================================================
   FOOTER — animating glow + balanced lockup
   ============================================================ */
.foot {
  border-top: 1px solid var(--border);
  padding-block: var(--s-20) var(--s-20);
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--ink-25) 0%, var(--ink-50) 100%);
  isolation: isolate;
  border-top-left-radius: 32px;
  border-top-right-radius: 32px;
  margin-top: -32px;
}
.foot::before {
  content: "";
  position: absolute;
  top: -20%;
  left: 10%;
  width: 720px; height: 720px;
  background: radial-gradient(closest-side, rgba(217,119,6,0.18), transparent 70%);
  pointer-events: none;
  filter: blur(60px);
  z-index: -1;
  animation: foot-glow-1 16s ease-in-out infinite;
}
.foot::after {
  content: "";
  position: absolute;
  top: 10%;
  right: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(closest-side, rgba(99,102,241,0.16), transparent 70%);
  pointer-events: none;
  filter: blur(60px);
  z-index: -1;
  animation: foot-glow-2 20s ease-in-out infinite;
}
@keyframes foot-glow-1 {
  0%, 100% { opacity: 0.6; transform: translate(0, 0) scale(1); }
  50%      { opacity: 1.0; transform: translate(40px, 30px) scale(1.15); }
}
@keyframes foot-glow-2 {
  0%, 100% { opacity: 0.7; transform: translate(0, 0) scale(1); }
  50%      { opacity: 1.0; transform: translate(-50px, -20px) scale(1.1); }
}

.foot__lockup {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.85fr);
  gap: var(--s-12);
  align-items: flex-start;
  margin-bottom: var(--s-12);
}
.foot__bigword {
  font-size: clamp(40px, 5.4vw, 88px);
  line-height: 1.0;
  letter-spacing: -0.04em;
  font-weight: 600;
  color: var(--fg);
  max-width: 100%;
}
/* "agentic" — same gradient family as hero */
.foot__bigword em {
  font-style: normal;
  font-family: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  background: linear-gradient(120deg,
    #d97706 0%, #e11d48 38%, #7c3aed 72%, #1e40af 100%);
  background-size: 220% 220%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
          color: transparent;
  animation: agentic-shift 14s ease-in-out infinite;
}
.foot__pitch {
  font-size: 16px; line-height: 1.6;
  color: var(--fg-mid);
  max-width: 420px;
  padding-top: var(--s-3);
}

/* Logo strip — placeholder slots for now */
.foot__logos {
  margin-top: var(--s-16);
  padding-block: var(--s-8) var(--s-10);
  border-top: 1px dashed rgba(12,12,10,0.10);
  border-bottom: 1px dashed rgba(12,12,10,0.10);
  margin-bottom: var(--s-12);
}
.foot__logos-eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 600;
  margin-bottom: var(--s-6);
}
.foot__logos-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  align-items: center;
}
.foot__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 168px;
  height: 72px;
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-3);
  background: rgba(255,255,255,0.45);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
          backdrop-filter: blur(10px) saturate(140%);
  border: 1px solid rgba(12,12,10,0.06);
  transition: all var(--dur-2) var(--ease);
  user-select: none;
  filter: saturate(0.85) opacity(0.85);
}
.foot__logo:hover {
  filter: saturate(1) opacity(1);
  background: rgba(255,255,255,0.85);
  border-color: rgba(12,12,10,0.12);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.foot__logo svg {
  display: block;
  height: 44px;
  width: auto;
  max-width: 100%;
}
.foot__bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--s-6);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-6);
  flex-wrap: wrap;
}
.foot__meta {
  font-size: 13px; color: var(--fg-mid);
}
.foot__links { display: flex; gap: var(--s-5); }
.foot__links a { color: var(--fg-mid); font-size: 13px; transition: color var(--dur-1) var(--ease); }
.foot__links a:hover { color: var(--fg); }

/* ============================================================
   LIBRARY PAGE — sidebar shell
   No overflow:hidden here — that would break position:sticky on
   the sidebar. Spotting blobs are hoisted to body level.
   ============================================================ */
.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--nav-h));
  position: relative;
}

/* Page-level shimmer — animated radial blobs fixed to viewport.
   Body must be transparent (set above) so these read through. */
body.has-shell::before {
  content: "";
  position: fixed;
  top: 10%;
  right: -10%;
  width: 720px; height: 720px;
  background: radial-gradient(closest-side, rgba(217,119,6,0.12), transparent 65%);
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
  animation: page-spot-a 22s ease-in-out infinite;
}
body.has-shell::after {
  content: "";
  position: fixed;
  bottom: -10%;
  left: 5%;
  width: 640px; height: 640px;
  background: radial-gradient(closest-side, rgba(99,102,241,0.10), transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
  animation: page-spot-b 26s ease-in-out infinite;
}
@keyframes page-spot-a {
  0%, 100% { transform: translate(0,0) scale(1); opacity: 0.55; }
  50%      { transform: translate(-60px, 70px) scale(1.15); opacity: 0.9; }
}
@keyframes page-spot-b {
  0%, 100% { transform: translate(0,0) scale(1); opacity: 0.5; }
  50%      { transform: translate(70px, -50px) scale(1.18); opacity: 0.85; }
}
.sidebar {
  position: sticky;
  top: var(--nav-h);
  align-self: start;
  height: calc(100vh - var(--nav-h));
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid var(--border);
  background: rgba(255,255,255,0.78);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
          backdrop-filter: blur(20px) saturate(160%);
  padding: var(--s-5) var(--s-5) var(--s-12);
  z-index: 5;
}
.sidebar__title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: var(--s-4);
  padding-inline: var(--s-3);
}
.sidebar__title h2 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--fg);
}
.sidebar__title small {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
}

.tree { display: flex; flex-direction: column; gap: var(--s-1); }
.tree__stage {
  border-radius: var(--r-3);
  position: relative;
}
.tree__stage-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px;
  border-radius: var(--r-3);
  cursor: pointer;
  font-size: 14px; font-weight: 600;
  color: var(--fg);
  user-select: none;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
  width: 100%;
  position: relative;
}
.tree__stage-head:hover { background: var(--ink-50); }
.tree__stage-head .num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
  font-weight: 500;
  transition: color var(--dur-1) var(--ease);
}
.tree__stage-head .name { flex: 1; text-align: left; }
.tree__stage-head .chev {
  width: 13px; height: 13px;
  transition: transform var(--dur-2) var(--ease);
  color: var(--fg-muted);
}
.tree__stage[aria-expanded="true"] .chev { transform: rotate(90deg); }
.tree__stage-body { display: none; padding-block: 4px 8px; }
.tree__stage[aria-expanded="true"] .tree__stage-body { display: block; }

/* ── ACTIVE SIDEBAR ITEM — soft colored shimmer
   Applies to stage / sub-category / pattern depending on scroll depth.
   ─────────────────────────────────────────────────────── */
@keyframes sb-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.tree__stage.is-current .tree__stage-head,
.tree__sub.is-current > .tree__sub-head,
.tree__pattern.is-current {
  position: relative;
  color: var(--fg);
  background: linear-gradient(90deg,
    rgba(217, 119, 6, 0.16) 0%,
    rgba(225, 29, 72, 0.13) 35%,
    rgba(124, 58, 237, 0.14) 70%,
    rgba(99, 102, 241, 0.14) 100%);
  background-size: 220% 100%;
  background-position: 0% 50%;
  animation: sb-shimmer 6s ease-in-out infinite;
  font-weight: 600;
}
/* Soft accent rail on the left for the active item */
.tree__stage.is-current .tree__stage-head::after,
.tree__sub.is-current > .tree__sub-head::after,
.tree__pattern.is-current::after {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 2px;
  border-radius: 1px;
  background: linear-gradient(180deg, var(--accent), #e11d48 50%, #7c3aed);
  box-shadow: 0 0 8px rgba(217,119,6,0.45);
}
/* Make the relevant items position:relative so ::after anchors correctly */
.tree__stage-head { position: relative; }
.tree__sub-head { position: relative; padding-left: 8px; }
.tree__pattern { position: relative; }

.tree__sub {
  margin-top: 4px;
  margin-left: 18px;
  padding-left: var(--s-3);
  border-left: 1px solid var(--border);
}
/* Sub-category header — sentence case, visible */
.tree__sub-head {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-mid);
  padding: 8px 0 4px;
  letter-spacing: -0.005em;
}
.tree__pattern {
  display: flex; align-items: center;
  padding: 6px 10px;
  border-radius: var(--r-2);
  font-size: 13px;
  color: var(--fg-mid);
  transition: all var(--dur-1) var(--ease);
}
.tree__pattern:hover { background: var(--ink-50); color: var(--fg); }
.tree__pattern .badge-dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-left: 6px;
  vertical-align: middle;
  opacity: 0;
}
.tree__pattern[data-status="full"] .badge-dot { opacity: 1; }

.sidebar__extras {
  margin-top: var(--s-10);
  padding-top: var(--s-6);
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.sidebar__extra {
  padding: 8px 12px;
  border-radius: var(--r-3);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-mid);
  transition: background var(--dur-1) var(--ease);
}
.sidebar__extra:hover { background: var(--ink-50); color: var(--fg); }

/* Library main — centered within its grid cell so right whitespace is balanced */
.main {
  padding: var(--s-12) var(--s-10);
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}
.main__head {
  display: flex; flex-direction: column; gap: var(--s-3);
  padding-bottom: var(--s-8);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-10);
}
.main__title {
  font-size: clamp(32px, 3.4vw, 48px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  font-weight: 600;
  max-width: 900px;
}
.main__lede {
  font-size: 17px; line-height: 1.55;
  color: var(--fg-mid);
  max-width: 720px;
  margin-top: var(--s-2);
}
.main__meta {
  display: flex; flex-wrap: wrap; gap: var(--s-5);
  margin-top: var(--s-3);
}
.main__meta-item { font-size: 13px; color: var(--fg-mid); }
.main__meta-item strong { color: var(--fg); font-weight: 600; }

.lib-stage { margin-bottom: var(--s-16); }
.lib-stage__head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-8);
  gap: var(--s-6);
  flex-wrap: wrap;
}
.lib-stage__title {
  font-size: var(--t-h1);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.lib-stage__meta { font-size: 13px; color: var(--fg-muted); font-family: var(--font-mono); margin-bottom: 6px; }
.lib-stage__lede { font-size: 16px; color: var(--fg-mid); max-width: 560px; margin-top: 4px; }

.lib-sub { margin-bottom: var(--s-12); }
.lib-sub__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-6);
  padding-bottom: var(--s-3);
  border-bottom: 1px dashed var(--border);
  margin-bottom: var(--s-5);
}
/* Sub-category name — sentence case, visible h-style */
.lib-sub__name {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--fg);
}
.lib-sub__name .count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-muted);
  font-weight: 500;
  margin-left: 10px;
  vertical-align: middle;
}
.lib-sub__desc { font-size: 14px; color: var(--fg-mid); max-width: 420px; text-align: right; }

.lib-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-4);
}
@media (max-width: 1200px) { .lib-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 780px) { .lib-grid { grid-template-columns: 1fr; } }

.pcard {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  overflow: hidden;
  transition: transform var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
  text-align: left;
  cursor: pointer;
  padding: 0;
}
.pcard:hover {
  border-color: var(--fg);
  box-shadow: var(--shadow-3);
  transform: translateY(-2px);
}
.pcard__visual {
  aspect-ratio: 16 / 10;
  background: var(--ink-25);
  border-bottom: 1px solid var(--border);
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.pcard__body {
  padding: var(--s-5);
  display: flex; flex-direction: column; gap: 8px;
  flex: 1;
}
.pcard__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pcard__name { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; }
.pcard__line { font-size: 13px; line-height: 1.45; color: var(--fg-mid); }
.pcard__foot { display: flex; align-items: center; justify-content: space-between; padding-top: 4px; margin-top: auto; }
.pcard__open { font-size: 12px; color: var(--fg); display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.pcard__open svg { transition: transform var(--dur-2) var(--ease); }
.pcard:hover .pcard__open svg { transform: translateX(2px); }
.pcard--placeholder { background: var(--ink-25); }
.pcard--placeholder .pcard__visual {
  background: repeating-linear-gradient(135deg, transparent 0 12px, rgba(0,0,0,0.025) 12px 13px);
}

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg-mid);
  white-space: nowrap;
}
.badge--crit { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.badge--high { background: var(--accent-soft); color: #92400e; border-color: #fcd34d; }
.badge--med  { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.badge--low  { background: var(--ink-50); color: var(--fg-muted); }
.badge--sub  { background: var(--ink-25); color: var(--fg-alt); }
.badge--hax  { font-family: var(--font-mono); font-size: 10px; padding: 2px 6px; }
.badge--full { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.badge--scaffold { background: var(--ink-50); color: var(--fg-muted); border-color: var(--border); }

/* ============================================================
   PATTERN DETAIL — 3-column balanced layout
   sidebar · content · "On this page" TOC
   ============================================================ */
.detail-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  min-height: calc(100vh - var(--nav-h));
  position: relative;
}
.detail {
  padding: var(--s-12) var(--s-10) var(--s-20);
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

.bread {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px;
  color: var(--fg-muted);
  margin-bottom: var(--s-6);
  flex-wrap: wrap;
}
.bread a { color: var(--fg-mid); transition: color var(--dur-1) var(--ease); }
.bread a:hover { color: var(--fg); }
.bread svg { opacity: 0.5; }
.bread .current { color: var(--fg); font-weight: 500; }

.detail__hero {
  padding-bottom: var(--s-10);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--s-12);
}
.detail__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s-5); }
.detail__name {
  font-size: clamp(40px, 4.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
}
.detail__oneline {
  margin-top: var(--s-5);
  font-size: 20px; line-height: 1.45;
  color: var(--fg-mid);
  max-width: 700px;
}

.section-block {
  padding-block: var(--s-10);
  border-bottom: 1px solid var(--border);
}
.section-block:last-child { border-bottom: none; }
.section-block__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-6);
  margin-bottom: var(--s-5);
}
/* Sentence case, larger, visible — not tracked uppercase */
.section-block__title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--fg);
}
.section-block__lede {
  font-size: 13.5px; color: var(--fg-mid); max-width: 380px; text-align: right;
}

.qa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-3);
}
@media (max-width: 680px) { .qa-grid { grid-template-columns: 1fr; } }
.qa-item {
  padding: var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  background: var(--surface);
}
.qa-item__k {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.qa-item__v {
  font-size: 14.5px; line-height: 1.55;
  color: var(--fg-alt);
}

.example {
  background: var(--ink-25);
  border: 1px solid var(--border);
  border-radius: var(--r-5);
  padding: var(--s-12);
  display: grid; place-items: center;
  min-height: 280px;
  position: relative;
}
.example::before {
  content: "Live preview";
  position: absolute;
  top: var(--s-4); left: var(--s-4);
  font-size: 11px;
  font-weight: 500;
  color: var(--fg-mid);
  padding: 3px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
}

.composed { display: flex; flex-wrap: wrap; gap: 6px; }
.composed__chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-2);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--fg-alt);
}
.composed__chip::before {
  content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--accent);
}

.code {
  background: var(--ink-950);
  color: var(--ink-100);
  border-radius: var(--r-4);
  padding: var(--s-5) var(--s-6);
  font-family: var(--font-mono);
  font-size: 12.5px; line-height: 1.6;
  overflow: auto;
  position: relative;
  border: 1px solid var(--ink-800);
}
.code__copy {
  position: absolute; top: 12px; right: 12px;
  padding: 4px 10px;
  font-size: 11px;
  border-radius: var(--r-2);
  background: var(--ink-800);
  color: var(--ink-200);
  border: 1px solid var(--ink-700);
}
.code__copy:hover { background: var(--ink-700); color: var(--ink-0); }

.related {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-3);
}
@media (max-width: 700px) { .related { grid-template-columns: 1fr; } }
.related__item {
  display: block;
  padding: var(--s-4) var(--s-5);
  border: 1px solid var(--border);
  border-radius: var(--r-3);
  background: var(--surface);
  transition: all var(--dur-2) var(--ease);
}
.related__item:hover { border-color: var(--fg); transform: translateY(-2px); }
.related__name { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.related__meta { margin-top: 4px; font-size: 12px; color: var(--fg-muted); }

.detail__nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3);
  margin-top: var(--s-10);
}
.detail__nav a {
  display: flex; flex-direction: column;
  padding: var(--s-5) var(--s-6);
  border: 1px solid var(--border);
  border-radius: var(--r-4);
  transition: all var(--dur-2) var(--ease);
  background: var(--surface);
}
.detail__nav a:hover { border-color: var(--fg); background: var(--ink-25); }
.detail__nav .dir { font-size: 12px; color: var(--fg-muted); font-weight: 500; }
.detail__nav .name { font-size: 16px; font-weight: 600; margin-top: 4px; letter-spacing: -0.01em; }
.detail__nav .next { text-align: right; }

/* "On this page" TOC */
.toc {
  position: sticky;
  top: calc(var(--nav-h) + var(--s-10));
  align-self: start;
  padding: var(--s-12) var(--s-6) var(--s-12) var(--s-3);
  font-size: 13px;
}
.toc__title {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 600;
  margin-bottom: var(--s-4);
}
.toc__list { display: flex; flex-direction: column; gap: 2px; }
.toc__link {
  display: block;
  padding: 6px 10px 6px 14px;
  color: var(--fg-mid);
  font-size: 13px;
  border-left: 1px solid var(--border);
  transition: all var(--dur-1) var(--ease);
  margin-left: -1px;
}
.toc__link:hover { color: var(--fg); border-color: var(--fg-mid); }
.toc__link.is-active { color: var(--fg); border-color: var(--fg); font-weight: 500; }
.toc__meta {
  margin-top: var(--s-8);
  padding-top: var(--s-5);
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: var(--s-3);
}
.toc__meta-row { display: flex; flex-direction: column; gap: 2px; }
.toc__meta-k { font-size: 11px; color: var(--fg-muted); }
.toc__meta-v { font-size: 13px; color: var(--fg); font-weight: 500; }

/* ============================================================
   MOCK MICRO-UIs
   ============================================================ */
.mock {
  width: 78%;
  background: var(--surface);
  border-radius: var(--r-3);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  padding: 12px;
  font-size: 11px;
  color: var(--fg);
}
.mock--lg { width: 70%; padding: 16px; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse {  0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
@keyframes blink {  0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* Strong fade-in + parallax reveal */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: translateY(0); }

/* Continuous parallax — landing.js writes --py variable per element */
[data-parallax-y] { transform: translateY(var(--py, 0px)); transition: transform 100ms linear; will-change: transform; }
[data-parallax-y].reveal:not(.is-in) { transform: translateY(40px); }
[data-parallax-y].reveal.is-in { transform: translateY(var(--py, 0px)); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .detail-shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 1000px) {
  .shell, .detail-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .main, .detail { padding: var(--s-8) var(--s-6); }
  .framework__head { grid-template-columns: 1fr; }
  .framework__grid { grid-template-columns: repeat(2, 1fr); }
  .cat { grid-template-columns: 1fr; }
  .stat-band__grid { grid-template-columns: 1fr 1fr; gap: var(--s-5); }
  .cats__intro { grid-template-columns: 1fr; }
  .foot__lockup { grid-template-columns: 1fr; align-items: start; }
}
@media (max-width: 720px) {
  .brand__tagline { display: none; }
  .gnav__sdk { display: none; }
}
@media (max-width: 480px) {
  .gnav__cta span, .gnav__cta { font-size: 12px; padding: 8px 14px; }
}
@media (max-width: 640px) {
  :root { --gutter: 20px; }
  .framework__grid { grid-template-columns: 1fr; }
  .stat-band__grid { grid-template-columns: 1fr; }
  .stat-item__v { font-size: 32px; }
}
