/* ============================================================================
   VEXELX SITE — design system (reads css/tokens.css only)
   ----------------------------------------------------------------------------
   No hex below this line. Every colour is a semantic token from tokens.css
   Part 2 (--bg, --surface, --ink, --muted, --hair, --accent-lemon,
   --accent-blue …) so light / dark / system all fall out of the same rules.

   Contents
     1  Reset + base type
     2  Layout (.wrap, .grid, .stack, .section rhythm)
     3  Type voices (.display .h2 .h3 .lede .small .caption .mono .eyebrow)
     4  Highlighter (mark.hl)
     5  Buttons + pills
     6  Cards, stats, rules, lists
     7  Nav pill
     8  Footer
     9  Theme toggle
    10  Forms
    11  Page head + prose (sub-pages)
    12  Reveal + motion
    13  Utilities + responsive
    14  Modal dialog (the "Book a walkthrough" popup)
   ============================================================================ */


/* ============================================================================
   1  RESET + BASE TYPE
   ============================================================================ */

:root {
  /* type scale for the site (the tin's --text-* stay available) */
  --fs-display: clamp(46px, 6.2vw, 88px);        /* hero H1                    */
  --fs-h2:      clamp(38px, 5.4vw, 68px);        /* section H2                 */
  --fs-h3:      var(--text-heading-md);        /* 24 — Geist 500             */
  --fs-h3-serif: clamp(25px, 2.3vw, 32px);     /* Playfair, editorial titles */
  --fs-lede:    clamp(18px, 1.35vw, 20px);
  --fs-body:    17px;   --lh-body: 1.6;
  --fs-small:   15px;   --lh-small: 1.55;
  --fs-caption: 13px;
  --fs-label:   var(--text-label);             /* 11 mono                    */
  --fs-label-lg: 12px;

  /* rhythm — matches home-origin-light: sections ~120 desktop / ~70 mobile */
  --section-y:       clamp(64px, 8.5vw, 112px);
  --section-y-tight: clamp(48px, 6vw, 80px);
  --section-y-close: clamp(96px, 12vw, 160px);
  --head-gap:        clamp(40px, 5vw, 64px);   /* section-head → content     */
  --site-max:  var(--page-max-width);          /* 1200                       */
  --reading:   66ch;
  --nav-h:     56px;

  /* motion */
  --ui-duration: 180ms;
  --ui-ease:     cubic-bezier(.2, .7, .2, 1);
  --reveal-duration: 900ms;                    /* 700–900 ms; origin used 2.5 s — one line to change */
  --reveal-ease:     cubic-bezier(.16, .84, .3, 1);
  --reveal-rise:     8px;
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 4px); }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: -0.1px;
  min-height: 100vh;
  overflow-x: hidden;
}

/* any element carrying its own theme paints its own ground */
[data-theme] { background-color: var(--bg); color: var(--ink); }
/* …except inline components that only borrow the palette */
.nav[data-theme], .theme-toggle[data-theme] { background-color: transparent; }

h1, h2, h3, h4 { font-weight: var(--font-weight-regular); overflow-wrap: break-word; }
p, li { max-width: var(--reading); }
p:empty { display: none; }
strong, b { font-weight: var(--font-weight-medium); }
em, i { font-style: italic; }
small { font-size: var(--fs-small); }
ul, ol { margin: 0; padding-left: 1.2em; }
hr { border: 0; height: 1px; background: var(--hair); margin: 0; }
img, video, canvas, svg { max-width: 100%; }
button { cursor: pointer; background: none; border: 0; padding: 0; color: inherit; }
::selection { background: var(--accent-lemon); color: var(--accent-lemon-ink); }

a { color: var(--link); text-decoration: underline; text-underline-offset: 0.16em; text-decoration-thickness: 1px; transition: color var(--ui-duration) var(--ui-ease); }
a:hover { color: var(--link-hover); }
a.quiet, .quiet a { text-decoration: none; }
a.quiet:hover, .quiet a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
.btn:focus-visible, .pill:focus-visible { border-radius: var(--radius-pill); }


/* ============================================================================
   2  LAYOUT
   ============================================================================ */

.wrap { width: 100%; max-width: var(--site-max); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow  { max-width: 880px; }
.wrap--reading { max-width: calc(var(--reading) + 2 * var(--gutter)); }
.wrap--wide    { max-width: 1320px; }

.grid { display: grid; gap: var(--spacing-16); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--gap-lg { gap: var(--spacing-32); }

.stack > * + * { margin-top: var(--spacing-16); }
.stack--lg > * + * { margin-top: var(--spacing-24); }
.stack--xl > * + * { margin-top: var(--spacing-40); }

.center { text-align: center; }
.center p, .center .lede { margin-inline: auto; }

/* Sections — one idea per section, generous air, bands alternate the rhythm */
.section { position: relative; padding-block: var(--section-y); }
.section--tight { padding-block: var(--section-y-tight); }
.section--flush-top { padding-top: 0; }
.section--closing { padding-block: var(--section-y-close); text-align: center; }
.section--band  { background: var(--bg-band); }
/* the dark stage: add data-theme="dark" on the element so the whole subtree flips */
.section--stage { background: var(--bg); }
.section--hairline { border-top: 1px solid var(--hair); }

/* Section head — centred by default (home-origin), .section-head--left for editorial */
.section-head { max-width: 760px; margin: 0 auto var(--head-gap); text-align: center; }
.section-head--left { margin-inline: 0; text-align: left; }
.section-head .eyebrow { margin-bottom: var(--spacing-20); }
.section-head .lede { margin-top: var(--spacing-24); }
.section-head:not(.section-head--left) .lede { margin-inline: auto; max-width: 600px; }
.section-head--tight { margin-bottom: var(--spacing-32); }


/* ============================================================================
   3  TYPE VOICES
   ============================================================================ */

/* Display — Playfair 400, never bold. Hero only. */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-display);
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: balance;
}
.display--sm { font-size: clamp(36px, 4.6vw, 64px); line-height: 1.06; }
.display em { font-style: italic; }

/* Section H2 — Playfair 400 */
.h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h2);
  line-height: 1.1;
  letter-spacing: -0.012em;
  color: var(--ink);
  text-wrap: balance;
}
.h2 em { font-style: italic; }

/* H3 — Geist 500 by default (the tin: Playfair is not for h3); .h3--serif when a
   card or step wants an editorial title */
.h3 {
  font-family: var(--font-sans);
  font-weight: var(--font-weight-medium);
  font-size: var(--fs-h3);
  line-height: 1.25;
  letter-spacing: -0.5px;
  color: var(--ink);
}
.h3--serif {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h3-serif);
  line-height: 1.12;
  letter-spacing: -0.01em;
}
.h4 { font-family: var(--font-sans); font-weight: var(--font-weight-medium); font-size: var(--text-heading-sm); line-height: 1.3; letter-spacing: -0.3px; color: var(--ink); }

/* Lede — the sentence under a headline. Geist 300/400, graphite. */
.lede {
  font-size: var(--fs-lede);
  font-weight: var(--font-weight-light);
  line-height: 1.5;
  letter-spacing: -0.2px;
  color: var(--ink-2);
  max-width: 62ch;
  text-wrap: pretty;
}
.lede--regular { font-weight: var(--font-weight-regular); }
.lede strong { font-weight: var(--font-weight-medium); color: var(--ink); }

.body-2 { color: var(--ink-2); }              /* secondary paragraph voice */
.small { font-size: var(--fs-small); line-height: var(--lh-small); }
.caption { font-size: var(--fs-caption); line-height: 1.5; color: var(--muted); }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }

/* Mono label — Roboto Mono, uppercase, the widest tracking in the system.
   Use it for card headers, stat labels, footer notes, the odd eyebrow.
   NOT above every section heading. */
.mono, .eyebrow, .label {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  font-weight: var(--font-weight-regular);
  line-height: var(--leading-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--muted);
}
.mono--lg, .eyebrow--lg { font-size: var(--fs-label-lg); }
.mono--ink { color: var(--ink); }
.eyebrow { display: block; }

/* Numbers in columns / stats: tabular. Not on hero values. */
.num, .tabular { font-variant-numeric: tabular-nums; }


/* ============================================================================
   4  HIGHLIGHTER — lemon band behind words, ink text on it (13.6:1).
      Works on dark too: lemon is a SURFACE, so ink-on-lemon inside an ivory
      headline is allowed. One per screen.
   ============================================================================ */

mark.hl {
  background: var(--accent-lemon);
  color: var(--accent-lemon-ink);
  padding: 0.02em 0.14em;
  margin: 0 -0.06em;
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
/* Display sizes: a band from just above cap height to just under the
   descenders, so it never paints over the line above. Keep the marked phrase
   on ONE line (nowrap) — split into two <mark>s if it must wrap. */
.display mark.hl, .h2 mark.hl, mark.hl.band {
  background: transparent; padding: 0; margin: 0;
  position: relative; z-index: 0; white-space: nowrap;
}
.display mark.hl::before, .h2 mark.hl::before, mark.hl.band::before {
  content: ""; position: absolute; z-index: -1;
  left: -0.08em; right: -0.08em; top: 0.3em; bottom: 0.06em;
  background: var(--accent-lemon); border-radius: 2px;
}
/* quiet variant — the lemon-quiet wash for "read this" in body copy */
mark.hl--quiet { background: var(--accent-lemon-quiet); color: var(--on-lemon-quiet); }


/* ============================================================================
   5  BUTTONS + PILLS
   ============================================================================ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--spacing-8);
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: var(--font-weight-medium);
  line-height: 1.2;
  letter-spacing: 0;
  padding: 14px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--ui-duration) var(--ui-ease), color var(--ui-duration) var(--ui-ease), border-color var(--ui-duration) var(--ui-ease);
}
.btn:hover { text-decoration: none; }

/* the ONE lemon object per view */
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-ink); border-color: var(--btn-primary-bg); }
.btn-primary:hover { background: var(--btn-primary-hover-bg); color: var(--btn-primary-hover-ink); border-color: var(--btn-primary-hover-bg); }

.btn-ghost { background: transparent; color: var(--btn-ghost-ink); border-color: var(--btn-ghost-border); }
.btn-ghost:hover { background: var(--btn-ghost-hover-bg); color: var(--btn-ghost-ink); }

/* filled ink — product-style, rare on the site (forms) */
.btn-ink { background: var(--ink); color: var(--ink-inverse); border-color: var(--ink); }
.btn-ink:hover { background: var(--link-hover); border-color: var(--link-hover); color: var(--ink-inverse); }

.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-lg { padding: 16px 30px; font-size: 16px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn .arrow { transition: transform var(--ui-duration) var(--ui-ease); }
.btn:hover .arrow { transform: translateX(3px); }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--spacing-12); align-items: center; }
.btn-row--center { justify-content: center; }

/* Pills / chips — 14 px Geist 500, hairline. Status chip = mono uppercase on its wash + dot. */
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: var(--font-weight-medium); line-height: 1;
  padding: 7px 12px 7px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--hair);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.pill i, .pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.pill--lemon { background: var(--accent-lemon); color: var(--accent-lemon-ink); border-color: transparent; }
.pill--lemon i, .pill--lemon .dot { background: var(--accent-lemon-ink); }
.pill--quiet { background: var(--accent-lemon-quiet); color: var(--on-lemon-quiet); border-color: transparent; }
.pill--quiet i, .pill--quiet .dot { background: var(--on-lemon-quiet); }
.pill--mono { font-family: var(--font-mono); font-size: var(--fs-label); font-weight: var(--font-weight-regular); letter-spacing: var(--tracking-label); text-transform: uppercase; padding: 7px 12px 6px 11px; }
.pill--critical { background: var(--st-critical-wash); color: var(--st-critical); border-color: transparent; }
.pill--warning  { background: var(--st-warning-wash);  color: var(--st-warning);  border-color: transparent; }
.pill--watch    { background: var(--st-watch-wash);    color: var(--st-watch);    border-color: transparent; }
.pill--win      { background: var(--st-win-wash);      color: var(--st-win);      border-color: transparent; }
.pill--critical i, .pill--critical .dot { background: var(--st-critical); }
.pill--warning i,  .pill--warning .dot  { background: var(--st-warning); }
.pill--watch i,    .pill--watch .dot    { background: var(--st-watch); }
.pill--win i,      .pill--win .dot      { background: var(--st-win); }


/* ============================================================================
   6  CARDS, STATS, RULES, LISTS — flat, hairline, 12 px, no shadow
   ============================================================================ */

.card {
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius-xl);
  padding: var(--spacing-32);
  color: var(--ink);
  text-decoration: none;
  transition: background-color var(--ui-duration) var(--ui-ease), border-color var(--ui-duration) var(--ui-ease);
}
.card--band { background: var(--bg-band); border-color: transparent; }   /* bone card on white */
.card--strong { border-color: var(--ink); }                               /* the "on" panel in a compare */
.card--tight { padding: var(--spacing-24); }
a.card:hover, .card--link:hover { background: var(--surface-2); }
.card > * + * { margin-top: var(--spacing-12); }
.card .h3, .card .h3--serif { margin-top: var(--spacing-16); }
.card .h3:first-child, .card .h3--serif:first-child { margin-top: 0; }
.card p { color: var(--ink-2); font-size: var(--fs-small); line-height: var(--lh-small); }
.card__foot { margin-top: var(--spacing-24); padding-top: var(--spacing-16); border-top: 1px solid var(--hair); font-size: var(--fs-small); color: var(--ink-2); }

/* Callout — the Action-callout voice: lemon-quiet wash, radius 8 */
.callout { background: var(--accent-lemon-quiet); color: var(--on-lemon-quiet); border-radius: var(--radius-lg); padding: var(--spacing-16) var(--spacing-20); }
.callout strong { font-weight: var(--font-weight-medium); }

/* Stat — a big number + mono label (cost bars, proof strip). Numbers are
   Geist 500 tabular (Playfair is not for numbers). */
.stat { display: flex; flex-direction: column; gap: var(--spacing-8); }
.stat__value {
  font-family: var(--font-sans); font-weight: var(--font-weight-medium);
  font-size: clamp(36px, 4.2vw, 56px); line-height: 1; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap;
}
.stat__value--serif { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.02em; }
.stat__value .unit { color: var(--accent-blue); }             /* "−$" in cobalt: what VEX found */
.stat__label { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); }
.stat p { font-size: var(--fs-small); color: var(--ink-2); margin-top: var(--spacing-4); }

/* Stat row — hairline-divided columns (lyon "costs") */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--hair); }
.stat-row > * { padding: var(--spacing-32) var(--spacing-24) var(--spacing-32) 0; border-right: 1px solid var(--hair); }
.stat-row > *:not(:first-child) { padding-left: var(--spacing-24); }
.stat-row > *:last-child { border-right: 0; }

/* Rules and hairline lists */
.rule { height: 1px; background: var(--hair); border: 0; }
.rule--strong { background: var(--ink); }
.list-hairline { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--hair); }
.list-hairline > li { padding-block: var(--spacing-16); border-bottom: 1px solid var(--hair); max-width: none; }
.list-check, .list-x { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--spacing-12); }
.list-check > li, .list-x > li { display: flex; gap: var(--spacing-12); align-items: flex-start; font-size: var(--fs-small); line-height: var(--lh-small); }
.list-check > li::before { content: ""; flex: none; width: 14px; height: 14px; margin-top: 4px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%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 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat; }
.list-x > li { color: var(--ink-2); }
.list-x > li::before { content: ""; flex: none; width: 14px; height: 14px; margin-top: 4px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%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 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M18 6 6 18M6 6l12 12'/%3E%3C/svg%3E") center / contain no-repeat; }

/* Brand mark / wordmark instances (the sprite lives in partials/sprite.html) */
.wordmark { display: inline-flex; align-items: center; color: var(--wordmark-text); text-decoration: none; }
.wordmark svg { height: var(--brand-wordmark-nav); width: auto; display: block; }
.wordmark--lg svg { height: 28px; }
.mark svg { height: var(--brand-mark-min); width: auto; display: block; }


/* ============================================================================
   7  NAV PILL — floating, centred, sticky. Wordmark left, links, lemon CTA.
      Compact on scroll (.is-compact). On the hero stage the JS sets
      data-theme="dark" + .nav--on-stage: transparent pill, on-stage hairline.
   ============================================================================ */

.nav {
  position: sticky; top: 16px; z-index: 60;
  height: var(--nav-h);                                                 /* fixed flow height: the open menu overlays, never pushes */
  padding-inline: var(--gutter);
  margin-top: 16px; margin-bottom: calc(-1 * (var(--nav-h) + 16px));  /* the page starts under the pill */
  transition: top var(--ui-duration) var(--ui-ease);
  pointer-events: none;
}
.nav > * { pointer-events: auto; }
.nav.is-compact { top: 8px; }
.nav__pill {
  max-width: 1040px; margin-inline: auto;
  min-height: var(--nav-h);
  display: flex; align-items: center; gap: var(--spacing-24);
  background: var(--nav-bg);
  border: 1px solid var(--nav-border);
  border-radius: var(--radius-pill);
  padding: 8px 8px 8px 22px;
  transition: background-color var(--ui-duration) var(--ui-ease), border-color var(--ui-duration) var(--ui-ease), padding var(--ui-duration) var(--ui-ease), border-radius var(--ui-duration) var(--ui-ease);
}
.nav.is-compact .nav__pill { padding-block: 5px; min-height: 50px; }
.nav--on-stage .nav__pill { background: transparent; border-color: var(--hair-2); }
.nav--on-stage.is-compact .nav__pill { background: var(--nav-bg); }   /* once scrolling, it needs a ground again */
html:not(.js) .nav--on-stage .nav__pill { background: var(--nav-bg); } /* no JS: build.js stamps the stage pages' nav on-stage + dark; keep a ground so it also reads once scrolled */
.nav__brand { display: inline-flex; align-items: center; margin-right: auto; }
.nav__brand .mark { display: none; }
.nav__links { display: flex; align-items: center; gap: var(--spacing-24); list-style: none; margin: 0; padding: 0; }
.nav__links li { max-width: none; }
.nav__links a {
  font-size: 14px; color: var(--ink); text-decoration: none;
  padding: 6px 2px; border-bottom: 1px solid transparent;
  transition: color var(--ui-duration) var(--ui-ease), border-color var(--ui-duration) var(--ui-ease);
}
.nav__links a:hover { color: var(--ink-2); }
.nav__links a[aria-current="page"] { border-bottom-color: var(--ink); }

/* "Try VEX" — the live-signal link: a small lemon dot with one soft ring that
   expands and fades on a 2 s loop. Lemon here is a MARKER, not text (the brand
   rule holds: the word stays --ink). The ring is a pseudo-element so the dot
   itself never moves and the row never reflows. */
.nav__try { display: inline-flex; align-items: center; gap: 8px; animation: vx-blink 2s ease-in-out infinite; }
@keyframes vx-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.52; } }
.pulse-dot {
  position: relative; flex: none;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-lemon);
}
.pulse-dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid var(--accent-lemon);
  animation: vx-pulse 2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}
@keyframes vx-pulse {
  0%       { transform: scale(1);   opacity: 0.85; }
  70%, 100%{ transform: scale(3.4); opacity: 0; }
}
/* reduced motion: the dot stays, the ring stops (a static marker, no loop) */
@media (prefers-reduced-motion: reduce) {
  .pulse-dot::after { animation: none; display: none; }
  .nav__try { animation: none; opacity: 1; }
}

.nav__cta { display: inline-flex; align-items: center; gap: var(--spacing-8); }
.nav__cta .btn { padding: 10px 18px; font-size: 14px; }
.nav__burger {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-pill);
  border: 1px solid var(--hair); color: var(--ink);
}
.nav__burger svg { width: 18px; height: 18px; }
.nav__burger .ic-close { display: none; }
.nav__menu { display: contents; }
/* the menu's theme row: only ever rendered below the burger breakpoint (§13), where
   site.js moves the one .theme-toggle into it. Above it the row is empty + hidden. */
.nav__theme { display: none; }


/* ============================================================================
   8  FOOTER — on the stage (data-theme="dark" on the element)
   ============================================================================ */

.footer { padding-block: var(--spacing-64) calc(var(--spacing-32) + 48px); border-top: 1px solid var(--hair); }   /* + 48: the base line clears the floating theme pill (.theme-fab, 48 px tall at bottom 20) at the end of the page */
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--spacing-40); }
.footer__brand p { margin-top: var(--spacing-16); font-size: var(--fs-small); line-height: var(--lh-small); color: var(--ink-2); max-width: 36ch; }
.footer__col h2 { font-family: var(--font-mono); font-size: var(--fs-label); font-weight: var(--font-weight-regular); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); margin: 0 0 var(--spacing-16); }   /* an h2 (not h4) so the outline never skips a level; styled as the mono column label */
.footer__col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer__col li { max-width: none; }
.footer__col a { font-size: var(--fs-small); color: var(--ink-2); text-decoration: none; }
.footer__col a:hover { color: var(--ink); text-decoration: underline; }
.footer__base {
  margin-top: var(--spacing-48); padding-top: var(--spacing-24); border-top: 1px solid var(--hair);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--spacing-16);
}
.footer__base .mono { color: var(--muted); }
.footer__promise { font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); }
.footer__promise b { font-weight: var(--font-weight-regular); color: var(--ink-2); }


/* ============================================================================
   9  THEME TOGGLE — Light / Dark / System segmented control (.theme-toggle),
      and the site's one instance: the floating pill (.theme-fab), fixed
      bottom-right on every page (partials/footer.html)
   ============================================================================ */

.theme-toggle {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px; border-radius: var(--radius-pill);
  border: 1px solid var(--hair); background: var(--surface);
}
.theme-toggle button {
  font-family: var(--font-sans); font-size: 13px; font-weight: var(--font-weight-medium); line-height: 1;
  padding: 7px 12px; border-radius: var(--radius-pill);
  color: var(--ink-2); background: transparent;
  transition: background-color var(--ui-duration) var(--ui-ease), color var(--ui-duration) var(--ui-ease);
}
.theme-toggle button:hover { color: var(--ink); }
.theme-toggle button[aria-checked="true"] { background: var(--ink); color: var(--ink-inverse); }
.theme-toggle button svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }
.theme-toggle--icons button { padding: 8px 10px; min-width: 36px; min-height: 32px; }   /* 36×32 target — fills the 40 px pill interior with the toggle's own 3 px padding + hairline */
.theme-toggle--icons button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.theme-toggle--icons button svg { margin: 0 auto; width: 15px; height: 15px; display: block; }
.theme-toggle--icons button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* the floating pill: 40 px targets, hairline, --surface; under the nav (z 60) so an open mobile menu always paints on
   top; site.js sets data-theme="dark" on it while a dark band (hero stage, footer…) is under it, so it takes the dark
   surface there instead of the transparent ground the inline toggles get.
   Desktop only: at ≤900 px site.js strips this class and moves the element into the nav menu's .nav__theme row (§13),
   so there is nothing floating over the page on a phone — no display:none here, the element genuinely leaves. */
.theme-fab {
  position: fixed; z-index: 50;
  right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transition: background-color var(--ui-duration) var(--ui-ease), border-color var(--ui-duration) var(--ui-ease);
}
.theme-fab[data-theme] { background-color: var(--surface); }
.theme-fab button { min-width: 40px; min-height: 40px; padding: 10px 12px; }
.theme-fab button svg { width: 16px; height: 16px; }
html:not(.js) .theme-fab { display: none; }              /* without JS the switch cannot switch — the page follows the OS instead */
@media print { .theme-fab { display: none; } }


/* ============================================================================
   10  FORMS — 16 px, radius 4, hairline-2 border, 2 px focus ring
   ============================================================================ */

.field { display: block; }
.field + .field { margin-top: var(--spacing-16); }
.field > span, .field__label { display: block; font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); margin-bottom: var(--spacing-8); }
.input, .field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 16px; line-height: 1.4;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--hair-2); border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: border-color var(--ui-duration) var(--ui-ease);
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { outline: 2px solid var(--focus); outline-offset: 2px; border-color: var(--hair-2); }
.field textarea { min-height: 140px; resize: vertical; }
.field__hint { display: block; margin-top: var(--spacing-8); font-size: var(--fs-caption); color: var(--muted); }


/* ============================================================================
   11  PAGE HEAD + PROSE — sub-pages (pricing, about, contact, compliance)
   ============================================================================ */

.page-head { padding-block: calc(var(--nav-h) + clamp(64px, 9vw, 120px)) clamp(32px, 4vw, 48px); }
.page-head .eyebrow { margin-bottom: var(--spacing-20); }
.page-head .lede { margin-top: var(--spacing-24); }
.page-head--center { text-align: center; }
.page-head--center .lede { margin-inline: auto; }
.page-head--solo { padding-bottom: var(--section-y-close); }   /* a page that is only a head (thanks): air before the footer */
.page-head + .section { padding-top: var(--section-y-tight); }

.prose > * + * { margin-top: var(--spacing-20); }
.prose h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(26px, 2.6vw, 34px); line-height: 1.15; letter-spacing: -0.01em; margin-top: var(--spacing-48); }
.prose h3 { font-weight: var(--font-weight-medium); font-size: var(--text-heading-sm); line-height: 1.3; letter-spacing: -0.3px; margin-top: var(--spacing-32); }
.prose p, .prose li { color: var(--ink-2); }
.prose strong { color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: var(--spacing-8); }
.prose hr { margin-block: var(--spacing-40); }
.prose blockquote { border-left: 2px solid var(--ink); padding-left: var(--spacing-24); font-family: var(--font-display); font-size: clamp(22px, 2vw, 28px); line-height: 1.25; color: var(--ink); max-width: 30ch; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.prose th { text-align: left; font-family: var(--font-mono); font-size: var(--fs-label); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--muted); font-weight: 400; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--hair-2); }
.prose td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--hair); vertical-align: top; color: var(--ink-2); }
.prose td.num, .prose th.num { text-align: right; font-variant-numeric: tabular-nums; }


/* ============================================================================
   12  REVEAL + MOTION — content is visible without JS (html.js gates it)
   ============================================================================ */

.js .reveal {
  opacity: 0;
  transform: translateY(var(--reveal-rise));
  transition: opacity var(--reveal-duration) var(--reveal-ease), transform var(--reveal-duration) var(--reveal-ease);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}
.js .reveal.in { opacity: 1; transform: none; will-change: auto; }
/* stagger direct children: <div class="reveal-stagger"> <div class="reveal">… */
.reveal-stagger > .reveal:nth-child(2) { --reveal-delay: 90ms; }
.reveal-stagger > .reveal:nth-child(3) { --reveal-delay: 180ms; }
.reveal-stagger > .reveal:nth-child(4) { --reveal-delay: 270ms; }
.reveal-stagger > .reveal:nth-child(5) { --reveal-delay: 360ms; }
.reveal-stagger > .reveal:nth-child(6) { --reveal-delay: 450ms; }
.reveal--slow { --reveal-duration: 1800ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn .arrow { transition: none; }
}


/* ============================================================================
   13  UTILITIES + RESPONSIVE
   ============================================================================ */

.sr-only { position: absolute !important; 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(--gutter); top: -100px; z-index: 100; background: var(--accent-lemon); color: var(--accent-lemon-ink); padding: 10px 16px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 500; text-decoration: none; }
.skip-link:focus { top: 12px; }
.hide { display: none !important; }
.mt-0 { margin-top: 0 !important; }
.mt-16 { margin-top: var(--spacing-16); } .mt-24 { margin-top: var(--spacing-24); } .mt-32 { margin-top: var(--spacing-32); } .mt-48 { margin-top: var(--spacing-48); }
.mb-16 { margin-bottom: var(--spacing-16); } .mb-24 { margin-bottom: var(--spacing-24); } .mb-32 { margin-bottom: var(--spacing-32); }
.max-w-reading { max-width: var(--reading); }
.p-full { max-width: none; }                             /* a <p> that must not take the 66ch reading cap: mono promise lines, captions, centred foot lines */
.balance { text-wrap: balance; }
.nowrap { white-space: nowrap; }

@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  .stat-row > * { border-right: 0; border-bottom: 1px solid var(--hair); padding-left: 0 !important; padding-right: 0; }
  .stat-row > *:last-child { border-bottom: 0; }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: var(--spacing-32); }
}

/* ---- the nav's burger breakpoint --------------------------------------------
   Round 4 put six links in the pill (Product · Trust · About · Pricing ·
   Pricing) plus the lemon CTA. Measured, that row needs ~520 px of
   viewport before it starts squeezing the wordmark, so the burger now appears
   at 900 px — the trimmed nav (Contact and Try VEX were removed 18 Aug) fits
   crowding. THIS NUMBER IS MIRRORED in js/site.js (matchMedia
   '(max-width: 900px)') because the same media query decides where the one
   theme radiogroup lives: floating pill above it, nav menu row below it.
   Change one, change the other. ------------------------------------------- */
@media (max-width: 900px) {
  /* nav → burger + panel */
  .nav__pill { gap: var(--spacing-12); padding-left: 18px; }
  .nav__burger { display: inline-flex; }
  .nav__menu { display: none; }
  .nav__cta .btn { padding: 9px 14px; }
  .nav.is-open .nav__pill { flex-wrap: wrap; border-radius: 28px; }
  .nav.is-open .nav__menu { display: flex; flex-direction: column; align-items: stretch; width: 100%; order: 3; gap: 0; padding: var(--spacing-12) 6px 6px; border-top: 1px solid var(--hair); margin-top: var(--spacing-8); }
  .nav.is-open .nav__links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav.is-open .nav__links a { display: block; padding: 12px 8px; font-size: 16px; border-bottom: 1px solid var(--hair); }
  .nav.is-open .nav__links a.nav__try { display: flex; align-items: center; gap: 10px; }   /* the dot keeps its air in the stacked menu */
  .nav.is-open .nav__links li:last-child a { border-bottom: 0; }
  .nav.is-open .nav__links a[aria-current="page"] { border-bottom-color: var(--hair); color: var(--ink); font-weight: 500; }
  .nav.is-open .nav__burger .ic-menu { display: none; }
  .nav.is-open .nav__burger .ic-close { display: block; }
  .nav.is-open .nav__pill { background: var(--nav-bg); }
  .nav--on-stage.is-open .nav__pill { background: var(--nav-bg); }

  /* theme row — the menu's last row. site.js has moved the one .theme-toggle in
     here (and dropped its .theme-fab class), so the floating pill is gone below
     this width instead of sitting on top of the page. Three 44 px targets, full
     width, hairline off the links above; picking a theme does not close the menu. */
  .nav.is-open .nav__theme:not([hidden]) {
    display: flex; flex-direction: column; align-items: stretch; gap: var(--spacing-8);
    margin-top: var(--spacing-12); padding: var(--spacing-12) 2px 2px;
    border-top: 1px solid var(--hair);
  }
  .nav__theme .theme-toggle { display: flex; width: 100%; max-width: 460px; }   /* full width on every phone; the cap only bites on the wide pill (600–900) where three stretched icon buttons read as empty */
  .nav__theme .theme-toggle button { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 12px 0; }
  .nav__theme .theme-toggle button svg { width: 17px; height: 17px; }
}

@media (max-width: 600px) {
  :root { --gutter: 20px; }
  .grid--4 { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__base { flex-direction: column; align-items: flex-start; }
  .nav__cta .btn { padding: 9px 12px; font-size: 13px; }
  .nav__brand .wordmark { display: none; }               /* collapsed pill: the mark alone */
  .nav__brand .mark { display: inline-flex; }
  .card { padding: var(--spacing-24); }
  .display br, .h2 br { display: none; }
}


/* ============================================================================
   14  MODAL DIALOG — the "Book a walkthrough" popup (partials/footer.html)
   ----------------------------------------------------------------------------
   A native <dialog> opened with showModal(), so the browser gives us the top
   layer, ::backdrop and inert-behind for free. js/site.js falls back to
   .modal--fallback (plain [open] + a ::before scrim) where showModal is
   missing. No shadow anywhere: the scrim and the hairline do the separating.
   The page behind is locked with html.modal-open; --sbw is the scrollbar width
   js/site.js measured, so removing the scrollbar cannot shift the layout.
   ============================================================================ */

.modal {
  position: fixed; inset: 0; z-index: 200;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: var(--gutter);
  border: 0; background: transparent; color: var(--ink);
  overflow: auto;
  overscroll-behavior: contain;
}
.modal:not([open]) { display: none; }
.modal[open] { display: flex; align-items: center; justify-content: center; }
.modal::backdrop { background: var(--scrim-color); }
/* fallback path (no showModal): the dialog is not in the top layer, so
   ::backdrop never paints — this ::before is the scrim instead. */
.modal--fallback::before { content: ""; position: fixed; inset: 0; background: var(--scrim-color); }

.modal__card {
  position: relative; z-index: 1;
  width: min(520px, 100%);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border: 1px solid var(--hair);
  border-radius: var(--radius-xl);
  padding: clamp(28px, 3vw, 40px);
}
.modal__close {
  position: absolute; top: 14px; right: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-pill);
  border: 1px solid transparent; background: none; color: var(--ink-2);
  cursor: pointer;
  transition: background-color var(--ui-duration) var(--ui-ease), color var(--ui-duration) var(--ui-ease), border-color var(--ui-duration) var(--ui-ease);
}
.modal__close:hover { background: var(--surface-2); border-color: var(--hair); color: var(--ink); }
.modal__close svg { width: 18px; height: 18px; }

.modal__title {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(26px, 2.6vw, 34px); line-height: 1.12; letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0; padding-right: 44px;                       /* clears the ✕ */
}
.modal__lede { margin-top: var(--spacing-8); color: var(--ink-2); font-size: var(--fs-small); line-height: var(--lh-small); max-width: none; }
.modal__card form { margin-top: var(--spacing-24); }
.modal__card form .btn { width: 100%; margin-top: var(--spacing-24); }
.modal__card .caption { margin-top: var(--spacing-12); text-align: center; max-width: none; }
.modal__card.is-done > .modal__lede { display: none; }   /* the intro line goes once the form has been sent */
.modal__card .form-error { max-width: none; }

/* entrance — a quiet fade + 8 px rise; the animation replays every open because
   the card is re-displayed each time. */
.modal[open] .modal__card { animation: vx-modal-in 220ms var(--ui-ease) both; }
@keyframes vx-modal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* page lock — the scrollbar's width is given back as padding so nothing shifts;
   the one position:fixed element on the site (.theme-fab) is compensated too,
   because a fixed box is laid out against the viewport, not the padded root. */
html.modal-open { overflow: hidden; padding-right: var(--sbw, 0px); }
html.modal-open .theme-fab { margin-right: var(--sbw, 0px); }

/* phone: a sheet docked to the bottom, sized to its content — never a full-height
   card with dead space under the button, and the thumb is already down there. */
@media (max-width: 600px) {
  .modal { padding: 0; }
  .modal[open] { align-items: flex-end; }
  .modal__card {
    width: 100%; max-height: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: 0;
    padding: 56px var(--gutter) var(--spacing-32);
  }
  .modal__close { top: 10px; right: 10px; }
  .modal[open] .modal__card { animation-name: vx-sheet-in; }
}
@keyframes vx-sheet-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .modal[open] .modal__card { animation: none; }
}
