/* ============================================================
   ░░░  DESIGN SYSTEM DRIFT GUARD  ░░░
   ------------------------------------------------------------
   This :root block is the single source of truth for the Base
   Element design system (v1.1, May 2026 / Brand Manual v2.0).
   Canonical reference: docs/DESIGN_SYSTEM.md
   Browse-mode addendum: docs/DESIGN_SYSTEM_BROWSE_ADDENDUM.md

   Rules — enforced by review:
     1. NO raw hex values outside this :root block. If a colour
        is needed elsewhere, add a token here first and reference
        it as var(--token).
     2. NO literal font family names outside this :root block.
        `font-family: var(--serif | --sans | --mono | --display)` is
        the only allowed form anywhere else — never `font-family:
        'DM Sans', ...` or any other quoted family name.
     3. The AA-lifted values for --text-mute, --text-faint, and
        --be-yellow-dim ARE the canonical v1.1 values. Do not
        "reconcile" them down to the lower-contrast spec drafts.
     4. Add new tokens to docs/DESIGN_SYSTEM.md FIRST, then add
        them here. Never inline a token in a route stylesheet
        without documenting it.
     5. BREAKPOINTS — canonical scale (Tailwind values). The site
        is desktop-first, so all width queries use max-width with
        the cutoff minus 1px. The ONLY allowed width queries are:
          @media (max-width: 639px)   → below sm (640) · small phone
          @media (max-width: 767px)   → below md (768) · mobile
          @media (max-width: 1023px)  → below lg (1024) · tablet
          @media (max-width: 1279px)  → below xl (1280) · small laptop
          @media (min-width: 1280px)  → xl and up · large desktop
        JS mobile checks mirror the md cutoff:
        matchMedia('(max-width: 767px)'). Do not introduce any
        other width value.
     6. PAGE SHELLS — canonical content wrappers (Task #601):
          Broad pages (/home, /work, /insights, /ai-ops, /about,
          /careers, /brief, /work/:slug, /insights/:slug,
          /privacy, /terms):
            max-width 1280px · padding 80px 48px desktop,
            56px 20px below md (767px). The footer-bar sits in normal
            document flow after #app (Task #718) — shells carry NO
            footer clearance; --footer-h may only appear on the fixed
            chat shell's inset.
            Long-form article text (insight body/end CTA) keeps a
            narrower reading measure INSIDE the shell.
          Application document (/apply):
            max-width 760px.
        Do not invent new shell widths. Enforced by stylelint
        (workspace/page-shell-convention, Task #613; detail pages
        aligned by Task #671): broad-page wrappers must match the
        recipe verbatim; the apply shell is the registered
        exception; --footer-h clearance may only appear on a
        documented exception in the plugin's allow-list (.screen--chat).
     7. SECTION RHYTHM — vertical space between major page
        sections is 96px desktop / 64px below md. Intra-section
        rhythm uses the --sp scale. No bespoke off-scale gaps.
     8. HEADING ROLES — one rule per role, identical on every page:
          Page hero    → serif light --fs-display / --lh-tight /
                         --ls-headline (case-study client names are
                         the documented exception: display 900).
          Section head → serif light-or-regular --fs-h1 / --lh-snug.
          Card/row     → --fs-h2 or --fs-sublede / --lh-snug.
          Sub-section  → --fs-h3 / --lh-snug.
          H5           → base rule in this file (sans medium body).
        PARAGRAPHS — DM Sans body copy uses --lh-body; --lh-article
        is reserved for the editorial (--serif register, DM Sans) prose. Never pair body sans with
        --lh-article.

   ──────────────────────────────────────────────────────────────
   THREE BRAND EXPRESSIONS — share the same foundation, swap
   surface + accent. Yellow only appears in expression A. The
   paper register (C) MUST stay yellow-free — sweep before ship.
   ──────────────────────────────────────────────────────────────
     A · Agentic dark
         Surface: --ink / --ink-2 / --ink-3 / --ink-line
         Accent : --be-yellow on em italics, hero metrics, focus
         Use on : /home, /ai-ops, / (Ask), dark hero moments
     B · Case panels (sector colour)
         Surface: --ink with sector tint header
         Accent : --sec-hospitality / --sec-retail / --sec-finance
                  / --sec-technology driving chip + dot + key numerals
         Use on : /work, /work/:slug, sector pills
     C · Brief paper + finance blue
         Surface: --paper / --bone
         Accent : --sec-finance for em italics + cues
         Use on : /brief, /apply, /legal — NO --be-yellow leakage
   ──────────────────────────────────────────────────────────────
*/

:root {
  /* ── Surfaces — dark register ───────────────────────────── */
  --ink:        #0E0E10;
  --ink-2:      #16161A;
  --ink-3:      #1E1E24;
  --ink-line:   #2A2A32;

  /* ── Surfaces — paper register ──────────────────────────── */
  --paper:      #F4F1EA;
  --bone:       #E8E3D7;
  --paper-line: rgba(14, 14, 16, 0.12);

  /* ── Text — on dark surfaces (AA-lifted, canonical v1.1) ──
     The lifted values below ARE canonical. The HTML reference
     spec lists lower-contrast drafts (#8A8A95 / #80808C / older
     #54545E) that fail WCAG AA on --ink (#0E0E10); we ship the
     lifted values. See docs/DESIGN_SYSTEM.md §Text. */
  --text:       #F4F1EA;   /* primary   · ~16:1   */
  --text-mute:  #B4B4BE;   /* secondary · ~8.5:1  */
  --text-faint: #9090A0;   /* tertiary  · ~6.0:1  */

  /* ── Brand — yellow accent (dark register only) ───────────
     --be-yellow-dim is the AA-lifted canonical v1.1 value
     (the HTML reference spec's #886600 fails AA on --ink). */
  --be-yellow:     #FFC217;
  --be-yellow-dim: #B88A10;

  /* ── Sector accents — work contexts only ──────────────────
     Chrome uses --be-yellow for emphasis/hover/focus instead. */
  --sec-hospitality:      #DA80AB;
  --sec-hospitality-dark: #B85F8B;
  /* Task #687: retail + technology now follow the finance base/-light
     split. Bases darkened so --paper text clears WCAG AA (≥4.5:1) on
     large surfaces (work tiles, empty states, case heroes); the -light
     companions keep the original hues for text/dots on --ink.
     Hospitality is the documented exception: its surfaces carry --ink
     text (never --paper), and the base doubles as the on-ink accent.
     Contrast pairs are enforced by scripts/stylelint/sector-contrast.test.mjs. */
  --sec-retail:           #3A7449;
  --sec-retail-light:     #4A8F5E;
  --sec-finance:          #2E51B5;
  --sec-finance-light:    #6B8FE0;
  --sec-technology:       #BC4300;
  --sec-technology-light: #E65300;
  /* Task #685: brand colours for the five formerly-neutral sectors.
     Base tokens carry --paper text on large surfaces (tiles, heroes);
     -light variants are the AA-lifted text-on-ink companions (same
     pattern as --sec-finance / --sec-finance-light). */
  --sec-public-sector:               #6C5FBF;
  --sec-public-sector-light:         #9C92E0;
  --sec-media:                       #B8433C;
  --sec-media-light:                 #E0736B;
  --sec-professional-services:       #2A727E;
  --sec-professional-services-light: #5FB0BD;
  --sec-energy-utilities:            #55701E;
  --sec-energy-utilities-light:      #A3C24C;
  --sec-industrial:                  #96552B;
  --sec-industrial-light:            #C98A55;
  --sec-education-research:          #245C69;
  --sec-education-research-light:    #78BDCC;

  /* ── Typography — two families, semantic roles ──────────
       --serif   → DM Sans (legacy register name — editorial body,
                   headings, em italics; formerly the serif family, swapped
                   weight-for-weight in Task #724)
       --sans    → DM Sans (UI, navigation, paragraphs — the default)
       --mono    → DM Mono (eyebrows, labels, wordmark, metadata)
       --display → DM Sans (legacy register name — display moments:
                   client names, hero metrics; formerly serif 900,
                   now DM Sans 900)
     System fonts are the only fallbacks. Only DM Sans + DM Mono are
     loaded via Google Fonts in index.html; the former serif family and all earlier
     transitional families have been removed from the loader and
     from every stylesheet. The --serif / --display token names are
     kept as semantic register aliases (editorial vs display roles)
     so the register-pairing lint guard keeps its meaning. */
  --serif:   'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sans:    'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:    'DM Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* ── Motion — one easing curve, one inverse ──────────────── */
  --ease:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);

  /* ── Radii ────────────────────────────────────────────────── */
  --r-xs:   4px;
  --r-sm:   6px;
  --r-md:   14px;
  --r-lg:   16px;
  --r-full: 999px;

  /* ── Paper register — warm variant for /apply ─────────────── */
  --paper-warm: #F6EFE1;

  /* ── Type scale — canonical font-size tokens (Task #527, floor
        raised Task #694). See docs/TYPOGRAPHY.md for the full
        per-element spec. Final ladder: 5 fixed steps (13/14/16/18/22)
        + 2 fluid clamps (h1, display). ACCESSIBILITY FLOOR: no token
        may resolve below 13px at any viewport width — enforced by
        scripts/stylelint/font-size-floor.test.mjs.
        Only --fs-display and --fs-h1 are clamps. */
  --fs-display:  clamp(40px, 5.5vw, 72px); /* page hero, one per page */
  --fs-h1:       clamp(28px, 3.4vw, 40px); /* mid-page section headlines */
  --fs-h2:       22px;                     /* card/row titles, hero sub-ledes via --fs-sublede alias */
  --fs-h3:       18px;                     /* sub-section headings, pull quotes */
  --fs-sublede:  22px;                     /* hero sub-ledes (DM Sans 300) — same step as --fs-h2 */
  --fs-body:     16px;                     /* default body (DM Sans) */
  --fs-sm:       14px;                     /* secondary text */
  --fs-xs:       13px;                     /* tertiary/help text — the floor */
  --fs-eyebrow:  13px;                     /* micro eyebrows (DM Mono): panel-eyebrow, section-label, nav/logo, form steps, footer copy, legal markers. Raised 11→13px (Task #694 floor); micro character now carried by mono + tracking + colour, not size */
  --fs-label:    13px;                     /* interactive labels, pills, tags & card metadata (DM Mono). Raised 12→13px (Task #694 floor); kept as a semantic alias of the micro step */
  --fs-eyebrow-section: 14px;              /* section-intro eyebrows (DM Mono): hero / major section openers. Was clamp(12px,1.05vw,14px); fixed at the 14px step so it never dips below the floor */

  /* ── Weight scale — 5 tokens. Migration map: 600→500;
        700→500 for labels/eyebrows; 700/800→900 for display face. */
  --fw-light:    300;
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-bold:     700;                      /* emphasis in body contexts (client-name labels, expandable toggles) */
  --fw-display:  900;

  /* ── Letter-spacing — 6 tokens. All other tracking values map
        to the nearest of these. */
  --ls-tight:    -0.035em; /* display client names */
  --ls-headline: -0.025em; /* hero & section headlines */
  --ls-metric:   -0.03em;  /* metric numbers (DM Sans 900) */
  --ls-body:     0;        /* body running text */
  --ls-caps:     0.18em;   /* micro eyebrows, mono labels. Was 0.22em when the micro step was 11px; tightened with the 13px floor (Task #696) so absolute tracking (~2.3px) matches the old optical density */
  --ls-caps-section: 0.18em; /* section-intro eyebrows — same em tracking as --ls-caps since Task #696; kept as a separate semantic token (14px step) */
  --ls-nav:      0.14em;   /* nav, buttons, chips. Was 0.16em; tightened alongside --ls-caps (Task #696) to offset the 11/12→13px raise on nav links and label chips */

  /* ── Line-height — 5 tokens. All other line-heights map to
        the nearest of these. */
  --lh-tight:    1.05;     /* display, hero headlines */
  --lh-snug:     1.2;      /* section headlines, card titles */
  --lh-base:     1.5;      /* sub-ledes, compact body */
  --lh-article:  1.65;     /* insight article body (editorial 22) */
  --lh-body:     1.7;      /* default body, browse paragraphs */

  /* ── Measure scale — canonical max-width tokens for prose. */
  --measure-meta:  22ch;
  --measure-prose: 44ch;
  --measure-lede:  52ch;
  --measure-body:  60ch;
  --measure-wide:  64ch;

  /* ── Spacing — 8-base scale ──────────────────────────────── */
  --sp-1:  4px;
  --sp-2:  8px;
  --sp-3:  12px;
  --sp-4:  16px;
  --sp-5:  20px;
  --sp-6:  24px;
  --sp-8:  32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-14: 56px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;
  --sp-30: 120px;

  /* ── Layout chrome heights ───────────────────────────────── */
  --nav-h:    56px;
  --footer-h: 40px;

  /* ============================================================
     Legacy aliases — DO NOT USE IN NEW CODE.
     These exist so existing stylesheets keep working without a
     mass rename. New rules must reference the canonical tokens
     above (--be-yellow, --serif, --sans, --mono, --display, etc.).
     ============================================================ */
  --yellow:           var(--be-yellow);
  --black:            #000000;
  --white:            #FFFFFF;
  --off-white:        #F0EDE6;
  --brand-blue:       var(--sec-finance);
  --brand-blue-dark:  #21408F;
  --orange:           var(--sec-technology-light); /* dark-register accent — keeps the original #E65300 (Task #687) */
  --orange-dim:       rgba(230, 83, 0, 0.1);
  --orange-border:    rgba(230, 83, 0, 0.25);
  --red:              #E24B4A;
  --green:            #34A672;
  --gray-90:          #161616;
  --gray-80:          #1A1A1A;
  --gray-60:          rgba(255, 255, 255, 0.6);
  --gray-40:          rgba(255, 255, 255, 0.4);
  --gray-20:          rgba(255, 255, 255, 0.2);
  --gray-10:          rgba(255, 255, 255, 0.1);
  --gray-06:          rgba(255, 255, 255, 0.06);
  --yellow-dim:       rgba(255, 194, 23, 0.1);
  --yellow-border:    rgba(255, 194, 23, 0.25);
  --paper-deep:       #ECE6D6;
  --ink-mute:         rgba(14, 14, 16, 0.72);
  --ink-faint:        rgba(14, 14, 16, 0.55);
  --ease-out:         var(--ease);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  /* Task #718: the footer-bar is in normal flow after #app. The body
     is a full-viewport flex column so #app stretches and the footer
     lands at the viewport bottom even on short pages. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

#app { flex: 1 0 auto; }

/* Base H5 — shared sub-label rule so bare <h5> markup (e.g. the
   architecture-panel note headings) never falls back to browser
   defaults. Pages may override with a scoped class, but this is
   the canonical treatment: DM Sans body-size medium, snug. */
h5,
.note-heading {
  font-family: var(--sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  line-height: var(--lh-snug);
  color: var(--text);
}

/* ---- NAV ---- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-8);
  background: var(--gray-90);
  border-bottom: 0.5px solid var(--gray-10);
  transition: opacity .42s var(--ease);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.be-mark {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

/* Brand-manual helper classes (Gilroy weights). */
.gilroy_bold {
  font-family: var(--sans);
  font-weight: var(--fw-medium);
}

.gilroy_light {
  font-family: var(--sans);
  font-weight: var(--fw-light);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-6);
  margin-left: auto;
  order: 1;
}

.nav-link {
  background: none;
  border: none;
  font-family: var(--mono);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-nav);
  text-transform: uppercase;
  color: var(--gray-40);
  cursor: pointer;
  transition: color 0.2s;
  padding: var(--sp-1) 0;
  white-space: nowrap;
  position: relative;
  text-decoration: none;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s var(--ease-out);
}

.nav-link:hover, .nav-link.active { color: var(--yellow); }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

/* ---- MODE SWITCHER (Task #370) ----
   A two-button pill sitting between the brand mark and the classic
   nav links. Persistent across both registers. The active button
   gets a yellow dot in the dark register and a sec-finance dot in
   the paper register. In agentic mode the .nav-links row is hidden
   so the chrome reads brand · switcher only — keeping the agentic
   surface visually quieter than the editorial pages. */
.nav-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 3px;
  border-radius: var(--r-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-left: var(--sp-6);
  order: 2;
}

.nav-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px var(--sp-3);
  border-radius: var(--r-full);
  font-family: var(--mono);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-nav);
  text-transform: uppercase;
  color: var(--gray-40);
  transition: color 0.18s, background 0.18s;
}

.nav-mode-btn:hover { color: var(--white); }

.nav-mode-btn.active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.nav-mode-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.18s, box-shadow 0.18s;
}

.nav-mode-btn.active .nav-mode-dot {
  background: var(--yellow);
  box-shadow: 0 0 0 2px rgba(255, 194, 23, 0.18);
}

/* Paper register — invert the pill for legibility on cream. */
body.theme-paper .nav-mode-switch {
  background: rgba(14, 14, 16, 0.04);
  border-color: rgba(14, 14, 16, 0.08);
}

body.theme-paper .nav-mode-btn { color: rgba(14, 14, 16, 0.55); }
body.theme-paper .nav-mode-btn:hover { color: var(--ink); }
body.theme-paper .nav-mode-btn.active {
  color: var(--ink);
  background: rgba(14, 14, 16, 0.06);
}
body.theme-paper .nav-mode-btn.active .nav-mode-dot {
  background: var(--sec-finance);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--sec-finance) 18%, transparent);
}

/* Agentic mode hides the classic nav-links row. With nav-links gone,
   the switcher needs its own margin-left: auto to stay pinned to the
   right edge (in classic, .nav-links provides that auto-margin and the
   switcher sits flush against it). */
body.mode-agentic .nav-links { display: none; }
body.mode-agentic .nav-mode-switch { margin-left: auto; }
/* Task #711: the burger only opens the classic links drawer, which is
   suppressed in agentic mode — so hide the button itself in Ask.
   Higher specificity than the mobile `.nav-burger { display:flex }`
   rule, so this wins in either source order. */
body.mode-agentic .nav-burger { display: none; }

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-1);
  order: 3;
}

.nav-burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  transition: all 0.2s;
}

/* ---- SCREENS ----
   The global footer sits in normal flow after #app (Task #718), so
   document-scrolling screens simply end above it. The fixed chat shell
   bounds its own working area via its inset (which still reserves
   --footer-h so the in-flow footer stays visible beneath it). */
.screen {
  display: none;
  padding-top: var(--nav-h);
}

.screen.active { display: flex; flex-direction: column; }

/* ---- GLOBAL FOOTER BAR ----
   In-flow strip at the end of the document (Task #718 — not sticky).
   Lives outside #app; body is a min-height:100svh flex column with
   #app flexing to fill, so on short pages (and the fixed chat shell,
   whose inset still reserves --footer-h) the footer sits at the
   viewport bottom, while long pages reveal it only at scroll end. The
   paper variant is toggled at body level on /privacy, /terms, /brief. */
.footer-bar {
  flex-shrink: 0;
  height: var(--footer-h);
  background: var(--ink);
  border-top: 1px solid var(--ink-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-5);
  font-family: var(--mono);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-nav);
  text-transform: uppercase;
  color: rgba(244, 241, 234, 0.45);
}

/* Desktop/tablet: copy and links share one 40px row — there is
   always room, so no truncation occurs. Below 640px the bar stacks
   into two rows instead (Task #711) so the copyright is never
   clipped at any width. */
.footer-bar__copy {
  white-space: nowrap;
  min-width: 0;
  flex: 0 1 auto;
}

.footer-bar__nav {
  display: flex;
  gap: var(--sp-5);
  align-items: center;
}

.footer-bar__link {
  color: rgba(244, 241, 234, 0.55);
  text-decoration: none;
  transition: color 0.15s;
}

.footer-bar__link:hover { color: var(--yellow); }

@media (max-width: 639px) {
  /* Task #711: the tracked 13px mono copyright plus PRIVACY/TERMS
     cannot fit one row at narrow widths, so stack the bar into two
     rows. --footer-h is overridden at :root scope so the fixed chat
     shell's inset grows with it. */
  :root { --footer-h: 64px; }
  .footer-bar {
    padding: var(--sp-2) 0.875rem;
    font-size: var(--fs-label);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: var(--sp-1);
    /* Snug line-height keeps two rows well inside 64px; if the
       (admin-editable) copy ever wraps, the in-flow bar simply grows
       taller instead of clipping the text. */
    line-height: var(--lh-snug);
    height: auto;
    min-height: var(--footer-h);
  }
  /* Untracked at mobile so the full notice fits one line even at
     320px; white-space: normal is the safety net for narrower
     viewports — the 64px bar has room for a second line. */
  .footer-bar__copy { white-space: normal; letter-spacing: var(--ls-body); }
  .footer-bar__nav { gap: 0.875rem; flex-shrink: 0; }
}

/* The fixed footer bar and fixed top nav would otherwise stamp
   themselves over every printed page (privacy, terms, insights,
   case studies…). */
@media print {
  .footer-bar,
  .nav,
  .nav-burger {
    display: none !important;
  }
}

/* ---- TOPBAR + FOOTER PAPER VARIANT ----
   Routes: /privacy, /terms, /brief/:ref. Same on/off mechanism for
   every paper-register surface. */
body.theme-paper {
  background: var(--paper);
  color: var(--ink);
}

body.theme-paper .nav {
  background: var(--paper);
  border-bottom-color: var(--paper-line);
}

body.theme-paper .be-mark {
  /* Dark-on-transparent mark inverts cleanly to ink in paper mode. */
  filter: brightness(0) saturate(100%);
}

body.theme-paper .nav-link { color: rgba(14, 14, 16, 0.55); }
body.theme-paper .nav-link:hover,
body.theme-paper .nav-link.active { color: var(--sec-finance); }
body.theme-paper .nav-link::after { background: var(--sec-finance); }
body.theme-paper .nav-burger span { background: var(--ink); }

body.theme-paper .footer-bar {
  background: var(--paper);
  border-top-color: var(--paper-line);
  color: rgba(14, 14, 16, 0.45);
}

body.theme-paper .footer-bar__link { color: rgba(14, 14, 16, 0.55); }
body.theme-paper .footer-bar__link:hover { color: var(--sec-finance); }

@media (max-width: 767px) {
  body.theme-paper .nav-links {
    background: var(--paper);
    border-bottom-color: var(--paper-line);
  }
}

/* ---- TOAST ---- */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--yellow);
  color: var(--black);
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  padding: 10px var(--sp-5);
  border-radius: 2px;
  opacity: 0;
  transition: all 0.3s var(--ease-out);
  pointer-events: none;
  white-space: nowrap;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-20); border-radius: 2px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 767px) {
  /* Mobile topbar — compressed to 48px so the conversation
     bottom-sheet has the most vertical room. Inline nav links are
     hidden in favour of a burger button that opens a drawer panel
     anchored under the top bar. */
  :root { --nav-h: 48px; }
  .nav { height: 48px; padding-inline: var(--sp-4); }

  .nav-burger { display: flex; }

  /* Mode switcher — keep it visible on mobile but compress so the
     burger still has room. On mobile the classic nav-links collapse
     into the burger menu, so the switcher needs its own auto-margin
     to stay right-anchored regardless of mode. */
  .nav-mode-switch {
    margin-left: auto;
    margin-right: 10px;
    padding: 2px;
  }
  .nav-mode-btn {
    padding: var(--sp-1) 9px;
    font-size: var(--fs-eyebrow);
    letter-spacing: var(--ls-nav);
  }
  .nav-mode-dot { width: 5px; height: 5px; }

  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--sp-2) 0;
    background: var(--gray-90);
    border-bottom: 0.5px solid var(--gray-10);
    z-index: 95;
  }

  .nav-links.open { display: flex; }

  .nav-links .nav-link {
    padding: 14px var(--sp-5);
    font-size: var(--fs-xs);
  }
}

/* ============================================================
   DESIGN-SYSTEM PRIMITIVES — frames, list rows, element entry
   Codified per Brand Manual v2.0 / Design System v1.1. The
   About / AI Ops / Careers pages compose against these classes
   so all three pages read as the same family of frames.

   .panel        — structural section frame (ink-2 + 1px ink-line, 0 radius)
   .list-row     — editorial row (rule-only, no fill, no radius)
   .element-entry — interactive entry-point card (ink-2 + 1px ink-line
                   + r-md + yellow pulse + yellow arrow on hover)
   .btn-primary  — yellow pill CTA (mono, uppercase, r-full)
   ============================================================ */

.panel {
  background: var(--ink-2);
  border: 1px solid var(--ink-line);
  border-radius: 0;
}

.list-row-group {
  border-top: 1px solid var(--ink-line);
}
.list-row {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-6) 0;
  border-bottom: 1px solid var(--ink-line);
}

.element-entry {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  width: 100%;
  padding: var(--sp-5) var(--sp-6);
  background: var(--ink-2);
  border: 1px solid var(--ink-line);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  font-family: var(--sans);
  color: var(--text);
  transition: border-color .2s var(--ease-out),
              background .2s var(--ease-out);
}
.element-entry:hover,
.element-entry:focus-visible {
  border-color: var(--be-yellow);
  background: var(--ink-3);
  outline: none;
}
.element-entry__pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--be-yellow);
  flex-shrink: 0;
  animation: element-entry-pulse 2.4s var(--ease-out) infinite;
}
/* Locked off-scale (Task #527 / docs/TYPOGRAPHY.md):
   the entry-point prompt renders at --fs-body. The italic editorial
   register is retained for the editorial "ask" voice. */
.element-entry__prompt {
  flex: 1;
  min-width: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: var(--fw-regular);
  font-size: var(--fs-body);
  line-height: var(--lh-base);
  color: var(--text-mute);
  transition: color .2s var(--ease-out);
}
.element-entry:hover .element-entry__prompt,
.element-entry:focus-visible .element-entry__prompt {
  color: var(--text);
}
.element-entry__arrow {
  /* "→" glyph affordance — mono at --fs-body sizes the arrow, not text
     (docs/TYPOGRAPHY.md §Glyph affordances, Task #702). */
  font-family: var(--mono);
  font-size: var(--fs-body);
  color: var(--be-yellow);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .2s var(--ease-out),
              transform .2s var(--ease-out);
  flex-shrink: 0;
}
.element-entry:hover .element-entry__arrow,
.element-entry:focus-visible .element-entry__arrow {
  opacity: 1;
  transform: translateX(0);
}
@keyframes element-entry-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 194, 23, 0.55); }
  50%      { box-shadow: 0 0 0 8px rgba(255, 194, 23, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .element-entry__pulse { animation: none; }
}

/* ============================================================
   .eyebrow primitive (Task #424).
   Shared mono / 11px / 0.22em uppercase eyebrow used across the
   Browse Mode pages. Two modifier variants:
     · .eyebrow--rule  — yellow rule + yellow label (above the
                        page H1; the prominent treatment used on
                        /about, /home opening, /work editorial,
                        /ai-ops hero).
     · .eyebrow--faint — dim DM Sans medium with a 1px ink-line
                        bottom border (the section-label treatment
                        used by /home, /about and any other page
                        opening a standard section — Task #569).
   The page-local class names that previously hand-rolled this
   pattern (.about-eyebrow, .about-section-label,
   .work-editorial__eyebrow) are aliased into the same selector
   list so existing markup keeps working without churn. The two
   variants that carry per-page deltas (.aiops-eyebrow has
   font-weight 600; .insight-eyebrow uses gap 16 + flex-wrap and
   skips the rule for its date+divider trio) keep their own
   definitions in their respective stylesheets.
   ============================================================ */
.eyebrow,
.about-eyebrow,
.about-section-label,
.work-editorial__eyebrow,
.aiops-eyebrow,
.aiops-cap__eyebrow,
.aiops-eng__eyebrow,
.aiops-insights__eyebrow,
.careers-hero__eyebrow,
.insight-eyebrow {
  font-family: var(--mono);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-regular);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
}
/* Section-intro tier (Task #541) — promote major page/section openers
   to a larger eyebrow size with slightly tighter caps tracking. The
   bare .eyebrow primitive and .insight-eyebrow (article metadata)
   stay on the micro 10px size above; .eyebrow--rule / .eyebrow--faint
   are promoted because they always denote a section opener (yellow
   rule above the headline / faint rule beneath the label). */
.eyebrow--rule,
.eyebrow--faint,
.about-eyebrow,
.about-section-label,
.work-editorial__eyebrow,
.aiops-eyebrow,
.aiops-cap__eyebrow,
.aiops-eng__eyebrow,
.aiops-insights__eyebrow,
.careers-hero__eyebrow {
  font-size: var(--fs-eyebrow-section);
  letter-spacing: var(--ls-caps-section);
}
.eyebrow--rule,
.about-eyebrow,
.work-editorial__eyebrow,
.aiops-eyebrow,
.aiops-cap__eyebrow,
.aiops-eng__eyebrow,
.aiops-insights__eyebrow,
.careers-hero__eyebrow {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--be-yellow);
  margin-bottom: var(--sp-8);
}
.eyebrow--rule::before,
.about-eyebrow::before,
.work-editorial__eyebrow::before,
.aiops-eyebrow::before,
.aiops-cap__eyebrow::before,
.aiops-eng__eyebrow::before,
.aiops-insights__eyebrow::before,
.careers-hero__eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--be-yellow);
}
/* ============================================================
   SECTOR PILLAR LABELS — shared accent recipe (Task #731).
   Single source of truth for the per-sector text colour on row/card
   pillar labels (/insights rows + featured cards, /careers rows,
   /work list sector labels — Task #735).
   Text sits on the dark --ink register, so each sector uses its
   -light companion for AA contrast; hospitality is the documented
   exception whose base token doubles as the on-ink accent (see the
   sector token comments above). Add new pillar-label selectors here
   rather than duplicating the per-sector list in page stylesheets.
   ============================================================ */
.insights-row__pillar[data-sector="hospitality"],
.insights-card__pillar[data-sector="hospitality"],
.careers-row__pillar[data-sector="hospitality"],
.work-list__sector[data-sector="hospitality"] { color: var(--sec-hospitality); }
.insights-row__pillar[data-sector="retail"],
.insights-card__pillar[data-sector="retail"],
.careers-row__pillar[data-sector="retail"],
.work-list__sector[data-sector="retail"] { color: var(--sec-retail-light); }
.insights-row__pillar[data-sector="finance"],
.insights-card__pillar[data-sector="finance"],
.careers-row__pillar[data-sector="finance"],
.work-list__sector[data-sector="finance"] { color: var(--sec-finance-light, var(--sec-finance)); }
.insights-row__pillar[data-sector="technology"],
.insights-card__pillar[data-sector="technology"],
.careers-row__pillar[data-sector="technology"],
.work-list__sector[data-sector="technology"] { color: var(--sec-technology-light); }
.insights-row__pillar[data-sector="public-sector"],
.insights-card__pillar[data-sector="public-sector"],
.careers-row__pillar[data-sector="public-sector"],
.work-list__sector[data-sector="public-sector"] { color: var(--sec-public-sector-light); }
.insights-row__pillar[data-sector="media"],
.insights-card__pillar[data-sector="media"],
.careers-row__pillar[data-sector="media"],
.work-list__sector[data-sector="media"] { color: var(--sec-media-light); }
.insights-row__pillar[data-sector="professional-services"],
.insights-card__pillar[data-sector="professional-services"],
.careers-row__pillar[data-sector="professional-services"],
.work-list__sector[data-sector="professional-services"] { color: var(--sec-professional-services-light); }
.insights-row__pillar[data-sector="energy-utilities"],
.insights-card__pillar[data-sector="energy-utilities"],
.careers-row__pillar[data-sector="energy-utilities"],
.work-list__sector[data-sector="energy-utilities"] { color: var(--sec-energy-utilities-light); }
.insights-row__pillar[data-sector="industrial"],
.insights-card__pillar[data-sector="industrial"],
.careers-row__pillar[data-sector="industrial"],
.work-list__sector[data-sector="industrial"] { color: var(--sec-industrial-light); }
.insights-row__pillar[data-sector="education-research"],
.insights-card__pillar[data-sector="education-research"],
.careers-row__pillar[data-sector="education-research"],
.work-list__sector[data-sector="education-research"] { color: var(--sec-education-research-light); }

.eyebrow--faint,
.about-section-label {
  /* Section eyebrows (SELECTED WORK, SIX DISCIPLINES, THE FOUNDERS,
     etc.) render site-wide in DM Sans medium against the faint text
     token. /home set this canonical treatment first (Task #554) and
     /about + any other page using .about-section-label inherits it
     from this single source of truth (Task #569). */
  font-family: var(--sans);
  font-weight: var(--fw-medium);
  color: var(--text-faint);
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--ink-line);
}

/* ============================================================
   CTA TYPOGRAPHY (Task #554)
   Site-wide flip of CTA / interactive-label buttons from DM Mono
   to DM Sans. One shared selector list so every page picks up the
   same treatment without per-file font-family overrides.
     · .insight-endcta__btn — shared end-of-page CTA on every
       classic-site page (rendered by BE.endCta, and /ai-ops which
       reuses the same band).
     · .careers-role__apply — /careers role apply button.
     · .insights-empty__reset — /insights "View all" reset CTA.
     · .quick-reply         — chat quick-reply chips (start +
       follow-up + agent-intro variants all extend this base).
   ============================================================ */
.insight-endcta__btn,
.careers-role__apply,
.insights-empty__reset,
.quick-reply {
  font-family: var(--sans);
}

/* ============================================================
   .browse-body — shared body-paragraph rule for Browse pages
   (Task #458). DM Sans 18px / weight 400 / line-height 1.7
   (sized to --fs-h3 in Task #547 so the shared body register
   matches the Insight article body face).
   Page-specific body containers are aliased onto this primitive
   so all six Browse pages share one paragraph register.
   Decorative editorial text (home summary lede, insights deck
   italic, aiops hard-truth body) keeps its page-local rule.
   ============================================================ */
.browse-body,
.aiops-live-signal__body,
.careers-principle__body {
  font-family: var(--sans);
  font-size: var(--fs-h3);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  color: var(--text-mute);
}

/* ============================================================
   .stats-band primitive (Task #424).
   Canonical 4-up grid of DM Sans 900 56px yellow numerals over
   DM Mono labels. /home, /about, and /ai-ops all render their
   stats through this primitive at the same canonical size.
   The wrapper chrome (border rules, vertical padding, eyebrow)
   lives on the shared .stats-band-section class below
   (Task #537); this primitive only renders the inner grid.
   ============================================================ */
.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-8);
}
.stats-band__stat {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.stats-band__num {
  font-family: var(--display);
  font-weight: var(--fw-display);
  font-size: var(--fs-display);
  letter-spacing: var(--ls-headline);
  line-height: var(--lh-tight);
  color: var(--be-yellow);
}
.stats-band__label {
  font-family: var(--mono);
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-nav);
  text-transform: uppercase;
  color: var(--text-mute);
  line-height: var(--lh-base);
  max-width: 24ch;
}
@media (max-width: 1023px) {
  .stats-band { grid-template-columns: repeat(2, 1fr); gap: var(--sp-10) var(--sp-8); }
}
@media (max-width: 767px) {
  .stats-band { grid-template-columns: repeat(2, 1fr); gap: var(--sp-8) var(--sp-6); }
  .stats-band__num { font-size: var(--fs-display); }
}

/* ============================================================
   .stats-band-section — canonical wrapper for the .stats-band
   primitive shared by /home, /about, and /ai-ops (Task #537).
   Treatment: top + bottom rule, transparent background, 56px
   vertical padding, faint DM Mono eyebrow above the numerals.
   Chosen over /about's full-bleed dark strip because it sits
   cleanly inside the standard page wrap on all three surfaces
   without requiring negative horizontal margins, and over a
   plain unframed section because the rules give the band the
   same "stats moment" weight on each page. Pages pass their
   own eyebrow copy keys but otherwise share this wrapper 1:1.
   ============================================================ */
.stats-band-section {
  padding: var(--sp-14) 0;
  border-top: 1px solid var(--ink-line);
  border-bottom: 1px solid var(--ink-line);
  margin-bottom: var(--sp-24);
}
.stats-band-section__head {
  margin-bottom: var(--sp-8);
}
.stats-band-section__eyebrow {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: var(--fs-eyebrow-section);
  letter-spacing: var(--ls-caps-section);
  text-transform: uppercase;
  color: var(--text-faint);
}
@media (max-width: 767px) {
  .stats-band-section { padding: var(--sp-10) 0; margin-bottom: 64px; }
  .stats-band-section__head { margin-bottom: var(--sp-6); }
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--be-yellow);
  color: var(--ink);
  border: 1px solid var(--be-yellow);
  border-radius: var(--r-full);
  padding: 13px 23px;
  font-family: var(--mono);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-medium);
  letter-spacing: var(--ls-nav);
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background .2s var(--ease-out), color .2s var(--ease-out);
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: transparent;
  color: var(--be-yellow);
  outline: none;
}
