/* ==========================================================================
   Levanger Consulting — site styles
   --------------------------------------------------------------------------
   1. Fonts            6. Header + menu        11. Process
   2. Tokens           7. Hero + workflow      12. About
   3. Themes           8. Facts strip          13. Contact + form
   4. Base             9. Services             14. Footer
   5. Primitives      10. Work + diagrams      15. Case study, utilities
   ========================================================================== */

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

@font-face {
  font-family: "Newsreader Display";
  src: url("../fonts/newsreader-display.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader Display";
  src: url("../fonts/newsreader-display-italic.woff2") format("woff2");
  font-weight: 300 600;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
/* Metric-matched fallbacks keep layout stable while web fonts load. */
@font-face {
  font-family: "Newsreader Fallback";
  src: local("Georgia");
  size-adjust: 101.32%;
  ascent-override: 72.55%;
  descent-override: 26.16%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Instrument Fallback";
  src: local("Arial");
  size-adjust: 103.43%;
  ascent-override: 93.78%;
  descent-override: 24.17%;
  line-gap-override: 0%;
}

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

:root {
  /* Palette */
  --navy-950: #070f1f;
  --navy-900: #0a1730;
  --navy-850: #0e1d3a;
  --navy-800: #132546;
  --navy-700: #1c3157;
  --paper-50: #fbf8f2;
  --paper-100: #f5f1e8;
  --paper-200: #ece6d9;
  --paper-300: #ddd5c4;
  --ink-900: #0e1a2e;
  --ink-700: #2f3a52;
  --ink-600: #4f5870;
  --ink-500: #5f6679;
  --mist-300: #c9d0dd;
  --mist-400: #a7b1c4;
  --mist-500: #8a95ac;
  --teal-300: #8ee6df;
  --teal-400: #4fd4cb;
  --teal-500: #22b5ac;
  --teal-600: #138a84;
  --teal-700: #0b6e69;
  --amber-400: #e2b04a;
  --amber-700: #8a5a00;
  --rose-400: #f08a7e;
  --rose-700: #a3322a;

  /* Type families */
  --font-display: "Newsreader Display", "Newsreader Fallback", Georgia, "Times New Roman", serif;
  --font-sans: "Instrument Sans", "Instrument Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Fluid type scale (min @ 360px → max @ 1440px) */
  --step--2: 0.75rem;                                         /* 12  mono labels   */
  --step--1: 0.875rem;                                        /* 14  small         */
  --step-0: clamp(1rem, 0.967rem + 0.148vw, 1.125rem);        /* 16→18 body        */
  --step-1: clamp(1.125rem, 1.06rem + 0.3vw, 1.3125rem);      /* 18→21 lede        */
  --step-2: clamp(1.375rem, 1.25rem + 0.56vw, 1.75rem);       /* 22→28 h3          */
  --step-3: clamp(1.75rem, 1.5rem + 1.11vw, 2.5rem);          /* 28→40 h2 small    */
  --step-4: clamp(2.25rem, 1.75rem + 2.22vw, 3.75rem);        /* 36→60 h2          */
  --step-5: clamp(2.5rem, 1.5rem + 4.3vw, 5.5rem);            /* 40→88 hero        */

  /* Spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;
  --section-y: clamp(4.5rem, 3rem + 6.5vw, 9rem);

  /* Layout */
  --max: 80rem;                              /* 1280px content width */
  --gutter: clamp(1rem, 0.4rem + 2.6vw, 3rem);
  --col-gap: clamp(1rem, 0.5rem + 1.5vw, 2rem);
  --measure: 38rem;                          /* ~68ch reading width */
  --header-h: 4.5rem;

  /* Shape */
  --radius-1: 3px;
  --radius-2: 6px;
  --radius-3: 10px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-1: 160ms;   /* hover, press */
  --dur-2: 280ms;   /* small state changes */
  --dur-3: 600ms;   /* section entrances */
  --dur-4: 760ms;   /* workflow placement */
}

/* 3. Themes --------------------------------------------------------------- */

.theme-dark {
  --bg: var(--navy-900);
  --bg-raised: var(--navy-850);
  --bg-sunken: var(--navy-950);
  --fg: var(--paper-100);
  --fg-muted: var(--mist-400);
  --fg-subtle: var(--mist-500);
  --line: rgb(201 208 221 / 0.13);
  --line-strong: rgb(201 208 221 / 0.26);
  --accent: var(--teal-400);
  --accent-soft: rgb(79 212 203 / 0.14);
  --pending: var(--amber-400);
  --danger: var(--rose-400);
  --focus: var(--teal-400);
  --btn-bg: var(--paper-100);
  --btn-fg: var(--navy-900);
  --btn-bg-hover: #ffffff;
  --field-bg: rgb(7 15 31 / 0.55);
  --grid-line: rgb(201 208 221 / 0.045);
  color-scheme: dark;
  background-color: var(--bg);
  color: var(--fg);
}

.theme-light {
  --bg: var(--paper-100);
  --bg-raised: var(--paper-50);
  --bg-sunken: var(--paper-200);
  --fg: var(--ink-900);
  --fg-muted: var(--ink-600);
  --fg-subtle: var(--ink-500);
  --line: rgb(14 26 46 / 0.13);
  --line-strong: rgb(14 26 46 / 0.26);
  --accent: var(--teal-700);
  --accent-soft: rgb(11 110 105 / 0.09);
  --pending: var(--amber-700);
  --danger: var(--rose-700);
  --focus: var(--teal-700);
  --btn-bg: var(--navy-900);
  --btn-fg: var(--paper-100);
  --btn-bg-hover: var(--navy-800);
  --field-bg: var(--paper-50);
  --grid-line: rgb(14 26 46 / 0.05);
  color-scheme: light;
  background-color: var(--bg);
  color: var(--fg);
}

.theme-sunken { --bg: var(--paper-200); --bg-raised: var(--paper-100); }

/* 4. Base ----------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  background: var(--navy-900);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  font-kerning: normal;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h4 { font-size: inherit; font-weight: 600; }
p, li, dd { text-wrap: pretty; }
strong { font-weight: 600; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: var(--line-strong);
  transition: color var(--dur-1) var(--ease-out), text-decoration-color var(--dur-1) var(--ease-out);
}
a:hover { text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--focus, var(--teal-400));
  outline-offset: 3px;
  border-radius: 2px;
}

::selection { background: var(--teal-300); color: var(--navy-950); }

button, input, textarea, select { font: inherit; color: inherit; }

[hidden] { display: none !important; }

.visually-hidden {
  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: 0.75rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--paper-100);
  color: var(--navy-900);
  font-weight: 600;
  border-radius: var(--radius-1);
  transform: translateY(-160%);
  transition: transform var(--dur-2) var(--ease-out);
}
.skip-link:focus-visible { transform: none; }

/* 5. Primitives ----------------------------------------------------------- */

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.section { padding-block: var(--section-y); position: relative; }

/* Single-column grids must not grow to fit long unbreakable content. */
.hero__grid, .section-head, .offer, .platform, .work__intro, .work__body,
.about, .contact, .case-hero__grid, .case-layout, .cta-band__inner, .also {
  grid-template-columns: minmax(0, 1fr);
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--font-sans);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.eyebrow .rule,
.rule {
  display: inline-block;
  width: 2.75rem;
  height: 1px;
  background: var(--accent);
  flex: none;
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-subtle);
}

.lede {
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--fg-muted);
  max-width: var(--measure);
}

/* Section heading: label column + title column */
.section-head {
  display: grid;
  gap: var(--space-5);
  margin-bottom: clamp(2.5rem, 2rem + 3vw, 5rem);
}
.section-head h2 { font-size: var(--step-4); max-width: 18ch; }
.section-head .lede { max-width: 34rem; }
@media (min-width: 60rem) {
  .section-head {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    align-items: end;
  }
  .section-head .eyebrow { grid-column: 1 / -1; }
  .section-head h2 { grid-column: 1 / span 7; }
  .section-head .lede { grid-column: 8 / span 5; padding-bottom: 0.4em; }
}

/* Buttons + arrow "wire" (a line ending in a node) */
.wire {
  position: relative;
  display: inline-block;
  width: 1.125rem;
  height: 1px;
  background: currentColor;
  flex: none;
  transition: width var(--dur-2) var(--ease-out);
}
.wire::after {
  content: "";
  position: absolute;
  right: -3px;
  top: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  transition: background-color var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  min-height: 3rem;
  padding: 0.8rem 1.35rem 0.8rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-1);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
.btn:hover { background: var(--btn-bg-hover); }
.btn:hover .wire,
.btn:focus-visible .wire,
.link-cta:hover .wire,
.link-cta:focus-visible .wire { width: 1.75rem; }
.btn:hover .wire::after,
.btn:focus-visible .wire::after { background: var(--teal-500); }
.btn:active { transform: translateY(1px); }
.btn--sm { min-height: 2.5rem; padding: 0.55rem 1rem 0.55rem 1rem; font-size: 0.9375rem; }
.btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--line-strong);
}
.btn--ghost:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn[aria-busy="true"] { cursor: progress; opacity: 0.8; }

.link-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 3rem;
  padding-block: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--fg);
}
.link-cta:hover { color: var(--accent); }
.link-cta .wire::after { background: var(--accent); }

/* Lists with node markers: hollow = situation, filled = delivered */
.node-list { list-style: none; padding: 0; display: grid; gap: 0.7rem; }
.node-list li { position: relative; padding-left: 1.4rem; line-height: 1.5; }
.node-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.25px solid var(--fg-subtle);
}
.node-list--filled li::before { border-color: var(--accent); background: var(--accent); }

/* Section entrances (only when JS + motion allowed) */
.motion [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out-expo);
}
.motion [data-reveal].is-visible { opacity: 1; transform: none; }
.motion [data-reveal-delay="1"] { transition-delay: 80ms; }
.motion [data-reveal-delay="2"] { transition-delay: 160ms; }
.motion [data-reveal-delay="3"] { transition-delay: 240ms; }

/* 6. Header + menu -------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out);
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  background-color: rgb(10 23 48 / 0.97);
}
.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--fg);
  margin-right: auto;
  min-height: 44px;
}
.wordmark__mark { width: 1.5rem; height: 1.5rem; flex: none; }
.wordmark__mark .m-line { stroke: currentColor; }
.wordmark__mark .m-start { fill: var(--bg); stroke: currentColor; }
.wordmark__mark .m-end { fill: var(--accent); }
.wordmark__text { display: inline-flex; align-items: baseline; gap: 0.6rem; }
.wordmark__name {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1;
}
.wordmark__sub {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--fg-muted);
  line-height: 1;
}

.site-nav ul { display: flex; gap: 0.25rem; list-style: none; padding: 0; margin: 0; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 0.85rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  position: relative;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.6rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-2) var(--ease-out);
}
.site-nav a:hover,
.site-nav a.is-active { color: var(--fg); }
.site-nav a:hover::after,
.site-nav a.is-active::after { transform: scaleX(1); }

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.25rem 0 0.75rem;
  background: none;
  border: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--fg);
  cursor: pointer;
}
.menu-toggle__icon { display: grid; gap: 5px; width: 20px; }
.menu-toggle__icon span { display: block; height: 1.5px; background: currentColor; }
.menu-toggle__icon span:last-child { width: 65%; justify-self: end; }

/* Small screens: menu button replaces inline nav (when JS is available) */
@media (max-width: 59.99rem) {
  .js .site-nav,
  .js .site-header__cta { display: none; }
  .js .menu-toggle { display: inline-flex; }
  .wordmark__sub { display: none; }
  :root { --header-h: 4rem; }
  html:not(.js) .site-header { height: auto; position: static; }
  html:not(.js) .site-header__inner { flex-wrap: wrap; padding-block: 0.75rem; gap: 0.25rem 1rem; }
  html:not(.js) .site-nav ul { flex-wrap: wrap; }
  html:not(.js) .site-nav a { padding-inline: 0.5rem; }
}
@media (min-width: 26rem) and (max-width: 59.99rem) {
  .wordmark__sub { display: inline; }
}

.menu {
  /* <dialog> used as a full-screen sheet */
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  inset: 0;
}
.menu::backdrop { background: rgb(7 15 31 / 0.6); }
.menu[open] { display: flex; flex-direction: column; }
.menu__bar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.menu__close {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.25rem 0 0.75rem;
  background: none;
  border: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}
.menu__close svg { width: 18px; height: 18px; }
.menu__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-7);
  padding-block: var(--space-6) var(--space-7);
  overflow-y: auto;
}
.menu__links { list-style: none; padding: 0; margin: 0; display: grid; }
.menu__links li { border-bottom: 1px solid var(--line); }
.menu__links a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-block: 1rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.5rem + 2.5vw, 2.75rem);
  line-height: 1.1;
  text-decoration: none;
}
.menu__links a .label { font-size: 0.6875rem; }
.menu__foot { display: grid; gap: var(--space-5); }
.menu__foot .btn { width: 100%; }
.menu__foot p { color: var(--fg-muted); font-size: var(--step--1); }
@media (prefers-reduced-motion: no-preference) {
  .menu[open] .menu__links li { animation: menu-in var(--dur-3) var(--ease-out-expo) both; }
  .menu[open] .menu__links li:nth-child(2) { animation-delay: 40ms; }
  .menu[open] .menu__links li:nth-child(3) { animation-delay: 80ms; }
  .menu[open] .menu__links li:nth-child(4) { animation-delay: 120ms; }
}
@keyframes menu-in { from { opacity: 0; transform: translateY(10px); } }

/* 7. Hero + signature workflow -------------------------------------------- */

.hero {
  position: relative;
  padding-block: clamp(2.25rem, 1.25rem + 3.5vw, 4.5rem) clamp(2.5rem, 2rem + 2vw, 3.5rem);
  overflow: clip;
}
.hero__lines {
  position: absolute;
  inset: 0;
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
  pointer-events: none;
  background-image: repeating-linear-gradient(to right, var(--grid-line) 0 1px, transparent 1px calc(100% / 12));
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
  border-right: 1px solid var(--grid-line);
}
.hero__grid {
  position: relative;
  display: grid;
  gap: clamp(2.5rem, 2rem + 3vw, 4rem);
  align-items: center;
}
@media (min-width: 64rem) {
  .hero__grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
  }
  .hero__copy { grid-column: 1 / span 7; }
  .hero .flow { grid-column: 8 / span 5; }
}
.hero__copy { display: grid; gap: var(--space-5); justify-items: start; }
.hero__title {
  font-size: var(--step-5);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.022em;
  margin-top: var(--space-2);
}
.hero__title span { display: block; }
.descriptor {
  /* Every item carries a leading dot; the dot that starts each line is
     pulled into a negative margin and clipped, so wrapped lines never
     begin with a separator. */
  --dot: calc(5px + 1.7rem);
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0;
  margin-left: calc(-1 * var(--dot));
  clip-path: inset(0 0 0 var(--dot));
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--fg);
}
.descriptor li { display: inline-flex; align-items: center; }
.descriptor li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  margin-inline: 0.85rem;
}
.hero .lede { max-width: 33rem; }
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
  margin-top: var(--space-2);
}

/* Workflow figure ----------------------------------------------------------
   Six steps on a spine. Circles are agent-assisted steps, diamonds are human
   checkpoints, and a rail on the right carries review feedback back up to the
   reusable guidance chip. */

.flow {
  --spine: 1.75rem;
  --gap: 0.5rem;
  --card-h: 3rem;
  --rail: 1.5rem;
  --corner: var(--line-strong);
  position: relative;
  padding: clamp(1rem, 0.75rem + 1vw, 1.5rem);
  width: 100%;
  max-width: 34rem;
  justify-self: end;
  background:
    linear-gradient(var(--corner), var(--corner)) top left / 14px 1px no-repeat,
    linear-gradient(var(--corner), var(--corner)) top left / 1px 14px no-repeat,
    linear-gradient(var(--corner), var(--corner)) top right / 14px 1px no-repeat,
    linear-gradient(var(--corner), var(--corner)) top right / 1px 14px no-repeat,
    linear-gradient(var(--corner), var(--corner)) bottom left / 14px 1px no-repeat,
    linear-gradient(var(--corner), var(--corner)) bottom left / 1px 14px no-repeat,
    linear-gradient(var(--corner), var(--corner)) bottom right / 14px 1px no-repeat,
    linear-gradient(var(--corner), var(--corner)) bottom right / 1px 14px no-repeat;
}
@media (max-width: 63.99rem) { .flow { justify-self: stretch; max-width: 40rem; } }

.flow__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  min-height: 2rem;
}
.flow__fig { color: var(--fg-subtle); }
.flow__fig b { color: var(--fg); font-weight: 500; margin-right: 0.6em; }
.flow__replay {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2rem;
  padding: 0 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--dur-1), border-color var(--dur-1);
}
.flow__replay:hover { color: var(--fg); border-color: var(--line-strong); }
.flow__replay svg { width: 12px; height: 12px; }

.flow__body { position: relative; padding-right: var(--rail); }

.flow__guide { display: flex; justify-content: flex-end; margin-bottom: 0.875rem; }
.flow__guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 2rem;
  padding: 0 0.85rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.flow__guide-btn svg { width: 12px; height: 12px; flex: none; }
.flow__guide-btn:hover { background: rgb(79 212 203 / 0.2); }
.flow__guide-btn[aria-pressed="true"] { box-shadow: 0 0 0 1px var(--accent); }
html:not(.js) .flow__guide-btn { cursor: default; }

.flow__loop {
  position: absolute;
  right: calc(var(--rail) - 1rem);
  width: 1rem;
  top: 1rem;                              /* centre of the guidance chip */
  bottom: calc(var(--card-h) / 2);        /* centre of the last step */
  color: var(--line-strong);
  border: 1px solid currentColor;
  border-left: 0;
  border-radius: 0 8px 8px 0;
  clip-path: inset(-6px -12px -6px -12px);
  transition: clip-path 620ms var(--ease-in-out), color 900ms var(--ease-out);
}
.flow__loop::before {                     /* arrowhead into the chip */
  content: "";
  position: absolute;
  left: -5px;
  top: -4px;
  border-style: solid;
  border-width: 4px 5px 4px 0;
  border-color: transparent currentColor transparent transparent;
}
.flow__loop-label {
  position: absolute;
  right: -0.3125rem;
  top: 50%;
  padding: 0.45rem 0;
  writing-mode: vertical-rl;
  transform: translateY(-50%) rotate(180deg);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--fg-subtle);
}

.flow__steps { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--gap); }
.flow__step {
  position: relative;
  display: grid;
  grid-template-columns: var(--spine) minmax(0, 1fr);
  align-items: center;
  transition: transform var(--dur-4) var(--ease-out-expo), opacity var(--dur-3) var(--ease-out);
}
.flow__node {
  position: relative;
  z-index: 1;
  justify-self: start;
  width: 11px;
  height: 11px;
  margin-left: calc((var(--spine) - 11px) / 2 - 6px);
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: var(--accent);
  transition: background-color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-3) var(--ease-out);
}
.flow__step--gate .flow__node { border-radius: 1px; transform: rotate(45deg) scale(0.9); }
.flow__wire {
  position: absolute;
  left: calc((var(--spine) - 11px) / 2 - 6px + 5px);
  top: calc(50% + 7px);
  width: 1px;
  height: calc(100% + var(--gap) - 14px);
  background: var(--line-strong);
  clip-path: inset(0 0 0 0);
  transition: clip-path 340ms var(--ease-in-out), background-color 900ms var(--ease-out);
}
.flow__spark {
  position: absolute;
  left: -2px;
  top: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal-300);
  box-shadow: 0 0 0 3px rgb(79 212 203 / 0.18);
  opacity: 0;
}

.flow__btn {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  width: 100%;
  height: var(--card-h);
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-2);
  background: rgb(255 255 255 / 0.018);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out);
}
html:not(.js) .flow__btn { cursor: default; }
.flow__btn:hover { border-color: var(--line-strong); background: rgb(255 255 255 / 0.035); }
.flow__btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.flow__label {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.003em;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.flow__status { display: grid; justify-items: end; }
.flow__status > * {
  grid-area: 1 / 1;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.flow__status > *::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.flow__before { color: var(--fg-subtle); opacity: 0; }
.flow__hold { color: var(--pending); opacity: 0; }
.flow__after { color: var(--accent); }

.flow__note {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  min-height: 4.75rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--fg-muted);
}
.flow__note strong { color: var(--fg); font-weight: 600; }
html:not(.js) .flow__note-prompt { display: none; }

.flow__legend {
  list-style: none;
  padding: 0;
  margin: var(--space-2) 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.flow__legend li { display: inline-flex; align-items: center; gap: 0.55rem; }
.flow__legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.flow__legend .lg-gate { border-radius: 1px; transform: rotate(45deg) scale(0.9); }
.flow__legend .lg-loop { width: 10px; border-radius: 0 4px 4px 0; border: 1px solid var(--fg-subtle); border-left: 0; background: none; }
.flow__caption { margin-top: var(--space-3); color: var(--fg-subtle); font-size: 0.6875rem; }

/* — Armed (pre-animation) state. Present only when JS + motion are allowed;
     the static, fully connected state above is the default. */
.motion .flow[data-animate] .flow__step:not(.is-live) .flow__node { background: var(--bg); border-color: var(--fg-subtle); }
.motion .flow[data-animate] .flow__step:not(.is-live) .flow__after { opacity: 0; transform: translateY(5px); }
.motion .flow[data-animate] .flow__step:not(.is-live):not(.is-hold) .flow__before { opacity: 1; }
.motion .flow[data-animate] .flow__step.is-hold .flow__hold { opacity: 1; }
.motion .flow[data-animate] .flow__step.is-hold .flow__node { border-color: var(--pending); background: var(--bg); }
.motion .flow[data-animate] .flow__wire:not(.is-drawn) { clip-path: inset(0 0 100% 0); }
.motion .flow[data-animate] .flow__wire.is-drawn:not(.is-settled) { background: var(--accent); }
.motion .flow[data-animate] .flow__wire.is-drawn:not(.is-settled) .flow__spark { animation: spark 360ms var(--ease-in-out) both; }
.motion .flow[data-animate] .flow__step.is-live:not(.is-settled) .flow__node { box-shadow: 0 0 0 6px rgb(79 212 203 / 0.16); }
.motion .flow[data-animate] .flow__step.is-settled .flow__node { box-shadow: 0 0 0 0 rgb(79 212 203 / 0); }
.motion .flow[data-animate] .flow__loop:not(.is-drawn) { clip-path: inset(calc(100% + 6px) -12px -6px -12px); }
.motion .flow[data-animate] .flow__loop.is-drawn:not(.is-settled) { color: var(--accent); }
.motion .flow[data-animate] .flow__guide:not(.is-live) .flow__guide-btn { border-style: dashed; border-color: var(--line-strong); background: none; color: var(--fg-muted); }
.flow.no-transition *,
.flow.no-transition .flow__step { transition: none !important; animation: none !important; }

@media (min-width: 48rem) {
  /* Disconnected: loose, slightly rotated steps that settle into a column. */
  .motion .flow[data-animate] .flow__step:not(.is-placed) .flow__btn { border-style: dashed; }
  .motion .flow[data-animate] .flow__step:not(.is-placed):nth-child(1) { transform: translate(-1.25rem, 0.2rem) rotate(-1.4deg); }
  .motion .flow[data-animate] .flow__step:not(.is-placed):nth-child(2) { transform: translate(2.25rem, -0.1rem) rotate(1.1deg); }
  .motion .flow[data-animate] .flow__step:not(.is-placed):nth-child(3) { transform: translate(-0.5rem, 0.25rem) rotate(-0.7deg); }
  .motion .flow[data-animate] .flow__step:not(.is-placed):nth-child(4) { transform: translate(3rem, -0.1rem) rotate(1.6deg); }
  .motion .flow[data-animate] .flow__step:not(.is-placed):nth-child(5) { transform: translate(0.75rem, 0.2rem) rotate(-1deg); }
  .motion .flow[data-animate] .flow__step:not(.is-placed):nth-child(6) { transform: translate(1.75rem, -0.15rem) rotate(0.9deg); }
}

@media (max-width: 29.99rem) {
  .flow__btn { padding: 0 0.8rem; gap: 0.6rem; }
  .flow__label { font-size: 0.9375rem; }
  .flow__status > * { letter-spacing: 0.04em; }
}

@keyframes spark {
  0%   { top: -2px; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { top: calc(100% - 3px); opacity: 0; }
}

/* 8. Facts strip ---------------------------------------------------------- */

.facts {
  position: relative;
  display: grid;
  margin-top: clamp(2.5rem, 1.5rem + 3vw, 4rem);
  border-top: 1px solid var(--line);
}
.fact { padding: var(--space-5) 0; display: grid; gap: 0.35rem; align-content: start; }
.fact + .fact { border-top: 1px solid var(--line); }
.fact dt {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.15;
  color: var(--fg);
}
.fact dd { color: var(--fg-muted); font-size: 0.9375rem; line-height: 1.5; max-width: 26rem; }
@media (min-width: 48rem) {
  .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--col-gap); }
  .fact { padding-top: var(--space-5); padding-right: var(--space-4); }
  .fact + .fact { border-top: 0; border-left: 1px solid var(--line); padding-left: var(--col-gap); }
}

/* 9. Services ------------------------------------------------------------- */

.offers { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line-strong); }
.offer {
  display: grid;
  gap: var(--space-5);
  padding-block: clamp(2rem, 1.5rem + 2vw, 3.25rem);
  border-bottom: 1px solid var(--line);
}
.offer__index {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: lining-nums;
}
.offer__main { display: grid; gap: var(--space-4); align-content: start; }
.offer__glyph { width: 5.5rem; height: 2.5rem; color: var(--fg); margin-bottom: var(--space-2); }
.offer__glyph .g-line { stroke: currentColor; stroke-width: 1.25; fill: none; }
.offer__glyph .g-node { fill: var(--bg); stroke: currentColor; stroke-width: 1.25; }
.offer__glyph .g-on { fill: var(--accent); stroke: var(--accent); }
.offer h3 { font-size: var(--step-3); }
.offer__lede { color: var(--fg-muted); max-width: 32rem; }
.offer__proof { min-height: 2.75rem; font-size: 0.9375rem; color: var(--accent); }
.offer__proof:hover { color: var(--fg); }
.offer__col { display: grid; gap: var(--space-4); align-content: start; }
.offer__col .node-list { font-size: 0.96875rem; }
@media (max-width: 47.99rem) {
  .offer { position: relative; }
  .offer__index { position: absolute; top: clamp(2rem, 1.5rem + 2vw, 3.25rem); right: 0; }
}
@media (min-width: 48rem) and (max-width: 63.99rem) {
  .offer { grid-template-columns: 4rem 1fr 1fr; column-gap: var(--col-gap); }
  .offer__index { grid-row: 1 / span 2; }
  .offer__main { grid-column: 2 / -1; }
}
@media (min-width: 64rem) {
  .offer {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
  }
  .offer__index { grid-column: 1 / span 1; }
  .offer__main { grid-column: 2 / span 5; padding-right: var(--space-6); }
  .offer__col--fits { grid-column: 7 / span 3; }
  .offer__col--gets { grid-column: 10 / span 3; }
  .offer__col { padding-top: 0.35rem; }
}

.platform {
  margin-top: clamp(3rem, 2rem + 4vw, 5rem);
  padding: clamp(1.5rem, 1rem + 2.5vw, 3rem);
  background: var(--bg-sunken);
  border-radius: var(--radius-3);
  display: grid;
  gap: var(--space-6);
}
.platform__head { display: grid; gap: var(--space-3); align-content: start; }
.platform__head h3 { font-size: var(--step-3); }
.platform__head p { color: var(--fg-muted); max-width: 28rem; }
.platform__list { display: grid; gap: 0; }
.platform__list > div { padding-block: var(--space-4); border-top: 1px solid var(--line); display: grid; gap: 0.2rem; }
.platform__list dt { font-weight: 600; }
.platform__list dd { color: var(--fg-muted); font-size: 0.9375rem; line-height: 1.5; }
@media (min-width: 48rem) {
  .platform__list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--col-gap); }
}
@media (min-width: 64rem) {
  .platform { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }
  .platform__head { grid-column: 1 / span 4; }
  .platform__list { grid-column: 5 / span 8; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 10. Work + diagrams ----------------------------------------------------- */

.work__intro { display: grid; gap: var(--space-5); margin-bottom: clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.work__intro > :first-child { display: grid; gap: var(--space-5); }
.work__intro h2 { font-size: var(--step-4); max-width: 20ch; }
.work__meta { display: grid; gap: var(--space-4); align-content: end; }
.work__meta dl { display: grid; gap: 0; }
.work__meta dl > div { display: grid; grid-template-columns: 6.5rem 1fr; gap: var(--space-4); padding-block: 0.7rem; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.work__meta dt { color: var(--fg-subtle); }
.work__meta dd { color: var(--fg); }
@media (min-width: 64rem) {
  .work__intro { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: start; }
  .work__intro > :first-child { grid-column: 1 / span 7; display: grid; gap: var(--space-5); }
  .work__meta { grid-column: 9 / span 4; }
}

.work__body { display: grid; gap: var(--space-7); margin-top: clamp(2.5rem, 2rem + 3vw, 4.5rem); }
.work__col { display: grid; gap: var(--space-3); align-content: start; }
.work__col h3 { font-family: var(--font-sans); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; font-family: var(--font-mono); color: var(--accent); }
.work__col p { color: var(--fg-muted); }
.work__col .node-list { color: var(--fg-muted); font-size: 0.96875rem; }
.outcome {
  display: grid;
  gap: var(--space-3);
  align-content: start;
  padding: var(--space-5) 0 var(--space-5) var(--space-5);
  border-left: 2px solid var(--accent);
}
.outcome .label { color: var(--accent); }
.outcome__value {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1.1;
  letter-spacing: -0.012em;
  color: var(--fg);
  text-wrap: balance;
}
.outcome__note { font-size: var(--step--1); line-height: 1.55; color: var(--fg-muted); max-width: 30rem; }
.outcome--large { padding-block: var(--space-6); }
.outcome--large .outcome__value { font-size: var(--step-4); max-width: 22ch; }
.outcome--large .outcome__note { font-size: var(--step-0); max-width: 36rem; }
.work__meta .outcome { margin-bottom: var(--space-5); }

.also {
  display: grid;
  gap: var(--space-4);
  margin-top: clamp(3.5rem, 2.5rem + 4vw, 6rem);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line-strong);
}
.also__main { display: grid; gap: var(--space-3); }
.also h3 { font-size: var(--step-3); }
.also__main p { color: var(--fg-muted); max-width: 40rem; }
.also .link-cta { justify-self: start; }
@media (min-width: 64rem) {
  .also { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: end; }
  .also > .label { grid-column: 1 / -1; }
  .also__main { grid-column: 1 / span 7; }
  .also .link-cta { grid-column: 9 / span 4; justify-self: end; }
}

.work__cta { margin-top: var(--space-7); display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); align-items: center; }
@media (min-width: 48rem) {
  .work__body { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--col-gap); }
}

/* Diagram (inline SVG; desktop horizontal + compact vertical variants) */
.diagram { position: relative; margin: 0; }
.diagram__frame {
  padding: clamp(1rem, 0.5rem + 2vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-3);
  background: var(--bg-raised);
}
.diagram svg { width: 100%; height: auto; }
.diagram__wide { display: none; }
@media (min-width: 48rem) {
  .diagram__wide { display: block; }
  .diagram__tall { display: none; }
}
.diagram__tall { max-width: 26rem; margin-inline: auto; }
.diagram figcaption { margin-top: var(--space-3); font-size: var(--step--1); color: var(--fg-subtle); max-width: 48rem; }

.d-text { font-family: var(--font-sans); font-size: 17px; font-weight: 500; fill: var(--fg); }
.d-sub { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.04em; fill: var(--fg-subtle); text-transform: uppercase; }
.d-note { font-family: var(--font-sans); font-size: 14px; fill: var(--fg-muted); }
.d-region { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.12em; fill: var(--fg-subtle); text-transform: uppercase; }
.d-accent { fill: var(--accent); }
.d-line { stroke: var(--line-strong); stroke-width: 1.25; fill: none; }
.d-line--on { stroke: var(--accent); }
.d-dash { stroke: var(--line-strong); stroke-width: 1.25; stroke-dasharray: 4 5; fill: none; }
.d-dot { stroke: var(--fg-subtle); stroke-width: 1.25; stroke-dasharray: 1 5; stroke-linecap: round; fill: none; }
.d-node { fill: var(--bg-raised); stroke: var(--fg); stroke-width: 1.5; }
.d-node--on { fill: var(--accent); stroke: var(--accent); }
.d-node--ext { fill: var(--bg-raised); stroke: var(--fg-subtle); stroke-width: 1.5; stroke-dasharray: 3 3; }
.d-box { fill: var(--bg-raised); stroke: var(--accent); stroke-width: 1.25; }
.d-arrow { fill: var(--fg-subtle); }
.d-arrow--on { fill: var(--accent); }
.d-boundary { stroke: var(--fg-subtle); stroke-width: 1; stroke-dasharray: 2 6; stroke-linecap: round; }
.d-band { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1; }
.d-role { font-family: var(--font-sans); font-size: 14px; fill: var(--fg); }
.diagram figcaption b,
.case-figure figcaption b { font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg); margin-right: 0.6em; }

/* 11. Process ------------------------------------------------------------- */

.process { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; counter-reset: step; }
.process__step { position: relative; display: grid; gap: var(--space-3); padding: 0 0 var(--space-7) 2.5rem; }
.process__step::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 0.55rem;
  bottom: -0.55rem;
  width: 1px;
  background: var(--line-strong);
}
.process__step:last-child::before { display: none; }
.process__step::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid var(--fg);
  background: var(--bg);
}
.process__step:last-child::after { background: var(--accent); border-color: var(--accent); }
.process__num { color: var(--fg-subtle); }
.process__step h3 { font-size: var(--step-2); }
.process__step p { color: var(--fg-muted); max-width: 22rem; }
.process__note {
  margin-top: var(--space-6);
  display: flex;
  gap: var(--space-3);
  align-items: baseline;
  color: var(--fg-muted);
  font-size: 0.9375rem;
  max-width: 44rem;
}
.process__note .label { flex: none; }
@media (min-width: 60rem) {
  .process { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: auto auto auto; column-gap: var(--col-gap); }
  .process__step { padding: 2.75rem var(--space-4) 0 0; grid-row: span 3; grid-template-rows: subgrid; row-gap: var(--space-3); }
  .process__step::before { left: 11px; right: calc(-1 * var(--col-gap)); top: 5px; bottom: auto; width: auto; height: 1px; }
  .process__step::after { top: 0; }
  .process__note { margin-top: var(--space-8); }
}

/* 12. About --------------------------------------------------------------- */

.about { display: grid; gap: var(--space-7); }
.about__lead { display: grid; gap: var(--space-6); align-content: start; }
.about__statement {
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 1.35rem + 1.1vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}
.about__statement em { font-style: italic; color: var(--accent); }
.about__sign { font-family: var(--font-display); font-style: italic; font-size: var(--step-2); color: var(--fg-muted); }
.about__body { display: grid; gap: var(--space-4); color: var(--fg-muted); max-width: var(--measure); }
.about__body p:first-child { color: var(--fg); }
.roles { margin-top: var(--space-6); }
.roles__head { display: flex; justify-content: space-between; gap: var(--space-4); align-items: baseline; padding-bottom: var(--space-3); border-bottom: 1px solid var(--line-strong); }
.roles__list { list-style: none; padding: 0; margin: 0; }
.roles__list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.1rem;
  padding-block: 0.8rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.96875rem;
}
.roles__list .role { color: var(--fg); font-weight: 500; }
.roles__list .org { color: var(--fg-muted); }
.roles__list .detail { color: var(--fg-subtle); font-size: var(--step--1); grid-column: 1 / -1; }
@media (min-width: 36rem) {
  .roles__list li { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--space-5); }
  .roles__list .org { text-align: right; }
}
.about__links { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); margin-top: var(--space-5); }
@media (min-width: 64rem) {
  .about { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }
  .about__lead { grid-column: 1 / span 5; position: sticky; top: calc(var(--header-h) + 3rem); }
  .about__main { grid-column: 7 / span 6; }
}

/* 13. Contact + form ------------------------------------------------------ */

.contact { display: grid; gap: var(--space-8); }
.contact__intro { display: grid; gap: var(--space-5); align-content: start; }
.contact__intro h2 { font-size: var(--step-4); max-width: 15ch; }
.contact__direct { display: grid; gap: 0; margin-top: var(--space-4); border-top: 1px solid var(--line); }
.contact__direct a,
.contact__direct .contact__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  min-height: 3.5rem;
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.contact__direct a:hover { color: var(--accent); }
.contact__direct a:hover .wire { width: 1.75rem; }
.contact__direct .label { min-width: 5.5rem; }
@media (max-width: 29.99rem) {
  .contact__direct a,
  .contact__direct .contact__row { flex-wrap: wrap; row-gap: 0.15rem; }
  .contact__direct .label { flex-basis: 100%; }
}
.contact__direct .value { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.contact__next { margin-top: var(--space-5); display: grid; gap: var(--space-3); }
.contact__next p:not(.label) { color: var(--fg-muted); font-size: 0.9375rem; max-width: 30rem; }
@media (min-width: 64rem) {
  .contact { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }
  .contact__intro { grid-column: 1 / span 5; }
  .contact__form-wrap { grid-column: 7 / span 6; }
}

.form-card {
  padding: clamp(1.25rem, 0.75rem + 2.5vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-3);
  background: var(--bg-raised);
}
.form { display: grid; gap: var(--space-5); }
.form__row { display: grid; gap: var(--space-5); }
@media (min-width: 40rem) { .form__row--2 { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 0.5rem; align-content: start; }
.field__label { font-size: 0.9375rem; font-weight: 500; color: var(--fg); display: flex; justify-content: space-between; gap: var(--space-3); }
.field__label .opt { color: var(--fg-subtle); font-weight: 400; font-size: var(--step--1); }
.field__hint { font-size: var(--step--1); color: var(--fg-subtle); }
.field input,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-2);
  background: var(--field-bg);
  color: var(--fg);
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
}
.field textarea { min-height: 9.5rem; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--fg-subtle); opacity: 0.85; }
.field input:hover,
.field textarea:hover { border-color: var(--fg-subtle); }
.field input:focus-visible,
.field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent);
}
.field [aria-invalid="true"] { border-color: var(--danger); }
.field [aria-invalid="true"]:focus-visible { box-shadow: 0 0 0 3px rgb(240 138 126 / 0.18), 0 0 0 1px var(--danger); border-color: var(--danger); }
.field__error {
  display: flex;
  gap: 0.45rem;
  align-items: baseline;
  font-size: var(--step--1);
  color: var(--danger);
}
.field__error:empty { display: none; }
.field__error::before { content: "!"; font-family: var(--font-mono); font-weight: 600; }

.chips { border: 0; padding: 0; margin: 0; min-width: 0; }
.chips legend { padding: 0; margin-bottom: 0.65rem; }
.chips__list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.9375rem;
  color: var(--fg-muted);
  transition: border-color var(--dur-1), background-color var(--dur-1), color var(--dur-1);
  pointer-events: none;
}
.chip span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.25px solid currentColor;
  transition: background-color var(--dur-1), border-color var(--dur-1);
}
.chip input:hover + span { border-color: var(--fg-subtle); color: var(--fg); }
.chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--fg); }
.chip input:checked + span::before { background: var(--accent); border-color: var(--accent); }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form__foot { display: grid; gap: var(--space-4); }
.form__privacy { font-size: var(--step--1); color: var(--fg-subtle); max-width: 30rem; }
.form__submit { justify-self: start; }
@media (max-width: 39.99rem) { .form__submit { justify-self: stretch; } }

.notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-2);
  font-size: var(--step--1);
  color: var(--fg-muted);
  line-height: 1.5;
}
.notice::before {
  content: "";
  grid-row: 1 / span 2;
  width: 8px;
  height: 8px;
  margin-top: 0.4em;
  border-radius: 50%;
  border: 1.5px solid var(--pending);
}
.notice strong { color: var(--fg); font-weight: 600; }
.notice--pending { border-color: rgb(226 176 74 / 0.45); }

.form-status {
  display: grid;
  gap: var(--space-3);
  padding: 1rem 1.1rem;
  border-radius: var(--radius-2);
  border: 1px solid var(--line-strong);
  font-size: 0.9375rem;
  color: var(--fg-muted);
}
.form-status:empty { display: none; }
.form-status h3 { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; color: var(--fg); line-height: 1.4; display: flex; gap: 0.6rem; align-items: center; }
.form-status h3::before { content: ""; width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--fg-subtle); }
.form-status[data-state="success"] { border-color: var(--accent); background: var(--accent-soft); }
.form-status[data-state="success"] h3::before { background: var(--accent); }
.form-status[data-state="error"] { border-color: var(--danger); }
.form-status[data-state="error"] h3::before { background: var(--danger); }
.form-status[data-state="unconnected"] { border-style: dashed; border-color: rgb(226 176 74 / 0.6); }
.form-status[data-state="unconnected"] h3::before { background: var(--pending); }
.form-status__actions { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); align-items: center; }
.form-status__actions a,
.form-status__actions button { font-weight: 600; color: var(--fg); }
.text-btn { background: none; border: 0; padding: 0; min-height: 44px; text-decoration: underline; text-underline-offset: 0.22em; text-decoration-color: var(--line-strong); cursor: pointer; }
.text-btn:hover { text-decoration-color: currentColor; }

/* 14. Footer -------------------------------------------------------------- */

.site-footer { padding-block: var(--space-8) var(--space-6); background: var(--bg-sunken); }
.site-footer__top { display: grid; gap: var(--space-6); padding-bottom: var(--space-7); border-bottom: 1px solid var(--line); }
.site-footer__tag { color: var(--fg-muted); font-size: 0.9375rem; max-width: 22rem; margin-top: var(--space-4); }
.site-footer nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.15rem; }
.site-footer nav a { display: inline-flex; min-height: 2.25rem; align-items: center; text-decoration: none; color: var(--fg-muted); font-size: 0.9375rem; }
.site-footer nav a:hover { color: var(--fg); }
.site-footer__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); }
.site-footer__cols .label { display: block; margin-bottom: var(--space-3); }
.site-footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3); padding-top: var(--space-5); color: var(--fg-subtle); font-size: var(--step--1); }
@media (min-width: 48rem) {
  .site-footer__top { grid-template-columns: 1fr auto; align-items: start; }
  .site-footer__cols { grid-template-columns: repeat(3, auto); column-gap: var(--space-8); }
}

/* 15. Case study ---------------------------------------------------------- */

.case-hero { padding-block: clamp(2.5rem, 2rem + 4vw, 6rem) clamp(3rem, 2rem + 4vw, 5.5rem); position: relative; overflow: clip; }
.crumbs { display: flex; gap: 0.6rem; align-items: center; font-size: var(--step--1); color: var(--fg-subtle); margin-bottom: var(--space-7); }
.crumbs a { color: var(--fg-muted); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.crumbs a:hover { color: var(--fg); }
.crumbs [aria-current] { color: var(--fg); }
.case-hero__grid { display: grid; gap: var(--space-7); }
.case-hero h1 { font-size: var(--step-5); line-height: 1.02; letter-spacing: -0.02em; max-width: 14ch; margin-top: var(--space-5); }
.case-hero .lede { margin-top: var(--space-5); }
.case-meta { display: grid; align-content: end; }
.case-meta > div { display: grid; grid-template-columns: 6.5rem 1fr; gap: var(--space-4); padding-block: 0.8rem; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.case-meta dt { color: var(--fg-subtle); }
.case-meta dd a { font-weight: 500; }
@media (min-width: 64rem) {
  .case-hero__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: end; }
  .case-hero__grid > :first-child { grid-column: 1 / span 8; }
  .case-meta { grid-column: 9 / span 4; }
}

/* Sections run on the 12-column grid: a left index column carries each
   section label, the text sits in columns 4–10, figures span the full width. */
.case-body { display: grid; gap: clamp(3.5rem, 3rem + 3vw, 6rem); min-width: 0; }
.case-section { display: grid; gap: var(--space-5); max-width: 46rem; min-width: 0; }
.case-section h2 { font-size: var(--step-3); }
.case-section > p { color: var(--fg-muted); }
.case-section > p.lead-in { color: var(--fg); font-size: var(--step-1); line-height: 1.55; }
.case-section .eyebrow { margin-bottom: calc(-1 * var(--space-2)); }
.case-section--wide > h2 { max-width: 22ch; }
@media (min-width: 64rem) {
  .case-section {
    max-width: none;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--col-gap);
    align-items: start;
  }
  .case-section > * { grid-column: 4 / span 7; }
  .case-section--wide > * { grid-column: 4 / -1; }
  .case-section > .eyebrow {
    grid-column: 1 / span 3;
    margin: 0;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line-strong);
    padding-right: var(--space-5);
  }
  .case-section > .eyebrow::before {
    content: "";
    width: 7px;
    height: 7px;
    margin-right: -0.25rem;
    border-radius: 50%;
    background: var(--accent);
    flex: none;
  }
}

.contrib { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line-strong); }
.contrib li { display: grid; grid-template-columns: 2.25rem 1fr; gap: var(--space-3); padding-block: 1rem; border-bottom: 1px solid var(--line); }
.contrib .label { padding-top: 0.3rem; }
.contrib strong { display: block; color: var(--fg); font-weight: 600; }
.contrib span { color: var(--fg-muted); font-size: 0.96875rem; }

.decisions { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-4); counter-reset: d; }
.decision {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-3);
  background: var(--bg-raised);
}
.decision__q { display: flex; gap: var(--space-4); align-items: baseline; }
.decision__q h3 { font-family: var(--font-sans); font-size: 1.0625rem; font-weight: 600; line-height: 1.4; letter-spacing: 0; }
.decision__why { display: grid; grid-template-columns: auto 1fr; gap: var(--space-3); color: var(--fg-muted); font-size: 0.96875rem; padding-left: calc(1.6rem + var(--space-4)); }
.decision__why .label { padding-top: 0.25rem; color: var(--accent); }
@media (max-width: 35.99rem) { .decision__why { padding-left: 0; grid-template-columns: 1fr; gap: 0.25rem; } }

.split { display: grid; gap: var(--space-6); }
@media (min-width: 48rem) { .split { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--col-gap); } }
.split > div { display: grid; gap: var(--space-3); align-content: start; padding-top: var(--space-4); border-top: 1px solid var(--line-strong); }
.split h3 { font-family: var(--font-sans); font-size: 1.0625rem; font-weight: 600; letter-spacing: 0; line-height: 1.35; }
.split p { color: var(--fg-muted); font-size: 0.96875rem; }

.stack { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.stack li { padding: 0.4rem 0.8rem; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 0.9375rem; }
.fine { font-size: var(--step--1); color: var(--fg-subtle); }

.case-figure figcaption { margin-top: var(--space-3); font-size: var(--step--1); color: var(--fg-subtle); max-width: 52rem; }

/* Synthetic contract → terms → API figure */
.synth { display: grid; gap: var(--space-4); }
@media (min-width: 64rem) { .synth { grid-template-columns: 1.15fr 1fr 1fr; gap: var(--space-6); } }
.synth__panel {
  position: relative;
  display: grid;
  gap: var(--space-4);
  align-content: start;
  min-width: 0;
  padding: var(--space-5);
  border: 1px solid var(--line);
  border-radius: var(--radius-3);
  background: var(--bg-raised);
}
@media (min-width: 64rem) {
  .synth__panel + .synth__panel::before {          /* wire + node between panels */
    content: "";
    position: absolute;
    top: 1.65rem;
    left: calc(-1 * var(--space-6) - 1px);
    width: var(--space-6);
    height: 1px;
    background: var(--accent);
  }
  .synth__panel + .synth__panel::after {
    content: "";
    position: absolute;
    top: calc(1.65rem - 3px);
    left: -4px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
  }
}
.synth__clause { font-family: var(--font-display); font-size: 1.1875rem; line-height: 1.55; color: var(--fg); }
.synth__clause b { font-weight: 600; }
.synth__clause mark { background: var(--accent-soft); color: inherit; border-bottom: 1px solid var(--accent); padding: 0 0.12em; }
.synth__terms { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; margin: 0; font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.5; }
.synth__terms dt { color: var(--fg-subtle); }
.synth__terms dd { color: var(--fg); }
.synth__q {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem 0.9rem;
  border: 1px dashed var(--pending);
  border-radius: var(--radius-2);
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--fg);
}
.synth__q .label { color: var(--pending); }
.synth__code { margin: 0; overflow-x: auto; font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.65; color: var(--fg); }
.synth__code .k { color: var(--accent); }
.synth__status { display: flex; align-items: center; gap: 0.55rem; font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pending); }
.synth__status .dot { width: 8px; height: 8px; flex: none; border-radius: 1px; background: var(--pending); transform: rotate(45deg) scale(0.9); }

/* Eight agent roles */
.agents { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-5); border-top: 1px solid var(--line-strong); }
@media (min-width: 48rem) { .agents { grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--col-gap); } }
.agents li { display: grid; gap: 0.3rem; align-content: start; padding: var(--space-4) 0 var(--space-5); border-bottom: 1px solid var(--line); }
.agents .label { color: var(--accent); }
.agents strong { font-weight: 600; line-height: 1.35; }
.agents li > span:last-child { color: var(--fg-muted); font-size: 0.9375rem; line-height: 1.45; }

/* Related case study card */
.related__card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-3);
  background: var(--bg-raised);
  text-decoration: none;
  transition: border-color var(--dur-2) var(--ease-out);
}
.related__card:hover { border-color: var(--accent); }
.related__card:hover .wire { width: 1.75rem; }
.related__title { font-family: var(--font-display); font-size: var(--step-3); line-height: 1.1; letter-spacing: -0.012em; color: var(--fg); }
.related__text { color: var(--fg-muted); max-width: 40rem; }
.related__card .link-cta { min-height: 2rem; margin-top: var(--space-2); }

.pull {
  padding: var(--space-6) 0 var(--space-6) var(--space-6);
  border-left: 2px solid var(--accent);
  display: grid;
  gap: var(--space-4);
}
.pull p {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.cta-band { padding-block: var(--section-y); }
.cta-band__inner { display: grid; gap: var(--space-6); justify-items: start; }
.cta-band h2 { font-size: var(--step-4); max-width: 18ch; }
.cta-band .lede { max-width: 32rem; }
@media (min-width: 64rem) {
  .cta-band__inner { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: end; }
  .cta-band__inner > :first-child { grid-column: 1 / span 8; display: grid; gap: var(--space-5); }
  .cta-band__actions { grid-column: 9 / span 4; justify-self: end; display: grid; gap: var(--space-3); justify-items: start; }
}

/* Simple pages (404, redirects) */
.simple { min-height: calc(100vh - var(--header-h)); display: grid; align-content: center; padding-block: var(--space-9); }
.simple__inner { display: grid; gap: var(--space-5); justify-items: start; max-width: 40rem; }
.simple h1 { font-size: var(--step-5); }

/* Print */
@media print {
  .site-header, .site-footer, .flow__replay, .menu, .skip-link { display: none !important; }
  .theme-dark { --bg: #fff; --fg: #000; --fg-muted: #333; --fg-subtle: #555; background: #fff; color: #000; }
  .section, .case-hero, .cta-band { padding-block: 1.5rem; }
  a { text-decoration: underline; }
}

/* Reduced motion: everything resolves instantly. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
