/* ============================================================
   crazy7in.com — Lilac Research Edition
   Universal Prompt Factory V9 FSL11 — selected modules:
     Layout 141 / Homepage 079 / Menu 052 / Color 003 / Typography 032 / CTA 009
   Stack: vanilla HTML/CSS/JS, no external UI framework
   ============================================================ */

/* --- Design tokens --------------------------------------- */
:root {
  --primary: #6657D9;
  --primary-ink: #4a3ec5;
  --accent: #BC3D74;
  --accent-ink: #952D58;
  --background: #F8F6FF;
  --surface: #FFFFFF;
  --surface-2: #ECE8FF;
  --surface-3: #F1EDFF;
  --ink: #24203D;
  --ink-2: #3a3559;
  --muted: #68627E;
  --border: #D8D0FA;
  --border-soft: #ece6ff;
  --success: #2f7a4f;
  --warning: #b8770e;
  --danger: #b1303a;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(36, 32, 61, 0.06);
  --shadow-md: 0 6px 18px rgba(36, 32, 61, 0.08);
  --shadow-lg: 0 18px 40px rgba(36, 32, 61, 0.10);
  --container: 1240px;
  --container-narrow: 880px;
  --header-h: 76px;
  --font-display: "Manrope", "Manrope Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Manrope", "Manrope Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-devanagari: "Manrope", "Manrope Fallback", system-ui, sans-serif;
}

/* --- Reset / base ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
  overflow-x: clip;
}
/* --- Self-hosted Manrope (variable, wght 200-800) ---------- */
/* Served same-origin so the font is not a third-party critical-chain hop.
   One variable file covers every weight the design uses (400/500/600/700/800). */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Font fallback sizing (prevents CLS on Manrope swap) */
/* Overrides match Manrope's real metrics (upem 2000, sTypoAscender 2132,
   sTypoDescender -600) so the local-Arial fallback occupies the same
   vertical box and the swap-in cannot reflow the hero h1 or CTA label. */
@font-face {
  font-family: "Manrope Fallback";
  src: local("Arial"), local("Helvetica");
  size-adjust: 106%;
  ascent-override: 106.6%;
  descent-override: 30%;
  line-gap-override: 0%;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--primary-ink); text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  margin: 0;
  letter-spacing: -0.01em;
  line-height: 1.18;
}
h1 { font-size: clamp(34px, 5.4vw, 56px); }
h2 { font-size: clamp(26px, 3.6vw, 38px); }
h3 { font-size: clamp(20px, 2.4vw, 24px); }
h4 { font-size: clamp(17px, 1.8vw, 19px); }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0; }

/* --- Skip link ------------------------------------------- */
.skip-link {
  position: absolute; left: -9999px; top: -9999px;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm);
  z-index: 9999;
}
.skip-link:focus { left: 16px; top: 16px; }

/* --- Container ------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(16px, 3.4vw, 28px);
}
.container--narrow { max-width: var(--container-narrow); }

/* --- Eyebrow (used sparingly) --------------------------- */
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
  margin: 0 0 12px;
  display: inline-block;
}

/* --- Header --------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
  flex-shrink: 1;
}
.brand > span {
  min-width: 0;
  overflow: hidden;
}
.brand-mark {
  width: 36px; height: 36px;
  background-color: var(--primary);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 9px;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  line-height: 1;
  min-width: 72px;
  display: inline-block;
}
.brand-tag {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 600;

  min-width: 180px;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav > li { list-style: none; }
.main-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 14.5px;
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a.is-active {
  background: var(--surface-2);
  color: var(--ink);
}
.main-nav .nav-trigger {
  background: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px;
  color: var(--ink-2);
  font-weight: 600; font-size: 14.5px;
  border-radius: var(--radius-sm);
}
.main-nav .nav-trigger:hover { background: var(--surface-2); color: var(--ink); }
.main-nav .nav-trigger::after {
  content: "";
  width: 8px; height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  margin-left: 2px;
}
.has-mega { position: relative; }
.mega {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 18px;
  display: none;
  min-width: 460px;
  z-index: 80;
}
.has-mega:hover .mega,
.has-mega:focus-within .mega { display: grid; }
.mega-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
}
.mega-grid a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
}
.mega-grid a:hover { background: var(--surface-2); color: var(--ink); }
.mega-grid small {
  display: block;
  color: var(--muted);
  font-weight: 500;
  font-size: 12.5px;
  margin-top: 2px;
}
.header-cta {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --- Buttons -------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--primary);
  color: #fff;
}
.btn--primary:hover { background: var(--primary-ink); color: #fff; }
.btn--accent {
  background: var(--accent);
  color: #fff;
}
.btn--accent:hover { background: var(--accent-ink); color: #fff; }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--primary); }
.btn--lg { padding: 14px 24px; font-size: 15.5px; }
.btn--block { width: 100%; }
.btn--icon svg { width: 18px; height: 18px; }

/* --- Hamburger ----------------------------------------- */
.hamburger {
  display: none;
  width: 44px; height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 110;
}
.hamburger span,
.hamburger span::before,
.hamburger span::after {
  display: block;
  width: 18px; height: 2px;
  background: var(--ink);
  position: relative;
}
.hamburger span::before,
.hamburger span::after { content: ""; position: absolute; left: 0; }
.hamburger span::before { top: -6px; }
.hamburger span::after { top: 6px; }

/* --- Mobile drawer ------------------------------------ */
.mobile-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(86vw, 340px);
  max-width: calc(100vw - 24px);
  height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 40px rgba(36, 32, 61, 0.12);
  z-index: 100;
  display: none;
  flex-direction: column;
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}
.mobile-drawer.is-open {
  display: flex;
  transform: translateX(0);
  animation: drawerSlideIn 220ms ease forwards;
}
@keyframes drawerSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.mobile-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.mobile-drawer-close {
  background: var(--surface-2);
  border: 0;
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 18px;
  color: var(--ink);
}
.mobile-drawer nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.mobile-drawer nav details { border-bottom: 1px solid var(--border-soft); }
.mobile-drawer nav summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 12px;
  font-weight: 700;
  color: var(--ink);
  display: flex; align-items: center; justify-content: space-between;
}
.mobile-drawer nav summary::after {
  content: "+";
  font-size: 22px; color: var(--muted);
  transition: transform 180ms ease;
}
.mobile-drawer nav details[open] summary::after { transform: rotate(45deg); }
.mobile-drawer nav summary::-webkit-details-marker { display: none; }
.mobile-drawer nav details a {
  display: block;
  padding: 10px 24px;
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
}
.mobile-drawer nav details a:hover { color: var(--primary); }
.mobile-drawer-cta { padding: 16px; border-top: 1px solid var(--border-soft); }
.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(36, 32, 61, 0.45);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}
.drawer-scrim.is-open { opacity: 1; pointer-events: auto; }

/* --- Hero (asymmetric sidebar-led cover) --------------- */
.hero {
  background:
    radial-gradient(900px 420px at 100% 0%, rgba(217, 79, 138, 0.10), transparent 65%),
    radial-gradient(700px 380px at 0% 100%, rgba(102, 87, 217, 0.10), transparent 65%),
    var(--background);
  padding: 56px 0 60px;
  border-bottom: 1px solid var(--border-soft);
}
.hero-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  align-items: stretch;
}
.hero-led {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}
.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
}
.hero h1 {
  font-size: clamp(34px, 4.8vw, 52px);
  line-height: 1.05;
  margin: 14px 0 18px;
  letter-spacing: -0.025em;
}
.hero-lede {
  color: var(--ink-2);
  font-size: 17px;
  line-height: 1.6;
  max-width: 38ch;
  margin: 0 0 22px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hero-meta {
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 14px;
  line-height: 1.5;
}
.hero-meta strong { color: var(--ink); font-weight: 700; }
.hero-figure {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  min-height: 380px;
  display: flex;
}
.hero-figure img {
  width: 100%; height: 100%;
  object-fit: cover;
  min-height: 380px;
}
.hero-figure .overlay {
  position: absolute;
  left: 22px; bottom: 22px;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: grid;
  grid-template-columns: repeat(2, auto);
  column-gap: 22px;
  row-gap: 4px;
  font-size: 13px;
  color: var(--ink-2);
  box-shadow: var(--shadow-md);
}
.hero-figure .overlay b {
  display: block;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* --- Quick actions ribbon ------------------------------- */
.ribbon {
  background: var(--surface);
  border-bottom: 1px solid var(--border-soft);
  padding: 18px 0;
}
.ribbon-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.ribbon-list li {
  display: flex;
}
.ribbon-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}
.ribbon-link:hover { background: var(--surface-3); color: var(--ink); border-color: var(--primary); }
.ribbon-link .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
}

/* --- Section base -------------------------------------- */
.section { padding: 56px 0; }
.section--tight { padding: 36px 0; }
.section--alt { background: var(--surface); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.section--ink { background: var(--ink); color: #f1edff; }
.section--ink h2, .section--ink h3 { color: #fff; }
.section-head { margin-bottom: 28px; max-width: 760px; }
.section-head h2 { letter-spacing: -0.02em; }
.section-head p { color: var(--muted); margin: 8px 0 0; font-size: 16px; }

/* --- Tabbed evidence desk (signature device) ----------- */
.evidence-desk {
  display: grid;
  grid-template-columns: 280px 1fr;
  max-width: 100%;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.desk-tabs {
  background: var(--surface-2);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-right: 1px solid var(--border);
  max-width: 100%;
  min-width: 0;
}
.desk-tab {
  display: block;
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink-2);
  font-weight: 700;
  font-size: 14.5px;
  line-height: 1.3;
  transition: background 140ms ease, color 140ms ease;
}
.desk-tab small {
  display: block;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.desk-tab.is-active {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.desk-panel {
  padding: 28px 32px;
  display: none;
}
.desk-panel.is-active { display: block; }
.desk-panel h3 { margin-bottom: 10px; }
.desk-panel .ledger {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.desk-panel .ledger div {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 14px;
}
.desk-panel .ledger div:nth-last-child(-n+2) { border-bottom: 0; }
.desk-panel .ledger div:nth-child(odd) { background: var(--surface-3); color: var(--ink-2); font-weight: 600; }
.desk-panel .ledger div:nth-child(even) { color: var(--ink); font-weight: 500; }

/* --- Deep dive chapter (text-rail + diagram-rail) ------ */
.deep-dive {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 220px;
  gap: 28px;
  min-width: 0;
  max-width: 100%;
}
.deep-dive-text { min-width: 0; }
.deep-dive-text h2 { margin-bottom: 14px; }
.deep-dive-text p { color: var(--ink-2); }
.deep-dive-diagram { min-width: 0; }
.deep-dive-diagram {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  min-width: 0;
}
.diagram-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
}
.diagram-row:last-child { border-bottom: 0; }
.diagram-row .num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--primary);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  text-align: center;
  padding: 6px 0;
}
.diagram-row .label { font-weight: 700; color: var(--ink); }
.diagram-row .label small { display: block; font-weight: 500; color: var(--muted); margin-top: 4px; font-size: 13px; }
.diagram-row .badge {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
}
.deep-dive-aside {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  font-size: 14px;
}
.deep-dive-aside h4 { margin-bottom: 8px; color: var(--primary); }
.deep-dive-aside ul { padding: 0; margin: 0; list-style: none; }
.deep-dive-aside li { padding: 8px 0; border-bottom: 1px dashed var(--border); color: var(--ink-2); }
.deep-dive-aside li:last-child { border-bottom: 0; }

/* --- Annotated visual ---------------------------------- */
.annotated {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 28px;
  align-items: stretch;
}
.annotated-figure {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  min-height: 360px;
}
.annotated-figure img { width: 100%; height: 100%; object-fit: cover; min-height: 360px; }
.callout {
  position: absolute;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  display: grid; place-items: center;
  font-size: 13px;
  border: 2px solid #fff;
  box-shadow: var(--shadow-md);
}
.callout--1 { top: 18%; left: 22%; }
.callout--2 { top: 56%; left: 44%; }
.callout--3 { top: 30%; right: 18%; }
.callout--4 { bottom: 16%; left: 30%; }
.legend-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}
.legend-table h3 { margin-bottom: 12px; }
.legend-table ol {
  list-style: none;
  margin: 0; padding: 0;
  counter-reset: legend;
}
.legend-table li {
  counter-increment: legend;
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.legend-table li:last-child { border-bottom: 0; }
.legend-table li::before {
  content: counter(legend);
  display: grid; place-items: center;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  border-radius: 50%;
  width: 28px; height: 28px;
  font-size: 13px;
}
.legend-table li strong { display: block; color: var(--ink); }
.legend-table li span { color: var(--muted); font-size: 13.5px; }

/* --- Data poster (vertical metric stack) -------------- */
.data-poster {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 28px;
}
.data-poster-text h2 { margin-bottom: 10px; }
.data-poster-text p { color: var(--ink-2); margin-bottom: 0; }
.metric-stack {
  display: grid;
  gap: 14px;
}
.metric-tile {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
}
.metric-tile b {
  display: block;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.metric-tile span { color: var(--ink-2); font-size: 14px; }
.metric-tile small { display: block; color: var(--muted); margin-top: 4px; font-size: 12.5px; }

/* --- Comparison ledger (table) ------------------------- */
.ledger-section h2 { margin-bottom: 16px; }
.ledger-table-wrap {
  max-width: 100%;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}
.ledger-table-wrap .ledger-table { border: 0; border-radius: 0; }
.ledger-table {
  width: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  table-layout: fixed;
}
.ledger-table thead th {
  background: var(--surface-2);
  text-align: left;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 700;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.ledger-table tbody td {
  padding: 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
  font-size: 14.5px;
  color: var(--ink-2);
}
.ledger-table tbody tr:last-child td { border-bottom: 0; }
.ledger-table tbody tr:nth-child(even) td { background: var(--surface-3); }
.ledger-table tbody td:first-child { font-weight: 700; color: var(--ink); }

/* --- Community questions (two-col Q&A) ----------------- */
.community {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
}
.qa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.qa-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
}
.qa-card h3 {
  font-size: 17px;
  margin-bottom: 8px;
}
.qa-card p { color: var(--ink-2); font-size: 14.5px; margin: 0; }
.qa-card .asker {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
  border-top: 1px solid var(--border-soft);
  padding-top: 10px;
}
.submit-panel {
  background: var(--ink);
  color: #f1edff;
  border-radius: var(--radius-md);
  padding: 24px;
  align-self: start;
  position: sticky;
  top: calc(var(--header-h) + 16px);
}
.submit-panel h3 { color: #fff; margin-bottom: 8px; }
.submit-panel p { color: #c8c2f0; font-size: 14px; margin-bottom: 14px; }
.submit-panel .btn--accent { width: 100%; }
.field {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #c8c2f0;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.field + .input { margin-bottom: 14px; }
/* Contact form on light-theme pages: labels must darken to satisfy WCAG AA. */
.prose .field, form .field { color: var(--ink-2); }
.submit-panel form .field { color: #c8c2f0; }
.prose .input, form .input { background: var(--surface); color: var(--ink); border-color: var(--border); }
.input {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 14px;
}

/* --- Related pathways (mixed tile grid) ---------------- */
.pathways {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.pathway-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.pathway-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.pathway-card img {
  width: 100%; aspect-ratio: 16/10; object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.pathway-card .label {
  font-size: 12px;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pathway-card h3 { font-size: 18px; line-height: 1.3; }
.pathway-card p { color: var(--ink-2); font-size: 14px; margin: 0; }
.pathway-card--outline {
  background: var(--surface-3);
  border-style: dashed;
}

/* --- Responsible-use close (editorial tone) ------------ */
.responsible-close {
  background: linear-gradient(180deg, var(--surface-3), var(--background));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 56px 0;
}
.responsible-close .grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 28px;
  align-items: start;
}
.responsible-close h2 { margin-bottom: 12px; }
.responsible-close p { color: var(--ink-2); }
.legend-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}
.legend-row:last-child { border-bottom: 0; }
.legend-row .pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
}
.legend-row strong { color: var(--ink); display: block; margin-bottom: 4px; }
.legend-row span { color: var(--muted); font-size: 13.5px; }

/* --- Footer --------------------------------------------- */
.site-footer {
  background: var(--ink);
  color: #d6d2eb;
  padding: 56px 0 32px;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
}
.footer-brand .brand-name { color: #fff; }
.footer-brand p { font-size: 14px; color: #b8b3d4; margin: 12px 0 16px; max-width: 32ch; }
.socials { display: flex; gap: 8px; }
.socials a {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: grid; place-items: center;
  color: #d6d2eb;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
}
.socials a:hover { background: var(--primary); color: #fff; }
.footer-col h4 {
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { padding: 6px 0; }
.footer-col a {
  color: #b8b3d4;
  text-decoration: none;
  font-size: 14px;
}
.footer-col a:hover { color: #fff; }
.footer-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 22px;
  font-size: 12.5px;
  color: #8e89b1;
}
.footer-meta a { color: #b8b3d4; text-decoration: none; }
.footer-meta a:hover { color: #fff; }

/* --- Article / hub layout ------------------------------ */
.article-hero {
  background:
    radial-gradient(800px 320px at 100% 0%, rgba(217, 79, 138, 0.08), transparent 60%),
    var(--surface);
  border-bottom: 1px solid var(--border-soft);
  padding: 56px 0 40px;
}
.article-hero .breadcrumbs {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
}
.article-hero .breadcrumbs a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 600;
}
.article-hero .breadcrumbs a:hover { color: var(--primary); }
.article-hero h1 {
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -0.02em;
  max-width: 24ch;
}
.article-hero .lede {
  margin-top: 16px;
  max-width: 60ch;
  font-size: 17px;
  color: var(--ink-2);
}
.article-hero .byline {
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.article-hero .byline strong { color: var(--ink-2); }

.article-body {
  padding: 48px 0 64px;
}
.article-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
  font-size: 14px;
}
.toc h2 {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 700;
}
.toc ol { padding-left: 18px; margin: 0; }
.toc li { padding: 6px 0; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--primary); }

.prose h2 {
  margin: 36px 0 12px;
  letter-spacing: -0.02em;
}
.prose h3 {
  margin: 28px 0 10px;
}
.prose p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-2);
}
.prose ul, .prose ol {
  padding-left: 22px;
  color: var(--ink-2);
}
.prose li { padding: 4px 0; }
.prose blockquote {
  margin: 28px 0;
  padding: 18px 22px;
  background: var(--surface-2);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
  font-size: 16px;
}
.prose .pull {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 28px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
}
.prose .pull figure { margin: 0; }
.prose .pull img { border-radius: var(--radius-sm); }
.prose .pull figcaption { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.prose .article-figure {
  margin: 22px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}
.prose .article-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  border-radius: var(--radius-sm);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.prose .article-figure figcaption {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.4;
}
.inline-card-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 22px 0;
}
.inline-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.inline-card h4 { margin-bottom: 6px; color: var(--primary); }
.inline-card p { margin: 0; font-size: 14.5px; }

.callout-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  margin: 28px 0;
}
.callout-block h3 { margin-bottom: 8px; color: var(--accent-ink); }

.faq {
  margin-top: 36px;
}
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 10px;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
  list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 20px;
  color: var(--muted);
}
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 10px 0 0; color: var(--ink-2); font-size: 15px; }

.related-strip {
  background: var(--surface);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 36px 0;
}
.related-strip h3 { margin-bottom: 14px; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.related-grid a {
  display: block;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-decoration: none;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 14.5px;
}
.related-grid a:hover { color: var(--primary); border-color: var(--primary); }

/* --- Sticky mobile CTA ---------------------------------- */
.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: rgba(36, 32, 61, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  z-index: 80;
  display: none;
  border-top: 1px solid rgba(255,255,255,0.10);
}
.sticky-cta-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sticky-cta-label {
  flex: 1;
  font-size: 13px;
  line-height: 1.3;
  color: #d6d2eb;
}
.sticky-cta-label b { color: #fff; display: block; font-size: 13.5px; }

/* --- Responsive ----------------------------------------- */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 280px 1fr; }
  .deep-dive { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .deep-dive-aside { grid-column: 1 / -1; }
  .data-poster { grid-template-columns: 1fr; }
  .annotated { grid-template-columns: 1fr; }
  .community { grid-template-columns: 1fr; }
  .submit-panel { position: static; }
  .article-grid { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .main-nav, .header-cta .desktop-only { display: none; }
  .hamburger { display: inline-flex; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { min-height: 280px; }
  .evidence-desk { grid-template-columns: 1fr; }
  .desk-tabs {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .desk-tab { flex: 0 0 auto; min-width: 180px; }
  .desk-panel { padding: 22px; }
  .desk-panel .ledger { grid-template-columns: 1fr; }
  .deep-dive { grid-template-columns: minmax(0, 1fr); }
  .pathways { grid-template-columns: 1fr 1fr; }
  .qa-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .prose .pull { grid-template-columns: 1fr; }
  .inline-card-row { grid-template-columns: 1fr; }
  .responsible-close .grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hero { padding: 40px 0 44px; }
  .hero-figure img, .hero-figure { min-height: 220px; }
  .hero-figure .overlay { left: 12px; bottom: 12px; padding: 10px 14px; font-size: 12px; }
  .section { padding: 40px 0; }
  .pathways { grid-template-columns: 1fr; }
  .desk-tab { min-width: 0; padding: 12px 14px; flex: 1 1 auto; }
  .sticky-cta { display: block; }
  body { padding-bottom: 80px; }
  .legend-table, .evidence-desk, .data-poster { padding: 18px; }
  .ledger-table thead th, .ledger-table tbody td { padding: 12px; font-size: 13px; word-break: break-word; overflow-wrap: anywhere; }
  .brand-tag { min-width: 0; }
  .brand-name { font-size: 17px; min-width: 0; }
  .header-inner { gap: 10px; }
  .btn { padding: 10px 14px; font-size: 13.5px; }
  .btn--lg { padding: 12px 18px; font-size: 14.5px; }
}
@media (max-width: 380px) {
  .desk-tabs { flex-wrap: wrap; }
  .desk-tab { flex: 1 1 100%; min-width: 0; }
  .header-inner { gap: 8px; }
  .header-cta { gap: 6px; }
  .btn { padding: 9px 12px; font-size: 13px; }
}

/* --- Accessibility -------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* --- Print ---------------------------------------------- */
@media print {
  .site-header, .site-footer, .sticky-cta, .mobile-drawer, .drawer-scrim { display: none !important; }
  body { background: #fff; }
}