/* ==========================================================================
   usamahabib.com — Design System
   Reference implementation of Section 6 of the Build Specification.
   Every value here is a token. Do NOT hard-code colours, sizes or spacing
   in components — extend this file instead.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  /* Colour — Spec 6.1 */
  --ink-900: #0B1120;
  --ink-700: #1F2A44;
  --ink-500: #4B5675;
  --ink-300: #8A94AD;
  --border: #E3E8F0;
  --border-strong: #CDD5E3;

  --surface: #FFFFFF;
  --surface-alt: #F6F8FC;
  --surface-dark: #0B1120;
  --surface-dark-2: #141C31;

  --primary: #4338CA;
  --primary-hover: #3730A3;
  --primary-soft: #EEF0FF;

  --ai-violet: #7C3AED;
  --ai-gradient: linear-gradient(135deg, #4338CA 0%, #7C3AED 100%);

  --cta: #FF5C28;          /* CONVERSION BUTTONS ONLY. Never decorative. */
  --cta-hover: #E24A18;

  --success: #0E9F6E;
  --warning: #F59E0B;

  /* Typography — Spec 6.2
     PROTOTYPE NOTE: fonts loaded from CDN for preview only.
     In production, SELF-HOST + subset + size-adjust fallback (Spec 6.2 / 11.3). */
  --font-heading: "General Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, monospace;

  /* Spacing — 4px base */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 24px;  --s-6: 32px;  --s-7: 40px;  --s-8: 48px;
  --s-9: 64px;  --s-10: 80px; --s-11: 96px; --s-12: 128px; --s-13: 160px;

  /* Layout */
  --container: 1280px;
  --container-inner: 1120px;
  --measure: 720px;          /* Article measure. Non-negotiable. Spec 6.3 */
  --gutter: 20px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 999px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(11,17,32,.06);
  --shadow-md: 0 4px 16px rgba(11,17,32,.08);
  --shadow-lg: 0 12px 40px rgba(11,17,32,.12);

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 150ms;
  --dur-base: 250ms;

  --glass: rgba(255,255,255,.88);
  --header-h: 72px;
}

@media (min-width: 768px)  { :root { --gutter: 32px; } }
@media (min-width: 1024px) { :root { --gutter: 48px; } }

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-700);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
/* Always ship explicit width/height on <img> in production — zero CLS. Spec 11.3 */

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  color: var(--ink-900);
  margin: 0 0 var(--s-4);
  font-weight: 600;
  line-height: 1.2;
}

p { margin: 0 0 var(--s-5); }

a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--primary-hover); }

/* Focus — visible, 3:1 contrast. Spec 13 */
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--ink-900); color: #fff; padding: 12px 20px;
  border-radius: 0 0 var(--radius-sm) 0; text-decoration: none;
}
.skip-link:focus { left: 0; color: #fff; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   3. TYPE SCALE — Spec 6.2
   -------------------------------------------------------------------------- */
.t-display { font-size: 38px; line-height: 1.15; letter-spacing: -0.02em; font-weight: 600; }
.t-h1      { font-size: 32px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 600; }
.t-h2      { font-size: 27px; line-height: 1.26; letter-spacing: -0.01em; font-weight: 600; }
.t-h3      { font-size: 22px; line-height: 1.36; letter-spacing: -0.01em; font-weight: 600; }
.t-h4      { font-size: 19px; line-height: 1.47; font-weight: 600; }
.t-body-lg { font-size: 18px; line-height: 1.67; }
.t-body    { font-size: 16px; line-height: 1.63; }
.t-small   { font-size: 14px; line-height: 1.57; }
.t-caption { font-size: 13px; line-height: 1.54; }

@media (min-width: 768px) {
  .t-display { font-size: 60px; line-height: 1.1; }
  .t-h1      { font-size: 48px; line-height: 1.17; }
  .t-h2      { font-size: 36px; line-height: 1.22; }
  .t-h3      { font-size: 27px; line-height: 1.33; }
  .t-h4      { font-size: 21px; line-height: 1.43; }
  .t-body-lg { font-size: 19px; line-height: 1.75; }
  .t-body    { font-size: 17px; line-height: 1.65; }
  .t-small   { font-size: 15px; line-height: 1.6; }
}

.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--primary);
  margin: 0 0 var(--s-3); display: block;
}
.eyebrow--light { color: #A5B4FC; }

.lede { color: var(--ink-500); }
.muted { color: var(--ink-500); }
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   4. LAYOUT
   -------------------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: var(--container-inner); }
.container--measure { max-width: calc(var(--measure) + var(--gutter) * 2); }

.section { padding-block: var(--s-9); }
.section--lg { padding-block: var(--s-11); }
.section--alt { background: var(--surface-alt); }
.section--dark { background: var(--surface-dark); color: #C7CFE0; }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: #fff; }

@media (min-width: 768px) {
  .section { padding-block: var(--s-11); }
  .section--lg { padding-block: var(--s-12); }
}

.section-head { max-width: 720px; margin-bottom: var(--s-8); }
.section-head--center { margin-inline: auto; text-align: center; }

.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid { gap: var(--s-6); }
}

.split { display: grid; gap: var(--s-8); align-items: center; }
@media (min-width: 1024px) {
  .split { grid-template-columns: 7fr 5fr; gap: var(--s-10); }
  .split--even { grid-template-columns: 1fr 1fr; }
}

.stack > * + * { margin-top: var(--s-4); }

/* --------------------------------------------------------------------------
   5. BUTTONS — Spec 6.6
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  font-family: var(--font-body); font-weight: 600; font-size: 16px; line-height: 1;
  padding: 14px 24px; border-radius: var(--radius-md);
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }

/* CTA orange = conversion only. Spec 6.1 */
.btn--cta { background: var(--cta); color: #fff; }
.btn--cta:hover { background: var(--cta-hover); color: #fff; }

.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); color: #fff; }

.btn--ghost { background: transparent; color: var(--primary); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

.btn--ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.btn--ghost-light:hover { border-color: #fff; background: rgba(255,255,255,.08); color: #fff; }

.btn--sm { padding: 10px 16px; font-size: 14px; }
.btn--lg { padding: 17px 32px; font-size: 17px; }
.btn--block { width: 100%; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 600; font-size: 15px; text-decoration: none; color: var(--primary);
}
.link-arrow::after { content: "\2192"; transition: transform var(--dur-fast) var(--ease); }
.link-arrow:hover::after { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   6. PILLS, BADGES, TAGS
   -------------------------------------------------------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  padding: 5px 12px; border-radius: var(--radius-full);
  background: var(--primary-soft); color: var(--primary); text-decoration: none;
}
.pill--ai { background: #F3E8FF; color: var(--ai-violet); }
.pill--muted { background: var(--surface-alt); color: var(--ink-500); }
.pill--success { background: #E6F7F0; color: var(--success); }
.pill--outline { background: transparent; border: 1px solid var(--border); color: var(--ink-500); }
a.pill:hover { filter: brightness(.95); }

/* --------------------------------------------------------------------------
   7. HEADER — Spec 7.1 S0
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: box-shadow var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.site-header.is-scrolled { box-shadow: var(--shadow-sm); border-bottom-color: var(--border); }

.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: var(--s-5); }

.logo { font-family: var(--font-heading); font-weight: 700; font-size: 19px; color: var(--ink-900); text-decoration: none; letter-spacing: -.02em; }
.logo span { color: var(--primary); }

.nav { display: none; }
@media (min-width: 1024px) { .nav { display: flex; align-items: center; gap: var(--s-2); } }

.nav__item { position: relative; }
.nav__link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 500; color: var(--ink-700); text-decoration: none;
  background: none; border: 0; cursor: pointer; font-family: inherit;
}
.nav__link:hover { background: var(--surface-alt); color: var(--ink-900); }
.nav__link[aria-expanded="true"] { background: var(--surface-alt); }
.nav__link .chev { font-size: 10px; color: var(--ink-300); }

/* Mega menu — data-driven in WP. Spec 5.5 */
.megamenu {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(-6px);
  width: 720px; max-width: 90vw;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: var(--s-5);
  opacity: 0; visibility: hidden; transition: all var(--dur-base) var(--ease);
}
.nav__item.is-open .megamenu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.megamenu__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.megamenu__link {
  display: block; padding: var(--s-3); border-radius: var(--radius-md); text-decoration: none;
  transition: background var(--dur-fast) var(--ease);
}
.megamenu__link:hover { background: var(--surface-alt); }
.megamenu__title { font-weight: 600; color: var(--ink-900); font-size: 15px; display: flex; align-items: center; gap: 8px; }
.megamenu__desc { font-size: 13px; color: var(--ink-500); margin: 2px 0 0; }
.megamenu__footer {
  margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; font-size: 14px;
}

.header-actions { display: flex; align-items: center; gap: var(--s-3); }

.lang-switch { position: relative; }
.lang-switch__btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 10px;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 14px; color: var(--ink-500); cursor: pointer;
}
.lang-switch__btn:hover { border-color: var(--border-strong); color: var(--ink-700); }
.lang-switch__menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 170px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 10;
}
.lang-switch.is-open .lang-switch__menu { display: block; }
.lang-switch__menu a {
  display: block; padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--ink-700); text-decoration: none;
}
.lang-switch__menu a:hover { background: var(--surface-alt); }
.lang-switch__menu a[aria-current="true"] { color: var(--primary); font-weight: 600; }

.burger {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 0 10px;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
}
.burger span { display: block; height: 2px; background: var(--ink-700); border-radius: 2px; }
@media (min-width: 1024px) { .burger { display: none; } }

.mobile-nav {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 99;
  background: var(--surface); padding: var(--s-5) var(--gutter) var(--s-8);
  overflow-y: auto; display: none; flex-direction: column;
}
.mobile-nav.is-open { display: flex; }
.mobile-nav a { display: block; padding: 14px 0; font-size: 18px; font-weight: 500; color: var(--ink-900); text-decoration: none; border-bottom: 1px solid var(--border); }
.mobile-nav__cta { margin-top: auto; padding-top: var(--s-6); }

/* --------------------------------------------------------------------------
   8. HERO
   -------------------------------------------------------------------------- */
.hero { padding-block: var(--s-9) var(--s-10); position: relative; }
@media (min-width: 768px) { .hero { padding-block: var(--s-11) var(--s-12); } }

.hero__media { position: relative; }
.hero__glow {
  position: absolute; inset: 10% -10% -10% -10%;
  background: var(--ai-gradient); filter: blur(70px); opacity: .25; z-index: 0;
  border-radius: 50%;
}
.hero__media .ph { position: relative; z-index: 1; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-6); }
.hero__microproof { margin-top: var(--s-4); color: var(--ink-300); font-size: 15px; }

/* Placeholder image blocks — replace with real assets */
.ph {
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #EEF1F7, #EEF1F7 10px, #F6F8FC 10px, #F6F8FC 20px);
  color: var(--ink-300); font-size: 13px; font-family: var(--font-mono);
  border-radius: var(--radius-lg); text-align: center; padding: var(--s-4);
}
.ph--16x9 { aspect-ratio: 16/9; }
.ph--4x5 { aspect-ratio: 4/5; }
.ph--1x1 { aspect-ratio: 1/1; }
.ph--dark { background: repeating-linear-gradient(45deg,#1A2338,#1A2338 10px,#141C31 10px,#141C31 20px); color: #4B5675; }

/* .ph is now an <img> (real asset slot) instead of a text-label div — keep the
   exact same box (aspect-ratio, radius, background-while-loading) and just make
   the image itself fill it without distortion. Swap the src to go live. */
img.ph { display: block; width: 100%; height: 100%; object-fit: cover; padding: 0; }

/* --------------------------------------------------------------------------
   9. LOGO STRIP
   -------------------------------------------------------------------------- */
.logostrip { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s-5) var(--s-8); }
.logostrip__item {
  height: 34px; min-width: 104px; border-radius: var(--radius-sm);
  background: var(--ink-300); opacity: .38;
  transition: opacity var(--dur-fast) var(--ease);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .1em; padding-inline: 14px;
}
.logostrip__item:hover { opacity: .7; }

/* --------------------------------------------------------------------------
   10. CARDS
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--s-6); transition: box-shadow var(--dur-base) var(--ease), transform var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
  display: flex; flex-direction: column;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); transform: translateY(-2px); }
.card--flat:hover { transform: none; box-shadow: none; }
.card--muted { background: var(--surface-alt); border-color: transparent; }
.card__icon {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  margin-bottom: var(--s-4);
}
.card__icon--ai { background: #F3E8FF; color: var(--ai-violet); }
.card__list { list-style: none; padding: 0; margin: 0 0 var(--s-5); }
.card__list li { position: relative; padding-left: 26px; margin-bottom: 8px; font-size: 15px; color: var(--ink-500); }
.card__list li::before { content: "\2713"; position: absolute; left: 0; color: var(--success); font-weight: 700; }
.card__foot { margin-top: auto; padding-top: var(--s-2); }

/* Post card */
.post-card { display: flex; flex-direction: column; }
.post-card__media { border-radius: var(--radius-lg); overflow: hidden; margin-bottom: var(--s-4); }
.post-card__title {
  font-family: var(--font-heading); font-size: 19px; line-height: 1.35; font-weight: 600;
  color: var(--ink-900); margin: var(--s-3) 0 var(--s-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card__title a { color: inherit; text-decoration: none; }
.post-card:hover .post-card__title a { color: var(--primary); }
.post-card__excerpt {
  font-size: 15px; color: var(--ink-500); margin: 0 0 var(--s-4);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card__meta { display: flex; align-items: center; gap: var(--s-2); font-size: 14px; color: var(--ink-300); margin-top: auto; }

/* Avatars and logo-strip chips are now real <img> slots instead of empty
   color swatches — keep the same fixed sizes/circle-crop, just make sure a
   dropped-in photo/logo of a different aspect ratio still fills it cleanly. */
.avatar, .person__avatar, .author-box__avatar { object-fit: cover; }
.logostrip__item { object-fit: contain; }
.post-card__meta .avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--ink-300); flex: none; }

/* Featured post card */
.post-featured { display: grid; gap: var(--s-6); align-items: center; border: 1px solid var(--border); border-radius: var(--radius-xl); padding: var(--s-5); background: var(--surface); }
@media (min-width: 900px) { .post-featured { grid-template-columns: 1.1fr 1fr; padding: var(--s-6); } }
.post-featured__title { font-size: 27px; line-height: 1.25; margin: var(--s-3) 0; }
.post-featured__title a { color: var(--ink-900); text-decoration: none; }
.post-featured__title a:hover { color: var(--primary); }
@media (min-width: 900px) { .post-featured__title { font-size: 32px; } }

/* Metric card */
.metric__number { font-family: var(--font-heading); font-size: 48px; line-height: 1; font-weight: 700; color: var(--success); letter-spacing: -.03em; }
.metric__label { font-weight: 600; color: var(--ink-900); margin-top: var(--s-3); }

/* Testimonial */
.quote { font-size: 17px; line-height: 1.6; color: var(--ink-700); margin: 0 0 var(--s-5); }
.person { display: flex; align-items: center; gap: var(--s-3); margin-top: auto; }
.person__avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--ink-300); flex: none; }
.person__name { font-weight: 600; color: var(--ink-900); font-size: 15px; }
.person__role { font-size: 14px; color: var(--ink-500); }

/* Silo / topical map card — the signature component. Spec 7.1 S7 */
.silo-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.silo-card__progress { height: 6px; border-radius: var(--radius-full); background: var(--border); overflow: hidden; margin: var(--s-4) 0 var(--s-2); }
.silo-card__bar { height: 100%; background: var(--ai-gradient); border-radius: var(--radius-full); }
.silo-card__count { font-size: 13px; color: var(--ink-300); font-family: var(--font-mono); }
.silo-card__links { list-style: none; padding: 0; margin: var(--s-4) 0; }
.silo-card__links li { border-top: 1px solid var(--border); }
.silo-card__links a { display: block; padding: 10px 0; font-size: 15px; color: var(--ink-700); text-decoration: none; }
.silo-card__links a:hover { color: var(--primary); }

/* --------------------------------------------------------------------------
   11. AI BAND
   -------------------------------------------------------------------------- */
.ai-band { position: relative; overflow: hidden; }
.ai-band::before {
  content: ""; position: absolute; top: -40%; right: -10%; width: 620px; height: 620px;
  background: var(--ai-gradient); filter: blur(140px); opacity: .35; border-radius: 50%;
}
.ai-band .container { position: relative; }
.ai-panel {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-xl); padding: var(--s-6);
}
.ai-answer { font-size: 15px; line-height: 1.7; color: #C7CFE0; }
.ai-answer mark { background: rgba(124,58,237,.35); color: #fff; padding: 1px 4px; border-radius: 4px; }
.ai-cite { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-family: var(--font-mono); color: #A5B4FC; margin-top: var(--s-4); }

/* --------------------------------------------------------------------------
   12. NEWSLETTER
   -------------------------------------------------------------------------- */
.newsletter { background: var(--primary-soft); border-radius: var(--radius-xl); padding: var(--s-8) var(--s-6); text-align: center; }
.newsletter--dark { background: var(--surface-dark); color: #C7CFE0; }
.newsletter--inline { text-align: left; padding: var(--s-6); }
.newsletter__form { display: flex; flex-wrap: wrap; gap: var(--s-3); max-width: 480px; margin: var(--s-6) auto 0; }
.newsletter--inline .newsletter__form { margin-inline: 0; }
.newsletter__form .input { flex: 1 1 240px; }
.newsletter__consent { font-size: 13px; color: var(--ink-500); margin: var(--s-4) auto 0; max-width: 480px; }
.newsletter--dark .newsletter__consent { color: var(--ink-300); }

/* --------------------------------------------------------------------------
   13. FORMS — Spec 8
   -------------------------------------------------------------------------- */
.field { margin-bottom: var(--s-5); }
.label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-700); margin-bottom: 6px; }
.label .req { color: var(--cta); }
.input, .select, .textarea {
  width: 100%; padding: 13px 16px; font-family: inherit; font-size: 16px; color: var(--ink-900);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-300); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(67,56,202,.14);
}
.input[aria-invalid="true"] { border-color: var(--cta); }
.textarea { min-height: 130px; resize: vertical; }
.field__error { display: block; font-size: 14px; color: var(--cta-hover); margin-top: 6px; }
.field__hint { display: block; font-size: 13px; color: var(--ink-300); margin-top: 6px; }

/* --------------------------------------------------------------------------
   14. ACCORDION / FAQ
   -------------------------------------------------------------------------- */
.accordion { border-top: 1px solid var(--border); max-width: 800px; }
.accordion__item { border-bottom: 1px solid var(--border); }
.accordion__btn {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: var(--s-4);
  padding: var(--s-5) 0; background: none; border: 0; cursor: pointer;
  font-family: var(--font-heading); font-size: 18px; font-weight: 600; color: var(--ink-900); text-align: left;
}
.accordion__btn:hover { color: var(--primary); }
.accordion__icon { flex: none; width: 24px; height: 24px; position: relative; }
.accordion__icon::before, .accordion__icon::after {
  content: ""; position: absolute; left: 4px; top: 11px; width: 16px; height: 2px;
  background: var(--primary); border-radius: 2px; transition: transform var(--dur-base) var(--ease);
}
.accordion__icon::after { transform: rotate(90deg); }
.accordion__btn[aria-expanded="true"] .accordion__icon::after { transform: rotate(0); }
.accordion__panel { padding: 0 0 var(--s-5); max-width: 680px; color: var(--ink-500); }
.accordion__panel[hidden] { display: none; }

/* --------------------------------------------------------------------------
   15. BREADCRUMBS
   -------------------------------------------------------------------------- */
.breadcrumbs { font-size: 14px; color: var(--ink-300); margin-bottom: var(--s-4); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.breadcrumbs li:not(:last-child)::after { content: "\203A"; margin-left: 8px; color: var(--border-strong); }
.breadcrumbs a { color: var(--ink-500); text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary); text-decoration: underline; }

/* --------------------------------------------------------------------------
   16. ARTICLE — Spec 7.3. READABILITY IS THE POINT.
   -------------------------------------------------------------------------- */
.progress-bar { position: fixed; top: var(--header-h); left: 0; height: 3px; background: var(--primary); z-index: 101; width: 0; }

/* Grid math (container 1280 − 2×48 gutter = 1184 usable):
   2-col @1100+ : 200 + 40 gap + 720            =  960  ✓
   3-col @1360+ : 200 + 40 + 720 + 40 + 160     = 1160  ✓ (fits 1184)
   Do not widen the rails or the gaps — the 720px measure gets squeezed first. */
.article-layout { display: block; }
@media (min-width: 1100px) {
  .article-layout { display: grid; grid-template-columns: 200px minmax(0, var(--measure)); gap: var(--s-7); justify-content: center; }
}
@media (min-width: 1360px) {
  .article-layout { grid-template-columns: 200px minmax(0, var(--measure)) 160px; gap: var(--s-7); }
}

.article-rail { display: none; }
@media (min-width: 1100px) { .article-rail--left { display: block; } }
@media (min-width: 1360px) { .article-rail--right { display: block; } }
.article-rail__inner { position: sticky; top: calc(var(--header-h) + 32px); }

/* TOC */
.toc__title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-300); margin-bottom: var(--s-3); }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.toc li a {
  display: block; padding: 7px 0 7px 14px; margin-left: -2px;
  font-size: 14px; line-height: 1.4; color: var(--ink-500); text-decoration: none;
  border-left: 2px solid transparent;
}
.toc li a:hover { color: var(--ink-900); }
.toc li a.is-active { color: var(--primary); font-weight: 600; border-left-color: var(--primary); }
.toc .toc-h3 a { padding-left: 26px; font-size: 13px; }

.toc-mobile { border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: var(--s-6); }
@media (min-width: 1100px) { .toc-mobile { display: none; } }
.toc-mobile summary { padding: var(--s-4) var(--s-5); font-weight: 600; cursor: pointer; color: var(--ink-900); }
.toc-mobile .toc { padding: 0 var(--s-5) var(--s-5); }

/* Share rail */
.share-rail { display: flex; flex-direction: column; gap: var(--s-2); }
.share-rail a, .share-rail button {
  width: 40px; height: 40px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--surface); color: var(--ink-500);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  text-decoration: none; font-size: 13px; font-weight: 700;
}
.share-rail a:hover, .share-rail button:hover { border-color: var(--primary); color: var(--primary); }

/* The prose block */
.prose { font-size: 18px; line-height: 1.7; color: var(--ink-700); max-width: var(--measure); }
@media (min-width: 768px) { .prose { font-size: 19px; line-height: 1.75; } }

.prose > * + * { margin-top: var(--s-5); }
.prose h2 {
  font-size: 30px; line-height: 1.25; margin-top: var(--s-8); padding-top: var(--s-5);
  border-top: 1px solid var(--border); scroll-margin-top: calc(var(--header-h) + 24px);
}
.prose h3 { font-size: 23px; line-height: 1.3; margin-top: var(--s-6); scroll-margin-top: calc(var(--header-h) + 24px); }
.prose h4 { font-size: 19px; margin-top: var(--s-5); }
@media (min-width: 768px) {
  .prose h2 { font-size: 36px; }
  .prose h3 { font-size: 27px; }
}
.prose p { margin: 0; }
.prose ul, .prose ol { padding-left: 24px; margin: 0; }
.prose li { margin-bottom: var(--s-3); }
.prose li::marker { color: var(--primary); }
.prose figure { margin: var(--s-6) 0; }
.prose figure img, .prose figure .ph { border-radius: var(--radius-lg); }
.prose figcaption { font-size: 14px; color: var(--ink-300); margin-top: var(--s-3); text-align: center; }
.prose strong { color: var(--ink-900); font-weight: 600; }
.prose code {
  font-family: var(--font-mono); font-size: .87em; background: var(--surface-alt);
  padding: 2px 6px; border-radius: 5px; color: var(--primary-hover);
}
.prose pre {
  background: var(--surface-dark); color: #C7CFE0; padding: var(--s-5);
  border-radius: var(--radius-lg); overflow-x: auto; font-size: 14px; line-height: 1.6;
}
.prose pre code { background: none; color: inherit; padding: 0; }
.prose blockquote {
  border-left: 3px solid var(--primary); padding-left: var(--s-5); margin-left: 0;
  font-size: 21px; line-height: 1.5; color: var(--ink-900); font-family: var(--font-heading);
}
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.prose th, .prose td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.prose th { background: var(--surface-alt); font-weight: 600; color: var(--ink-900); font-size: 14px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Article meta */
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); font-size: 15px; color: var(--ink-500); margin-bottom: var(--s-5); }
.article-meta__author { display: flex; align-items: center; gap: var(--s-3); }
.article-meta__author .avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--ink-300); flex: none; }
.article-meta__author a { color: var(--ink-900); font-weight: 600; text-decoration: none; }
.article-meta .sep { color: var(--border-strong); }
.article-meta .updated { color: var(--success); font-weight: 600; }
.reviewed-by {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-500);
  background: var(--surface-alt); padding: 8px 14px; border-radius: var(--radius-full); margin-bottom: var(--s-6);
}

/* Content components — Spec 7.3 */
.callout {
  border-left: 4px solid var(--primary); background: var(--primary-soft);
  padding: var(--s-5); border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 17px; line-height: 1.65;
}
.callout__title { display: flex; align-items: center; gap: 8px; font-family: var(--font-heading); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); margin-bottom: var(--s-3); }
.callout p:last-child { margin-bottom: 0; }
.callout--tip { border-color: var(--success); background: #E9F8F2; }
.callout--tip .callout__title { color: var(--success); }
.callout--warn { border-color: var(--warning); background: #FEF6E7; }
.callout--warn .callout__title { color: #B45309; }

.takeaways {
  border: 1.5px solid var(--primary); border-radius: var(--radius-lg);
  background: var(--primary-soft); padding: var(--s-5) var(--s-6);
}
.takeaways__title { font-family: var(--font-heading); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); margin-bottom: var(--s-3); }
.takeaways ul { list-style: none; padding: 0; margin: 0; }
.takeaways li { position: relative; padding-left: 28px; margin-bottom: var(--s-3); font-size: 17px; }
.takeaways li:last-child { margin-bottom: 0; }
.takeaways li::before { content: "\2192"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }

.steps { list-style: none; counter-reset: step; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 60px; margin-bottom: var(--s-6); }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -4px;
  width: 42px; height: 42px; border-radius: var(--radius-md);
  background: var(--ink-900); color: #fff; font-family: var(--font-heading); font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.steps h3 { margin-top: 0 !important; padding-top: 0; border-top: 0; }

.proscons { display: grid; gap: var(--s-4); }
@media (min-width: 640px) { .proscons { grid-template-columns: 1fr 1fr; } }
.proscons__col { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s-5); }
.proscons__col h4 { margin: 0 0 var(--s-3); font-size: 16px; }
.proscons__col ul { list-style: none; padding: 0; margin: 0; font-size: 16px; }
.proscons__col li { padding-left: 24px; position: relative; margin-bottom: 8px; }
.proscons--pro li::before { content: "\2713"; position: absolute; left: 0; color: var(--success); font-weight: 700; }
.proscons--con li::before { content: "\2715"; position: absolute; left: 0; color: var(--cta); font-weight: 700; }

.screenshot-frame { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); }
.screenshot-frame__bar { display: flex; gap: 6px; padding: 10px 14px; background: var(--surface-alt); border-bottom: 1px solid var(--border); }
.screenshot-frame__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }

.video-facade { position: relative; border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; }
.video-facade__play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.video-facade__play span {
  width: 68px; height: 68px; border-radius: 50%; background: rgba(11,17,32,.82); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 20px; padding-left: 4px;
}

.stat-highlight { text-align: center; padding: var(--s-6); background: var(--surface-alt); border-radius: var(--radius-lg); }
.stat-highlight__num { font-family: var(--font-heading); font-size: 48px; font-weight: 700; color: var(--primary); line-height: 1; }

/* Author box */
.author-box { display: flex; gap: var(--s-5); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s-6); background: var(--surface-alt); flex-wrap: wrap; }
.author-box__avatar { width: 80px; height: 80px; border-radius: 50%; background: var(--ink-300); flex: none; }

.prevnext { display: grid; gap: var(--s-4); }
@media (min-width: 640px) { .prevnext { grid-template-columns: 1fr 1fr; } }
.prevnext a { display: block; padding: var(--s-5); border: 1px solid var(--border); border-radius: var(--radius-lg); text-decoration: none; }
.prevnext a:hover { border-color: var(--primary); background: var(--surface-alt); }
.prevnext .dir { font-size: 13px; color: var(--ink-300); display: block; margin-bottom: 6px; }
.prevnext .ttl { font-weight: 600; color: var(--ink-900); font-family: var(--font-heading); }

/* --------------------------------------------------------------------------
   17. PILLAR HUB — Spec 7.4
   -------------------------------------------------------------------------- */
.chapter { border-top: 1px solid var(--border); padding-top: var(--s-6); margin-top: var(--s-8); scroll-margin-top: calc(var(--header-h) + 70px); }
.chapter__num { font-family: var(--font-mono); font-size: 13px; color: var(--primary); letter-spacing: .08em; text-transform: uppercase; }
.chapter__list { list-style: none; padding: 0; margin: var(--s-5) 0 0; display: grid; gap: var(--s-2); }
@media (min-width: 768px) { .chapter__list { grid-template-columns: 1fr 1fr; gap: var(--s-2) var(--s-6); } }
.chapter__list a {
  display: flex; align-items: baseline; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); border-radius: var(--radius-md);
  color: var(--ink-700); text-decoration: none; font-size: 16px;
  border: 1px solid transparent; transition: all var(--dur-fast) var(--ease);
}
.chapter__list a:hover { background: var(--surface-alt); border-color: var(--border); color: var(--primary); }
.chapter__list .idx { font-family: var(--font-mono); font-size: 12px; color: var(--ink-300); flex: none; }

.chapter-nav { position: sticky; top: var(--header-h); z-index: 50; background: var(--glass); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.chapter-nav ul { list-style: none; display: flex; gap: var(--s-2); padding: 0; margin: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chapter-nav a { display: block; padding: 14px; font-size: 14px; font-weight: 500; color: var(--ink-500); text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.chapter-nav a:hover, .chapter-nav a.is-active { color: var(--primary); border-bottom-color: var(--primary); }

/* --------------------------------------------------------------------------
   18. BLOG INDEX
   -------------------------------------------------------------------------- */
.topic-bar { position: sticky; top: var(--header-h); z-index: 50; background: var(--glass); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topic-bar__inner { display: flex; gap: var(--s-2); overflow-x: auto; padding-block: var(--s-3); -webkit-overflow-scrolling: touch; }
.topic-bar a {
  flex: none; padding: 8px 16px; border-radius: var(--radius-full); font-size: 14px; font-weight: 500;
  color: var(--ink-500); text-decoration: none; border: 1px solid var(--border); background: var(--surface);
}
.topic-bar a:hover { border-color: var(--border-strong); color: var(--ink-900); }
.topic-bar a[aria-current="page"] { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }

.search-field { position: relative; max-width: 520px; }
.search-field .input { padding-left: 46px; }
.search-field__icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-300); }

.pagination { display: flex; justify-content: center; gap: var(--s-2); margin-top: var(--s-9); flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); border: 1px solid var(--border); text-decoration: none;
  color: var(--ink-700); font-size: 15px; font-weight: 500; padding-inline: 12px;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination [aria-current="page"] { background: var(--ink-900); border-color: var(--ink-900); color: #fff; }

/* Hub split (blog index topical sections) */
.hub-split { display: grid; gap: var(--s-6); }
@media (min-width: 900px) { .hub-split { grid-template-columns: 1fr 1fr; gap: var(--s-8); } }

/* --------------------------------------------------------------------------
   19. SERVICE PAGE
   -------------------------------------------------------------------------- */
.price-band { border: 1.5px solid var(--border); border-radius: var(--radius-xl); padding: var(--s-8) var(--s-6); text-align: center; background: var(--surface-alt); }
.price-band__amount { font-family: var(--font-heading); font-size: 44px; font-weight: 700; color: var(--ink-900); letter-spacing: -.02em; }

/* --------------------------------------------------------------------------
   20. FOOTER
   -------------------------------------------------------------------------- */
.site-footer { background: var(--surface-dark); color: #8A94AD; padding-block: var(--s-11) var(--s-6); }
.site-footer h3 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #fff; margin-bottom: var(--s-4); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 10px; }
.site-footer a { color: #8A94AD; text-decoration: none; font-size: 15px; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; gap: var(--s-7); }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: repeat(4, 1fr) 1.6fr; gap: var(--s-8); } }
.footer-bottom {
  margin-top: var(--s-9); padding-top: var(--s-5); border-top: 1px solid rgba(255,255,255,.1);
  display: flex; flex-wrap: wrap; gap: var(--s-4); justify-content: space-between; font-size: 14px;
}
.social { display: flex; gap: var(--s-3); margin-top: var(--s-5); }
.social a {
  width: 38px; height: 38px; border-radius: var(--radius-md); border: 1px solid rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.social a:hover { border-color: #fff; background: rgba(255,255,255,.06); text-decoration: none; }

/* --------------------------------------------------------------------------
   21. UTILITIES
   -------------------------------------------------------------------------- */
.mt-0{margin-top:0}.mt-3{margin-top:var(--s-3)}.mt-4{margin-top:var(--s-4)}.mt-5{margin-top:var(--s-5)}
.mt-6{margin-top:var(--s-6)}.mt-8{margin-top:var(--s-8)}.mt-9{margin-top:var(--s-9)}
.mb-3{margin-bottom:var(--s-3)}.mb-4{margin-bottom:var(--s-4)}.mb-5{margin-bottom:var(--s-5)}
.mb-6{margin-bottom:var(--s-6)}.mb-8{margin-bottom:var(--s-8)}
.flex{display:flex}.items-center{align-items:center}.justify-between{justify-content:space-between}
.gap-2{gap:var(--s-2)}.gap-3{gap:var(--s-3)}.gap-4{gap:var(--s-4)}.gap-5{gap:var(--s-5)}
.wrap{flex-wrap:wrap}

/* Dev annotation — remove before production */
.spec-note {
  font-family: var(--font-mono); font-size: 12px; line-height: 1.5;
  background: #FFFBEB; border: 1px dashed var(--warning); color: #92400E;
  padding: 8px 12px; border-radius: var(--radius-sm); margin: var(--s-3) 0;
}
body.hide-notes .spec-note { display: none; }
.notes-toggle {
  position: fixed; right: 16px; bottom: 16px; z-index: 200;
  background: var(--ink-900); color: #fff; border: 0; border-radius: var(--radius-full);
  padding: 10px 18px; font-family: var(--font-mono); font-size: 12px; cursor: pointer; box-shadow: var(--shadow-lg);
}

/* Reduced motion — Spec 6.4 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* RTL readiness — Spec 9.7:
   In production, replace remaining left/right properties with logical
   properties (margin-inline-start, padding-inline-end, border-inline-start,
   inset-inline-start) and ship an RTL stylesheet. */


/* ==========================================================================
   PART 2 — Added in revision 2
   22. Dark theme · 23. Icons · 24. Motion & reveals · 25. Decorative surfaces
   26. Sticky CTA & modal · 27. Interactive tool widgets · 28. Stepper form
   29. Timeline · 30. Case study · 31. Node map · 32. Misc additions
   ========================================================================== */

/* --------------------------------------------------------------------------
   22. DARK THEME — Spec 16 "dark mode is a stylesheet, not a rebuild"
   Toggle sets data-theme="dark" on <html>. Defaults to system preference.
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  --ink-900: #F2F5FA;
  --ink-700: #C9D2E3;
  --ink-500: #99A3BA;
  --ink-300: #6C7791;
  --border: #232C42;
  --border-strong: #35415C;

  --surface: #0B1120;
  --surface-alt: #111A2E;
  --surface-dark: #060A14;
  --surface-dark-2: #0F1728;

  --primary: #8B85F5;
  --primary-hover: #A7A2F8;
  --primary-soft: #1B1E3E;

  --ai-violet: #A87BF7;
  --ai-gradient: linear-gradient(135deg, #6D63E8 0%, #A87BF7 100%);

  --cta: #FF6B3D;
  --cta-hover: #FF8560;

  --success: #34D399;
  --warning: #FBBF24;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 4px 18px rgba(0,0,0,.45);
  --shadow-lg: 0 14px 44px rgba(0,0,0,.55);
  --glass: rgba(11,17,32,.86);

  color-scheme: dark;
}
[data-theme="dark"] .ph {
  background: repeating-linear-gradient(45deg,#151E33,#151E33 10px,#111A2E 10px,#111A2E 20px);
  color: #55617D;
}
[data-theme="dark"] .callout--tip { background: #0E2A20; }
[data-theme="dark"] .callout--warn { background: #2A2010; }
[data-theme="dark"] .callout--warn .callout__title { color: #FBBF24; }
[data-theme="dark"] .pill--ai { background: #241839; }
[data-theme="dark"] .pill--success { background: #0E2A20; }
[data-theme="dark"] .spec-note { background: #241E0B; border-color: #6B5416; color: #E0BA5C; }
[data-theme="dark"] .logostrip__item { background: var(--ink-500); }
[data-theme="dark"] .btn--cta, [data-theme="dark"] .btn--primary { color: #0B1120; }
[data-theme="dark"] .site-footer { background: var(--surface-dark); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0;
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--ink-500); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--border-strong); color: var(--ink-900); }
.theme-toggle .ico--moon { display: none; }
[data-theme="dark"] .theme-toggle .ico--sun { display: none; }
[data-theme="dark"] .theme-toggle .ico--moon { display: block; }

/* --------------------------------------------------------------------------
   23. ICONS
   -------------------------------------------------------------------------- */
.ico { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.ico--sm { width: 16px; height: 16px; }
.ico--lg { width: 24px; height: 24px; }
.ico--xl { width: 32px; height: 32px; }
.btn .ico { width: 18px; height: 18px; }
.link-arrow .ico { width: 16px; height: 16px; transition: transform var(--dur-fast) var(--ease); }
.link-arrow:hover .ico { transform: translateX(4px); }
.link-arrow::after { content: none; }        /* icon replaces the text arrow */
.pill .ico { width: 14px; height: 14px; }
.card__list li .ico, .takeaways li .ico { position: absolute; left: 0; top: 4px; }

/* --------------------------------------------------------------------------
   24. MOTION & SCROLL REVEALS — always gated on prefers-reduced-motion
   -------------------------------------------------------------------------- */
[data-reveal] { opacity: 0; transform: translateY(14px); }
.js-reveal-ready [data-reveal] {
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
}
.no-js [data-reveal] { opacity: 1; transform: none; }

.count-up { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------------------
   25. DECORATIVE SURFACES
   -------------------------------------------------------------------------- */
/* Soft mesh gradient backdrop — pure CSS, no image, no repaint cost */
.mesh { position: relative; isolation: isolate; }
.mesh::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 130%;
  z-index: -1; pointer-events: none;
  background:
    radial-gradient(42rem 26rem at 78% 8%,  color-mix(in srgb, var(--ai-violet) 16%, transparent), transparent 65%),
    radial-gradient(38rem 24rem at 12% 22%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 62%);
}
[data-theme="dark"] .mesh::before { opacity: .8; }

/* Faint grid — signals "technical" without shouting */
.gridlines { position: relative; isolation: isolate; }
.gridlines::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--ink-900) 5%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--ink-900) 5%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(70% 60% at 50% 40%, #000 30%, transparent 100%);
}

.rule-gradient { height: 1px; border: 0; background: linear-gradient(90deg, transparent, var(--border-strong), transparent); margin: 0; }

/* Section corner tuck — softens the hard edge between alternating sections */
.section--tuck { border-radius: var(--radius-xl) var(--radius-xl) 0 0; }

/* --------------------------------------------------------------------------
   26. STICKY MOBILE CTA + MODAL — conversion layer
   -------------------------------------------------------------------------- */
.sticky-cta {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 90;
  display: none; align-items: center; gap: var(--s-3);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--glass); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  transform: translateY(110%); transition: transform var(--dur-base) var(--ease);
}
.sticky-cta.is-visible { transform: none; }
.sticky-cta__text { flex: 1; min-width: 0; }
.sticky-cta__text strong { display: block; font-size: 14px; color: var(--ink-900); }
.sticky-cta__text span { font-size: 12px; color: var(--ink-500); }
@media (max-width: 767px) { .sticky-cta { display: flex; } }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: var(--s-5);
  background: rgba(11,17,32,.55); backdrop-filter: blur(4px);
}
.modal-backdrop.is-open { display: flex; }
.modal {
  position: relative; width: 100%; max-width: 460px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: var(--s-7);
  animation: modal-in 300ms var(--ease);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .modal { animation: none; } }
.modal__close {
  position: absolute; top: 12px; inset-inline-end: 12px;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: var(--radius-sm); color: var(--ink-300); cursor: pointer;
}
.modal__close:hover { background: var(--surface-alt); color: var(--ink-900); }

/* Trust microcopy under CTAs */
.microtrust {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4);
  font-size: 13px; color: var(--ink-300); margin-top: var(--s-4);
}
.microtrust span { display: inline-flex; align-items: center; gap: 6px; }
.microtrust .ico { width: 15px; height: 15px; color: var(--success); }

/* --------------------------------------------------------------------------
   27. INTERACTIVE TOOL WIDGETS
   -------------------------------------------------------------------------- */
.tool {
  border: 1px solid var(--border); border-radius: var(--radius-xl);
  background: var(--surface); box-shadow: var(--shadow-md); overflow: hidden;
}
.tool__head {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}
.tool__head .ico { color: var(--primary); }
.tool__title { font-family: var(--font-heading); font-weight: 600; font-size: 15px; color: var(--ink-900); }
.tool__badge { margin-inline-start: auto; }
.tool__body { padding: var(--s-5); }
.tool__row { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.tool__row .input { flex: 1 1 200px; }
.tool__out { margin-top: var(--s-5); }
.tool__out[hidden] { display: none; }

/* scanning animation */
.scanline { height: 4px; border-radius: var(--radius-full); background: var(--border); overflow: hidden; }
.scanline i {
  display: block; height: 100%; width: 40%; border-radius: inherit;
  background: var(--ai-gradient); animation: scan 1.1s var(--ease) infinite;
}
@keyframes scan { 0% { transform: translateX(-100%); } 100% { transform: translateX(280%); } }

.engine-row {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) 0; border-bottom: 1px solid var(--border);
}
.engine-row:last-child { border-bottom: 0; }
.engine-row__name { font-weight: 600; font-size: 15px; color: var(--ink-900); flex: 1; }
.meter { width: 120px; height: 6px; border-radius: var(--radius-full); background: var(--border); overflow: hidden; flex: none; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--success); width: 0; transition: width 900ms var(--ease); }
.meter--low i { background: var(--cta); }
.meter--mid i { background: var(--warning); }
.engine-row__val { font-family: var(--font-mono); font-size: 13px; color: var(--ink-500); width: 44px; text-align: end; flex: none; }

/* calculator */
.calc-out {
  display: grid; gap: var(--s-4); margin-top: var(--s-5);
  padding: var(--s-5); border-radius: var(--radius-lg); background: var(--primary-soft);
}
@media (min-width: 560px) { .calc-out { grid-template-columns: repeat(3, 1fr); } }
.calc-out__item { text-align: center; }
.calc-out__num { font-family: var(--font-heading); font-size: 30px; font-weight: 700; color: var(--primary); line-height: 1.1; }
.calc-out__lbl { font-size: 13px; color: var(--ink-500); margin-top: 4px; }
.range-row { display: flex; align-items: center; gap: var(--s-4); }
.range-row input[type="range"] { flex: 1; accent-color: var(--primary); }
.range-row output { font-family: var(--font-mono); font-size: 14px; color: var(--ink-900); min-width: 68px; text-align: end; }

/* --------------------------------------------------------------------------
   28. STEPPER FORM
   -------------------------------------------------------------------------- */
.stepper { display: flex; gap: var(--s-2); margin-bottom: var(--s-6); }
.stepper__item { flex: 1; }
.stepper__bar { height: 4px; border-radius: var(--radius-full); background: var(--border); }
.stepper__item.is-done .stepper__bar, .stepper__item.is-active .stepper__bar { background: var(--primary); }
.stepper__lbl { font-size: 12px; color: var(--ink-300); margin-top: 8px; display: block; }
.stepper__item.is-active .stepper__lbl { color: var(--primary); font-weight: 600; }
.step-panel[hidden] { display: none; }

.choice-grid { display: grid; gap: var(--s-3); }
@media (min-width: 520px) { .choice-grid { grid-template-columns: 1fr 1fr; } }
.choice {
  position: relative; display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4); border: 1.5px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer; transition: all var(--dur-fast) var(--ease); background: var(--surface);
}
.choice:hover { border-color: var(--border-strong); }
.choice input { position: absolute; opacity: 0; }
.choice input:checked ~ .choice__mark { border-color: var(--primary); background: var(--primary); color: #fff; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice input:focus-visible ~ .choice__mark { outline: 3px solid var(--primary); outline-offset: 2px; }
.choice__mark {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center; flex: none; color: transparent;
}
.choice__mark .ico { width: 14px; height: 14px; }
.choice__txt { font-size: 15px; font-weight: 500; color: var(--ink-900); }

/* --------------------------------------------------------------------------
   29. TIMELINE (about page)
   -------------------------------------------------------------------------- */
.timeline { list-style: none; padding: 0; margin: 0; border-inline-start: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 var(--s-7) var(--s-6); }
.timeline li::before {
  content: ""; position: absolute; inset-inline-start: -7px; top: 6px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--primary);
}
.timeline li:first-child::before { background: var(--primary); }
.timeline__year { font-family: var(--font-mono); font-size: 13px; color: var(--primary); letter-spacing: .04em; }
.timeline__title { font-family: var(--font-heading); font-weight: 600; color: var(--ink-900); margin: 4px 0 6px; }

/* --------------------------------------------------------------------------
   30. CASE STUDY
   -------------------------------------------------------------------------- */
.result-strip {
  display: grid; gap: var(--s-5); padding: var(--s-6);
  border-radius: var(--radius-xl); background: var(--surface-alt); border: 1px solid var(--border);
}
@media (min-width: 640px) { .result-strip { grid-template-columns: repeat(3, 1fr); } }
.result-strip__num { font-family: var(--font-heading); font-size: 38px; font-weight: 700; color: var(--success); line-height: 1; letter-spacing: -.03em; }
.result-strip__lbl { font-size: 14px; color: var(--ink-500); margin-top: 6px; }

.factbox { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--s-5); }
.factbox dl { margin: 0; display: grid; gap: var(--s-3); }
.factbox dt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-300); }
.factbox dd { margin: 2px 0 0; font-weight: 500; color: var(--ink-900); font-size: 15px; }

/* --------------------------------------------------------------------------
   31. TOPICAL MAP NODE GRAPH
   -------------------------------------------------------------------------- */
.nodemap { width: 100%; touch-action: manipulation; }
.nodemap .nm-edge { stroke: var(--border-strong); stroke-width: 1.5; transition: stroke var(--dur-base) var(--ease); }
.nodemap .nm-node circle { transition: all var(--dur-base) var(--ease); cursor: pointer; }
.nodemap .nm-node text { font-family: var(--font-body); font-size: 11px; fill: var(--ink-500); pointer-events: none; }
.nodemap .nm-node:hover circle, .nodemap .nm-node.is-active circle { r: 9; }
.nodemap .nm-node:hover text, .nodemap .nm-node.is-active text { fill: var(--ink-900); font-weight: 600; }
.nodemap .nm-hub circle { fill: var(--primary); }
.nodemap .nm-pub circle { fill: var(--success); }
.nodemap .nm-plan circle { fill: var(--surface); stroke: var(--border-strong); stroke-width: 2; stroke-dasharray: 3 3; }
.nodemap .nm-edge.is-lit { stroke: var(--primary); stroke-width: 2.5; }
.nodemap-legend { display: flex; flex-wrap: wrap; gap: var(--s-4); font-size: 13px; color: var(--ink-500); }
.nodemap-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-inline-end: 6px; }

/* --------------------------------------------------------------------------
   32. MISC ADDITIONS
   -------------------------------------------------------------------------- */
/* Filterable blog */
.post-card.is-hidden { display: none; }
.filter-empty { padding: var(--s-9) 0; text-align: center; color: var(--ink-500); }
.filter-count { font-family: var(--font-mono); font-size: 13px; color: var(--ink-300); }

/* Comparison "before / after" bar */
.ba { display: grid; gap: var(--s-3); }
.ba__row { display: flex; align-items: center; gap: var(--s-4); }
.ba__lbl { width: 74px; font-size: 13px; color: var(--ink-500); flex: none; }
.ba__track { flex: 1; height: 30px; border-radius: var(--radius-sm); background: var(--surface-alt); overflow: hidden; }
.ba__fill { height: 100%; border-radius: inherit; background: var(--border-strong); width: 0; transition: width 1s var(--ease); }
.ba__fill--after { background: var(--ai-gradient); }
.ba__val { width: 56px; text-align: end; font-family: var(--font-mono); font-size: 13px; color: var(--ink-900); flex: none; }

/* Anchored "as featured in" ticker */
.ticker { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.ticker__track { display: flex; gap: var(--s-8); width: max-content; animation: ticker 38s linear infinite; }
@keyframes ticker { to { transform: translateX(-50%); } }
.ticker:hover .ticker__track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .ticker__track { animation: none; } .ticker { mask-image: none; overflow-x: auto; } }

/* Author / entity credibility row */
.cred { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.cred span {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 6px 12px; border-radius: var(--radius-full);
  border: 1px solid var(--border); color: var(--ink-500);
}
.cred .ico { width: 14px; height: 14px; color: var(--primary); }

/* 404 */
.bignum {
  font-family: var(--font-heading); font-weight: 700; line-height: .85;
  font-size: clamp(96px, 22vw, 220px); letter-spacing: -.05em;
  background: var(--ai-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Utility additions */
.stack-sm > * + * { margin-top: var(--s-2); }
.w-full { width: 100%; }
.relative { position: relative; }
.text-end { text-align: end; }
.max-720 { max-width: 720px; }
.max-560 { max-width: 560px; }

/* --------------------------------------------------------------------------
   33. HERO COMPOSITION — portrait + floating proof cards
   -------------------------------------------------------------------------- */
.hero-figure { position: relative; }
.hero-figure__frame { border-radius: var(--radius-xl); overflow: hidden; }
.float-card {
  position: absolute; z-index: 2;
  background: var(--glass); backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: var(--s-4);
  width: 208px;
}
.float-card__label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-300); margin-bottom: 10px;
}
.float-card__label .ico { width: 14px; height: 14px; color: var(--primary); }
.float-card--a { top: 8%; inset-inline-start: -6%; }
.float-card--b { bottom: 9%; inset-inline-end: -6%; }
@media (max-width: 639px) {
  .float-card { width: 168px; padding: var(--s-3); }
  .float-card--a { inset-inline-start: -2%; }
  .float-card--b { inset-inline-end: -2%; }
}
.float-card__quote { font-size: 12px; line-height: 1.5; color: var(--ink-700); margin: 0; }
.float-card__quote mark { background: color-mix(in srgb, var(--ai-violet) 22%, transparent); color: inherit; padding: 0 3px; border-radius: 3px; }

@media (prefers-reduced-motion: no-preference) {
  .float-card--a { animation: bob 7s ease-in-out infinite; }
  .float-card--b { animation: bob 7s ease-in-out infinite reverse; }
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }

/* mini rank grid inside the floating card */
.rankgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.rankgrid i { aspect-ratio: 1; border-radius: 3px; background: var(--border); }
.rankgrid i.g1 { background: var(--success); }
.rankgrid i.g2 { background: color-mix(in srgb, var(--success) 55%, var(--border)); }
.rankgrid i.g3 { background: color-mix(in srgb, var(--warning) 60%, var(--border)); }

/* Section eyebrow with rule */
.eyebrow-rule { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.eyebrow-rule::after { content: ""; height: 1px; flex: 1; max-width: 72px; background: var(--border-strong); }
