/* ═══════════════════════════════════════════════════════════════════
   Forma Design System V5 — component layer
   Landscape molecule kit + Web-Doc module + infographics.
   Verbatim from "Forma - Web Documents" (Sage Design System).
   Pairs with tokens.css (already in this project) and js/forma-webdoc.js.
   ═══════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════
   Forma — Landscape Layout Kit  (fusion/landscape-layouts.css)
   ───────────────────────────────────────────────────────────────────
   An ATOMIC, orientation-agnostic layout grammar + molecule set for
   Forma / MakeIt. A layout service composes a page from these pieces:

       .surface                one composed page (a "surface" in MakeIt)
         └ .surface__chrome-top / __chrome-bot   running header / footer
         └ .surface__body       the inset content area (flex column)
              └ .row            a horizontal band of slots
                   └ .slot      one cell; holds ONE molecule

   GRID GRAMMAR
   ────────────
   • A surface body is a vertical stack of up to 4 ROWS.
   • A row is 1–4 SLOTS:  <div class="row cols-3"> … </div>
       cols-1 | cols-2 | cols-3 | cols-4   →  sets --cols (max 4).
   • A slot may span / stretch:
       .slot.span-2 / .span-3 / .span-4    →  widen across columns
       .slot.rspan-2                        →  deepen across the next row
   • Rows can be asymmetric with an explicit template:
       <div class="row" style="--tpl:1.4fr 1fr"> … </div>

   SURFACE SIZES (same molecules, two grounds)
   ───────────────────────────────────────────
       .surface.surface--ls   1280×720   (16:9 — slides / digital)
       .surface.surface--pt    794×1123  (A4 portrait — print)
   The molecules below are size-agnostic; only the frame differs, so the
   SAME kit drives both orientations.

   THEMING
   ───────
   Light + dark "paper" are equal citizens. Set the ground on any
   ancestor:   <body data-paper="light">  …  <body data-paper="dark">
   Every molecule reads the scoped --pg-* tokens, so a single attribute
   flips the whole document.

   MOLECULES  (each maps to one or more MakeIt content UNITS)
   ──────────
     .m-eyebrow      eyebrow            short title-case category label (= Sage Subtitle)
     .m-display      heading (display)  hero / cover headline
     .m-h1 .m-h2 .m-h3   heading 1-3    section + block headings
     .m-h4           heading 4          bold inline lead-in (not a divider)
     .m-lede         body (intro)       large standfirst paragraph
     .m-prose        body               paragraph block; .cols-2 / .cols-3
     .m-bullets      bullet-group       checkmark list
     .m-feature      heading+body+icon  icon capability cell
     .m-stat         stat               number + label; .is-card / .is-toprule
     .m-quote        quote              voice-of-customer pull quote
     .m-image        image              photo slot; .is-bleed, __tag, __caption
     .m-caption      caption            fine print / sourcing under media
     .m-legal        caption (legal)    disclaimer, pinned to surface foot
     .m-cta          cta                Sage pill; .is-secondary
     .m-callout      —                  tonal aside; .is-cream / .is-surface
     .m-rule         —                  hairline divider
   ═══════════════════════════════════════════════════════════════════ */

/* ── Paper tokens — LIGHT (default) ──────────────────────────────── */
.surface {
  --pg-bg:        #FFFFFF;
  --pg-fg:        rgba(0,25,38,0.92);
  --pg-fg-2:      rgba(0,25,38,0.70);
  --pg-fg-3:      rgba(0,25,38,0.55);
  --pg-fg-4:      rgba(0,25,38,0.35);
  --pg-border:    rgba(0,25,38,0.10);
  --pg-border-s:  rgba(0,25,38,0.16);
  --pg-surface:   #F3F8F6;
  --pg-mint:      #D1FDE0;
  --pg-cream:     #F8F4EC;
  --pg-rule:      rgba(0,25,38,0.14);
  --pg-brand:     #008146;   /* WCAG jade on light */
  --pg-brand-deep:#006738;
  --pg-on-brand:  #FFFFFF;

  /* frame geometry — overridable per surface size */
  --pad-x: 64px;
  --pad-y: 56px;
  --gap:   24px;
}

/* ── Paper tokens — DARK ──────────────────────────────────────────── */
[data-paper="dark"] .surface {
  --pg-bg:        #0A0A0A;
  --pg-fg:        rgba(255,255,255,0.95);
  --pg-fg-2:      rgba(255,255,255,0.78);
  --pg-fg-3:      rgba(255,255,255,0.55);
  --pg-fg-4:      rgba(255,255,255,0.32);
  --pg-border:    rgba(255,255,255,0.10);
  --pg-border-s:  rgba(255,255,255,0.18);
  --pg-surface:   #1B1B1B;
  --pg-mint:      rgba(0,214,57,0.12);
  --pg-cream:     #1F1B14;
  --pg-rule:      rgba(255,255,255,0.16);
  --pg-brand:     #00D639;   /* brilliant green on dark */
  --pg-brand-deep:#00D639;
  --pg-on-brand:  #000000;
}

/* ─────────────────────────────────────────────────────────────────
   SURFACE FRAME
   ───────────────────────────────────────────────────────────────── */
.surface {
  position: relative;
  background: var(--pg-bg);
  color: var(--pg-fg);
  font-family: var(--font-ui);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.surface--ls { width: 1280px; height: 720px; --pad-x: 64px; --pad-y: 56px; }
.surface--pt { width: 794px;  height: 1123px; --pad-x: 56px; --pad-y: 48px; }

/* Running chrome */
.surface__chrome-top,
.surface__chrome-bot {
  position: absolute; left: var(--pad-x); right: var(--pad-x); height: 24px;
  display: flex; align-items: center;
  font-family: var(--font-ui); font-size: 10px; color: var(--pg-fg-3);
  letter-spacing: normal; text-transform: none;
}
.surface__chrome-top { top: calc(var(--pad-y) - 16px); border-bottom: 1px solid var(--pg-rule); z-index: 2; }
.surface__chrome-bot { bottom: calc(var(--pad-y) - 16px); border-top: 1px solid var(--pg-rule); justify-content: space-between; z-index: 2; }
/* Page-colour layer behind each chrome band that BLEEDS to the surface
   edge (top band to the top edge, bottom band to the bottom edge). This
   keeps header + pagination readable over any bleed image behind them,
   yet is invisible on a plain surface (it is the page colour). */
.surface__chrome-top::before, .surface__chrome-bot::before {
  content: ""; position: absolute; z-index: -1;
  left: calc(-1 * var(--pad-x)); right: calc(-1 * var(--pad-x));
  background: var(--pg-bg);
}
.surface__chrome-top::before { top: calc(-1 * (var(--pad-y) - 16px)); bottom: 0; }
.surface__chrome-bot::before { bottom: calc(-1 * (var(--pad-y) - 16px)); top: 0; }
.surface__chrome-top .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pg-brand); margin-right: 8px; }
.surface__chrome-bot .pg {
  font-family: 'SF Mono', ui-monospace, Menlo, monospace;
  font-size: 10px; color: var(--pg-fg-2); letter-spacing: 0; text-transform: none;
}

/* Inset content area (between chrome) */
.surface__body {
  position: absolute;
  top: calc(var(--pad-y) + 32px); bottom: calc(var(--pad-y) + 32px);
  left: var(--pad-x); right: var(--pad-x);
  display: flex; flex-direction: column; gap: var(--gap);
  min-height: 0; z-index: 1;
}
/* Edge-to-edge body (covers / closings with no chrome) */
.surface__body.is-bleed { top: 0; bottom: 0; left: 0; right: 0; gap: 0; }

/* ── Optional bleed image ────────────────────────────────────
   A user-set image that fills a side band and BLEEDS ~20% off the top
   and ~20% off the bottom of the surface (height 140%, offset -20%).
   The user fills it like any image — click / drop onto the <image-slot>.
   Entirely optional: omit it and the surface is unchanged.

   Add `.media-right` (or `.media-left`) to the .surface, then drop
   `<div class="surface__media right"><image-slot …/></div>` as the
   first child. The body auto-reserves the band so text never collides;
   the chrome layers above keep header + footer readable over the bleed. */
.surface__media { position: absolute; top: -20%; height: 140%; overflow: hidden; z-index: 0; }
.surface__media.right { right: 0; }
.surface__media.left  { left: 0; }
.surface__media > image-slot,
.surface__media > img { width: 100%; height: 100%; display: block; object-fit: cover; }
.surface.media-right { --media-w: 34%; }
.surface.media-left  { --media-w: 34%; }
.surface.media-right .surface__media { width: var(--media-w); }
.surface.media-left  .surface__media { width: var(--media-w); }
.surface.media-right .surface__body { right: calc(var(--media-w) + var(--gap)); }
.surface.media-left  .surface__body { left: calc(var(--media-w) + var(--gap)); }

/* Section header block that introduces a row stack */
.surface__head { display: flex; flex-direction: column; gap: 12px; }
.surface__head.row-between { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 24px; }

/* ─────────────────────────────────────────────────────────────────
   ROW / SLOT GRID  — 1 to 4 columns
   ───────────────────────────────────────────────────────────────── */
.row {
  display: grid;
  gap: var(--gap);
  grid-template-columns: var(--tpl, repeat(var(--cols, 1), minmax(0, 1fr)));
  min-height: 0;
}
.row.cols-1 { --cols: 1; }
.row.cols-2 { --cols: 2; }
.row.cols-3 { --cols: 3; }
.row.cols-4 { --cols: 4; }
.row.grow   { flex: 1; }                 /* fill remaining surface height */
.row.align-center { align-items: center; }
.row.align-start  { align-items: start; }

.slot { min-width: 0; display: flex; flex-direction: column; }
.slot.span-2 { grid-column: span 2; }
.slot.span-3 { grid-column: span 3; }
.slot.span-4 { grid-column: span 4; }
.slot.rspan-2 { grid-row: span 2; }
.slot.center { justify-content: center; }
.slot.between { justify-content: space-between; }
.slot.end { justify-content: flex-end; }

/* A full-bleed tonal band (cover panel, closing CTA strip) */
.band {
  display: flex; flex-direction: column;
  padding: var(--pad-y) var(--pad-x);
}
.band.is-mint  { background: var(--pg-mint); }
.band.is-brand { background: var(--pg-brand); color: var(--pg-on-brand); }
.band.is-surface { background: var(--pg-surface); }

/* ═════════════════════════════════════════════════════════════════
   MOLECULES
   ═════════════════════════════════════════════════════════════════ */

/* ── eyebrow ─────────────────────────────────────────────────────── */
.m-eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-text); font-weight: 500;
  font-size: 13px; letter-spacing: normal; text-transform: none;
  color: var(--pg-brand);
}
.m-eyebrow::before { display: none; }
.m-eyebrow.is-plain::before { display: none; }

/* ── headings ────────────────────────────────────────────────────── */
.m-display {
  font-family: var(--font-headline); font-weight: 900;
  font-size: clamp(40px, 4.4vw, 56px); line-height: 0.96;
  letter-spacing: 0; color: var(--pg-fg); margin: 0; text-wrap: balance;
}
.m-display .accent { color: var(--pg-brand); }
.m-h1 {
  font-family: var(--font-headline); font-weight: 900;
  font-size: 34px; line-height: 1.04; letter-spacing: 0;
  color: var(--pg-fg); margin: 0; text-wrap: balance;
}
.m-h1 .accent { color: var(--pg-brand); }
.m-h2 {
  font-family: var(--font-headline); font-weight: 900;
  font-size: 26px; line-height: 1.1; letter-spacing: 0;
  color: var(--pg-fg); margin: 0; text-wrap: balance;
}
.m-h3 {
  font-family: var(--font-ui); font-weight: 500;
  font-size: 18px; line-height: 1.25; color: var(--pg-fg); margin: 0;
}
/* h4 = bold inline lead-in, sits at the head of a paragraph */
.m-h4 {
  font-family: var(--font-ui); font-weight: 700;
  font-size: 13.5px; color: var(--pg-fg);
}

/* ── body / prose ────────────────────────────────────────────────── */
.m-lede {
  font-family: var(--font-text); font-weight: 400;
  font-size: 16px; line-height: 1.5; color: var(--pg-fg-2);
  margin: 0; text-wrap: pretty;
}
.m-prose {
  font-family: var(--font-text); font-weight: 400;
  font-size: 13px; line-height: 1.62; color: var(--pg-fg-2); text-wrap: pretty;
}
.m-prose p { margin: 0 0 11px; }
.m-prose p:last-child { margin-bottom: 0; }
.m-prose strong { color: var(--pg-fg); font-family: var(--font-ui); font-weight: 600; }
.m-prose a { color: var(--pg-brand-deep); text-decoration: underline; text-underline-offset: 3px; }
/* multi-column flow — for long verbatim body that must fill a wide slot */
.m-prose.cols-2 { column-count: 2; column-gap: 32px; }
.m-prose.cols-3 { column-count: 3; column-gap: 26px; }
.m-prose.cols-2.ruled,
.m-prose.cols-3.ruled { column-rule: 1px solid var(--pg-rule); }
.m-prose.cols-2 p, .m-prose.cols-3 p { break-inside: avoid; }

/* single paragraph shorthand */
.m-body {
  font-family: var(--font-text); font-weight: 400;
  font-size: 13px; line-height: 1.62; color: var(--pg-fg-2);
  margin: 0; text-wrap: pretty;
}
.m-body strong { color: var(--pg-fg); font-family: var(--font-ui); font-weight: 600; }

/* ── bullets ─────────────────────────────────────────────────────── */
.m-bullets { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.m-bullets li {
  position: relative; padding-left: 24px;
  font-family: var(--font-text); font-size: 13px; line-height: 1.5; color: var(--pg-fg-2);
}
.m-bullets li::before {
  content: ""; position: absolute; left: 2px; top: 4px;
  width: 11px; height: 7px;
  border-left: 1.6px solid var(--pg-brand-deep);
  border-bottom: 1.6px solid var(--pg-brand-deep);
  transform: rotate(-45deg);
}
.m-bullets li strong { color: var(--pg-fg); font-family: var(--font-ui); font-weight: 600; }

/* ── feature (icon + title + body) ───────────────────────────────── */
.m-feature { display: flex; flex-direction: column; gap: 9px; }
.m-feature.is-card {
  background: var(--pg-surface); border: 1px solid var(--pg-border);
  border-radius: 12px; padding: 20px; height: 100%;
}
.m-feature__icon {
  width: 38px; height: 38px; border-radius: 9px;
  background: var(--pg-mint); color: var(--pg-brand-deep);
  display: grid; place-items: center; margin-bottom: 2px;
}
.m-feature__icon svg { width: 20px; height: 20px; display: block; }
.m-feature__icon.is-numeral {
  font-family: var(--font-headline); font-weight: 900; font-size: 16px;
}
.m-feature__title { font-family: var(--font-ui); font-weight: 700; font-size: 14px; color: var(--pg-fg); }
.m-feature__body { font-family: var(--font-text); font-size: 12px; line-height: 1.55; color: var(--pg-fg-2); margin: 0; }
/* optional bleed media strip pinned to the card foot (≈10–20% of card height).
   Drop as the LAST child of a .m-feature.is-card; margin-top:auto floats it
   down, the negative margins bleed it past the 20px card padding to all three
   edges, and the card's overflow:hidden clips it to the bottom radius. */
.m-feature.is-card { overflow: hidden; }
.m-feature__media {
  margin: auto -20px -20px -20px; flex: none;
  height: 84px; min-height: 84px; position: relative; overflow: hidden;
  border-top: 1px solid var(--pg-border);
  background:
    repeating-linear-gradient(45deg,
      rgba(0,25,38,0.04) 0, rgba(0,25,38,0.04) 8px,
      rgba(0,25,38,0.07) 8px, rgba(0,25,38,0.07) 16px),
    var(--pg-surface);
}
[data-paper="dark"] .m-feature__media {
  background:
    repeating-linear-gradient(45deg,
      rgba(255,255,255,0.04) 0, rgba(255,255,255,0.04) 8px,
      rgba(255,255,255,0.07) 8px, rgba(255,255,255,0.07) 16px),
    var(--pg-surface);
}
.m-feature__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.m-feature__media .m-image__tag { position: absolute; left: 8px; bottom: 8px; font-size: 9px; padding: 3px 6px; }

/* ── stat ────────────────────────────────────────────────────────── */
.m-stat { display: flex; flex-direction: column; gap: 6px; }
.m-stat__num {
  font-family: var(--font-headline); font-weight: 900;
  font-size: 40px; line-height: 0.95; letter-spacing: 0; color: var(--pg-brand-deep);
}
.m-stat__lbl { font-family: var(--font-text); font-size: 12px; line-height: 1.4; color: var(--pg-fg-2); }
.m-stat.is-card {
  background: var(--pg-surface); border: 1px solid var(--pg-border);
  border-radius: 12px; padding: 20px 22px; height: 100%; justify-content: center;
}
.m-stat.is-toprule { border-top: 2px solid var(--pg-brand); padding-top: 14px; }
.m-stat.is-toprule .m-stat__num { font-size: 36px; }

/* ── quote ───────────────────────────────────────────────────────── */
.m-quote {
  font-family: var(--font-headline); font-weight: 500;
  font-size: 32px; line-height: 1.12; letter-spacing: 0;
  color: var(--pg-fg); margin: 0; text-wrap: balance;
}
.m-quote::before { content: "\201C"; color: var(--pg-brand); }
.m-quote::after  { content: "\201D"; color: var(--pg-brand); }
.m-quote__attrib {
  margin-top: 22px; font-family: var(--font-text); font-size: 13px;
  color: var(--pg-fg-3); line-height: 1.5;
}
.m-quote__attrib strong {
  display: block; color: var(--pg-fg);
  font-family: var(--font-ui); font-weight: 600; margin-bottom: 2px; font-size: 14px;
}

/* ── image ───────────────────────────────────────────────────────── */
.m-image {
  position: relative; border-radius: 12px; border: 1px solid var(--pg-border);
  background:
    repeating-linear-gradient(45deg,
      rgba(0,25,38,0.04) 0, rgba(0,25,38,0.04) 10px,
      rgba(0,25,38,0.07) 10px, rgba(0,25,38,0.07) 20px),
    var(--pg-surface);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 16px; overflow: hidden; min-height: 120px; flex: 1;
}
[data-paper="dark"] .m-image {
  background:
    repeating-linear-gradient(45deg,
      rgba(255,255,255,0.04) 0, rgba(255,255,255,0.04) 10px,
      rgba(255,255,255,0.07) 10px, rgba(255,255,255,0.07) 20px),
    var(--pg-surface);
}
.m-image.is-bleed { border-radius: 0; border: 0; }
.m-image__tag {
  align-self: flex-start;
  font-family: 'SF Mono', ui-monospace, Menlo, monospace; font-size: 11px; color: var(--pg-fg-3);
  padding: 5px 9px; border-radius: 4px; background: var(--pg-bg); border: 1px solid var(--pg-border);
}

/* ── caption ─────────────────────────────────────────────────────── */
.m-caption { font-family: var(--font-text); font-size: 11px; line-height: 1.45; color: var(--pg-fg-3); }

/* ── legal / disclaimer (pin to bottom of a slot or surface) ─────── */
.m-legal { font-family: var(--font-text); font-size: 9px; line-height: 1.55; color: var(--pg-fg-3); margin: 0; }
.m-legal.pin { margin-top: auto; padding-top: 12px; }

/* ── cta (Sage pill) ─────────────────────────────────────────────── */
.m-cta {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  padding: 12px 22px; border-radius: 999px;
  background: var(--pg-brand); color: var(--pg-on-brand);
  font-family: var(--font-ui); font-weight: 500; font-size: 13px; letter-spacing: 0.01em;
  text-decoration: none; border: 0;
}
.m-cta.is-secondary { background: transparent; color: var(--pg-fg); border: 1px solid var(--pg-border-s); }
.m-cta::after { content: "→"; }
.m-cta.no-arrow::after { content: ""; }

/* ── callout / aside ─ de-greened: subtle surface + soft corner glow ── */
.m-callout {
  position: relative; overflow: hidden; isolation: isolate;
  background: color-mix(in srgb, var(--pg-fg) 4%, transparent);
  border: 1px solid var(--pg-border); border-radius: 16px; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.m-callout::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  top: -34%; right: -10%; width: 44%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, hsl(var(--glow-h, 205) 88% 62% / 0.20), transparent 70%);
  filter: blur(20px);
}
.m-callout > * { position: relative; z-index: 1; }
.m-callout.is-cream, .m-callout.is-surface { background: color-mix(in srgb, var(--pg-fg) 5%, transparent); }

/* ── corner-glow utility ─ hue via --glow-h (sage 150 · azure 205 · violet 265 · amber 32) ── */
.fx-cornerglow { position: relative; overflow: hidden; isolation: isolate; }
.fx-cornerglow::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  top: -28%; right: -12%; width: 46%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, hsl(var(--glow-h, 150) 88% 62% / 0.18), transparent 70%);
  filter: blur(22px);
}
.fx-cornerglow > * { position: relative; z-index: 1; }

/* ── rule ────────────────────────────────────────────────────────── */
.m-rule { height: 1px; background: var(--pg-rule); border: 0; margin: 0; }

/* ── photo tile — image-led card; companion molecule to infographic cards ── */
.photo-tile { position: relative; overflow: hidden; border-radius: 18px;
  border: 1px solid var(--pg-border); background: color-mix(in srgb, var(--pg-fg) 4%, transparent);
  min-height: 200px; isolation: isolate; }
.photo-tile > img, .photo-tile > image-slot {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile__cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 16px 18px; font-family: var(--font-ui); font-weight: 600; font-size: 14px; color: #fff;
  -webkit-backdrop-filter: blur(16px) saturate(1.15); backdrop-filter: blur(16px) saturate(1.15);
  background: linear-gradient(180deg, rgba(8,10,12,0.30) 0%, rgba(8,10,12,0.58) 100%);
  border-top: 1px solid rgba(255,255,255,0.10);
  border-bottom-left-radius: 17px; border-bottom-right-radius: 17px; }
.photo-tile__cap small { display: block; font-weight: 500; font-size: 12px; opacity: 0.8; margin-top: 2px; }

/* ── brand wordmark (cover / closing lockup) ─────────────────────── */
.m-wordmark {
  font-family: var(--font-headline); font-weight: 900; letter-spacing: 0;
  color: var(--pg-fg); display: inline-flex; align-items: baseline; gap: 9px;
}
.m-wordmark .pip { width: 9px; height: 9px; border-radius: 50%; background: var(--pg-brand); align-self: center; }
.m-wordmark .sub { font-family: var(--font-ui); font-weight: 600; letter-spacing: 0; color: var(--pg-fg-3); }

/* ═══════════════════════════════════════════════════════════════════
   Forma — Web-Doc Module  (fusion/web-doc.css)
   ───────────────────────────────────────────────────────────────────
   Turns the landscape SURFACE kit into a WEB-NATIVE document: a thing
   that scrolls and behaves like a webpage, not a paginated PDF — yet
   every section stays a self-contained frame that can be snapped to
   16:9 for slide export later.

   Pairs with: fusion/tokens.css  +  fusion/landscape-layouts.css
   Behaviour:  web-doc.js (reveals, chart animate-in, scroll-spy, glow)

   ─────────────────────────────────────────────────────────────────
   STRUCTURE
   ─────────────────────────────────────────────────────────────────
     .webdoc                  the document root (sets the ground)
       .doc-rail              sticky scroll-spy nav (toggleable off)
       .doc-canvas            the scroll column
         .doc-section         ONE section — content-sized flex frame
           .doc-well          centred content measure (max-width)
           .doc-glow          optional scroll-reactive glow layer

   SECTION SIZING — "a flexbox that changes to suit the content"
     A .doc-section is `display:flex; flex-direction:column` and grows
     to fit its content (min-height: a comfortable floor, NOT a forced
     16:9). No wasted letterbox space on the web.
       .doc-section.is-hero      taller floor, centred (cover)
       .doc-section.is-divider   section break (inverts in light theme)
       .doc-section.is-moment    a key stat / quote beat (carries glow)
     SLIDE EXPORT: add `data-frame="slide"` to .webdoc (or a section)
     and every section locks to 1280×720 — one section = one slide.

   GLOW POLICY (your caveat: not every page)
     Glow only renders inside .is-hero, .is-divider, .is-moment — or any
     section you tag `.has-glow`. It is scroll-reactive (drifts + breathes
     as the section moves through the viewport) and built on transparency.

   THEME
     <div class="webdoc" data-paper="light|dark">. In LIGHT, body sits on
     paper but hero/divider/moment sections invert to a black ground with
     display type — dynamic, while preserving the reader's paper preference
     for long-form body. In DARK, the whole doc is dark.
   ═══════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────
   ROOT + GROUND
   ───────────────────────────────────────────────────────────────── */
.webdoc {
  /* inherits the paper tokens from landscape-layouts.css via .surface-less
     usage; we restate the ones the doc needs so .webdoc works standalone. */
  --pg-bg:        #FFFFFF;
  --pg-fg:        rgba(0,25,38,0.92);
  --pg-fg-2:      rgba(0,25,38,0.70);
  --pg-fg-3:      rgba(0,25,38,0.55);
  --pg-fg-4:      rgba(0,25,38,0.35);
  --pg-border:    rgba(0,25,38,0.10);
  --pg-border-s:  rgba(0,25,38,0.16);
  --pg-surface:   #F3F8F6;
  --pg-mint:      #D1FDE0;
  --pg-cream:     #F8F4EC;
  --pg-rule:      rgba(0,25,38,0.14);
  --pg-brand:     #008146;
  --pg-brand-deep:#006738;
  --pg-on-brand:  #FFFFFF;

  /* glow palette — greens carry, blue + amber sparse (transparency-first) */
  --glow-1: 0,214,57;     /* brilliant jade  */
  --glow-2: 68,237,144;   /* jade 80         */
  --glow-3: 29,140,195;   /* navy 60         */
  --glow-4: 245,206,85;   /* amber 80        */

  --rail-w: 248px;
  --well:   1000px;       /* content measure cap */
  --lf-words: 9;          /* long-form: target words per column line (8–10) */
  --lf-size:  15px;       /* long-form: body size */
  --sec-pad-y: clamp(64px, 8vh, 120px);
  --sec-pad-x: clamp(24px, 5vw, 88px);

  position: relative;
  background: var(--pg-bg);
  color: var(--pg-fg);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
}
.webdoc[data-paper="dark"] {
  --pg-bg:        #070807;
  --pg-fg:        rgba(255,255,255,0.95);
  --pg-fg-2:      rgba(255,255,255,0.78);
  --pg-fg-3:      rgba(255,255,255,0.55);
  --pg-fg-4:      rgba(255,255,255,0.32);
  --pg-border:    rgba(255,255,255,0.10);
  --pg-border-s:  rgba(255,255,255,0.18);
  --pg-surface:   #141514;
  --pg-mint:      rgba(0,214,57,0.12);
  --pg-cream:     #1F1B14;
  --pg-rule:      rgba(255,255,255,0.16);
  --pg-brand:     #00D639;
  --pg-brand-deep:#00D639;
  --pg-on-brand:  #000000;
}

/* the doc lays out as [rail | canvas] */
.webdoc { display: grid; grid-template-columns: var(--rail-w) minmax(0,1fr); }
.webdoc.rail-off,
.webdoc[data-rail="off"] { grid-template-columns: minmax(0,1fr); }
.webdoc.rail-off .doc-rail,
.webdoc[data-rail="off"] .doc-rail { display: none; }

/* ─────────────────────────────────────────────────────────────────
   SCROLL-SPY NAV RAIL
   ───────────────────────────────────────────────────────────────── */
.doc-rail {
  /* Always dark for framing — even on light paper. Restate dark tokens
     locally so the rail's brand + nav rows read light-on-dark in both themes. */
  --pg-bg:        #070807;
  --pg-fg:        rgba(255,255,255,0.95);
  --pg-fg-2:      rgba(255,255,255,0.78);
  --pg-fg-3:      rgba(255,255,255,0.55);
  --pg-fg-4:      rgba(255,255,255,0.32);
  --pg-border:    rgba(255,255,255,0.10);
  --pg-border-s:  rgba(255,255,255,0.18);
  --pg-brand:     #00D639;
  position: sticky; top: 0; align-self: start;
  height: 100vh; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 4px;
  padding: 32px 20px; overflow-y: auto;
  border-right: 1px solid var(--pg-border);
  background: color-mix(in srgb, #070807 88%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  z-index: 20;
}
.doc-rail__brand {
  display: inline-flex; align-items: baseline; gap: 9px; margin-bottom: 22px;
  font-family: var(--font-headline); font-weight: 900; font-size: 19px;
  letter-spacing: 0; color: var(--pg-fg); text-decoration: none;
}
.doc-rail__brand .pip { width: 9px; height: 9px; border-radius: 50%; background: var(--pg-brand); align-self: center; }
.doc-rail__brand small { font-family: var(--font-ui); font-weight: 500; font-size: 11px; color: var(--pg-fg-3); }
.doc-rail__eyebrow {
  font-family: var(--font-ui); font-weight: 700; font-size: 10px;
  letter-spacing: normal; text-transform: none; color: var(--pg-fg-4);
  padding: 0 10px; margin: 14px 0 6px;
}
.doc-rail__list { display: flex; flex-direction: column; gap: 4px; }
.doc-rail__select { display: none; }
.navrow {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 11px; text-decoration: none;
  font-family: var(--font-ui); font-size: 13px; color: var(--pg-fg-3);
  border: 0; background: transparent; cursor: pointer; text-align: left;
  transition: background .14s var(--ease-out), color .14s var(--ease-out), transform .12s var(--ease-out);
}
.navrow .navrow__dot {
  width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.05);
  flex: none; transition: background .2s var(--ease-out), transform .2s var(--ease-out);
}
.navrow:hover { color: var(--pg-fg); transform: translateX(2px); }
/* Active chapter. [aria-current="location"] is the source of truth (set by
   web-doc.js); .is-active is kept as an alias so any existing markup or
   styling hook keeps working. Both selectors, one appearance — the visible
   state and the announced state cannot drift apart. */
.navrow.is-active,
.navrow[aria-current] { color: var(--pg-fg); background: color-mix(in srgb, var(--pg-brand) 12%, transparent); }
.navrow.is-active .navrow__dot,
.navrow[aria-current] .navrow__dot { background: var(--pg-brand); transform: scale(1.5); }
/* Publication metadata, not decorative chrome. Was --pg-fg-4 (32% white)
   at 11px = 2.76:1, with a further opacity:.65 on the document number —
   ~21% white, 1.79:1. Now 12px at --pg-fg-3 (55%) with no nested opacity,
   which measures 6.26:1 on the #070807 rail. (Dru's review, 2026-09-22.) */
.doc-rail__foot { margin-top: auto; padding: 12px 10px 0; font-family: var(--font-text); font-size: 12px; color: var(--pg-fg-3); line-height: 1.55; }
.doc-rail__ref { color: var(--pg-fg-3); }

/* progress bar at the top of the canvas */
.doc-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0; z-index: 40;
  background: linear-gradient(90deg, rgba(var(--glow-3),1), rgba(var(--glow-1),1), rgba(var(--glow-2),1)); }

/* hamburger (mobile) */
.doc-rail__toggle { display: none; }

/* ─────────────────────────────────────────────────────────────────
   CANVAS + SECTIONS  (content-sized flex frames)
   ───────────────────────────────────────────────────────────────── */
.doc-canvas { min-width: 0; }

.doc-section {
  position: relative;
  display: flex; flex-direction: column; justify-content: center;
  box-sizing: border-box;
  min-height: 62vh;                 /* a comfortable floor — content can exceed */
  padding: var(--sec-pad-y) var(--sec-pad-x);
  overflow: clip;
  scroll-margin-top: 12px;
}
.doc-section + .doc-section { border-top: 1px solid var(--pg-rule); }
.doc-section.is-hero    { min-height: 92vh; }
.doc-section.is-divider { min-height: 70vh; }
.doc-section.is-flush   { padding-left: 0; padding-right: 0; }      /* full-bleed media */
.doc-section.is-tight   { min-height: 0; }                          /* let content fully drive */

/* centred content well — keeps measure readable; opt out with .is-wide */
.doc-well { width: 100%; max-width: var(--well); margin: 0 auto; position: relative; z-index: 1; }
.doc-well.is-wide { max-width: 1200px; }
.doc-well.is-narrow { max-width: 760px; }

/* ── Light-theme INVERSION: hero / divider / moment go to black ground ──
   Restate dark tokens locally so the section is dark even on light paper. */
.webdoc:not([data-paper="dark"]) .doc-section.is-hero,
.webdoc:not([data-paper="dark"]) .doc-section.is-divider,
.webdoc:not([data-paper="dark"]) .doc-section.is-moment,
.doc-section.is-invert {
  --pg-bg:        #070807;
  --pg-fg:        rgba(255,255,255,0.95);
  --pg-fg-2:      rgba(255,255,255,0.78);
  --pg-fg-3:      rgba(255,255,255,0.55);
  --pg-fg-4:      rgba(255,255,255,0.32);
  --pg-border:    rgba(255,255,255,0.10);
  --pg-border-s:  rgba(255,255,255,0.18);
  --pg-surface:   #141514;
  --pg-mint:      rgba(0,214,57,0.12);
  --pg-rule:      rgba(255,255,255,0.16);
  --pg-brand:     #00D639;
  --pg-brand-deep:#00D639;
  --pg-on-brand:  #000000;
  background: var(--pg-bg);
  color: var(--pg-fg);
}
/* a hard divider colour change reads as a deliberate break, not a seam */
.doc-section.is-invert + .doc-section:not(.is-invert),
.webdoc:not([data-paper="dark"]) .doc-section.is-divider { border-top: 0; }

/* ─────────────────────────────────────────────────────────────────
   SCROLL-REACTIVE GLOW  (only where glow is allowed)
   web-doc.js sets --gp (0→1 progress through viewport) and --gi (intensity)
   ───────────────────────────────────────────────────────────────── */
.doc-glow { display: none; }
.doc-section.is-hero .doc-glow,
.doc-section.is-divider .doc-glow,
.doc-section.is-moment .doc-glow,
.doc-section.has-glow .doc-glow {
  display: block; position: absolute; inset: -10% -5%; z-index: 0;
  pointer-events: none; overflow: hidden;
  --gp: 0.5; --gi: 1;
}
.doc-glow::before, .doc-glow::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(60px); opacity: calc(0.55 * var(--gi));
  transition: opacity .4s linear;
  mix-blend-mode: screen;
}
/* primary jade bloom — enters from the right, drifts with scroll */
.doc-glow::before {
  width: 60%; height: 120%;
  right: calc(-8% + (1 - var(--gp)) * 18%);
  top: calc(-10% + var(--gp) * 22%);
  background: radial-gradient(closest-side,
    rgba(var(--glow-1), 0.50), rgba(var(--glow-2), 0.22) 55%, transparent 72%);
}
/* secondary navy bloom — enters from the left, counter-drifts */
.doc-glow::after {
  width: 46%; height: 90%;
  left: calc(-10% + var(--gp) * 16%);
  bottom: calc(-12% + (1 - var(--gp)) * 20%);
  background: radial-gradient(closest-side,
    rgba(var(--glow-3), 0.34), rgba(var(--glow-4), 0.10) 60%, transparent 75%);
}
/* a faint grain/scanline keeps the bloom from banding (transparency cue) */
.doc-glow__veil { position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 70% 0%, transparent 40%, rgba(0,0,0,0.20) 100%); }
.webdoc:not([data-paper="dark"]) .doc-section.is-moment .doc-glow__veil { opacity: 0.5; }

@media (prefers-reduced-motion: reduce) {
  .doc-glow::before, .doc-glow::after { transition: none; }
}

/* ─────────────────────────────────────────────────────────────────
   TYPE accents for the doc (build on landscape m-* molecules)
   ───────────────────────────────────────────────────────────────── */
.doc-kicker {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-text); font-weight: 500; font-size: 13px;
  letter-spacing: normal; text-transform: none; color: var(--pg-brand);
}
.doc-kicker::before { display: none; }
.doc-display {
  font-family: var(--font-headline); font-weight: 900;
  font-size: clamp(28px, 3.4vw, 48px); line-height: 1.02; letter-spacing: 0;
  color: var(--pg-fg); margin: 0; text-wrap: balance;
}
.doc-display .accent { color: var(--pg-brand); }
.doc-display.is-strong { font-weight: 900; }
.doc-h2 {
  font-family: var(--font-text); font-weight: 500;
  font-size: clamp(20px, 2.2vw, 28px); line-height: 1.14; letter-spacing: 0;
  color: var(--pg-fg); margin: 0; text-wrap: balance;
}
.doc-lede {
  font-family: var(--font-text); font-weight: 400;
  font-size: clamp(16px, 1.5vw, 21px); line-height: 1.5; color: var(--pg-fg-2);
  margin: 0; text-wrap: pretty; max-width: 60ch;
}
.doc-body {
  font-family: var(--font-text); font-weight: 400;
  font-size: 15px; line-height: 1.68; color: var(--pg-fg-2); text-wrap: pretty; max-width: 72ch;
}
.doc-body p { margin: 0 0 14px; }
.doc-body p:last-child { margin-bottom: 0; }
.doc-body strong { color: var(--pg-fg); font-family: var(--font-ui); font-weight: 600; }
.doc-body.cols-2 { column-count: 2; column-gap: 40px; max-width: none; }
.doc-body.cols-2 p { break-inside: avoid; -webkit-column-break-inside: avoid; }
@media (max-width: 760px) {
  .doc-body.cols-2 { column-count: 1; }
  /* A single-column container still honours `break-before: column`, so the
     inline breaks on the exec "defining question" and "strongest adoption
     patterns" pages (2026-09-21) opened a phantom second column off the
     right edge — 355px of overflow at 375px. Nothing to break TO when
     there is one column, so cancel it. (Dru's review, 2026-09-22.) */
  .doc-body.cols-2 > * { break-before: auto !important; }
  /* drop tall vh floors so short sections don't leave big empty gaps */
  .doc-section, .doc-section.is-divider { min-height: 0; }
  .doc-section.is-hero { min-height: 78vh; }
  /* keep long single-word display headings from overflowing */
  .doc-display { font-size: clamp(25px, 7.4vw, 38px); overflow-wrap: break-word; }
  /* collapse every multi-column row to a single column on phones */
  .row { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  /* keep tables inside the viewport */
  .ig-table { font-size: 12px; }
  .ig-table th, .ig-table td { padding: 9px 10px; overflow-wrap: anywhere; }
  .ig-table td[style*="width:200px"] { width: 88px !important; overflow-wrap: normal; }
}

/* ── Long-form content ──────────────────────────────────────────────
   How Forma sets long passages. Text flows newspaper-style into columns
   of a FIXED narrow measure (~8–10 words, --lf-words). A wider viewport
   yields MORE columns — never wider lines — so body copy never spans the
   viewport as one long line. column-width does the work; the browser fits
   as many columns as the measure allows.
     .doc-longform.is-ruled    hairline rule between columns
     .doc-longform.has-dropcap drop-cap on the first paragraph
   Tweakable live via --lf-words / --lf-size on the .webdoc root. */
.doc-longform {
  /* measure ≈ words × per-word advance. Cap the BLOCK to the measure so a
     lone column can't stretch wide; widen at breakpoints to add columns. */
  --lf-measure: calc(var(--lf-words, 9) * 2.4em);
  font-family: var(--font-text); font-weight: 400;
  font-size: var(--lf-size, 15px); line-height: 1.72;
  color: var(--pg-fg-2); text-wrap: pretty;
  column-width: var(--lf-measure);
  column-gap: clamp(30px, 4vw, 56px);
  max-width: var(--lf-measure);
  orphans: 2; widows: 2;
}
@media (min-width: 1080px) { .doc-longform { max-width: calc(var(--lf-measure) * 2 + 56px); } }
@media (min-width: 1540px) { .doc-longform { max-width: calc(var(--lf-measure) * 3 + 112px); } }
.doc-longform.is-ruled { column-rule: 1px solid var(--pg-rule); }
.doc-longform p { margin: 0 0 1.05em; break-inside: avoid-column; }
.doc-longform p:first-child { margin-top: 0; }
.doc-longform p:last-child { margin-bottom: 0; }
.doc-longform strong { color: var(--pg-fg); font-family: var(--font-ui); font-weight: 600; }
.doc-longform a { color: var(--pg-brand-deep); text-decoration: underline; text-underline-offset: 3px; }
.doc-longform.has-dropcap > p:first-child::first-letter {
  font-family: var(--font-headline); font-weight: 900; float: left;
  font-size: 3.1em; line-height: 0.78; padding: 6px 12px 0 0; color: var(--pg-brand);
}
/* Headings are EXCLUDED from the narrow-column measure — a readability
   rule: headings read wider than body lines, so any heading inside a
   long-form block spans ALL columns instead of being trapped in one. */
.doc-longform :is(h2, h3, h4, .lf-head) {
  -webkit-column-span: all; column-span: all;
  font-family: var(--font-text); font-weight: 500; letter-spacing: 0;
  color: var(--pg-fg); text-wrap: balance; margin: 1.4em 0 0.55em;
}
.doc-longform .lf-head { font-size: 1.5em; line-height: 1.12; }
.doc-longform > :is(h2, h3, h4, .lf-head):first-child { margin-top: 0; }
/* keep the drop-cap on the first BODY paragraph, even after a lead heading */
.doc-longform.has-dropcap > :is(h2, h3, h4, .lf-head):first-child + p::first-letter {
  font-family: var(--font-headline); font-weight: 900; float: left;
  font-size: 3.1em; line-height: 0.78; padding: 6px 12px 0 0; color: var(--pg-brand);
}
/* a labelled measure guide the showcase can switch on to make the rule legible */
.doc-longform.show-measure { position: relative; }
.glow-off .doc-glow { display: none !important; }

/* ─────────────────────────────────────────────────────────────────
   IMAGERY  — figures for a scrolling doc
   The author drops an <img> or <image-slot> into .doc-figure__img;
   the frame, ratio, caption, and reveal come from here.
     .doc-figure              framed image + optional caption
       .is-portrait / .is-square / .is-wide   aspect overrides (default 16:9)
     .doc-figure.is-bleed     full-bleed band (pair with .doc-section.is-flush)
     .doc-figure.has-overlay  caption/label sits over the image (gradient scrim)
     .doc-gallery             responsive row of figures (auto 2–4 up)
   ───────────────────────────────────────────────────────────────── */
.doc-figure { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.doc-figure__img {
  position: relative; overflow: hidden; border-radius: 18px;
  border: 1px solid var(--pg-border); background: var(--pg-surface);
  aspect-ratio: 16 / 9;
}
.doc-figure.is-portrait .doc-figure__img { aspect-ratio: 4 / 5; }
.doc-figure.is-square   .doc-figure__img { aspect-ratio: 1 / 1; }
.doc-figure.is-wide     .doc-figure__img { aspect-ratio: 21 / 9; }
.doc-figure__img > img,
.doc-figure__img > image-slot,
.doc-figure__img > .doc-figure__ph {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block;
}
.doc-figure__cap {
  display: flex; gap: 14px; justify-content: space-between; align-items: baseline;
  font-family: var(--font-text); font-size: 12.5px; color: var(--pg-fg-3); line-height: 1.5;
}
.doc-figure__cap b { color: var(--pg-fg-2); font-family: var(--font-ui); font-weight: 600; }
.doc-figure__cap .idx { font-family: 'SF Mono', ui-monospace, Menlo, monospace; font-size: 11px; color: var(--pg-brand); white-space: nowrap; }

/* caption-over-image variant */
.doc-figure.has-overlay .doc-figure__img { display: flex; align-items: flex-end; }
.doc-figure.has-overlay .doc-figure__cap {
  position: relative; z-index: 2; margin: 0; padding: 18px 20px; width: 100%; box-sizing: border-box;
  color: rgba(255,255,255,0.92); align-items: flex-end;
}
.doc-figure.has-overlay .doc-figure__cap b { color: #fff; }
.doc-figure.has-overlay .doc-figure__img::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,0.72), rgba(0,0,0,0.10) 46%, transparent 70%);
}

/* full-bleed band — edge to edge inside an .is-flush section */
.doc-figure.is-bleed { gap: 0; }
.doc-figure.is-bleed .doc-figure__img { border-radius: 0; border-left: 0; border-right: 0; aspect-ratio: 21 / 9; }
.doc-figure.is-bleed .doc-figure__cap { padding: 14px var(--sec-pad-x) 0; }
.doc-figure.is-bleed.has-overlay .doc-figure__cap { padding: 22px var(--sec-pad-x); }

/* placeholder fill for showcases (no payload) */
.doc-figure__ph {
  background:
    radial-gradient(120% 100% at 78% 12%, rgba(var(--glow-1),0.20), transparent 55%),
    repeating-linear-gradient(45deg, rgba(128,128,128,0.05) 0 11px, rgba(128,128,128,0.09) 11px 22px),
    var(--pg-surface);
  display: flex; align-items: flex-end; padding: 14px;
}
.doc-figure__ph .tag {
  font-family: 'SF Mono', ui-monospace, Menlo, monospace; font-size: 11px; color: var(--pg-fg-3);
  padding: 5px 9px; border-radius: 6px; background: var(--pg-bg); border: 1px solid var(--pg-border);
}

.doc-gallery { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
@media (max-width: 560px) { .doc-gallery { grid-template-columns: 1fr 1fr; } }

/* ═════════════════════════════════════════════════════════════════
   MORE MOLECULES  — extra variety for the layout tool to compose from.
   All declarative, theme-aware, and animate-in where [data-ig] applies.
   ═════════════════════════════════════════════════════════════════ */

/* ── Badge / tag / status pill ──────────────────────────────────── */
.m-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-ui); font-weight: 600; font-size: 11px; letter-spacing: 0.02em;
  padding: 4px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--pg-fg) 7%, transparent); color: var(--pg-fg-2);
  border: 1px solid var(--pg-border);
}
.m-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.m-badge.no-dot::before { display: none; }
.m-badge.is-brand    { background: color-mix(in srgb, var(--pg-brand) 12%, transparent); color: var(--pg-brand-deep); border-color: color-mix(in srgb, var(--pg-brand) 28%, transparent); }
.m-badge.is-positive { background: rgba(0,138,33,0.14); color: #1Fae4d; border-color: transparent; }
.m-badge.is-caution  { background: rgba(239,103,0,0.14); color: #EF6700; border-color: transparent; }
.m-badge.is-negative { background: rgba(205,56,75,0.14); color: #EA433F; border-color: transparent; }
.m-badge.is-neutral  { background: rgba(0,96,167,0.14); color: #2f8fd6; border-color: transparent; }
.m-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* ── KPI — big number with delta ────────────────────────────────── */
.ig-kpi { display: flex; flex-direction: column; gap: 6px; }
.ig-kpi__n { font-family: var(--font-headline); font-weight: 900; font-size: 48px; line-height: 0.92;
  letter-spacing: 0; color: var(--pg-fg); font-variant-numeric: tabular-nums; }
.ig-kpi__lbl { font-family: var(--font-text); font-size: 13px; color: var(--pg-fg-2); }
.ig-kpi__delta { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start;
  font-family: var(--font-ui); font-weight: 600; font-size: 12px; padding: 3px 8px; border-radius: 999px; }
.ig-kpi__delta.up   { color: #1Fae4d; background: rgba(0,138,33,0.13); }
.ig-kpi__delta.down { color: #EA433F; background: rgba(205,56,75,0.13); }
.ig-kpi__delta.up::before   { content: "▲"; font-size: 9px; }
.ig-kpi__delta.down::before { content: "▼"; font-size: 9px; }

/* ═══ Adaptive content card ══════════════════════════════════════════
   ONE frame for every boxed content unit — replaces the separate callout,
   feature card, KPI card, infographic card, and figure-stat card. Include
   only the slots you need; they stack top→bottom in this fixed order with a
   consistent rhythm, so any subset reads right:
     .card__icon     icon / numeral tile (40px rounded)
     .card__eyebrow  label (kicker treatment)
     .card__stat     big number / hero figure
     .card__title    heading
     .card__body     small body copy
     .card__foot     badges, a .card__delta chip, or a CTA
   Modifiers: .is-center · .is-spread (foot to bottom edge) · .is-accent
   (brand-tinted frame + stat) · compose with .fx-cornerglow for the glow. */
.card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  background: color-mix(in srgb, var(--pg-fg) 4%, transparent);
  border: 1px solid var(--pg-border); border-radius: 18px; padding: 24px;
  height: 100%; box-sizing: border-box;
}
.card.is-center { align-items: center; text-align: center; }
.card.is-spread { justify-content: space-between; }
.card.is-spread .card__foot { margin-top: auto; }
.card.is-lg { padding: 40px; gap: 26px; border-radius: 24px; min-height: 230px; }
.card.is-accent { background: color-mix(in srgb, var(--pg-brand) 7%, transparent);
  border-color: color-mix(in srgb, var(--pg-brand) 26%, transparent); }

.card__icon {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  background: var(--pg-mint); color: var(--pg-brand-deep); display: grid; place-items: center;
}
.card__icon svg { width: 21px; height: 21px; display: block; stroke-width: 1.8; fill: none; }
.card__icon.is-numeral { font-family: var(--font-headline); font-weight: 900; font-size: 17px; }

.card__eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-text); font-weight: 500; font-size: 13px; color: var(--pg-brand);
}
.card.is-center .card__eyebrow { justify-content: center; }

.card__stat {
  font-family: var(--font-headline); font-weight: 900; font-size: 46px; line-height: 0.92;
  letter-spacing: 0; color: var(--pg-fg); font-variant-numeric: tabular-nums;
}
.card.is-accent .card__stat, .card__stat.is-brand { color: var(--pg-brand); }

.card__title {
  font-family: var(--font-text); font-weight: 500; font-size: 17px; line-height: 1.25;
  letter-spacing: 0; color: var(--pg-fg); margin: 0; text-wrap: balance;
}
.card__body {
  font-family: var(--font-text); font-size: 14px; line-height: 1.55; color: var(--pg-fg-2);
  margin: 0; max-width: 42ch;
}
.card.is-center .card__body { max-width: 36ch; }

.card__foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card.is-center .card__foot { justify-content: center; }
.card__delta { display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-ui); font-weight: 600; font-size: 12px; padding: 3px 8px; border-radius: 999px; }
.card__delta.up   { color: #1Fae4d; background: rgba(0,138,33,0.13); }
.card__delta.up::before   { content: "▲"; font-size: 9px; }
.card__delta.down { color: #EA433F; background: rgba(205,56,75,0.13); }
.card__delta.down::before { content: "▼"; font-size: 9px; }

/* ── Labeled progress meter ─────────────────────────────────────── */
.ig-meter { display: flex; flex-direction: column; gap: 10px; }
.ig-meter__row { display: flex; flex-direction: column; gap: 7px; }
.ig-meter__top { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-text); font-size: 13px; color: var(--pg-fg-2); }
.ig-meter__top b { font-family: var(--font-headline); font-weight: 900; font-size: 14px; color: var(--pg-fg); font-variant-numeric: tabular-nums; }
.ig-meter__track { height: 7px; border-radius: 99px; background: rgba(128,128,128,0.16); overflow: hidden; }
.ig-meter__track > b { display: block; height: 100%; width: var(--v, 0%); border-radius: 99px;
  background: linear-gradient(90deg, rgba(var(--glow-1),1), rgba(var(--glow-2),1)); transition: width 1.1s var(--ease-out); }
.reveal-ready .ig-meter__track > b { width: 0; }
.reveal-ready [data-ig].in .ig-meter__track > b { width: var(--v, 0%); }

/* ── Data / comparison table ────────────────────────────────────── */
.ig-table { width: 100%; border-collapse: collapse; font-family: var(--font-text); font-size: 13px; color: var(--pg-fg-2); }
.ig-table th, .ig-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--pg-rule); }
.ig-table thead th { font-family: var(--font-ui); font-weight: 700; font-size: 11px; letter-spacing: 0.06em;
  text-transform: none; color: var(--pg-fg-3); border-bottom-color: var(--pg-border-s); }
.ig-table td.num, .ig-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ig-table tbody tr:last-child td { border-bottom: 0; }
.ig-table tbody tr.is-hi td { background: color-mix(in srgb, var(--pg-brand) 8%, transparent); color: var(--pg-fg); }
.ig-table td b { color: var(--pg-fg); font-family: var(--font-ui); font-weight: 600; }

/* ── Vertical timeline ──────────────────────────────────────────── */
.ig-timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ig-timeline li { position: relative; padding: 0 0 22px 28px; border-left: 1.5px solid var(--pg-rule); }
.ig-timeline li:last-child { padding-bottom: 0; }
.ig-timeline li::before { content: ""; position: absolute; left: -6.5px; top: 2px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--pg-brand); box-shadow: 0 0 0 4px var(--pg-bg); }
.ig-timeline .t-when { font-family: 'SF Mono', ui-monospace, Menlo, monospace; font-size: 11px; color: var(--pg-brand); }
.ig-timeline .t-what { font-family: var(--font-ui); font-weight: 700; font-size: 14px; color: var(--pg-fg); margin: 3px 0 4px; }
.ig-timeline .t-desc { font-family: var(--font-text); font-size: 12.5px; line-height: 1.5; color: var(--pg-fg-2); }

/* ── Sparkline (inline trend) ───────────────────────────────────── */
.ig-spark { display: inline-flex; align-items: center; gap: 12px; }
.ig-spark svg { width: 120px; height: 36px; overflow: visible; display: block; }
.ig-spark .sp-line { fill: none; stroke: rgba(var(--glow-1),1); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ig-spark__v { font-family: var(--font-headline); font-weight: 900; font-size: 20px; color: var(--pg-fg); letter-spacing: 0; font-variant-numeric: tabular-nums; }

/* ── Numbered process steps (web) ───────────────────────────────── */
.doc-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-steps li { display: grid; grid-template-columns: 72px 1fr; gap: 6px; padding: 24px 0; border-top: 1px solid var(--pg-rule); align-items: center; }
.doc-steps li:last-child { border-bottom: 1px solid var(--pg-rule); }
.doc-steps .s-n { font-family: var(--font-headline); font-weight: 900; font-size: 80px; line-height: 0.8; color: var(--pg-brand); letter-spacing: 0; }
.doc-steps .s-t { font-family: var(--font-ui); font-weight: 700; font-size: 15px; color: var(--pg-fg); margin-bottom: 5px; }
.doc-steps .s-d { font-family: var(--font-text); font-size: 13px; line-height: 1.55; color: var(--pg-fg-2); }

/* ── Pull quote (web, oversized) ────────────────────────────────── */
.doc-pullquote { margin: 0; }
.doc-pullquote__q { font-family: var(--font-headline); font-weight: 600; font-size: clamp(24px, 3vw, 36px);
  line-height: 1.16; letter-spacing: 0; color: var(--pg-fg); margin: 0; text-wrap: balance; }
.doc-pullquote__q::before { content: "\201C"; color: var(--pg-brand); }
.doc-pullquote__q::after  { content: "\201D"; color: var(--pg-brand); }
.doc-pullquote__by { margin-top: 18px; display: flex; align-items: center; gap: 12px; }

/* ── Avatar / portrait + name + role ────────────────────────────── */
.doc-avatar { display: flex; align-items: center; gap: 12px; }
.doc-avatar__img { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex: none;
  background: var(--pg-surface); border: 1px solid var(--pg-border); position: relative; }
.doc-avatar__img > img, .doc-avatar__img > image-slot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.doc-avatar.lg .doc-avatar__img { width: 64px; height: 64px; }
.doc-avatar__name { font-family: var(--font-ui); font-weight: 600; font-size: 14px; color: var(--pg-fg); }
.doc-avatar__role { font-family: var(--font-text); font-size: 12px; color: var(--pg-fg-3); margin-top: 1px; }

/* ── Labeled keyline divider ────────────────────────────────────── */
.doc-keyline { display: flex; align-items: center; gap: 16px; }
.doc-keyline::before, .doc-keyline::after { content: ""; height: 1px; background: var(--pg-rule); flex: 1; }
.doc-keyline span { font-family: var(--font-text); font-weight: 500; font-size: 13px; letter-spacing: normal;
  text-transform: none; color: var(--pg-fg-3); white-space: nowrap; }

/* ═════════════════════════════════════════════════════════════════
   GLASS + FLIP CARDS  — Apple "Liquid Glass" surface + Stripe card grid.
   Glass is a translucent, blurred panel; flip cards reveal a message on
   hover / tap. Designed to sit on glow ("is-moment") grounds.
   ═════════════════════════════════════════════════════════════════ */

/* frosted glass utility — translucent, blurred, with an inner highlight */
.glass {
  background: linear-gradient(155deg, rgba(255,255,255,0.14), rgba(255,255,255,0.045));
  -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.26), inset 0 -1px 0 rgba(0,0,0,0.12), 0 18px 48px rgba(0,0,0,0.34);
}
.glass.is-tinted {
  background: linear-gradient(155deg, rgba(0,214,57,0.16), rgba(255,255,255,0.04));
  border-color: rgba(0,214,57,0.30);
}

/* pillar grid (Stripe-style responsive card row) */
.pillargrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(248px, 1fr)); gap: 18px; }

/* flip card */
.flipcard { position: relative; perspective: 1600px; aspect-ratio: 4 / 5; min-height: 340px; }
.flipcard__inner {
  position: relative; width: 100%; height: 100%; cursor: pointer;
  transition: transform .8s cubic-bezier(.65,0,.35,1) .09s; transform-style: preserve-3d;
}
.flipcard:hover .flipcard__inner,
.flipcard:focus-visible .flipcard__inner,
.flipcard.is-flipped .flipcard__inner { transform: rotateY(180deg); }
.flipcard:focus, .flipcard:focus-visible { outline: none; box-shadow: none; }
.flipcard:focus-visible .flipcard__face { box-shadow: var(--focus-ring), 0 18px 48px rgba(0,0,0,0.4); }
.flipcard__face {
  position: absolute; inset: 0; border-radius: 28px; overflow: hidden;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  display: flex; flex-direction: column;
}

/* front — image with a liquid-glass caption */
.flipcard__img { position: absolute; inset: 0; background: var(--pg-surface); }
.flipcard__img > image-slot, .flipcard__img > img,
.flipcard__img > .doc-figure__ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.flipcard__scrim { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,0.66), rgba(0,0,0,0.06) 52%, transparent 76%); }
.flipcard__cap { position: relative; z-index: 2; margin: auto 14px 14px; padding: 14px 16px; border-radius: 20px; }
.flipcard__num { font-family: var(--font-text); font-weight: 500; font-size: 12px; color: rgba(255,255,255,0.85); }
.flipcard__num b { color: #fff; }
.flipcard__title { font-family: var(--font-text); font-weight: 500; font-size: 21px; line-height: 1.1; color: #fff; letter-spacing: 0; margin-top: 3px; text-shadow: 0 1px 12px rgba(0,0,0,0.4); }
.flipcard__hint { position: absolute; top: 14px; right: 14px; z-index: 2; width: 32px; height: 32px;
  border-radius: 50%; display: grid; place-items: center; color: #fff; }
.flipcard__hint svg { width: 15px; height: 15px; }

/* back — frosted message panel */
.flipcard__back { transform: rotateY(180deg); padding: 26px 24px; justify-content: space-between;
  background: linear-gradient(160deg, rgba(8,28,18,0.92), rgba(8,10,9,0.94));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid rgba(0,214,57,0.22);
}
.flipcard__back::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 100% 0%, rgba(0,214,57,0.18), transparent 60%); }
.flipcard__back > * { position: relative; z-index: 1; }
.flipcard__back .fc-k { font-family: var(--font-text); font-weight: 500; font-size: 12px; letter-spacing: normal; text-transform: none; color: var(--pg-brand); }
.flipcard__back .fc-t { font-family: var(--font-text); font-weight: 500; font-size: 20px; color: #fff; margin: 10px 0 12px; letter-spacing: 0; line-height: 1.12; }
.flipcard__back .fc-d { font-family: var(--font-text); font-size: 14px; line-height: 1.58; color: rgba(255,255,255,0.82); }
.flipcard__back .fc-cta { margin-top: 18px; display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-ui); font-weight: 600; font-size: 13px; color: #fff; }
.flipcard__back .fc-cta::after { content: "→"; transition: transform .2s var(--ease-out); }
.flipcard:hover .flipcard__back .fc-cta::after { transform: translateX(3px); }

@media (prefers-reduced-motion: reduce) {
  .flipcard__inner { transition: none; }
  .flipcard:hover .flipcard__inner, .flipcard:focus-visible .flipcard__inner { transform: none; }
  .flipcard.is-flipped .flipcard__inner { transform: rotateY(180deg); }
}
/* Opacity gate (swaps at the 0.4s mid-flip): guarantees only the correct
   face shows even where backface-visibility is unreliable. */
.flipcard__front, .flipcard__back { transition: opacity 0s linear .49s; }
.flipcard__back { opacity: 0; }
.flipcard:hover .flipcard__front,
.flipcard:focus-visible .flipcard__front,
.flipcard.is-flipped .flipcard__front { opacity: 0; }
.flipcard:hover .flipcard__back,
.flipcard:focus-visible .flipcard__back,
.flipcard.is-flipped .flipcard__back { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .flipcard__front, .flipcard__back { transition: opacity .25s; } }
/* backdrop-filter flattens a 3D (preserve-3d) subtree and breaks
   backface-visibility, so INSIDE a flip card the glass is a translucent
   panel rather than a live blur. True backdrop glass is used elsewhere. */
.flipcard .glass, .flipcard__back { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.flipcard__cap.glass { background: linear-gradient(155deg, rgba(255,255,255,0.22), rgba(255,255,255,0.08)); }
.flipcard__hint.glass { background: rgba(0,0,0,0.32); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.22); }

/* ─────────────────────────────────────────────────────────────────
   EXPRESSIVE REVEAL + MICRO-INTERACTIONS
   ───────────────────────────────────────────────────────────────── */
/* PROGRESSIVE ENHANCEMENT — visible is the default state.
   ───────────────────────────────────────────────────────────────────
   Dru's review (2026-09-22): headings, prose and interactive controls
   started at opacity:0 in plain CSS and only became visible once JS and
   IntersectionObserver had both run. Blocked JS, a script error before
   init, or a missing observer left the document blank — and a
   keyboard user could focus a calculator slider that was invisible.

   Now the hidden start frame is scoped under `.reveal-ready`, which
   web-doc.js adds to <html> ONLY after it has confirmed it can drive the
   reveals. No JS, an early throw, or no IntersectionObserver → the class
   is never added and everything renders as ordinary visible content.
   Never write a `.reveal` rule that hides something outside this scope. */
.reveal-ready .reveal { opacity: 0; transform: translateY(20px) scale(.985);
  will-change: opacity, transform; }
.reveal { transition: opacity 1s var(--ease-out), transform 1.05s var(--ease-out); }
.reveal-ready .reveal.in { opacity: 1; transform: none; }
.reveal-ready .reveal.spin { transform: translateY(20px) rotate(-6deg) scale(.9); transform-origin: left center; }
.reveal-ready .reveal.spin.in { transform: none; }
.reveal-ready .reveal.from-right { transform: translateX(34px); }
.reveal-ready .reveal.from-right.in { transform: none; }
.reveal-ready .reveal.from-left { transform: translateX(-34px); }
.reveal-ready .reveal.from-left.in { transform: none; }
/* staggered children: set --i on each child */
.stagger > * { transition: opacity .7s var(--ease-out), transform .75s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms); }
.reveal-ready .stagger > * { opacity: 0; transform: translateY(18px); }
.reveal-ready .stagger.in > * { opacity: 1; transform: none; }

/* A container holding interactive controls must never be hidden by a
   reveal — a focusable but invisible control is a keyboard trap in all
   but name. The calculator animates nothing; it is simply always visible. */
.reveal-ready .reveal:has(input, button, select, textarea, a[href]) {
  opacity: 1; transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.spin, .reveal.from-right, .reveal.from-left, .stagger > * {
    opacity: 1 !important; transform: none !important; transition: none !important; }
}
/* Frozen-timeline guard (set by web-doc.js): remove transitions/animations
   entirely so every end-state applies as a static value (a frozen clock
   never ticks a 0s transition, so duration:0 alone is not enough). */
.anim-frozen .reveal, .anim-frozen .stagger > *, .anim-frozen .ig-stack__layer { opacity: 1 !important; transform: none !important; }
.anim-frozen * { transition: none !important; animation: none !important; }

/* hover tracing border */
@property --tr-ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.trace { position: relative; }
.trace::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; z-index: 3; pointer-events: none;
  background: conic-gradient(from var(--tr-ang), transparent 0deg 250deg, rgba(var(--glow-1),1) 316deg, rgba(var(--glow-2),1) 346deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
  opacity: 0; transition: opacity .25s var(--ease-out);
}
.trace:hover::after { opacity: 1; animation: traceSpin 1.4s var(--ease-out) 1; }
@keyframes traceSpin { to { --tr-ang: 360deg; } }

/* lift on cards */
.lift { transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .25s var(--ease-out); }
.lift:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 rgba(255,255,255,0.09), 0 16px 44px rgba(0,0,0,0.30); }

/* ─────────────────────────────────────────────────────────────────
   INFOGRAPHICS  — declarative, AI-generatable, animate-in on scroll
   Each container carries [data-ig]; web-doc.js adds .in when in view,
   which drives every fill from its --v / --to custom property.
   ───────────────────────────────────────────────────────────────── */
.ig-cap {
  font-family: var(--font-text); font-weight: 500; font-size: 13px; letter-spacing: normal;
  text-transform: none; color: var(--pg-brand); margin-bottom: 16px;
}
.ig-foot { font-family: var(--font-text); font-size: 12px; line-height: 1.5; color: var(--pg-fg-3); margin-top: 14px; }

/* ── 1 · Bar / comparison chart ─────────────────────────────────── */
.ig-bars { display: flex; flex-direction: column; gap: 16px; }
.ig-bar__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.ig-bar__lbl { font-family: var(--font-text); font-size: 13.5px; line-height: 1.3; color: var(--pg-fg-2); }
.ig-bar__val { font-family: var(--font-headline); font-weight: 900; font-size: 19px; color: var(--pg-fg);
  letter-spacing: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ig-bar__track { height: 9px; border-radius: 99px; background: rgba(128,128,128,0.16); overflow: hidden; }
.ig-bar__track > b { display: block; height: 100%; width: var(--v, 0%); border-radius: 99px;
  background: linear-gradient(90deg, rgba(var(--glow-1),1), rgba(var(--glow-2),1));
  transition: width 1.2s var(--ease-out); }
/* animate from zero only when JS can drive it — without the enhancement
   class the bar renders at its real value instead of empty */
.reveal-ready .ig-bar__track > b { width: 0; }
.reveal-ready [data-ig].in .ig-bar__track > b { width: var(--v, 0%); }
.ig-bar.is-dim .ig-bar__val { color: var(--pg-fg-3); }
.ig-bar.is-dim .ig-bar__track > b { background: rgba(128,128,128,0.45); }

/* ── 2 · Ring / donut (single + multi) ──────────────────────────── */
@property --rd { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.ig-rings { display: flex; flex-direction: column; align-items: center; gap: 52px; }
.ig-ringrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px 22px; width: 100%; }
.ig-ringrow.is-three { grid-template-columns: repeat(4, 1fr); }
.ig-ring { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.ig-ring__wrap { position: relative; width: 124px; height: 124px; display: grid; place-items: center; }
.ig-ring__svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ig-ring__track { fill: none; stroke: rgba(128,128,128,0.16); stroke-width: 8; }
.ig-ring__val {
  fill: none; stroke: rgba(var(--glow-1),1); stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: calc(var(--pct) * 2.7646) 1000; transition: stroke-dasharray 1.6s var(--ease-out);
}
.reveal-ready .ig-ring__val { stroke-dasharray: 0 1000; }
.reveal-ready [data-ig].in .ig-ring__val { stroke-dasharray: calc(var(--pct) * 2.7646) 1000; }
.ig-ring__num { position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-headline); font-weight: 900; font-size: 26px; color: var(--pg-fg); letter-spacing: 0; }
.ig-ring__lbl { font-family: var(--font-text); font-size: 12.5px; line-height: 1.4; color: var(--pg-fg-2);
  width: 20ch; max-width: 100%; text-align: left; }
@media (max-width: 720px) {
  .ig-ringrow, .ig-ringrow.is-three { grid-template-columns: repeat(2, 1fr); max-width: 100%; }
}

/* ── Scatter / bubble figure ────────────────────────────────────── */
.fig-scatter { width: 100%; position: relative; }
.fig-scatter svg { width: 100%; height: auto; display: block; overflow: visible; }
.fig-dot { cursor: pointer; outline: none; }
.fig-dot > circle { transition: filter .15s var(--ease-out); }
.fig-dot:hover > circle,
.fig-dot:focus-visible > circle,
.fig-dot.is-on > circle { filter: brightness(1.35) saturate(1.1); }
.fig-tip {
  position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  min-width: 168px; padding: 10px 13px; border-radius: 11px;
  background: rgba(12,14,16,0.97); border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 16px 44px rgba(0,0,0,0.5);
  opacity: 0; transition: opacity .12s var(--ease-out);
}
.fig-tip.is-below { transform: translate(-50%, 14px); }
.fig-tip.is-on { opacity: 1; }
.fig-tip__name { font-family: var(--font-headline); font-weight: 700; font-size: 13px;
  color: var(--pg-fg); margin-bottom: 6px; letter-spacing: 0; }
.fig-tip__row { display: flex; justify-content: space-between; gap: 18px;
  font-family: var(--font-text); font-size: 11.5px; color: var(--pg-fg-2); line-height: 1.6; }
.fig-tip__row b { font-family: var(--font-headline); font-weight: 700; color: var(--pg-fg);
  font-variant-numeric: tabular-nums; }

/* ── 3 · Gauge / radial progress ────────────────────────────────── */
.ig-gauge { display: flex; flex-direction: column; align-items: center; text-align: center; }
.ig-gauge__svg { width: 248px; height: 248px; grid-area: 1 / 1; }
.ig-gauge__svg svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ig-gauge .g-track { fill: none; stroke: rgba(128,128,128,0.16); stroke-width: 7.5; }
.ig-gauge .g-val { fill: none; stroke: url(#ig-gauge-grad); stroke-width: 7.5; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: var(--goff, 50); transition: stroke-dashoffset 1.5s var(--ease-out); }
.reveal-ready .ig-gauge .g-val { stroke-dashoffset: 100; }
.reveal-ready [data-ig].in .ig-gauge .g-val { stroke-dashoffset: var(--goff, 50); }
/* number + ring share one grid cell — a real (flex/grid) item, never
   absolutely positioned, so it reserves its space and cannot be clipped. */
.ig-gauge__wrap { width: 248px; height: 248px; display: grid; place-items: center; }
.ig-gauge__n { grid-area: 1 / 1; place-self: center; white-space: nowrap;
  font-family: var(--font-headline); font-weight: 900; font-size: 48px; color: var(--pg-fg); letter-spacing: 0; }
.ig-gauge__lbl { font-family: var(--font-text); font-size: 14px; color: var(--pg-fg-2); line-height: 1.5; max-width: 30ch; margin-top: 18px; }

/* ── 4 · Segmented / stacked "erosion" bar ──────────────────────── */
.ig-seg { display: flex; flex-direction: column; gap: 18px; }
.ig-seg__top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--pg-fg-2); margin-bottom: 8px; }
.ig-seg__top b { color: var(--pg-fg); font-family: var(--font-headline); font-weight: 900; font-size: 16px; letter-spacing: 0; }
.ig-seg__bar { display: flex; height: 40px; border-radius: 14px; overflow: hidden; background: rgba(128,128,128,0.10); gap: 3px; }
.ig-seg__bar > span { display: flex; align-items: center; padding: 0 14px; font-family: var(--font-ui); font-size: 12px; font-weight: 600;
  width: var(--v, 0%); transition: width 1.15s var(--ease-out); white-space: nowrap; overflow: hidden; border-radius: 11px; }
.reveal-ready .ig-seg__bar > span { width: 0; }
.reveal-ready [data-ig].in .ig-seg__bar > span { width: var(--v, 0%); }
.ig-seg__bar .seg-keep { background: linear-gradient(90deg, rgba(var(--glow-1),1), rgba(var(--glow-2),1)); color: #06140A; }
.ig-seg__bar .seg-lost { background: rgba(128,128,128,0.22); color: var(--pg-fg-2); }

/* ── 5 · Figure-stat cards ──────────────────────────────────────── */
.ig-figs { display: flex; gap: 16px; flex-wrap: wrap; }
.ig-fig { flex: 1 1 0; min-width: 150px; padding: 28px; border-radius: 22px;
  background: color-mix(in srgb, var(--pg-fg) 4%, transparent); border: 1px solid var(--pg-border); }
.ig-fig__n { font-family: var(--font-text); font-weight: 500; font-size: 28px; line-height: 1; color: var(--pg-brand); letter-spacing: 0; }
.ig-fig.is-hi { background: color-mix(in srgb, var(--pg-fg) 4%, transparent); border-color: var(--pg-border); }
.ig-fig.is-hi .ig-fig__n { color: var(--pg-brand); }
.ig-fig__sub { font-family: var(--font-ui); font-size: 13px; color: var(--pg-fg-2); margin-top: 4px; }
.ig-fig__l { font-family: var(--font-text); font-size: 12.5px; color: var(--pg-fg-3); margin-top: 12px; line-height: 1.45; }
/* number + sub on one baseline row, support line wraps below */
.ig-fig.is-inline { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 8px; }
.ig-fig.is-inline .ig-fig__sub { margin-top: 0; }
.ig-fig.is-inline .ig-fig__l { flex-basis: 100%; }

/* ── 6 · Process / layered stack diagram ────────────────────────── */
.ig-stack { display: flex; flex-direction: column; gap: 9px; }
.ig-stack__layer { background: color-mix(in srgb, var(--pg-fg) 5%, transparent);
  border: 1px solid var(--pg-border); border-radius: 999px;
  padding: 13px 22px 13px 32px; display: flex; flex-direction: column; gap: 3px;
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
  transition-delay: calc(var(--i,0) * 110ms); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
/* hidden start frame only once JS can reveal it — see PROGRESSIVE ENHANCEMENT */
.reveal-ready .ig-stack__layer { opacity: 0; transform: translateX(20px); }
.reveal-ready [data-ig].in .ig-stack__layer { opacity: 1; transform: none; }
.ig-stack__n { font-family: var(--font-ui); font-weight: 700; font-size: 14px; color: var(--pg-fg); }
.ig-stack__p { font-family: var(--font-text); font-size: 12px; line-height: 1.45; color: var(--pg-fg-2); }

/* ── 7 · Interactive calculator (sliders → outputs) ─────────────── */
.ig-calc { display: grid; grid-template-columns: minmax(0,0.92fr) minmax(0,1.08fr); gap: 36px; align-items: start; }
@media (max-width: 820px) { .ig-calc { grid-template-columns: 1fr; gap: 24px; } }
.ig-calc__inputs { display: flex; flex-direction: column; gap: 16px; }
.ig-calc__field { display: flex; flex-direction: column; gap: 8px; }
.ig-calc__k { font-family: var(--font-text); font-size: 12.5px; color: var(--pg-fg-2); display: flex; justify-content: space-between; align-items: baseline; }
.ig-calc__k b { font-family: var(--font-headline); font-weight: 900; font-size: 15px; color: var(--pg-brand); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.ig-calc input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px;
  background: rgba(128,128,128,0.22); cursor: pointer; }
/* The slider track is 4px tall, so a ring on the input itself is nearly
   invisible. Ring the FIELD instead — the label and track together — which
   gives the indicator something to sit around. (Dru, 2026-09-22: the range
   inputs removed the outline and supplied no replacement.) */
.ig-calc__field:has(input:focus-visible) {
  box-shadow: var(--focus-ring); border-radius: 10px;
}
/* The ring lives on the field, so the input itself draws none. */
.ig-calc input[type=range]:focus,
.ig-calc input[type=range]:focus-visible { outline: none; box-shadow: none; }
.ig-calc input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 17px; height: 17px; border-radius: 50%;
  background: var(--pg-brand); border: 2px solid var(--pg-bg); box-shadow: 0 0 0 1px rgba(var(--glow-1),0.5), 0 2px 6px rgba(0,0,0,0.4); }
.ig-calc input[type=range]::-moz-range-thumb { width: 17px; height: 17px; border-radius: 50%; background: var(--pg-brand); border: 2px solid var(--pg-bg); }
.ig-calc__out { display: flex; flex-direction: column; gap: 12px; }
.ig-calc__row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 2px 14px;
  background: color-mix(in srgb, var(--pg-fg) 4%, transparent); border: 1px solid var(--pg-border);
  border-radius: 999px; padding: 13px 22px; }
.ig-calc__rk { font-family: var(--font-text); font-size: 12.5px; color: var(--pg-fg-2); align-self: center; min-width: 0; }
.ig-calc__rv { font-family: var(--font-headline); font-weight: 900; font-size: 23px; color: var(--pg-fg); letter-spacing: 0; font-variant-numeric: tabular-nums; text-align: right;
  min-width: 0; white-space: nowrap; }

/* Result rows stack label-over-value when the COMPONENT (not the viewport)
   is too narrow to seat both on one line. Dru's review (2026-09-22) measured
   the max value ($12,000,000) overflowing its row by ~41px at a 901px
   viewport, where the desktop rail left a 653px canvas: `1fr auto` cannot
   shrink a currency total, and the label kept a large min-content width.
   Container query so it reacts to the space the calculator actually has,
   not the outer viewport. `white-space: nowrap` above keeps the currency
   whole — it must never wrap mid-number. */
.ig-calc__out { container-type: inline-size; container-name: calcout; }
@container calcout (max-width: 420px) {
  .ig-calc__row { grid-template-columns: minmax(0,1fr); border-radius: 22px; padding: 14px 20px; }
  .ig-calc__rv { text-align: left; font-size: clamp(19px, 7cqi, 23px); }
  .ig-calc__row--total .ig-calc__rv { font-size: clamp(22px, 8.5cqi, 27px); }
}
/* No container-query support: fall back to a viewport rule at the width
   where the canvas gets tight. */
@supports not (container-type: inline-size) {
  @media (max-width: 1100px) {
    .ig-calc__row { grid-template-columns: minmax(0,1fr); border-radius: 22px; }
    .ig-calc__rv { text-align: left; }
  }
}
.ig-calc__row--total { border-color: color-mix(in srgb, var(--pg-brand) 36%, transparent); }
.ig-calc__row--total .ig-calc__rv { color: var(--pg-brand); font-size: 27px; }

/* ── 8 · Line / trend chart ─────────────────────────────────────── */
.ig-line { width: 100%; }
.ig-line svg { width: 100%; height: auto; display: block; overflow: visible; }
.ig-line .ln-grid { stroke: var(--pg-rule); stroke-width: 1; }
.ig-line .ln-area { fill: url(#ig-line-grad); opacity: 0.5; transition: opacity 1s var(--ease-out) .3s; }
.ig-line .ln-path { fill: none; stroke: rgba(var(--glow-1),1); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: var(--len, 1000); stroke-dashoffset: 0; transition: stroke-dashoffset 1.7s var(--ease-out); }
.ig-line .ln-dot { fill: rgba(var(--glow-1),1); opacity: 1; transition: opacity .4s var(--ease-out); }
.reveal-ready .ig-line .ln-area { opacity: 0; }
.reveal-ready .ig-line .ln-path { stroke-dashoffset: var(--len, 1000); }
.reveal-ready .ig-line .ln-dot { opacity: 0; }
.reveal-ready [data-ig].in .ig-line .ln-path { stroke-dashoffset: 0; }
.reveal-ready [data-ig].in .ig-line .ln-area { opacity: 0.5; }
.reveal-ready [data-ig].in .ig-line .ln-dot { opacity: 1; transition-delay: calc(1.2s + var(--i,0) * 90ms); }
.ig-line__axis { display: flex; justify-content: space-between; font-family: var(--font-ui); font-size: 11px; color: var(--pg-fg-3); margin-top: 8px; }

/* ═════════════════════════════════════════════════════════════════
   CAROUSEL / SLIDER  — horizontal scroll-snap track of cards
   ───────────────────────────────────────────────────────────────────
     <div class="doc-slider" data-slider style="--slide-w:420px">
       <div class="doc-slider__track">
         <article class="doc-slide is-card">…</article> …
       </div>
       <div class="doc-slider__ctl">
         <div class="doc-slider__dots"></div>            ← web-doc.js fills
         <div class="doc-slider__arrows">
           <button class="doc-slider__btn" data-slider-prev>‹</button>
           <button class="doc-slider__btn" data-slider-next>›</button>
         </div>
       </div>
     </div>
   web-doc.js builds the dots and wires arrows + drag + swipe + keyboard,
   tracks the active slide, and disables arrows at the ends. Any markup
   can fill a .doc-slide; .is-card gives a ready surface. Set the per-slide
   width with --slide-w on the .doc-slider.
   ═════════════════════════════════════════════════════════════════ */
.doc-slider { position: relative; }
.doc-slider__track {
  display: flex; gap: 20px; overflow-x: auto;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
  padding: 6px 2px 4px; margin: 0 -2px;
}
.doc-slider__track::-webkit-scrollbar { display: none; }
.doc-slide {
  flex: 0 0 var(--slide-w, 360px); max-width: 86%;
  scroll-snap-align: start; box-sizing: border-box;
}
/* while dragging: free scroll, no snap fighting the pointer */
.doc-slider.is-grabbing .doc-slider__track { scroll-behavior: auto; scroll-snap-type: none; cursor: grabbing; }
.doc-slider.is-grabbing .doc-slide { pointer-events: none; }

/* a ready-made card surface for slides */
.doc-slide.is-card {
  display: flex; flex-direction: column; gap: 16px;
  padding: 30px; border-radius: 22px; min-height: 240px;
  background: color-mix(in srgb, var(--pg-fg) 4%, transparent);
  border: 1px solid var(--pg-border);
}

/* image-led slide: photo band on top, compact testimonial below */
.doc-slide.is-media { padding: 0; overflow: hidden; }
.doc-slide__media { position: relative; aspect-ratio: 16 / 11; background: var(--pg-surface); flex: none; }
.doc-slide__media > image-slot,
.doc-slide__media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.doc-slide__body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 13px; flex: 1; }
.doc-slide__q { margin: 0; font-family: var(--font-text); font-weight: 500; font-size: 16px; line-height: 1.5;
  letter-spacing: 0; color: var(--pg-fg); text-wrap: pretty; }
.doc-slide__by { margin-top: auto; }
.doc-slide__by .nm { font-family: var(--font-ui); font-weight: 600; font-size: 13px; color: var(--pg-fg); }
.doc-slide__by .rl { font-family: var(--font-text); font-size: 12px; color: var(--pg-fg-3); margin-top: 2px; }

/* controls: arrows, right-aligned */
.doc-slider__ctl { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.doc-slider__dots { display: flex; gap: 8px; }
.doc-slider__dot {
  width: 7px; height: 7px; border-radius: 99px; border: 0; padding: 0; cursor: pointer;
  background: var(--pg-border-s); transition: width .25s var(--ease-out), background .25s var(--ease-out);
}
.doc-slider__dot.is-on { width: 22px; background: var(--pg-brand); }
.doc-slider__arrows { display: flex; gap: 8px; }
.doc-slider__btn {
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer; line-height: 1;
  display: grid; place-items: center; font-size: 19px; color: var(--pg-fg);
  background: color-mix(in srgb, var(--pg-fg) 5%, transparent); border: 1px solid var(--pg-border-s);
  transition: background .18s var(--ease-out), border-color .18s var(--ease-out), opacity .18s var(--ease-out);
}
.doc-slider__btn:hover { background: color-mix(in srgb, var(--pg-brand) 16%, transparent); border-color: var(--pg-brand); }
.doc-slider__btn:disabled { opacity: 0.3; cursor: default; }
.doc-slider__btn:disabled:hover { background: color-mix(in srgb, var(--pg-fg) 5%, transparent); border-color: var(--pg-border-s); }

/* ─────────────────────────────────────────────────────────────────
   SLIDE-EXPORT FRAME MODE — one section = one 1280×720 slide
   Add data-frame="slide" to .webdoc (or a single .doc-section).
   ───────────────────────────────────────────────────────────────── */
.webdoc[data-frame="slide"] { display: block; }
.webdoc[data-frame="slide"] .doc-rail,
.webdoc[data-frame="slide"] .doc-progress { display: none; }
.webdoc[data-frame="slide"] .doc-section,
.doc-section[data-frame="slide"] {
  width: 1280px; height: 720px; min-height: 0; margin: 0 auto;
  padding: 56px 72px; overflow: hidden;
}
.webdoc[data-frame="slide"] .doc-section + .doc-section { border-top: 0; }

/* ── responsive: rail becomes a "Select a chapter" dropdown ───────
   Boundary raised 900 → 1100px (Dru's review, 2026-09-22). At 901px the
   248px rail left only ~653px of canvas, so desktop type, section padding,
   tables, the calculator and the two-column pairs all ran in a much
   narrower space than they had at 900px — the source of the cramped
   layouts and overflow between 901 and 1100px. 1100px also lines this up
   with .doc-pair's own stacking rule, so the rail and the pairs now change
   at the same width instead of fighting across a 200px band.
   The paired `min-width: 1101px` desktop rules live in styles.css. */
@media (max-width: 1100px) {
  .webdoc { grid-template-columns: 1fr; }
  .doc-rail {
    position: sticky; top: 0; z-index: 50; height: auto;
    flex-direction: row; align-items: center; gap: 0;
    padding: 10px 16px; overflow: visible;
    border-right: 0; border-bottom: 1px solid var(--pg-border);
    background: color-mix(in srgb, #070807 96%, transparent);
  }
  .doc-rail__eyebrow, .doc-rail__foot { display: none; }
  .doc-rail__select {
    display: inline-flex; align-items: center; justify-content: space-between; gap: 12px;
    /* was width:100% — the PDF action is now a sibling on this row, so the
       trigger takes the space it needs and leaves the rest */
    flex: 1 1 auto; min-width: 0; max-width: 420px; padding: 12px 18px;
    border: 1px solid var(--pg-border-s); border-radius: 999px;
    background: color-mix(in srgb, #ffffff 5%, transparent);
    font-family: var(--font-ui); font-weight: 500; font-size: 14.5px; color: var(--pg-fg);
    cursor: pointer; transition: border-color .15s var(--ease-out);
  }
  .doc-rail__select:hover { border-color: var(--pg-brand); }
  .doc-rail__select-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .doc-rail__select-caret { width: 16px; height: 16px; flex: none; transition: transform .2s var(--ease-out); }
  .doc-rail.is-open .doc-rail__select-caret { transform: rotate(180deg); }
  .doc-rail__list {
    display: none; position: absolute; top: calc(100% + 8px); left: 16px; right: 16px;
    max-width: 420px; max-height: 72vh; overflow-y: auto; gap: 2px; padding: 8px;
    background: #0E1210; border: 1px solid var(--pg-border-s); border-radius: 16px;
    box-shadow: 0 28px 70px rgba(0,0,0,0.62);
  }
  .doc-rail.is-open .doc-rail__list { display: flex; }
  .doc-rail__list .navrow { white-space: normal; width: 100%; padding: 12px 14px; font-size: 14px; }
  .doc-rail__list .navrow .navrow__dot { display: inline-block; }
}

/* ═══════════════════════════════════════════════════════════════════
   Scale band — dark performance panel: flowing <flow-wave> ribbon,
   muted-lead headline, oversized gradient stat numerals.
   Self-contained dark surface; drops into any doc-well.
   ═══════════════════════════════════════════════════════════════════ */
.scaleband__panel {
  position: relative; overflow: hidden; border-radius: 26px;
  border: 1px solid rgba(120, 150, 210, 0.16);
  background: #05070C;
  min-height: 640px; padding: 56px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.scaleband__wave { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
/* top + bottom scrims keep headline and stats fully legible over the ribbon */
.scaleband__panel::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(8,12,36,0.88) 0%, rgba(8,12,36,0) 27%,
              rgba(8,12,36,0) 68%, rgba(8,12,36,0.94) 100%);
}
.scaleband__h {
  position: relative; z-index: 2; margin: 0; max-width: 44ch;
  font-family: var(--font-text); font-weight: 600; font-size: 30px; line-height: 1.3;
  letter-spacing: 0; color: #93A4CE;
}
.scaleband__h b { font-weight: 600; color: #FFFFFF; }
.scaleband__stats {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.flowstat__n {
  font-family: var(--font-text); font-weight: 600; font-size: 64px; line-height: 1;
  letter-spacing: 0; width: max-content; max-width: 100%;
  background-clip: text; -webkit-background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
}
.flowstat__l { font-family: var(--font-ui); font-size: 15px; color: #AEB9D8; margin-top: 14px; }
.flowstat__n.g1 { background-image: linear-gradient(95deg, #EAF4FF 0%, #9BD4FF 46%, #5CA8FF 100%); }
.flowstat__n.g2 { background-image: linear-gradient(95deg, #BFE6FF 0%, #6C9CF0 100%); }
.flowstat__n.g3 { background-image: linear-gradient(95deg, #8FC4FF 0%, #6D8AE8 100%); }
@media (max-width: 760px) {
  .scaleband__panel { min-height: 0; padding: 40px 28px; }
  .scaleband__h { font-size: 23px; }
  .scaleband__stats { grid-template-columns: 1fr; gap: 28px; }
  .flowstat__n { font-size: 52px; }
}

/* ═════════════════════════════════════════════════════════════════
   PILLAR BENTO  — a square-card grid for "what the product believes".
   Each card carries ONE plain statement (Sage Text ~26px) and a round
   expand affordance top-right. Variants:
     .bento.is-photo   photo fill + frosted caption bar (white type)
     .bento.is-brand   brand-colour customer card (logo + lockup)
     .bento.has-ui     statement + an in-card live status panel (.bui)
   Theme-aware via pg-* tokens; glow accents use the --glow-* palette.
   ═════════════════════════════════════════════════════════════════ */
.doc-bento { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
@media (max-width: 560px) { .doc-bento { grid-template-columns: 1fr; } }

.bento {
  position: relative; overflow: hidden; cursor: pointer;
  border: 1px solid var(--pg-border); border-radius: 24px;
  background: color-mix(in srgb, var(--pg-fg) 4%, transparent);
  padding: 40px; aspect-ratio: 1 / 1;
  display: flex; flex-direction: column; justify-content: flex-end;
  transition: border-color .4s var(--ease-out), transform .4s var(--ease-out);
}
.bento::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .85; transition: opacity .4s;
  background:
    radial-gradient(48% 60% at 8% 4%, rgba(var(--glow-1),0.16) 0%, transparent 64%),
    radial-gradient(46% 56% at 100% 36%, rgba(var(--glow-1),0.08) 0%, transparent 70%);
}
.bento:nth-of-type(3)::before {
  background:
    radial-gradient(50% 58% at 100% 4%, rgba(var(--glow-3),0.15) 0%, transparent 64%),
    radial-gradient(44% 54% at 0% 72%, rgba(var(--glow-1),0.09) 0%, transparent 70%);
}
.bento:hover { transform: translateY(-3px); border-color: var(--pg-border-s); }
.bento:hover::before { opacity: 1; }
.bento:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.bento > * { position: relative; z-index: 2; }

/* unified statement — Sage Text ~26px regular, identical on every card */
.bento__state {
  font-family: var(--font-text); font-weight: 400; font-size: 26px;
  line-height: 1.3; letter-spacing: 0; color: var(--pg-fg);
  max-width: 17ch; text-wrap: pretty; margin: 0;
}

/* round expand — top-right on every card */
.bento__plus {
  position: absolute; top: 24px; right: 24px; z-index: 4; width: 46px; height: 46px; flex: none;
  border: none; cursor: pointer; background: var(--pg-fg); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: transform .3s var(--ease-out);
}
.bento__plus svg { width: 19px; height: 19px; stroke: var(--pg-bg); stroke-width: 2.2; fill: none; }
.bento:hover .bento__plus { transform: rotate(90deg); }

/* has-ui — statement + live status panel pushed apart */
.bento.has-ui { justify-content: space-between; }

/* in-card status / automation panel */
.bui {
  width: 100%; border: 1px solid var(--pg-border); border-radius: 14px; padding: 16px 16px 14px;
  background: color-mix(in srgb, var(--pg-fg) 4%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.bui__head { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.bui__pill { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-text); font-size: 12.5px; color: var(--pg-fg-3); }
.bui__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pg-brand); flex: none;
  box-shadow: 0 0 0 0 rgba(var(--glow-1),0.5); animation: buiPulse 1.8s var(--ease-out) infinite; }
@keyframes buiPulse { 0% { box-shadow: 0 0 0 0 rgba(var(--glow-1),0.45); } 70% { box-shadow: 0 0 0 7px rgba(var(--glow-1),0); } 100% { box-shadow: 0 0 0 0 rgba(var(--glow-1),0); } }
.bui__meta { margin-left: auto; font-family: 'SF Mono', ui-monospace, Menlo, monospace; font-size: 11.5px; color: var(--pg-fg-4); }
.bui__row { display: flex; align-items: center; gap: 11px; padding: 8px 0; border-top: 1px solid var(--pg-border); }
.bui__check { width: 18px; height: 18px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: var(--pg-brand); }
.bui__check svg { width: 11px; height: 11px; stroke: var(--pg-on-brand); stroke-width: 3; fill: none; display: block; }
.bui__check.is-run { background: transparent; border: 1.6px solid var(--pg-fg-4); }
.bui__check.is-run svg { display: none; }
.bui__spin { width: 11px; height: 11px; border-radius: 50%; border: 1.6px solid var(--pg-brand); border-right-color: transparent; animation: buiSpin .9s linear infinite; }
@keyframes buiSpin { to { transform: rotate(360deg); } }
.bui__label { font-family: var(--font-text); font-size: 14px; color: var(--pg-fg-2); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bui__row.is-run .bui__label { color: var(--pg-fg); }
.bui__tag { margin-left: auto; font-family: 'SF Mono', ui-monospace, Menlo, monospace; font-size: 11px; color: var(--pg-fg-4); flex: none; }
.bui__row.is-run .bui__tag { color: var(--pg-brand); }
@media (prefers-reduced-motion: reduce) { .bui__dot, .bui__spin { animation: none; } }

/* photo card — image fill + frosted, darkened caption bar (white type) */
.bento.is-photo { padding: 0; }
.bento.is-photo .bento__media { position: absolute; inset: 0; z-index: 0; border-radius: inherit; overflow: hidden; -webkit-transform: translateZ(0); transform: translateZ(0); }
.bento.is-photo .bento__media > img,
.bento.is-photo .bento__media > image-slot { width: 100%; height: 100%; object-fit: cover; display: block; }
.bento.is-photo .bento__frost {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 30px 32px;
  -webkit-backdrop-filter: blur(16px) saturate(1.15); backdrop-filter: blur(16px) saturate(1.15);
  background: linear-gradient(180deg, rgba(8,10,12,0.30) 0%, rgba(8,10,12,0.58) 100%);
  border-top: 1px solid rgba(255,255,255,0.10);
  border-bottom-left-radius: 23px; border-bottom-right-radius: 23px;
}
.bento.is-photo .bento__state { color: #fff; max-width: 20ch; }
.bento.is-photo .bento__plus { background: #fff; }
.bento.is-photo .bento__plus svg { stroke: #0A0A0A; }

/* brand customer card — brand-colour ground, big logo, partnership lockup */
.bento.is-brand { background: var(--pg-brand-card, #143C9E); border: none; padding: 36px; justify-content: space-between; }
.bento.is-brand::before { display: none; }
.bento.is-brand .bento__plus { background: #fff; }
.bento.is-brand .bento__plus svg { stroke: #0A0A0A; }
.bento.is-brand .bento__lock { height: 34px; width: auto; display: block; }
.bento.is-brand .bento__logo { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; padding: 14px 0; }
.bento.is-brand .bento__logo > img { height: 100%; width: auto; max-height: 260px; max-width: 92%; display: block; }
.bento.is-brand .bento__state { color: #fff; max-width: 18ch; }

/* ═════════════════════════════════════════════════════════════════
   AGENTS FLUID MENU  — a vertical list where the focused row expands
   to reveal its description while neighbours lift and the rest dim.
   Pairs with a framed media stage (.agentstage). One row may carry
   .is-open as the default-expanded item. Locked to a fixed height so
   hover reflow never pushes the next section.
   ═════════════════════════════════════════════════════════════════ */
.doc-agents { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: 56px; align-items: center; }
@media (max-width: 880px) { .doc-agents { grid-template-columns: 1fr; gap: 40px; } .agentstage { order: -1; } }

.agentmenu { display: flex; flex-direction: column; justify-content: center; height: 562px; --ease-m: cubic-bezier(0.16, 1, 0.3, 1); }
.agentitem {
  position: relative; display: flex; align-items: center; gap: 22px; cursor: pointer; outline: none;
  height: 86px; padding: 0 8px; border-bottom: 1px solid var(--pg-rule); overflow: hidden;
  transition: height .55s var(--ease-m), opacity .45s var(--ease-m), background .45s var(--ease-m);
}
.agentitem:first-child { border-top: 1px solid var(--pg-rule); }
.agentitem__i { font-family: 'SF Mono', ui-monospace, Menlo, monospace; font-size: 13px; color: var(--pg-fg-4); transition: color .3s; flex: none; }
.agentitem__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.agentitem__t { font-family: var(--font-text); font-size: 23px; font-weight: 400; letter-spacing: 0; color: var(--pg-fg-3);
  transition: color .35s, transform .5s var(--ease-m); transform-origin: left; }
.agentitem__d { font-family: var(--font-text); font-size: 14px; line-height: 1.55; color: var(--pg-fg-4); max-width: 42ch;
  height: 0; opacity: 0; transform: translateY(8px); transition: opacity .4s var(--ease-m), transform .4s var(--ease-m); }
.agentitem__arr { margin-left: auto; flex: none; color: var(--pg-brand); opacity: 0; transform: translateX(-8px);
  transition: opacity .4s, transform .4s var(--ease-m); }
.agentitem__arr svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 2; fill: none; display: block; }

/* expanded look — default-open row + whichever is hovered / focused */
.agentitem.is-open, .agentmenu .agentitem:hover, .agentmenu .agentitem:focus-visible { height: 170px; background: color-mix(in srgb, var(--pg-fg) 5%, transparent); }
.agentitem.is-open .agentitem__t, .agentitem:hover .agentitem__t, .agentitem:focus-visible .agentitem__t { color: var(--pg-fg); transform: scale(1.04); }
.agentitem.is-open .agentitem__i, .agentitem:hover .agentitem__i, .agentitem:focus-visible .agentitem__i { color: var(--pg-brand); }
.agentitem.is-open .agentitem__d, .agentitem:hover .agentitem__d, .agentitem:focus-visible .agentitem__d { height: auto; opacity: 1; transform: none; margin-top: 6px; transition-delay: .08s; }
.agentitem.is-open .agentitem__arr, .agentitem:hover .agentitem__arr, .agentitem:focus-visible .agentitem__arr { opacity: 1; transform: none; transition-delay: .14s; }

/* the wave — dim the rest, lift neighbours, retire the default while hovering */
.agentmenu:has(.agentitem:hover) .agentitem:not(:hover) { opacity: .4; }
.agentmenu:has(.agentitem:hover) .agentitem.is-open:not(:hover) { height: 86px; background: transparent; }
.agentmenu:has(.agentitem:hover) .agentitem.is-open:not(:hover) .agentitem__t { color: var(--pg-fg-3); transform: none; }
.agentmenu:has(.agentitem:hover) .agentitem.is-open:not(:hover) .agentitem__i { color: var(--pg-fg-4); }
.agentmenu:has(.agentitem:hover) .agentitem.is-open:not(:hover) .agentitem__d { height: 0; opacity: 0; }
.agentmenu:has(.agentitem:hover) .agentitem.is-open:not(:hover) .agentitem__arr { opacity: 0; }
.agentitem:hover + .agentitem, .agentitem:has(+ .agentitem:hover) { height: 110px; opacity: .72 !important; }

.agentstage { position: relative; }
.agentstage::before { content: ""; position: absolute; inset: -8% -6% -10% -6%; z-index: 0;
  background: radial-gradient(60% 60% at 50% 50%, rgba(var(--glow-1),0.12) 0%, transparent 70%); pointer-events: none; }
.agentframe { position: relative; z-index: 1; border-radius: 22px; background: #000;
  border: 1px solid var(--pg-border-s); padding: 14px; box-shadow: 0 34px 80px rgba(0,0,0,0.55); }
.agentframe > img, .agentframe > image-slot { width: 100%; display: block; border-radius: 12px; }
.agentframe.is-ratio { aspect-ratio: 16 / 10; }
.agentframe.is-ratio > image-slot { position: absolute; inset: 14px; width: auto; height: auto; }

/* ── Mobile overrides that must win over later base rules ─────────── */
@media (max-width: 760px) {
  /* stack the big step numeral above its text */
  .doc-steps li { grid-template-columns: 1fr; gap: 8px; align-items: start; }
  .ig-table { font-size: 12px; }
}

