/* ==========================================================================
   Consolo — design system
   --------------------------------------------------------------------------
   1. Fonts
   2. Tokens
   3. Reset & base
   4. Utilities
   5. Layout: bands, wrappers, section headings
   6. Components
   7. Motion
   8. Responsive
   9. Preference & environment overrides

   Contrast rule for this file: every text/surface pair below is measured to
   meet WCAG 2.2 AA (4.5:1 body, 3:1 large text and UI borders). On-dark
   surfaces are declared by re-binding the semantic tokens inside `.on-dark`,
   so a component can never inherit the wrong pairing.
   ========================================================================== */

/* -------------------------------------------------- 1. Fonts ------------- */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* -------------------------------------------------- 2. Tokens ------------ */

:root {
  /* --- raw palette ------------------------------------------------------ */
  --ink-900: #05161d;
  --ink-800: #0b1e26;
  --ink-700: #122e38;
  --ink-600: #1b3f4b;
  --ink-500: #2a5461;

  --paper-000: #ffffff;
  --paper-100: #f6f8f7;
  --paper-200: #eef2f1;
  --paper-300: #e2e8e7;

  --amber-300: #f5c684;
  --amber-400: #f2b661;
  --amber-500: #e9a23b;
  --amber-600: #d98b1f;
  --amber-800: #8a5a12;   /* 5.54:1 on --paper-100 — safe for small text */

  --teal-400: #7cc0b8;
  --teal-500: #5fa8a0;
  --teal-700: #33716b;

  --mint-400: #7ae8b0;
  --danger-600: #b3261e;

  /* --- semantic: light surfaces (default) ------------------------------- */
  --surface: var(--paper-100);
  --surface-raised: var(--paper-000);
  --surface-sunken: var(--paper-200);

  --text: var(--ink-800);          /* 16.0:1 on --paper-100 */
  --text-muted: #4a5c63;           /*  6.6:1 */
  --text-subtle: #55666d;          /*  5.6:1 */
  --text-accent: var(--amber-800);
  --text-inverse: var(--paper-000);

  --border: rgba(11, 30, 38, 0.10);
  --border-strong: rgba(11, 30, 38, 0.18);
  --focus-ring: var(--ink-800);

  /* --- space ------------------------------------------------------------ */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  --section-y: clamp(4rem, 8vw, 6.5rem);
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --wrap: 1200px;
  --wrap-wide: 1320px;
  --wrap-prose: 70ch;

  /* --- type ------------------------------------------------------------- */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;

  --fs-display: clamp(2.5rem, 5.4vw, 4.25rem);
  --fs-h1: clamp(2.1rem, 4vw, 3rem);
  --fs-h2: clamp(1.9rem, 3.4vw, 2.85rem);
  --fs-h3: 1.15rem;
  --fs-h4: 1rem;
  --fs-lead: clamp(1.05rem, 1.3vw, 1.2rem);
  --fs-body: 1rem;
  --fs-sm: 0.9rem;
  --fs-xs: 0.8rem;
  --fs-2xs: 0.72rem;

  --lh-tight: 1.05;
  --lh-snug: 1.25;
  --lh-normal: 1.6;
  --lh-relaxed: 1.75;

  --tracking-display: -0.035em;
  --tracking-heading: -0.02em;
  --tracking-eyebrow: 0.14em;

  /* --- shape, depth, motion --------------------------------------------- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(5, 22, 29, 0.06), 0 2px 8px rgba(5, 22, 29, 0.04);
  --shadow-md: 0 4px 12px rgba(5, 22, 29, 0.08), 0 12px 32px rgba(5, 22, 29, 0.06);
  --shadow-lg: 0 12px 32px rgba(5, 22, 29, 0.12), 0 32px 64px rgba(5, 22, 29, 0.10);

  --dur-fast: 140ms;
  --dur: 240ms;
  --dur-slow: 520ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --header-h: 4.5rem;
}

/* On-dark scope. Any component placed inside inherits the correct pairing. */
.on-dark {
  --surface: var(--ink-800);
  --surface-raised: rgba(255, 255, 255, 0.07);   /* = #1c2e35 over --ink-800 */
  --surface-sunken: rgba(255, 255, 255, 0.03);

  --text: var(--paper-000);        /* 14.1:1 on the raised surface */
  --text-muted: #cfdadd;           /*  9.9:1 */
  --text-subtle: #b9c6ca;          /*  8.0:1 */
  --text-accent: var(--amber-500); /*  7.9:1 on --ink-800 */
  --text-inverse: var(--ink-800);

  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.24);
  --focus-ring: var(--amber-400);

  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.20), 0 16px 40px rgba(0, 0, 0, 0.18);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.28), 0 40px 80px rgba(0, 0, 0, 0.22);

  color: var(--text);
}

/* -------------------------------------------------- 3. Reset & base ------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  font-feature-settings: 'cv11' 1, 'ss01' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 800;
  letter-spacing: var(--tracking-heading);
  line-height: var(--lh-snug);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); letter-spacing: var(--tracking-display); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); letter-spacing: var(--tracking-display); line-height: 1.1; }
h3 { font-size: var(--fs-h3); font-weight: 700; }
h4 { font-size: var(--fs-h4); font-weight: 700; }

p { margin: 0 0 var(--space-sm); }
p:last-child { margin-bottom: 0; }

a {
  color: inherit;
  text-decoration: none;
}

a:not(.btn):not(.brand):not(.nav__link):not(.logo-rail__item) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: text-decoration-color var(--dur-fast) var(--ease);
}

a:not(.btn):hover {
  text-decoration-color: currentColor;
}

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

ul, ol {
  margin: 0 0 var(--space-sm);
  padding-left: 1.15rem;
}

li { margin-bottom: var(--space-3xs); }

strong { font-weight: 700; }

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

/* Anchor targets must clear the sticky header. */
:target,
[id] {
  scroll-margin-top: calc(var(--header-h) + var(--space-md));
}

/* -------------------------------------------------- 4. Utilities --------- */

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

.skip-link {
  position: absolute;
  left: var(--space-sm);
  top: var(--space-sm);
  z-index: 100;
  transform: translateY(-200%);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-md);
  background: var(--paper-000);
  color: var(--ink-800);
  font-weight: 700;
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-md);
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.eyebrow {
  margin: 0 0 var(--space-xs);
  color: var(--text-accent);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.text-muted { color: var(--text-muted); }

.lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-relaxed);
  color: var(--text-muted);
  max-width: 62ch;
}

.note {
  font-size: var(--fs-sm);
  color: var(--text-subtle);
}

/* -------------------------------------------------- 5. Layout ------------ */

/*
  A band is the full-bleed background carrier; its inner element carries the
  width constraint. Keeping these two jobs on separate elements is what stops
  dark sections rendering as inset boxes with pale gutters.
*/
.band {
  width: 100%;
  padding-block: var(--section-y);
}

.band__inner {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.band__inner--wide { max-width: var(--wrap-wide); }
.band__inner--prose { max-width: var(--wrap-prose); }

.band--paper { background: var(--paper-100); }
.band--paper-raised { background: var(--paper-000); }

.band--ink {
  background: var(--ink-800);
}

.band--ink-deep {
  background:
    radial-gradient(120% 90% at 15% 0%, rgba(233, 162, 59, 0.09), transparent 60%),
    linear-gradient(180deg, var(--ink-900) 0%, var(--ink-800) 55%, var(--ink-700) 100%);
}

.section-head {
  max-width: 62ch;
  margin-bottom: var(--space-xl);
}

.section-head--center {
  max-width: 68ch;
  margin-inline: auto;
  text-align: center;
}

.section-head p {
  margin-top: var(--space-sm);
  color: var(--text-muted);
  font-size: var(--fs-lead);
  line-height: var(--lh-relaxed);
}

.grid {
  display: grid;
  gap: var(--space-md);
}

.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* -------------------------------------------------- 6. Components -------- */

/* --- 6.1 Header & navigation -------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--ink-900) 88%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.site-header[data-scrolled='true'] {
  background: color-mix(in srgb, var(--ink-900) 96%, transparent);
  border-bottom-color: rgba(255, 255, 255, 0.14);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: var(--header-h);
  max-width: var(--wrap-wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  color: var(--paper-000);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

/* Inline SVG: the C-ring is stroked with currentColor, so it inherits the brand text colour. */
.brand__logo {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  color: inherit;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.6vw, 1.6rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav__list li { margin: 0; }

.nav__link {
  display: inline-block;
  padding: 0.5rem 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease);
}

.nav__link:hover,
.nav__link[aria-current='page'] {
  color: var(--paper-000);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  flex-shrink: 0;
}

/* Disclosure-based mobile menu: works with no JavaScript, JS only enhances it. */
.nav__disclosure { display: none; }

.nav__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  color: var(--paper-000);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.nav__toggle::-webkit-details-marker { display: none; }

.nav__toggle-bars {
  position: relative;
  width: 1rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.nav__toggle-bars::before,
.nav__toggle-bars::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.nav__toggle-bars::before { top: -5px; }
.nav__toggle-bars::after { top: 5px; }

.nav__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  padding: var(--space-md) var(--gutter) var(--space-lg);
  background: var(--ink-900);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-lg);
}

.nav__panel .nav__list {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.nav__panel .nav__link {
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 1rem;
}

.nav__panel .btn {
  width: 100%;
  margin-top: var(--space-md);
}

/* --- 6.2 Buttons -------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease),
    background-color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/*
  Ink-on-amber, not white-on-amber: white text on the brand amber measures
  2.2:1 and fails AA. Ink on amber measures 7.9:1.
*/
.btn--primary {
  background: var(--amber-500);
  color: var(--ink-800);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 6px 18px rgba(233, 162, 59, 0.28);
}

.btn--primary:hover {
  background: var(--amber-400);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.4) inset,
    0 10px 26px rgba(233, 162, 59, 0.34);
}

.btn--secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn--secondary:hover {
  border-color: currentColor;
  background: color-mix(in srgb, currentColor 8%, transparent);
}

.btn--small {
  padding: 0.6rem 1rem;
  font-size: var(--fs-xs);
}

.btn--block { width: 100%; }

/* --- 6.3 Hero ----------------------------------------------------------- */

/*
  Photograph, then a left-weighted ink gradient over it. The copy sits on the near-opaque
  left third (contrast identical to a solid ink band) while the photo stays legible on the
  right. Self-hosted so no third party sees a visitor, and so the CSP can stay 'self'.
*/
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(3rem, 6vw, 5rem);
  background-color: var(--ink-900);
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url('../images/hero-team-1000.jpg');
  background-position: 70% 32%;
  background-size: cover;
  background-repeat: no-repeat;
  /* Pull the photo towards the brand: cooler, deeper, less stock-bright. */
  filter: saturate(0.74) contrast(1.05) brightness(0.92);
}

@media (min-width: 900px) {
  .hero::after { background-image: url('../images/hero-team-1920.jpg'); }
}

.hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(70% 60% at 6% 10%, rgba(233, 162, 59, 0.20), transparent 62%),
    linear-gradient(100deg,
      var(--ink-900) 0%,
      color-mix(in srgb, var(--ink-900) 96%, transparent) 34%,
      color-mix(in srgb, var(--ink-800) 82%, transparent) 56%,
      color-mix(in srgb, var(--ink-800) 52%, transparent) 78%,
      color-mix(in srgb, var(--ink-700) 42%, transparent) 100%),
    linear-gradient(to bottom, transparent 55%, color-mix(in srgb, var(--ink-900) 70%, transparent) 100%);
}

/* Below the two-column threshold the copy spans the full width, so the scrim must too. */
@media (max-width: 900px) {
  .hero__scrim {
    background:
      radial-gradient(80% 60% at 8% 8%, rgba(233, 162, 59, 0.18), transparent 62%),
      linear-gradient(175deg,
        color-mix(in srgb, var(--ink-900) 94%, transparent) 0%,
        color-mix(in srgb, var(--ink-900) 90%, transparent) 60%,
        color-mix(in srgb, var(--ink-800) 88%, transparent) 100%);
  }
}

/* Faint engineering grid — reads as "system", costs nothing to serve. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(120% 100% at 20% 0%, #000 20%, transparent 78%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.hero h1 {
  font-size: var(--fs-display);
  max-width: 22ch;
  margin-bottom: var(--space-md);
}

.hero__lead {
  max-width: 58ch;
  font-size: var(--fs-lead);
  line-height: var(--lh-relaxed);
  color: var(--text-muted);
}

.hero__icp {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: var(--space-md);
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.hero__icp::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--teal-400);
  box-shadow: 0 0 0 4px rgba(124, 192, 184, 0.16);
  flex-shrink: 0;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-lg);
}

.hero__proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, max-content));
  gap: var(--space-lg) var(--space-xl);
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.hero__proof div { min-width: 0; }

.hero__proof dt {
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}

.hero__proof dd {
  margin: 0 0 0.15rem;
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-weight: 800;
  letter-spacing: var(--tracking-heading);
  color: var(--amber-400);
}

/* --- 6.4 Logo rail ------------------------------------------------------ */

/*
  Sits directly under the hero and continues its dark ground. The background is set
  explicitly rather than via --surface-sunken, which on an .on-dark element resolves to a
  translucent white and would put light text on a near-white strip.
*/
.logo-rail {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--ink-700);
  padding-block: var(--space-md);
  overflow: hidden;
}

.logo-rail__label {
  max-width: var(--wrap);
  margin: 0 auto var(--space-sm);
  padding-inline: var(--gutter);
  color: var(--text-subtle);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.logo-rail__viewport {
  position: relative;
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent);
}

.logo-rail__track {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  width: max-content;
  animation: logo-scroll 46s linear infinite;
}

.logo-rail:hover .logo-rail__track,
.logo-rail:focus-within .logo-rail__track {
  animation-play-state: paused;
}

.logo-rail__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
}

.logo-rail__item img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.92;
}

@keyframes logo-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* --- 6.5 Cards ---------------------------------------------------------- */

.card {
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.card > h3 {
  margin-bottom: var(--space-2xs);
  color: var(--text);
}

.card > p {
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
}

.card--interactive:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

/*
  A feature card that follows a card grid needs clear separation from it — at the grid's own
  gap it reads as another row of the grid rather than a distinct callout.
*/
.section-feature { margin-top: var(--space-xl); }

/* A trailing link or button after a card grid needs breathing room, not a paragraph gap. */
.section-cta {
  margin: var(--space-xl) 0 0;
}

.card--feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: var(--space-lg);
  align-items: center;
  padding: var(--space-lg);
  border-color: color-mix(in srgb, var(--amber-500) 34%, transparent);
  background:
    linear-gradient(135deg, rgba(233, 162, 59, 0.12), rgba(95, 168, 160, 0.08)),
    var(--surface-raised);
}

/* The heading inside a feature card is nested in a div, so `.card > h3` does not reach it. */
.card--feature h3 { margin-bottom: var(--space-2xs); }

.card--feature p {
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
}

.card__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: var(--space-2xs);
  padding: 0.3rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--amber-500) 40%, transparent);
  border-radius: var(--radius-pill);
  color: var(--text-accent);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card__list {
  display: grid;
  gap: var(--space-2xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card__list li {
  display: grid;
  grid-template-columns: 1.1rem 1fr;
  gap: 0.6rem;
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.card__list li::before {
  content: '';
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.18rem;
  border-radius: 50%;
  background:
    linear-gradient(135deg, var(--amber-500), var(--teal-500));
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.2 11.3 3.5 8.6l1-1 1.7 1.7 5.3-5.3 1 1z' fill='%23000'/%3E%3C/svg%3E");
  mask-size: contain;
}

/* --- 6.6 Stat tiles ----------------------------------------------------- */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.stat {
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.stat__value {
  display: block;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: var(--tracking-heading);
  color: var(--text);
}

.stat__label {
  display: block;
  margin-top: var(--space-3xs);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.stat__source {
  display: block;
  margin-top: var(--space-2xs);
  font-size: var(--fs-2xs);
  color: var(--text-subtle);
}

.stat__source a { color: inherit; }

/* --- 6.6b The gap: question, argument, pull quote ----------------------- */

.question {
  max-width: 30ch;
  margin: 0 0 var(--space-xl);
  padding-left: var(--space-md);
  border-left: 3px solid var(--amber-500);
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: var(--tracking-heading);
  color: var(--text);
  text-wrap: balance;
}

/* The gap diagram: loop → diagnosis → fix, read top to bottom. */

.gap-flow {
  display: grid;
  gap: var(--space-md);
}

.gap-stage {
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface-sunken);
}

.gap-stage--fix {
  border-color: color-mix(in srgb, var(--amber-500) 30%, transparent);
  background:
    radial-gradient(90% 130% at 0% 0%, rgba(233, 162, 59, 0.14), transparent 62%),
    var(--ink-800);
}

.gap-stage__label {
  margin-bottom: var(--space-sm);
  color: var(--text-subtle);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.gap-stage--fix .gap-stage__label { color: var(--amber-400); }

.gap-stage__why {
  margin: 0;
  padding: var(--space-sm) var(--space-md);
  border-left: 3px solid var(--amber-500);
  color: var(--text-muted);
  font-size: var(--fs-lead);
  line-height: var(--lh-relaxed);
}

.gap-stage__why strong { color: var(--text); }

/* --- the flow itself --------------------------------------------------- */

.flow {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: flow;
}

.flow__step {
  position: relative;
  margin: 0;
  padding: var(--space-sm) var(--space-lg) var(--space-sm) var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.45;
  counter-increment: flow;
}

/* display:flex (not inline-flex) so the badge occupies its own line above the label. */
.flow__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-bottom: var(--space-2xs);
  border-radius: 50%;
  background: color-mix(in srgb, var(--amber-500) 22%, transparent);
  color: var(--text-accent);
  font-size: var(--fs-2xs);
  font-weight: 800;
}

.flow__num::before { content: counter(flow); }

/* Connector between steps. Decorative, so it never reaches assistive tech. */
.flow__step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  right: calc(var(--space-sm) / -2 - 4px);
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--border-strong);
  border-right: 2px solid var(--border-strong);
  transform: translateY(-50%) rotate(45deg);
}

.flow--loop .flow__step {
  border-style: dashed;
  background: var(--surface);
}

.flow--fix .flow__step {
  border-color: var(--border-strong);
  background: var(--surface-raised);
}

/*
  Return arc under the loop. The ends must land on the centre of the first and last step,
  so the inset is derived from the grid rather than eyeballed: with n equal columns and
  n-1 gaps, the centre of the outer columns sits (100% - (n-1)·gap) / 2n from each edge.
*/
.flow--loop {
  --flow-count: 4;
  --flow-gap: var(--space-sm);
  --flow-edge: calc((100% - (var(--flow-count) - 1) * var(--flow-gap)) / (2 * var(--flow-count)));
  position: relative;
  margin-bottom: 2.9rem;
}

.flow--loop::after {
  content: '';
  position: absolute;
  left: var(--flow-edge);
  right: var(--flow-edge);
  bottom: -1.75rem;
  height: 1.5rem;
  border: 2px dashed var(--border-strong);
  border-top: 0;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Arrowhead on the left end of the arc, pointing back up into step 1. */
.flow--loop::before {
  content: '';
  position: absolute;
  left: var(--flow-edge);
  bottom: -0.5rem;
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--border-strong);
  border-left: 2px solid var(--border-strong);
  transform: translateX(-5.5px) rotate(45deg);
}

.flow__loop-note {
  position: relative;
  z-index: 1;
  width: max-content;
  max-width: 100%;
  margin: -2.35rem auto 0;
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  color: var(--text-subtle);
  font-size: var(--fs-2xs);
  font-style: italic;
}

/* --- payoff visual: one layer spanning every system -------------------- */

.span-visual {
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}

.span-visual__systems {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--space-3xs);
  margin-bottom: 0.45rem;
}

.span-visual__systems span {
  padding: 0.5rem 0.3rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--fs-2xs);
  font-weight: 700;
  text-align: center;
}

.span-visual__bar {
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(100deg, var(--amber-500), var(--amber-400) 60%, var(--teal-400));
  color: var(--ink-800);
  font-size: var(--fs-2xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

/* --- compact cited-evidence row ---------------------------------------- */

.evidence-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
  align-items: start;
  margin: var(--space-lg) 0 0;
  padding: var(--space-md) 0 0;
  border-top: 1px solid var(--border);
  list-style: none;
}

.evidence-row li { margin: 0; }

.evidence-row__intro {
  color: var(--text-subtle);
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
}

.evidence-row strong {
  display: block;
  font-size: clamp(1.45rem, 2.2vw, 1.8rem);
  font-weight: 800;
  letter-spacing: var(--tracking-heading);
  color: var(--text-accent);
}

.evidence-row span {
  display: block;
  margin-top: 0.1rem;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.evidence-row a {
  display: block;
  margin-top: 0.3rem;
  color: var(--text-subtle);
  font-size: var(--fs-2xs);
}

/* Dark focal card inside a light band. Background is set explicitly — inside .on-dark the
   surface tokens are translucent white, which over a pale band reads as almost-white. */
.pull-quote {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: var(--space-md);
  align-items: center;
  margin: var(--space-xl) 0 0;
  padding: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(80% 120% at 0% 0%, rgba(233, 162, 59, 0.14), transparent 60%),
    var(--ink-800);
  box-shadow: var(--shadow-md);
}

.pull-quote__portrait {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-strong);
}

.pull-quote blockquote {
  margin: 0;
}

.pull-quote blockquote p {
  margin: 0;
  font-size: var(--fs-lead);
  line-height: var(--lh-relaxed);
  color: var(--text);
  text-wrap: pretty;
}

.pull-quote blockquote strong { color: var(--amber-400); }

.pull-quote figcaption {
  margin-top: var(--space-sm);
  padding-top: var(--space-2xs);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.pull-quote figcaption span {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-subtle);
  font-size: var(--fs-2xs);
  font-weight: 400;
}

/* --- 6.7 Ecosystem map -------------------------------------------------- */

.system-map {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr);
  gap: var(--space-md);
  align-items: start;
  margin-top: var(--space-xl);
}

.system-map__column {
  display: grid;
  gap: var(--space-2xs);
}

.source-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
}

.source-card__name {
  margin: 0;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
}

.source-card__tools {
  margin: 0.2rem 0 0;
  font-size: var(--fs-2xs);
  line-height: 1.45;
  color: var(--text-subtle);
}

.source-card__logos {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.tool-logo {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0.22rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.94);
  object-fit: contain;
}

.tool-logo--more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: var(--border);
  background: var(--surface-sunken);
  color: var(--text-muted);
  font-size: var(--fs-2xs);
  font-weight: 700;
}

/* --- 6.8 Console preview ------------------------------------------------ */

.console {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.console__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.console__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
}

.console__brand .brand__logo { width: 1.25rem; height: 1.25rem; }

.console__live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: var(--fs-2xs);
  white-space: nowrap;
}

.console__live::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--mint-400);
  box-shadow: 0 0 0 3px rgba(122, 232, 176, 0.18);
}

.console__tabs {
  display: flex;
  gap: 0.25rem;
  padding: var(--space-2xs) var(--space-sm);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.console__tabs::-webkit-scrollbar { display: none; }

.console__tab {
  padding: 0.5rem 0.85rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.console__tab:hover { color: var(--text); background: var(--surface-sunken); }

.console__tab[aria-selected='true'] {
  background: var(--paper-000);
  color: var(--ink-800);
}

.console__panel { padding: var(--space-sm); }
.console__panel[hidden] { display: none; }

.console__kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2xs);
}

.console__kpi {
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}

.console__kpi dt {
  font-size: var(--fs-2xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.console__kpi dd {
  margin: 0.35rem 0 0;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: var(--tracking-heading);
  color: var(--text);
}

.console__kpi dd small {
  display: block;
  margin-top: 0.2rem;
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-muted);
}

.console__record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.console__record h4 { font-size: var(--fs-sm); color: var(--text); }

.console__flag {
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(122, 232, 176, 0.28);
  border-radius: var(--radius-pill);
  background: rgba(122, 232, 176, 0.08);
  color: #8ee8b7;
  font-size: var(--fs-2xs);
  font-weight: 600;
  white-space: nowrap;
}

.console__feed {
  display: grid;
  gap: 0.4rem;
  margin: var(--space-2xs) 0 0;
  padding: 0;
  list-style: none;
}

.console__feed li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.chip {
  padding: 0.25rem 0.45rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.chip--finance { background: rgba(145, 153, 255, 0.16); }
.chip--service { background: rgba(255, 188, 96, 0.16); }
.chip--ops { background: rgba(143, 224, 196, 0.16); }
.chip--files { background: rgba(255, 153, 153, 0.16); }

.console__feed time {
  color: var(--text-subtle);
  font-size: var(--fs-2xs);
  white-space: nowrap;
}

.console__ai {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}

.console__ai p {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.5;
  color: var(--text-muted);
}

.console__caption {
  margin-top: var(--space-2xs);
  font-size: var(--fs-2xs);
  color: var(--text-subtle);
  text-align: center;
}

/* --- 6.9 Timeline ------------------------------------------------------- */

/* auto-fit so the step count can change (it went from four to five) without a breakpoint edit. */
.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
  counter-reset: step;
}

/* Column layout so the duration is pushed to the bottom and all five align on one row,
   whatever length each step's description happens to be. */
.timeline__item {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-top: var(--space-md);
  border-top: 2px solid var(--border);
}

.timeline__item::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  width: 2.5rem;
  height: 2px;
  background: var(--amber-500);
}

.timeline__step {
  display: block;
  color: var(--text-accent);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.timeline__item h3 { margin: var(--space-2xs) 0; }

.timeline__item p {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
}

.timeline__duration {
  margin-top: auto;
  padding-top: var(--space-sm);
  font-size: var(--fs-2xs);
  color: var(--text-subtle);
}

/* --- 6.10 Integrations -------------------------------------------------- */

.integrations {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.integration-group {
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.integration-group__label {
  margin-bottom: var(--space-sm);
  color: var(--text-subtle);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.integration-group__items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin: 0;
  padding: 0;
  list-style: none;
}

.integration-group__items li { margin: 0; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}

.pill img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
}

.pill__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber-500), var(--teal-500));
  flex-shrink: 0;
}

/* --- 6.11 Case study ---------------------------------------------------- */

.case {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-lg);
  margin-top: var(--space-lg);
}

.case__body {
  padding: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface-raised);
}

.case__meta {
  display: grid;
  gap: var(--space-sm);
  margin: 0;
}

.case__meta dt {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-accent);
}

.case__meta dd {
  margin: 0.3rem 0 0;
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
}

.case__outcomes {
  display: grid;
  gap: var(--space-2xs);
  align-content: start;
}

.case__outcome {
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
}

.case__outcome strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: var(--tracking-heading);
  color: var(--amber-400);
}

.case__outcome span {
  display: block;
  margin-top: 0.15rem;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

blockquote.quote {
  margin: var(--space-md) 0 0;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  font-size: var(--fs-lead);
  line-height: var(--lh-relaxed);
  color: var(--text);
}

blockquote.quote footer {
  margin-top: var(--space-2xs);
  font-size: var(--fs-sm);
  color: var(--text-subtle);
}

/* --- 6.12b Price calculator --------------------------------------------- */

.calc {
  margin-top: var(--space-xl);
  padding: var(--space-lg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(233, 162, 59, 0.10), transparent 60%),
    var(--surface-raised);
}

.calc__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: var(--space-xl);
  align-items: start;
}

.calc__controls {
  display: grid;
  gap: var(--space-lg);
}

.calc__field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem var(--space-sm);
  align-items: baseline;
}

.calc__field > label {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
}

.calc__value {
  justify-self: end;
  min-width: 3.5rem;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--amber-500) 18%, transparent);
  color: var(--text-accent);
  font-size: var(--fs-sm);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.calc__field input[type='range'] { grid-column: 1 / -1; }

.calc__hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: var(--fs-2xs);
  color: var(--text-subtle);
}

/* Range input, styled explicitly so it looks the same in every engine. */
.calc input[type='range'] {
  --calc-fill: 50%;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.calc input[type='range']::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(to right, var(--amber-500) var(--calc-fill), var(--surface-sunken) var(--calc-fill));
  border: 1px solid var(--border);
}

.calc input[type='range']::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
}

.calc input[type='range']::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--amber-500);
}

.calc input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: calc((1.2rem - 8px) / -2);
  border: 2px solid var(--paper-000);
  border-radius: 50%;
  background: var(--ink-800);
  box-shadow: 0 1px 4px rgba(5, 22, 29, 0.35);
}

.calc input[type='range']::-moz-range-thumb {
  width: 1.2rem;
  height: 1.2rem;
  border: 2px solid var(--paper-000);
  border-radius: 50%;
  background: var(--ink-800);
  box-shadow: 0 1px 4px rgba(5, 22, 29, 0.35);
}

.calc input[type='range']:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

/* --- output ------------------------------------------------------------- */

.calc__result {
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-sunken);
}

.calc__figure-label {
  display: block;
  color: var(--text-subtle);
  font-size: var(--fs-2xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.calc__figure strong {
  display: block;
  margin: 0.25rem 0;
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 800;
  letter-spacing: var(--tracking-heading);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.calc__custom {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  color: var(--text-muted);
}

.calc__custom strong { display: block; color: var(--text); }

.calc__disclaimer {
  margin: var(--space-sm) 0 var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
  font-size: var(--fs-2xs);
  color: var(--text-subtle);
  line-height: 1.5;
}

/* Without JS there is nothing to compute, so swap the figures for a plain message. */
.calc__nojs {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
}

.calc--ready .calc__nojs { display: none; }
.calc:not(.calc--ready) .calc__figure,
.calc:not(.calc--ready) .calc__custom { display: none; }

/* --- 6.13 Founder card -------------------------------------------------- */

/*
  One solid dark card on a light band. The portrait bleeds to the card edge rather than
  sitting in its own framed box, which is what made the previous version feel loose.
  Background set explicitly: inside .on-dark the surface tokens are translucent white.
*/
.founder {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  margin-top: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(70% 120% at 100% 0%, rgba(233, 162, 59, 0.12), transparent 62%),
    var(--ink-800);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.founder__media {
  position: relative;
  margin: 0;
  min-height: 100%;
  background: var(--ink-700);
}

.founder__media img {
  width: 100%;
  height: 100%;
  min-height: 22rem;
  object-fit: cover;
  object-position: center 22%;
}

/* Blends the photo edge into the card instead of ending on a hard seam. */
.founder__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 55%, color-mix(in srgb, var(--ink-800) 85%, transparent) 100%);
}

.founder__body {
  padding: var(--space-lg);
}

.founder__role {
  margin: 0 0 var(--space-3xs);
  color: var(--amber-400);
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.founder__name {
  margin: 0 0 var(--space-sm);
  font-size: clamp(1.6rem, 2.6vw, 2.1rem);
  font-weight: 800;
  letter-spacing: var(--tracking-display);
  color: var(--text);
}

.founder__lead {
  margin-bottom: var(--space-sm);
  padding-left: var(--space-sm);
  border-left: 3px solid var(--amber-500);
  font-size: var(--fs-lead);
  line-height: var(--lh-relaxed);
  color: var(--text);
  max-width: 54ch;
}

.founder__body > p {
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
  max-width: 60ch;
}

.founder__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
  margin: var(--space-md) 0;
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.founder__facts dt {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text);
}

.founder__facts dd {
  margin: 0.1rem 0 0;
  font-size: var(--fs-xs);
  color: var(--text-subtle);
}

.founder__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
}

/* --- 6.14 FAQ ----------------------------------------------------------- */

.faq {
  margin-top: var(--space-lg);
  border-top: 1px solid var(--border);
}

.faq details {
  border-bottom: 1px solid var(--border);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: '';
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: currentColor;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 7h2v10h-2z M7 11h10v2H7z' fill='%23000'/%3E%3C/svg%3E");
  mask-size: 1.5rem;
  mask-position: center;
  mask-repeat: no-repeat;
  transition: transform var(--dur) var(--ease);
}

.faq details[open] summary::after {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 11h10v2H7z' fill='%23000'/%3E%3C/svg%3E");
}

.faq__answer {
  padding-bottom: var(--space-md);
  max-width: 68ch;
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
}

/* --- 6.15 Forms --------------------------------------------------------- */

.form {
  display: grid;
  gap: var(--space-md);
  max-width: 44rem;
  margin-top: var(--space-lg);
}

.form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field > label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}

.field__hint {
  font-size: var(--fs-2xs);
  color: var(--text-subtle);
}

input[type='text'],
input[type='email'],
select,
textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

textarea { resize: vertical; min-height: 6rem; }

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--amber-600);
  box-shadow: 0 0 0 3px rgba(233, 162, 59, 0.20);
}

input[aria-invalid='true'],
select[aria-invalid='true'],
textarea[aria-invalid='true'] {
  border-color: var(--danger-600);
}

.field-error {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--danger-600);
}

.form__status {
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
}

.form__status--error {
  border: 1px solid color-mix(in srgb, var(--danger-600) 40%, transparent);
  background: color-mix(in srgb, var(--danger-600) 8%, transparent);
  color: var(--danger-600);
}

/* --- 6.16 Callout & CTA ------------------------------------------------- */

.callout {
  display: grid;
  gap: var(--space-md);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface-raised);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.cta h2 { max-width: 34ch; }

.warning-box {
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid color-mix(in srgb, var(--danger-600) 45%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--danger-600) 8%, transparent);
  color: var(--danger-600);
  font-size: var(--fs-sm);
  font-weight: 600;
}

/* --- 6.17 Prose pages -------------------------------------------------- */

.prose {
  max-width: var(--wrap-prose);
}

.prose h2 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-sm);
  font-size: 1.5rem;
}

.prose h3 {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-2xs);
}

.prose p,
.prose li {
  color: var(--text-muted);
  line-height: var(--lh-relaxed);
}

.prose > p:first-of-type {
  font-size: var(--fs-lead);
  color: var(--text);
}

.definition-list {
  display: grid;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.definition-list dt {
  font-weight: 700;
  color: var(--text);
}

.definition-list dd {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
}

.page-header {
  padding-block: clamp(3rem, 6vw, 4.5rem) var(--space-lg);
}

.page-header h1 { max-width: 30ch; }

.page-header p {
  margin-top: var(--space-sm);
  color: var(--text-muted);
  font-size: var(--fs-lead);
  max-width: 62ch;
}

/* --- 6.18 Footer ------------------------------------------------------- */

.site-footer {
  padding-block: var(--space-xl) var(--space-lg);
  background: var(--ink-900);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: var(--space-lg);
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-footer h2 {
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: var(--space-2xs);
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li { margin-bottom: 0.4rem; }

.site-footer a {
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.site-footer a:hover { color: var(--paper-000); }

.site-footer__about p {
  margin-top: var(--space-2xs);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  max-width: 34ch;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-md);
  justify-content: space-between;
  max-width: var(--wrap);
  margin: var(--space-lg) auto 0;
  padding: var(--space-md) var(--gutter) 0;
  border-top: 1px solid var(--border);
  color: var(--text-subtle);
  font-size: var(--fs-xs);
}

/* -------------------------------------------------- 7. Motion ------------ */

/*
  Scoped to .js — set by an inline script in the head. Content is never hidden unless
  JavaScript is confirmed present to reveal it again, so a blocked or failed script can
  never leave the page blank.
*/
.js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}

.js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* -------------------------------------------------- 8. Responsive -------- */

@media (max-width: 1080px) {
  .system-map { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .system-map__console { grid-column: 1 / -1; grid-row: 1; }
  .case { grid-template-columns: minmax(0, 1fr); }
  .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
  .evidence-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .evidence-row__intro { grid-column: 1 / -1; }
  .calc__grid { grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); }
}

/* Below this the flow stacks, so the connector has to point down instead of right. */
@media (max-width: 860px) {
  .flow {
    grid-auto-flow: row;
    gap: var(--space-md);
  }

  .flow__step { padding-right: var(--space-sm); }

  .flow__step:not(:last-child)::after {
    top: auto;
    right: auto;
    left: var(--space-md);
    bottom: calc(var(--space-md) / -2 - 4px);
    transform: translateX(-50%) rotate(135deg);
  }

  /* Stacked, an arc spanning the width would point nowhere. Drop it and let the note carry it. */
  .flow--loop { margin-bottom: var(--space-sm); }
  .flow--loop::after,
  .flow--loop::before { display: none; }

  .flow__loop-note {
    margin: var(--space-sm) auto 0;
    border: 1px dashed var(--border-strong);
  }

  .flow__loop-note::before { content: '\21BA\00A0'; }

  .span-visual__systems {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(4.5rem, 1fr));
  }
}

@media (max-width: 860px) {
  .nav__list--desktop,
  .nav__actions .btn { display: none; }
  .nav__disclosure { display: block; }
  .site-header { position: sticky; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card--feature { grid-template-columns: minmax(0, 1fr); }
  .founder { grid-template-columns: minmax(0, 1fr); }
  .founder__media img { min-height: 16rem; object-position: center 18%; }
  .founder__media::after {
    background: linear-gradient(180deg, transparent 50%, color-mix(in srgb, var(--ink-800) 92%, transparent) 100%);
  }
}

@media (max-width: 640px) {
  :root { --header-h: 4rem; }

  .grid--3,
  .stats,
  .system-map,
  .system-map__column,
  .timeline,
  .form__row,
  .console__kpis,
  .site-footer__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .founder__facts { grid-template-columns: minmax(0, 1fr); }
  .founder__body { padding: var(--space-md); }
  .founder__actions .btn { width: 100%; }

  .pull-quote { grid-template-columns: minmax(0, 1fr); }
  .evidence-row { grid-template-columns: minmax(0, 1fr); gap: var(--space-sm); }

  .hero__proof { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); }
  .hero__actions .btn { width: 100%; }

  .cta { flex-direction: column; align-items: flex-start; }

  .console__record { flex-direction: column; align-items: flex-start; }
  .console__ai { flex-direction: column; align-items: flex-start; }
  .console__ai .btn { width: 100%; }

  .console__feed li { grid-template-columns: auto minmax(0, 1fr); }
  .console__feed time { grid-column: 2; }
}

/* -------------------------------------------------- 9. Preferences ------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js [data-reveal] { opacity: 1; transform: none; }

  .logo-rail__track {
    animation: none;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
    gap: var(--space-md) var(--space-lg);
  }

  .logo-rail__viewport { mask-image: none; }
}

@media (forced-colors: active) {
  .card,
  .stat,
  .calc,
  .calc__result,
  .console,
  .source-card,
  .pill {
    border: 1px solid CanvasText;
  }

  .btn { border: 1px solid ButtonText; }
}

@media print {
  .site-header,
  .site-footer,
  .logo-rail,
  .hero__actions { display: none; }

  body { background: #fff; color: #000; }
  .band { padding-block: 1rem; }
}
