/* ==========================================================================
   Rivetira — Stylesheet
   Enterprise data-visualization system. Pure CSS, no framework.

   STRUCTURAL RULE: every section sits on the one canvas (--bg-base). Sections
   are separated by whitespace alone — never by borders, rules, <hr> or tone
   steps. Hairlines only ever appear INSIDE components (card edges, chart
   gridlines, table row rules, list dividers). Depth is a hairline plus one
   opaque tonal step; there are no gradients, shadows, glows or blur.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -moz-text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  background: var(--bg-base);
}

body {
  margin: 0;
  background: var(--bg-base);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img, svg, video { max-width: 100%; }
img { height: auto; display: block; }

h1, h2, h3, h4, h5 {
  color: var(--text-primary);
  font-family: var(--font-display);
  font-weight: 600;
  text-wrap: balance;
  margin: 0 0 var(--space-4);
}
h1 { font-size: var(--fs-h1); line-height: 1.04; letter-spacing: -0.03em; }
h2 { font-size: var(--fs-h2); line-height: 1.08; letter-spacing: -0.025em; }
h3 { font-family: var(--font-sans); font-size: var(--fs-h3); line-height: 1.25; letter-spacing: -0.01em; }
h4 { font-family: var(--font-sans); font-size: var(--fs-h4); line-height: 1.3; letter-spacing: -0.006em; }

p { margin: 0 0 var(--space-4); max-width: 68ch; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 var(--space-4); padding-left: 1.15em; }
li { margin-bottom: var(--space-2); }

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

strong, b { color: var(--text-primary); font-weight: 600; }
small { font-size: var(--fs-small); }

hr { display: none; } /* dividers are never used between sections */

::selection { background: var(--accent); color: var(--text-on-accent); }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.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;
}

.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 200;
  background: var(--accent); color: var(--text-on-accent);
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-md);
  font-weight: 600; transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--space-4); text-decoration: none; }

/* Numbers are always tabular so digits align and never shift on update.
   Large figures are set in the sans (Martian Mono is too wide for them). */
.num, .kpi__value, .delta, td.num, th.num, .axis, .legend__value,
.price__amount, .stat__value, .tick {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
td.num, th.num { text-align: right; }
code, kbd, .mono, .chip, .badge { font-family: var(--font-mono); }

/* Spacing utilities (replace inline style hacks) */
.mt-3 { margin-top: var(--space-3) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-5 { margin-top: var(--space-5) !important; }
.mt-6 { margin-top: var(--space-6) !important; }
.mt-8 { margin-top: var(--space-8) !important; }
.mt-10 { margin-top: var(--space-10) !important; }
.mt-gap { margin-top: var(--dash-gap) !important; }
.m-0 { margin: 0 !important; }
.measure-wide { max-width: 880px; }

/* --------------------------------------------------------------------------
   2. Layout — container, grid, sections
   -------------------------------------------------------------------------- */
.container {
  width: 100%; max-width: var(--container-xl);
  margin-inline: auto; padding-inline: var(--gutter);
}
/* Every page aligns to one left edge: the "wide" container is the same
   measure as the section container so heroes line up with what follows. */
.container--wide { max-width: var(--container-xl); }
.container--lg { max-width: var(--container-lg); }
.container--md { max-width: var(--container-md); }
.container--sm { max-width: var(--container-sm); }

/* No borders and no tone steps between sections: every one of them sits on
   the one canvas, separation is space alone, and two stacked sections share
   a single gap rather than doubling it. */
.section { padding-block: var(--section-y); border: 0; position: relative; background: var(--bg-base); }
.section + .section { border-top: 0; padding-top: 0; }
.section + .section.section--keep-top { padding-top: var(--section-y); }
.section--lg { padding-block: var(--section-y-lg); }
.section--tight { padding-block: clamp(40px, 5vw, 72px); }
.section--alt,
.section--deep { background: var(--bg-base); }

.grid { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(var(--grid-cols), minmax(0, 1fr)); }
.cols-2, .cols-3, .cols-4, .cols-5, .cols-6 { display: grid; gap: var(--grid-gap); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.split { display: grid; gap: clamp(32px, 5vw, 80px); grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; }
.split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split--reverse > :first-child { order: 2; }
.split > div > h2:first-child, .split > div > h3:first-child { margin-top: 0; }

.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; } .span-9 { grid-column: span 9; }
.span-12 { grid-column: span 12; }
.row-2 { grid-row: span 2; }

.dash { display: grid; gap: var(--dash-gap); }
.stack { display: flex; flex-direction: column; gap: var(--dash-gap); }
.stack > * + * { margin-top: 0; }
.stack > .kpi, .stack > .card { flex: 1 1 auto; }
.stack-sm > * + * { margin-top: var(--space-3); }
.gap-marketing { --grid-gap: var(--space-6); }

/* Odd counts in a 3-up grid: a last lone card spans the row instead of
   sitting orphaned. (Two leftovers share the row.) */
.cols-3 > :last-child:nth-child(3n + 1) { grid-column: 1 / -1; }
.cols-3 > :nth-last-child(2):nth-child(3n + 1) { grid-column: span 1; }
.cols-4 > :last-child:nth-child(4n + 1) { grid-column: 1 / -1; }
.cols-4 > :last-child:nth-child(4n + 2) { grid-column: span 3; }

@media (max-width: 1024px) {
  .split, .split--even { grid-template-columns: minmax(0, 1fr); }
  .split--reverse > :first-child { order: 0; }
  .span-2, .span-3, .span-6 { grid-column: span 6; }
  .span-4, .span-5 { grid-column: span 12; }
  .span-7, .span-8, .span-9 { grid-column: span 12; }
  .grid > .span-5.stack, .grid > .span-4.stack { grid-column: span 12; flex-direction: row; flex-wrap: wrap; }
  .grid > .span-5.stack > *, .grid > .span-4.stack > * { flex: 1 1 220px; }
  .cols-4, .cols-5, .cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 > :last-child:nth-child(3n + 1) { grid-column: auto; }
  .cols-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .cols-4 > :last-child:nth-child(4n + 2) { grid-column: auto; }
  .cols-4 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  [class*="span-"] { grid-column: 1 / -1 !important; }
  .cols-2, .cols-3, .cols-4, .cols-5, .cols-6 { grid-template-columns: minmax(0, 1fr); }
  .row-2 { grid-row: auto; }
  .grid > .span-5.stack, .grid > .span-4.stack { flex-direction: column; }
  .grid > .span-5.stack > *, .grid > .span-4.stack > * { flex: 0 0 auto; }
}

/* --------------------------------------------------------------------------
   3. Typography helpers
   -------------------------------------------------------------------------- */
.display { font-size: var(--fs-display); line-height: 1.02; letter-spacing: -0.035em; }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--text-secondary); max-width: 62ch; }
.prose { font-size: var(--fs-body-lg); line-height: 1.7; }
.prose p, .prose li { max-width: 70ch; }
.muted { color: var(--text-muted); }
.small { font-size: var(--fs-small); line-height: 1.55; }
.center { text-align: center; }
.center p, .center .lead, p.center { margin-inline: auto; }

.section__head { max-width: 780px; margin-bottom: clamp(32px, 4vw, 56px); }
.section__head h2 { margin-bottom: 0; }
.section__head h2 + .lead { margin-top: var(--space-5); }
.section__head.center { margin-inline: auto; }
.section__head p { color: var(--text-secondary); }
.section__head .lead { color: var(--text-muted); }
@media (min-width: 1025px) {
  .section__head--split {
    max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(32px, 5vw, 80px); align-items: end;
  }
  .section__head--split h2 + .lead { margin-top: 0; }
  .section__head--split .lead { font-size: var(--fs-body-lg); }
}

/* --------------------------------------------------------------------------
   4. Buttons, badges, pills
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-family: var(--font-sans); font-weight: 600; font-size: 0.9375rem;
  line-height: 1; min-height: 44px; letter-spacing: -0.005em;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md); border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--text-on-accent); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-primary:active { background: var(--accent-press); }
.btn-secondary {
  background: var(--surface-1); color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-2); border-color: rgba(255, 255, 255, 0.24); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: var(--surface-2); }
.btn-sm { min-height: 36px; padding: var(--space-2) var(--space-4); font-size: var(--fs-small); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-8); }
.btn-row.center { justify-content: center; }
@media (max-width: 480px) {
  .btn-row:not(.btn-row--inline) > .btn { flex: 1 1 100%; }
}

.badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.02em;
  line-height: 1.2;
  padding: 5px var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--text-secondary);
  border: 1px solid var(--border-default);
  margin: 0;
}
p.badge { display: inline-flex; }
.badge--accent { background: var(--accent-soft); color: #8dbbff; border-color: rgba(63, 140, 255, 0.28); }
.badge--good { background: var(--good-soft); color: #4ade80; border-color: rgba(34, 197, 94, 0.28); }
.badge--warn { background: var(--warn-soft); color: #fbbf24; border-color: rgba(245, 158, 11, 0.28); }
.badge--bad  { background: var(--bad-soft);  color: #f87171; border-color: rgba(239, 68, 68, 0.28); }
.badge--info { background: var(--info-soft); color: var(--info); border-color: rgba(56, 189, 248, 0.28); }

.pill-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* --------------------------------------------------------------------------
   5. Cards & surfaces
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--card-pad);
  min-width: 0;
}
figure.card { margin: 0; }
.card--flat { background: var(--surface-1); }
.card--raised { background: var(--surface-2); }
.card--hover { transition: border-color var(--dur-base) var(--ease-out), background var(--dur-base) var(--ease-out); }
.card--hover:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.card__head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--space-4); margin-bottom: var(--space-4);
}
.card__title { font-size: var(--fs-h4); margin: 0; color: var(--text-primary); font-weight: 600; }
.card__sub { font-size: var(--fs-small); color: var(--text-muted); margin: var(--space-1) 0 0; }
.card h3 { font-size: var(--fs-h4); margin-bottom: var(--space-2); }
.card p { color: var(--text-secondary); }
.card > .small, .card p.small { color: var(--text-muted); }
.card__meta {
  margin-top: var(--space-5); padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
  font-size: var(--fs-small); color: var(--text-muted); line-height: 1.7;
}
.card__meta b { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.card__link { margin-top: auto; padding-top: var(--space-4); font-size: var(--fs-small); font-weight: 600; }
.card__link a { color: var(--text-primary); }
.card__link a span { display: inline-block; transition: transform var(--dur-fast) var(--ease-out); color: var(--accent-hover); }
.card--hover:hover .card__link a span { transform: translateX(3px); }
.card--hover { display: flex; flex-direction: column; }

/* Chart cards centre their figure so a short chart beside a tall stack
   doesn't leave a dead block of card at the bottom. */
.card:has(> .chart) { display: flex; flex-direction: column; }
.card > .chart { flex: 1 1 auto; }
.card > .chart > .chart__canvas { margin-block: auto; }

.icon-tile {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: var(--surface-2); color: var(--accent-hover);
  border: 1px solid var(--border-default);
  margin-bottom: var(--space-5); flex: none;
}
.icon-tile svg { width: 20px; height: 20px; }

/* Bento: odd-count feature sets (5 or 7) close every row. */
.bento { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bento > :first-child { grid-column: span 2; }
.bento--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bento--5 > :first-child { grid-column: span 1; grid-row: span 2; }
@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bento--5 > :first-child { grid-row: auto; grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .bento, .bento--5 { grid-template-columns: minmax(0, 1fr); }
  .bento > :first-child { grid-column: auto; }
}

/* --------------------------------------------------------------------------
   6. Navbar
   -------------------------------------------------------------------------- */
/* The header is the page canvas: solid, unblurred, and it draws no rule. */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg-base);
}
.site-header.is-scrolled { background: var(--bg-base); }
.nav {
  display: flex; align-items: center; gap: var(--space-8);
  min-height: 68px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text-primary); font-family: var(--font-display); font-weight: 700;
  letter-spacing: -0.02em; font-size: 1.1875rem; text-decoration: none; flex: none;
}
.brand:hover { text-decoration: none; }
.brand__mark { width: 26px; height: 26px; flex: none; color: var(--text-primary); }
.nav__list {
  display: flex; align-items: center; gap: 2px;
  list-style: none; margin: 0; padding: 0; flex: 1;
}
.nav__list > li { margin: 0; position: relative; }
.nav__link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: var(--space-2) var(--space-3); min-height: 36px;
  color: var(--text-secondary); font-size: 0.9375rem; font-weight: 500;
  border-radius: var(--radius-md); background: none; border: 0;
  font-family: inherit; cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.nav__link:hover, .nav__link[aria-expanded="true"] { color: var(--text-primary); background: var(--surface-1); text-decoration: none; }
.nav__link[aria-current="page"] { color: var(--text-primary); }
.nav__caret { width: 10px; height: 10px; opacity: 0.7; transition: transform var(--dur-fast) var(--ease-out); }
.nav__link[aria-expanded="true"] .nav__caret { transform: rotate(180deg); }
.nav__actions { display: flex; align-items: center; gap: var(--space-2); flex: none; margin-left: auto; }

.megamenu {
  position: absolute; top: calc(100% + 12px); left: -12px;
  width: 600px;
  background: var(--surface-1); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); padding: var(--space-3);
  display: none; z-index: 110;
}
.megamenu::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; }
.megamenu[data-open="true"] { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
.megamenu > div { padding: var(--space-3); }
.megamenu > div + div { border-left: 1px solid var(--border-subtle); }
.megamenu__col { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.megamenu__col > li { margin: 0; }
.megamenu__title {
  font-size: var(--fs-micro); letter-spacing: 0.02em;
  color: var(--text-muted); font-weight: 500; margin: 0 0 var(--space-2); padding-inline: var(--space-3);
}
.megamenu a {
  display: block; padding: 10px var(--space-3);
  border-radius: var(--radius-md); color: var(--text-primary);
  font-weight: 600; font-size: 0.9375rem; line-height: 1.3;
}
.megamenu a:hover { background: var(--surface-2); text-decoration: none; }
.megamenu a span { display: block; color: var(--text-muted); font-size: var(--fs-small); font-weight: 400; margin-top: 3px; }

.nav__toggle { display: none; }

@media (max-width: 1240px) { .nav__docs { display: none; } .nav { gap: var(--space-6); } }
@media (max-width: 1120px) {
  .nav__list { display: none; }
  .nav__actions .btn-secondary { display: none; }
  .nav__toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    background: var(--surface-1); border: 1px solid var(--border-default);
    border-radius: var(--radius-md); color: var(--text-primary); cursor: pointer;
  }
  .nav__toggle svg { width: 18px; height: 18px; }
}
@media (max-width: 560px) { .nav__cta { display: none; } }

.mobile-nav {
  position: fixed; inset: 0; z-index: 150;
  background: var(--bg-base);
  padding: 12px var(--gutter) var(--space-12);
  overflow-y: auto;
  display: none;
}
.mobile-nav .nav__toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: var(--surface-1); border: 1px solid var(--border-default); border-radius: var(--radius-md); color: var(--text-primary); cursor: pointer; }
.mobile-nav .nav__toggle svg { width: 18px; height: 18px; }
.mobile-nav[data-open="true"] { display: block; }
.mobile-nav__head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-bottom: var(--space-6); }
.mobile-nav ul { list-style: none; margin: 0; padding: 0; }
.mobile-nav > ul > li { border-bottom: 1px solid var(--border-subtle); }
.mobile-nav li { margin: 0; }
.mobile-nav__group > button {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: var(--space-4) 0; background: none; border: 0;
  color: var(--text-primary); font-family: var(--font-display); font-size: 1.25rem;
  font-weight: 600; cursor: pointer; min-height: 56px; letter-spacing: -0.01em;
}
.mobile-nav__group > button span { color: var(--text-muted); font-family: var(--font-sans); font-weight: 400; }
.mobile-nav__panel { display: none; padding-bottom: var(--space-4); }
.mobile-nav__panel[data-open="true"] { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-4); }
.mobile-nav__panel a, .mobile-nav > ul > li > a {
  display: flex; align-items: center; padding: var(--space-2) 0; color: var(--text-secondary);
  font-size: var(--fs-body); min-height: 44px;
}
.mobile-nav > ul > li > a { color: var(--text-primary); font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; min-height: 56px; letter-spacing: -0.01em; }
.mobile-nav .btn { width: 100%; margin-top: var(--space-8); }

/* --------------------------------------------------------------------------
   7. Breadcrumbs
   -------------------------------------------------------------------------- */
.breadcrumb { padding-top: var(--space-8); }
.breadcrumb ol {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
  list-style: none; margin: 0; padding: 0;
  font-size: var(--fs-small); color: var(--text-muted);
}
.breadcrumb li { margin: 0; display: flex; align-items: center; gap: var(--space-2); }
.breadcrumb li + li::before { content: "/"; color: var(--text-faint); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text-primary); }
.breadcrumb [aria-current="page"] { color: var(--text-secondary); }
.breadcrumb + main .hero { padding-top: clamp(32px, 4vw, 56px); }

/* --------------------------------------------------------------------------
   8. Hero
   -------------------------------------------------------------------------- */
.hero { padding-block: clamp(48px, 6vw, 96px) var(--section-y); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(40px, 5vw, 80px); align-items: center; }
.hero__grid > * { min-width: 0; }
.hero h1 { font-size: var(--fs-display); line-height: 1.02; letter-spacing: -0.035em; margin-bottom: var(--space-6); }
.hero .lead { max-width: 54ch; font-size: var(--fs-lead); color: var(--text-secondary); }
.hero__proof {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0;
  margin-top: var(--space-12); padding-top: var(--space-6);
  border-top: 1px solid var(--border-default);
}
.hero__proof-item { min-width: 0; padding-right: var(--space-5); }
.hero__proof-item + .hero__proof-item { padding-left: var(--space-5); border-left: 1px solid var(--border-subtle); }
.hero__proof-value { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 600; color: var(--text-primary); line-height: 1; letter-spacing: -0.02em; margin: 0; }
.hero__proof-label { font-size: var(--fs-small); color: var(--text-muted); margin-top: var(--space-2); line-height: 1.45; }
.hero__grid--single, .hero__grid[style] { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1024px) { .hero__grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) {
  .hero__proof { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .hero__proof-item, .hero__proof-item + .hero__proof-item { padding: 0; border-left: 0; display: flex; align-items: baseline; gap: var(--space-4); }
  .hero__proof-value { min-width: 5.5ch; }
  .hero__proof-label { margin-top: 0; }
}

/* --------------------------------------------------------------------------
   9. KPI tiles & stats
   -------------------------------------------------------------------------- */
.kpi {
  background: var(--surface-1); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: var(--card-pad);
  display: flex; flex-direction: column; gap: var(--space-3); min-width: 0;
}
.kpi__label {
  font-size: var(--fs-small); font-weight: 500;
  color: var(--text-muted); display: flex; align-items: center; gap: var(--space-2); margin: 0;
}
.kpi__value {
  font-size: var(--fs-kpi); font-weight: 600; line-height: 1;
  letter-spacing: -0.03em; color: var(--text-primary); margin: var(--space-2) 0 0;
}
.kpi__value--lg { font-size: var(--fs-kpi-lg); }
.kpi__unit { font-size: 0.5em; color: var(--text-muted); margin-left: 3px; font-weight: 500; letter-spacing: 0; }
.kpi__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: auto; padding-top: var(--space-2); flex-wrap: wrap; }
.kpi__meta { font-size: var(--fs-small); color: var(--text-muted); }
.kpi__spark { display: block; width: 100%; height: 36px; }

.delta {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-small); font-weight: 600; line-height: 1;
}
.delta--up { color: #4ade80; }
.delta--down { color: #f87171; }
.delta--flat { color: var(--neutral); }

.stat { padding: var(--space-2) 0; }
.stat__value {
  font-size: var(--fs-kpi); font-weight: 600; line-height: 1;
  color: var(--text-primary); letter-spacing: -0.03em; margin: 0;
}
.stat__label { font-size: var(--fs-small); color: var(--text-muted); margin-top: var(--space-3); }

/* --------------------------------------------------------------------------
   10. Charts (inline SVG — no chart library)
   -------------------------------------------------------------------------- */
.chart {
  margin: 0; display: flex; flex-direction: column; gap: var(--space-4); min-width: 0;
}
.chart__canvas { min-width: 0; }
.chart__svg { display: block; width: 100%; height: auto; overflow: visible; --k: 1; }
.chart figcaption, .chart__caption {
  font-size: var(--fs-small); color: var(--text-muted); order: 3; line-height: 1.5;
  padding-top: var(--space-4); border-top: 1px solid var(--border-subtle);
}
.chart__title { display: block; color: var(--text-secondary); font-weight: 500; }
.chart__note { display: block; margin-top: var(--space-1); color: var(--text-muted); }
.chart__toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.chart__toolbar .btn { flex: none; }
.chart__toolbar > .chart-note:empty { flex: 1; }

/* Small screens: wide charts keep a legible minimum width and scroll
   inside their card rather than shrinking labels to nothing. */
@media (max-width: 640px) {
  .chart__canvas { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
  .card .chart__canvas { margin-inline: calc(var(--card-pad) * -1); padding-inline: var(--card-pad); }
  .chart__canvas > .chart__svg:not([style*="max-width"]) { min-width: 540px; }
  .chart__toolbar { flex-wrap: wrap; }
}

/* Chart label sizes are multiplied by --k (inverse render scale, set by
   js/charts.js) so on-screen text stays ~11–12px at every chart width. */
.grid-line { stroke: var(--grid-line); stroke-width: 1; shape-rendering: crispEdges; vector-effect: non-scaling-stroke; }
.axis-line { stroke: var(--axis-line); stroke-width: 1; shape-rendering: crispEdges; vector-effect: non-scaling-stroke; }
.tick {
  font-size: calc(11.5px * var(--k, 1)); font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}
.tick:not([fill]) { fill: var(--text-muted); }
.axis-title { fill: var(--text-muted); font-size: calc(10.5px * var(--k, 1)); font-family: var(--font-sans); letter-spacing: 0.02em; font-weight: 500; }
.series-label { font-size: calc(11.5px * var(--k, 1)); font-family: var(--font-sans); font-weight: 600; }
.point-label { font-size: calc(11px * var(--k, 1)); font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.point-label:not([fill]):not([style*="fill"]) { fill: var(--text-secondary); }
.series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.series-fill { stroke: none; }
.bar { shape-rendering: crispEdges; }
.threshold { stroke-dasharray: 4 4; stroke-width: 1.5; }
.dot { stroke: var(--surface-1); stroke-width: 1.5; }

.legend { display: flex; flex-wrap: wrap; gap: 2px var(--space-3); list-style: none; margin: 0; padding: 0; font-size: var(--fs-small); min-width: 0; }
.legend li { margin: 0; }
.legend__item {
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: none; border: 0; padding: var(--space-1) var(--space-2) var(--space-1) 0;
  color: var(--text-secondary); font-family: inherit; font-size: var(--fs-small);
  cursor: pointer; border-radius: var(--radius-sm); min-height: 32px;
}
.legend__item:hover { color: var(--text-primary); }
.legend__item[aria-pressed="false"] { color: var(--text-faint); }
.legend__item[aria-pressed="false"] .legend__swatch { opacity: 0.3; }
.legend__swatch { width: 10px; height: 10px; border-radius: 2px; flex: none; }
.legend__swatch--dash { width: 14px; height: 0; border-top: 2px dashed currentColor; border-radius: 0; }

.chart-note { font-size: var(--fs-small); color: var(--text-muted); }
[data-series-hidden="true"] { opacity: 0.08; }

/* Chart draw-in — final state is the truth (see reduced motion below) */
[data-chart] .series { stroke-dasharray: var(--len, none); stroke-dashoffset: var(--len, 0); }
[data-chart].is-drawn .series { transition: stroke-dashoffset var(--dur-chart) var(--ease-out); stroke-dashoffset: 0; }
[data-chart].is-instant .series { stroke-dashoffset: 0; }
[data-chart] .bar-grow { transform-origin: bottom; transform-box: fill-box; transform: scaleY(0.001); }
[data-chart].is-drawn .bar-grow { transition: transform var(--dur-chart) var(--ease-out); transform: scaleY(1); }
[data-chart].is-instant .bar-grow { transform: none; }

.chart-tooltip {
  position: fixed; z-index: 140; pointer-events: none;
  background: var(--surface-3); color: var(--text-primary);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3); font-size: var(--fs-small); opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
  max-width: 240px;
}
.chart-tooltip[data-open="true"] { opacity: 1; }
.chart-tooltip .num { color: var(--text-primary); font-weight: 600; }

.data-table-panel { display: none; }
.data-table-panel[data-open="true"] { display: block; margin-top: var(--space-3); order: 4; }

/* Crafted diagrams (inline SVG, flat) */
.diagram { display: block; width: 100%; height: auto; color: var(--text-muted); }
.diagram .dg-ring { fill: none; stroke: var(--border-strong); stroke-width: 1; }
.diagram .dg-flow { fill: none; stroke: var(--accent); stroke-width: 1.75; }
.diagram .dg-arrowhead { stroke: var(--accent); }
.diagram .dg-spoke { stroke: var(--border-default); stroke-width: 1; stroke-dasharray: 3 4; }
.diagram .dg-core { fill: var(--surface-1); stroke: var(--border-strong); }
.diagram .dg-core-inner { fill: var(--surface-2); stroke: var(--accent); stroke-width: 1; stroke-dasharray: 2 4; }
.diagram .dg-node { fill: var(--surface-2); stroke: var(--border-strong); }
.diagram .dg-label { fill: var(--text-primary); font-family: var(--font-sans); font-weight: 600; font-size: 14px; }
.diagram .dg-meta { fill: var(--text-muted); font-family: var(--font-mono); font-size: 9.5px; }
.diagram .dg-rivet { fill: var(--border-strong); }
.diagram .dg-accent { fill: var(--accent); }
.diagram .dg-good { fill: var(--good); }
.diagram .dg-line { fill: none; stroke: var(--border-strong); stroke-width: 1; }
.diagram .dg-surface { fill: var(--surface-1); stroke: var(--border-default); }

/* --------------------------------------------------------------------------
   11. Data tables
   -------------------------------------------------------------------------- */
.table-wrap {
  overflow-x: auto; border-radius: var(--radius-lg);
  border: 1px solid var(--border-default); background: var(--surface-1);
  max-width: 100%;
}
.table-wrap:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
table.data {
  width: 100%; border-collapse: collapse;
  font-size: var(--fs-small); color: var(--text-secondary);
}
table.data caption {
  text-align: left; padding: var(--space-4) var(--space-5) var(--space-3);
  font-size: var(--fs-small); color: var(--text-muted);
}
table.data thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2); color: var(--text-secondary);
  font-size: var(--fs-small); font-weight: 600;
  text-align: left; padding: var(--cell-pad-y) var(--cell-pad-x);
  white-space: nowrap; border-top: 1px solid var(--border-subtle); border-bottom: 1px solid var(--border-default);
}
table.data th:first-child, table.data td:first-child { padding-left: var(--space-5); }
table.data th:last-child, table.data td:last-child { padding-right: var(--space-5); }
table.data thead th.num { text-align: right; }
table.data th button.sort {
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: none; border: 0; color: inherit; font: inherit; cursor: pointer;
  padding: var(--space-1) 0; border-radius: var(--radius-sm); min-height: 32px;
}
table.data th.num button.sort { flex-direction: row-reverse; }
table.data th button.sort:hover { color: var(--text-primary); }
table.data th button.sort .arrow { opacity: 0.4; font-size: 10px; }
table.data th[aria-sort="ascending"] button.sort .arrow,
table.data th[aria-sort="descending"] button.sort .arrow { opacity: 1; color: var(--accent-hover); }
table.data tbody td { padding: 12px var(--cell-pad-x); border-top: 1px solid var(--border-subtle); vertical-align: middle; }
table.data tbody tr:first-child td, table.data tbody tr:first-child th { border-top: 0; }
table.data tbody tr:hover { background: var(--surface-hover); }
table.data tbody th { padding: 12px var(--cell-pad-x); border-top: 1px solid var(--border-subtle); text-align: left; font-weight: 500; color: var(--text-primary); }
table.data td.num, table.data th.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
table.data tfoot td { padding: 12px var(--cell-pad-x); border-top: 1px solid var(--border-default); font-weight: 600; color: var(--text-primary); }

.minibar { display: inline-flex; align-items: center; gap: var(--space-3); width: 100%; justify-content: flex-end; }
.minibar__track { width: 64px; height: 4px; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; flex: none; }
.minibar__fill { height: 100%; background: var(--cat-1); border-radius: var(--radius-pill); display: block; }

.filter-bar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.field { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.field label { font-size: var(--fs-small); color: var(--text-secondary); font-weight: 500; }
.field select, .field input {
  min-height: 44px; padding: var(--space-2) var(--space-3);
  background: var(--surface-1); color: var(--text-primary);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  font-family: inherit; font-size: var(--fs-body); min-width: 180px; max-width: 100%;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.field textarea {
  padding: var(--space-3); background: var(--surface-1); color: var(--text-primary);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  font-family: inherit; font-size: var(--fs-body); min-height: 132px; width: 100%; resize: vertical;
}
.field select:hover, .field input:hover, .field textarea:hover { border-color: rgba(255, 255, 255, 0.26); }
.field select:focus, .field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.field--narrow { max-width: 320px; margin-bottom: var(--space-6); }
@media (max-width: 480px) { .field select, .field input { min-width: 0; width: 100%; } .filter-bar .field { flex: 1 1 100%; } }

.segmented {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface-1); border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
}
.segmented button {
  min-height: 36px; padding: var(--space-2) var(--space-4);
  background: none; border: 1px solid transparent; border-radius: var(--radius-pill);
  color: var(--text-muted); font-family: inherit; font-size: var(--fs-small);
  font-weight: 600; cursor: pointer;
}
.segmented button:hover { color: var(--text-primary); }
.segmented button[aria-pressed="true"] { background: var(--surface-3); color: var(--text-primary); border-color: var(--border-default); }

/* --------------------------------------------------------------------------
   12. Dashboard preview (in-product shell)
   -------------------------------------------------------------------------- */
.appshell {
  background: var(--surface-1); border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl); overflow: hidden; min-width: 0;
}
.appshell__bar {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-1); border-bottom: 1px solid var(--border-default);
}
.appshell__dots { display: flex; gap: 6px; }
.appshell__dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); display: block; }
.appshell__title { font-size: var(--fs-micro); color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.appshell__chip {
  margin-left: auto; font-size: var(--fs-micro); color: #4ade80; white-space: nowrap;
  background: var(--good-soft); padding: 4px var(--space-3); border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; gap: 6px;
}
.appshell__chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good); }
.appshell__body { display: grid; grid-template-columns: 156px minmax(0, 1fr); }
.appshell__side {
  padding: var(--space-3); border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: 2px; background: var(--bg-base);
}
.appshell__side span {
  font-size: var(--fs-small); color: var(--text-muted); white-space: nowrap;
  padding: 7px var(--space-3); border-radius: var(--radius-sm);
}
.appshell__side span.is-active { background: var(--surface-2); color: var(--text-primary); font-weight: 600; }
.appshell__main { padding: var(--space-5); display: grid; gap: var(--space-5); min-width: 0; }
.appshell__main .chart__toolbar .btn { min-height: 30px; padding: 4px 10px; font-size: var(--fs-micro); }
.appshell__main .chart figcaption { font-size: var(--fs-micro); }
.appshell__kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.mini-kpi { background: var(--surface-2); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: var(--space-3); min-width: 0; }
.mini-kpi__label { font-size: var(--fs-micro); color: var(--text-muted); margin: 0; line-height: 1.3; min-height: 2.6em; }
.mini-kpi__value { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 1.25rem; font-weight: 600; color: var(--text-primary); margin: var(--space-2) 0 0; line-height: 1; letter-spacing: -0.02em; }
.mini-kpi__delta { font-size: var(--fs-micro); margin: var(--space-2) 0 0; }
.mini-kpi__delta .delta { font-size: var(--fs-micro); }
@media (max-width: 1280px) and (min-width: 1025px) { .appshell__body { grid-template-columns: minmax(0, 1fr); } .appshell__side { display: none; } }
@media (max-width: 900px) {
  .appshell__body { grid-template-columns: minmax(0, 1fr); }
  .appshell__side { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border-subtle); scrollbar-width: none; }
  .appshell__kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) { .appshell__main { padding: var(--space-4); } .appshell__chip { display: none; } }

/* --------------------------------------------------------------------------
   13. Pipeline / steps / phases / loop
   -------------------------------------------------------------------------- */
.pipeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--dash-gap); grid-template-columns: repeat(4, minmax(0, 1fr)); counter-reset: step; }
.pipeline li { margin: 0; }
.pipeline__step {
  background: var(--surface-1); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); padding: var(--card-pad); height: 100%;
  display: flex; flex-direction: column; gap: var(--space-3);
}
.pipeline__n {
  font-family: var(--font-mono); font-size: var(--fs-micro); font-weight: 500;
  color: var(--accent-hover); letter-spacing: 0.04em;
}
.pipeline__step h3 { font-size: var(--fs-h4); margin: 0; }
.pipeline__step p.small { color: var(--text-muted); }
.pipeline__metric { margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); font-size: var(--fs-small); color: var(--text-muted); display: flex; justify-content: space-between; gap: var(--space-3); }
.pipeline__metric b { font-family: var(--font-num); font-variant-numeric: tabular-nums; color: var(--text-primary); white-space: nowrap; }
@media (max-width: 1024px) { .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .pipeline { grid-template-columns: minmax(0, 1fr); } }

.loop { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.loop__text > h2 { margin-bottom: var(--space-5); }
.loop__figure { max-width: 560px; justify-self: end; width: 100%; }
@media (max-width: 1024px) { .loop { grid-template-columns: minmax(0, 1fr); } .loop__figure { justify-self: center; } }

.steps { list-style: none; margin: var(--space-10) 0 0; padding: 0; }
.step {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--space-4);
  align-items: baseline; padding: var(--space-5) 0; margin: 0;
  border-top: 1px solid var(--border-default);
}
.step:last-child { border-bottom: 1px solid var(--border-default); }
.step__n { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--accent-hover); }
.step h3 { font-size: var(--fs-h4); margin: 0 0 var(--space-1); }
.step p { font-size: var(--fs-small); color: var(--text-muted); margin: 0; }
.step__metric { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.step__metric b { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 1.125rem; letter-spacing: -0.01em; white-space: nowrap; }
.step__metric span { font-size: var(--fs-micro); color: var(--text-muted); white-space: nowrap; }
@media (max-width: 560px) {
  .step { grid-template-columns: 32px minmax(0, 1fr); }
  .step__metric { grid-column: 2; text-align: left; flex-direction: row; align-items: baseline; gap: var(--space-2); }
}

.phases { list-style: none; margin: 0 0 var(--dash-gap); padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--dash-gap); position: relative; }
.phase { margin: 0; position: relative; padding: var(--space-8) var(--space-5) 0 0; }
.phase::before { content: ""; position: absolute; top: 5px; left: 0; right: calc(var(--dash-gap) * -1); height: 1px; background: var(--border-strong); }
.phase:last-child::before { right: 0; }
.phase__node { position: absolute; top: 0; left: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--bg-base); border: 1.5px solid var(--text-muted); }
.phase--final .phase__node { background: var(--good); border-color: var(--good); }
.phase__when { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--text-muted); margin: 0 0 var(--space-2); }
.phase--final .phase__when { color: #4ade80; }
.phase h3 { font-size: var(--fs-h4); margin: 0 0 var(--space-2); }
.phase p { color: var(--text-muted); }
.phases + .card { margin-top: var(--space-10); }
@media (max-width: 1024px) { .phases { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--space-8); } .phase:nth-child(2n)::before { right: 0; } }
@media (max-width: 560px) {
  .phases { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .phase { padding: 0 0 var(--space-6) var(--space-8); }
  .phase::before, .phase:nth-child(2n)::before, .phase:last-child::before { top: 6px; bottom: -6px; left: 5px; right: auto; width: 1px; height: auto; }
  .phase:last-child::before { display: none; }
}

/* --------------------------------------------------------------------------
   14. Logos / trust
   -------------------------------------------------------------------------- */
.trust { display: grid; gap: var(--space-8); }
.trust__caption { margin: 0 auto; text-align: center; font-size: var(--fs-small); color: var(--text-muted); max-width: 64ch; }
.logos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; }
.logos--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.logos--4, .logos--8 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.logos--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.logo-item {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  color: var(--text-muted); font-weight: 600; font-size: var(--fs-small);
  letter-spacing: -0.01em; padding: var(--space-6) var(--space-3); text-align: left; line-height: 1.25;
  box-shadow: none; outline: 1px solid var(--border-subtle); outline-offset: -0.5px;
  transition: color var(--dur-fast) var(--ease-out);
}
.logo-item:hover { color: var(--text-primary); }
.logo-item svg { width: 20px; height: 20px; flex: none; }
@media (max-width: 1024px) { .logos--6, .logos--5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .logos, .logos--6, .logos--5, .logos--4, .logos--8 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .logo-item { padding: var(--space-5) var(--space-2); font-size: var(--fs-micro); } }

/* --------------------------------------------------------------------------
   15. Testimonials
   -------------------------------------------------------------------------- */
.quote { display: flex; flex-direction: column; gap: var(--space-5); height: 100%; margin: 0; }
.quote blockquote { margin: 0; font-size: var(--fs-body-lg); color: var(--text-primary); line-height: 1.55; letter-spacing: -0.005em; }
.quote blockquote p { max-width: none; }
.quote figcaption, .quote cite { font-style: normal; font-size: var(--fs-small); color: var(--text-muted); }
.quote cite b { display: block; color: var(--text-primary); font-weight: 600; }
.quote__result {
  margin-top: auto; padding-top: var(--space-4); border-top: 1px solid var(--border-subtle);
  display: flex; align-items: baseline; gap: var(--space-3);
}
.quote__result .num { font-size: 1.75rem; font-weight: 600; color: var(--text-primary); letter-spacing: -0.02em; }

/* --------------------------------------------------------------------------
   16. Pricing
   -------------------------------------------------------------------------- */
.price-card { display: flex; flex-direction: column; gap: 0; height: 100%; position: relative; padding: clamp(24px, 2.4vw, 32px); }
.price-card--featured { border-color: var(--accent); background: var(--surface-2); }
.price-card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 28px; margin-bottom: var(--space-6); }
.price-card__head h3 { margin: 0; font-family: var(--font-display); font-size: 1.375rem; letter-spacing: -0.015em; }
.price__amount { font-size: var(--fs-price); font-weight: 600; line-height: 1; color: var(--text-primary); letter-spacing: -0.035em; margin: 0; white-space: nowrap; }
.price__period { font-size: var(--fs-small); color: var(--text-muted); font-family: var(--font-sans); margin: var(--space-2) 0 0; }
.price-card__blurb { font-size: var(--fs-small); color: var(--text-secondary) !important; margin: var(--space-5) 0 var(--space-6); padding-bottom: var(--space-6); border-bottom: 1px solid var(--border-subtle); }
.price__list { list-style: none; margin: 0 0 var(--space-8); padding: 0; display: grid; gap: var(--space-3); font-size: var(--fs-small); }
.price__list li { margin: 0; display: flex; gap: var(--space-3); align-items: flex-start; line-height: 1.5; }
.price__list li::before { content: ""; flex: none; width: 14px; height: 14px; margin-top: 3px; background: currentColor; color: var(--accent-hover);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.price-card .btn { margin-top: auto; width: 100%; }

/* --------------------------------------------------------------------------
   17. FAQ accordion
   -------------------------------------------------------------------------- */
.faq { display: grid; gap: 0; border-top: 1px solid var(--border-default); }
.faq__item { background: none; border: 0; border-bottom: 1px solid var(--border-default); border-radius: 0; }
.faq__h { margin: 0; font-size: inherit; }
.faq__q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-6);
  padding: var(--space-5) 0; background: none; border: 0;
  color: var(--text-primary); font-family: var(--font-sans); font-size: var(--fs-body-lg);
  font-weight: 600; text-align: left; cursor: pointer; min-height: 64px; letter-spacing: -0.005em;
  transition: color var(--dur-fast) var(--ease-out);
}
.faq__q:hover { color: #fff; }
.faq__q .plus { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--border-strong); color: var(--text-secondary); transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-fast); }
.faq__q .plus svg { width: 12px; height: 12px; }
.faq__q:hover .plus { border-color: var(--text-muted); }
.faq__q[aria-expanded="true"] .plus { transform: rotate(45deg); color: var(--text-primary); }
.faq__a { padding: 0 var(--space-12) var(--space-6) 0; display: none; }
.faq__a[data-open="true"] { display: block; }
.faq__a p { color: var(--text-secondary); max-width: 70ch; }

.faq-split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.faq-split__head { position: sticky; top: 100px; }
.faq-split__head h2 { margin-bottom: var(--space-4); }
@media (max-width: 1024px) { .faq-split { grid-template-columns: minmax(0, 1fr); } .faq-split__head { position: static; } }
@media (max-width: 560px) { .faq__a { padding-right: 0; } }

/* --------------------------------------------------------------------------
   18. Code & terminal
   -------------------------------------------------------------------------- */
.code-window, .terminal {
  background: var(--bg-base); border: 1px solid var(--border-default);
  border-radius: var(--radius-lg); overflow: hidden; min-width: 0; max-width: 100%;
}
.code-window__bar, .terminal__bar {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); min-height: 44px; background: var(--surface-1);
  border-bottom: 1px solid var(--border-default);
  font-size: var(--fs-micro); color: var(--text-muted); font-family: var(--font-mono);
}
.code-window__bar .btn-sm, .terminal__bar .btn-sm { margin-left: auto; min-height: 28px; padding: 4px 10px; font-size: var(--fs-micro); }
.code-window pre, .terminal pre {
  margin: 0; padding: var(--card-pad); overflow-x: auto;
  font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.75;
  color: var(--text-secondary); tab-size: 2;
}
.code-window code, .terminal code { font-family: inherit; }
.tok-key { color: var(--cat-4); }
.tok-str { color: var(--cat-3); }
.tok-num { color: var(--cat-2); }
.tok-com { color: var(--text-faint); }
.tok-fn  { color: var(--cat-1); }
.term-prompt { color: var(--good); }
.term-out { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   19. Lists, checks, feature rows
   -------------------------------------------------------------------------- */
.checklist { list-style: none; margin: var(--space-6) 0 0; padding: 0; display: grid; gap: var(--space-3); }
.card .checklist, h3 + .checklist { margin-top: var(--space-4); }
.checklist li { margin: 0; display: flex; gap: var(--space-3); align-items: flex-start; font-size: var(--fs-body); line-height: 1.55; }
.checklist.small li { font-size: var(--fs-small); }
.checklist li::before { content: ""; flex: none; width: 14px; height: 14px; margin-top: 0.3em; background: var(--accent-hover);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.checklist--dash li::before { -webkit-mask: none; mask: none; width: 10px; height: 1px; margin-top: 0.8em; background: var(--text-faint); }

.deflist { display: grid; gap: var(--space-5); margin: 0; }
.deflist dt { color: var(--text-primary); font-weight: 600; font-size: var(--fs-body); }
.deflist dd { margin: var(--space-1) 0 0; color: var(--text-secondary); font-size: var(--fs-body); }
.deflist--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: var(--space-6); }
@media (max-width: 680px) { .deflist--3 { grid-template-columns: minmax(0, 1fr); } }

.spec-list { display: grid; gap: 0; padding-block: var(--space-2); margin: 0; }
.spec-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); padding: 12px 0; }
.spec-row + .spec-row { border-top: 1px solid var(--border-subtle); }
.spec-row dt { color: var(--text-muted); font-size: var(--fs-small); }
.spec-row dd { margin: 0; color: var(--text-primary); font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: var(--fs-small); font-weight: 600; text-align: right; }

.persona__q { color: var(--text-primary) !important; font-size: var(--fs-body-lg); line-height: 1.5; margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--border-subtle); }

.compliance .card h3 { margin-top: var(--space-5); }

/* --------------------------------------------------------------------------
   20. CTA band
   -------------------------------------------------------------------------- */
.cta {
  position: relative; overflow: hidden;
  background: var(--surface-1); border: 1px solid var(--border-default);
  border-radius: var(--radius-xl); padding: clamp(40px, 7vw, 96px) clamp(24px, 5vw, 64px);
  text-align: center;
}
/* Rivet grid: a flat dot pattern (SVG, no gradient) along the panel edges. */
.cta::before, .cta::after {
  content: ""; position: absolute; top: 24px; bottom: 24px; width: 72px; pointer-events: none; opacity: 0.55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Ccircle cx='2' cy='2' r='1.25' fill='%23313a4b'/%3E%3C/svg%3E") repeat;
}
.cta::before { left: 24px; }
.cta::after { right: 24px; }
.cta > * { position: relative; }
.cta h2 { font-size: var(--fs-h1); letter-spacing: -0.03em; max-width: 20ch; margin-inline: auto; }
.cta p { margin-inline: auto; color: var(--text-muted); max-width: 58ch; }
@media (max-width: 760px) { .cta::before, .cta::after { display: none; } }

/* --------------------------------------------------------------------------
   21. Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--bg-base); padding-block: var(--space-16) var(--space-10); }
.footer__grid { display: grid; grid-template-columns: 1.5fr repeat(4, minmax(0, 1fr)); gap: var(--space-8); }
.footer__brand p { font-size: var(--fs-small); color: var(--text-muted); max-width: 34ch; margin-top: var(--space-4); }
.footer__status { margin-top: var(--space-5) !important; }
.footer__col h3 { font-family: var(--font-sans); font-size: var(--fs-small); color: var(--text-primary); margin-bottom: var(--space-4); font-weight: 600; }
.footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.footer__col li { margin: 0; }
.footer__col a { color: var(--text-muted); font-size: var(--fs-small); }
.footer__col a:hover { color: var(--text-primary); text-decoration: none; }
.footer__bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-4); margin-top: var(--space-16);
  font-size: var(--fs-small); color: var(--text-faint);
}
.footer__bottom p { margin: 0; }
.footer__bottom ul { display: flex; flex-wrap: wrap; gap: var(--space-5); list-style: none; margin: 0; padding: 0; }
.footer__bottom li { margin: 0; }
.footer__bottom a { color: var(--text-muted); }
.footer__bottom a:hover { color: var(--text-primary); }
.status-dot { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--text-muted); font-size: var(--fs-small); }
.status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: none; }
@media (max-width: 900px) { .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer__brand { grid-column: 1 / -1; } }

/* --------------------------------------------------------------------------
   22. Docs / article layouts
   -------------------------------------------------------------------------- */
.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 200px; gap: clamp(24px, 3vw, 56px); align-items: start; }
.docs-layout > * { min-width: 0; }
.docs-nav { position: sticky; top: 92px; }
.docs-nav h3 { font-family: var(--font-sans); font-size: var(--fs-small); color: var(--text-primary); margin-bottom: var(--space-2); padding-inline: var(--space-3); }
.docs-nav ul { list-style: none; margin: 0 0 var(--space-6); padding: 0; display: grid; gap: 1px; }
.docs-nav li { margin: 0; }
.docs-nav a { display: block; padding: 6px var(--space-3); border-radius: var(--radius-sm); color: var(--text-muted); font-size: var(--fs-small); }
.docs-nav a:hover { background: var(--surface-1); color: var(--text-primary); text-decoration: none; }
.docs-toc { position: sticky; top: 92px; font-size: var(--fs-small); padding-left: var(--space-4); border-left: 1px solid var(--border-subtle); }
.docs-toc__title { font-family: var(--font-sans); font-size: var(--fs-small) !important; color: var(--text-primary); margin-bottom: var(--space-3); font-weight: 600; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.docs-toc li { margin: 0; }
.docs-toc a { color: var(--text-muted); }
.docs-toc a:hover { color: var(--text-primary); }
@media (max-width: 1120px) { .docs-layout { grid-template-columns: 200px minmax(0, 1fr); } .docs-toc { display: none; } }
@media (max-width: 800px) { .docs-layout { grid-template-columns: minmax(0, 1fr); } .docs-nav { position: static; } }

.article-meta { display: flex; flex-wrap: wrap; gap: var(--space-4); font-size: var(--fs-small); color: var(--text-muted); margin-bottom: var(--space-6); }
.post-card { display: flex; flex-direction: column; gap: var(--space-3); height: 100%; }
.post-card h3 { margin: 0; font-size: var(--fs-h4); line-height: 1.35; }
.post-card .meta { font-size: var(--fs-small); color: var(--text-muted); margin-top: auto; padding-top: var(--space-4); border-top: 1px solid var(--border-subtle); }

/* --------------------------------------------------------------------------
   23. Misc
   -------------------------------------------------------------------------- */
.notice {
  background: var(--accent-soft); border: 1px solid rgba(63, 140, 255, 0.24);
  border-radius: var(--radius-md); padding: var(--space-4) var(--space-5);
  font-size: var(--fs-small); color: var(--text-secondary);
}
.notice--warn { background: var(--warn-soft); border-color: rgba(245, 158, 11, 0.24); }
.map-cell { transition: opacity var(--dur-fast) var(--ease-out); }
.aspect-wide { aspect-ratio: 16 / 9; }

[data-reveal] { opacity: 0; transform: translateY(12px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out); }
[data-reveal].is-in { opacity: 1; transform: none; }

@media (max-width: 680px) {
  .cta { padding: var(--space-10) var(--space-5); }
}

/* --------------------------------------------------------------------------
   24. Reduced motion — data must be fully legible with zero animation
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  [data-chart] .series { stroke-dashoffset: 0; }
  [data-chart] .bar-grow { transform: none; }
}

/* --------------------------------------------------------------------------
   25. Print — charts stay readable in grayscale
   -------------------------------------------------------------------------- */
@media print {
  .site-header, .mobile-nav, .btn, .chart-tooltip { display: none !important; }
  body { background: #fff; color: #000; }
  .data-table-panel { display: block !important; }
}

/* --------------------------------------------------------------------------
   26. Page-level variants
   -------------------------------------------------------------------------- */
.hero__grid--narrow { max-width: 820px; }
.hero__grid--center { max-width: 880px; margin-inline: auto; text-align: center; }
.hero__grid--center .lead { margin-inline: auto; }
.form-title { font-size: var(--fs-h3); margin-top: 0; }
/* Pipelines size their columns to their step count so a 3-step list never
   leaves an empty fourth column. */
@media (min-width: 1025px) {
  .pipeline:has(> li:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipeline:has(> li:nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .pipeline:has(> li:nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1024px) and (min-width: 681px) {
  .pipeline > li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
/* Two cards side by side in a split share one height. */
.split:has(> .card + .card), .split:has(> .card + .stack), .split:has(> .stack + .card) { align-items: stretch; }
/* 2×2 KPI block beside a chart */
.kpi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--dash-gap); }
.kpi-grid > .kpi { min-height: 0; }
@media (max-width: 400px) { .kpi-grid { grid-template-columns: minmax(0, 1fr); } }
/* Site directory (404) */
.directory { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-12) var(--space-8); }
.directory__group h3 { font-size: var(--fs-small); color: var(--text-muted); font-weight: 500; margin: 0 0 var(--space-3); }
.directory__group ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border-default); }
.directory__group li { margin: 0; border-bottom: 1px solid var(--border-subtle); }
.directory__group a { display: grid; gap: 2px; padding: var(--space-4) var(--space-6) var(--space-4) 0; position: relative; color: var(--text-primary); }
.directory__group a::after { content: "→"; position: absolute; right: 0; top: var(--space-4); color: var(--text-faint); transition: transform var(--dur-fast) var(--ease-out), color var(--dur-fast); }
.directory__group a:hover { text-decoration: none; }
.directory__group a:hover::after { transform: translateX(3px); color: var(--accent-hover); }
.directory__title { font-weight: 600; }
.directory__desc { font-size: var(--fs-small); color: var(--text-muted); }
@media (max-width: 1024px) { .directory { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .directory { grid-template-columns: minmax(0, 1fr); gap: var(--space-10); } }
/* Figures inside cards keep their primary colour (beats `.card p`). */
.card .price__amount, .card .stat__value, .card .kpi__value, .card .hero__proof-value, .card .mini-kpi__value { color: var(--text-primary); }
.card .stat__label, .card .price__period { color: var(--text-muted); }
@media (max-width: 1024px) and (min-width: 681px) { .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
