/* ============================================================================
   ATLAS — Benali design system (production)
   ----------------------------------------------------------------------------
   This file is the AUTHORITATIVE implementation of the Atlas brand for any
   surface: apps, client deliverables, documents, internal tools, landings.
   Link it. Do not re-derive tokens or re-invent components from screenshots.

   Companions:
   - brand-guidelines.md   — machine-readable spec + hard rules (R01–R19)
   - atlas-components.html — rendered component sheet (visual reference)
   - atlas-landing.html    — the marketing landing: ONE surface built on this
                             system, with landing-only moves (accent H1 word,
                             dark bands, the Atlas line). Do not copy landing
                             moves onto other surfaces.

   THE LAWS (digest — full text in brand-guidelines.md §6):
   1. Majorelle is ink, not paint (~2% of a viewport). It never fills panels,
      buttons, badges, or backgrounds, and never draws borders around cards.
   2. Outside the locked hero copy, NO header on ANY surface carries an
      accent-colored word. Accent lives in kickers, live dots, and links.
   3. The filled pill silhouette means INTERACTIVE. Static labels (status,
      tag, count, category) never take a pill fill.
   4. One font: Hanken Grotesk. Headers 700, body 400, figures hairline 300.
      Figures are never bold and never accent-colored at display size.
   5. The engineering grid is a ground, not wallpaper: open architectural
      grounds only, always masked, never behind a reading column or object.
   6. Dark (slate-deep) surfaces are reserved moments of weight — at most two
      per page. On working surfaces, dark fill appears only in buttons.
   7. Motion is never faster than a breath; nothing re-animates on scroll.
   ========================================================================== */


/* ============================================================================
   01 · TOKENS  (mirrors brand-guidelines.md §1 — never invent a hex;
                 tints are color-mixed from these, per R14)
   ========================================================================== */

:root {
  /* Grounds (light) — cream and slate do the work */
  --ivory: #f7f3ea;        /* primary page ground */
  --bone: #fcfaf4;         /* object / card surface */
  --cream: #efe8d9;        /* tint only — NEVER text */
  --taupe: #d9d0be;        /* warm hairline */

  /* Ink / dark grounds */
  --slate: #2e333b;        /* primary text + voice */
  --slate-deep: #22262d;   /* dark ground — moments of weight only */
  --slate-mid: #5b626d;    /* secondary text, labels */

  /* Accent — the ONLY signature color. Means "live". */
  --majorelle: #4a52d8;
  --majorelle-soft: #9aa0ee;  /* replaces majorelle on dark grounds */

  /* Hairlines */
  --line: rgba(46, 51, 59, 0.12);
  --line-strong: rgba(46, 51, 59, 0.26);
  --line-faint: rgba(46, 51, 59, 0.07);
  --line-light: rgba(247, 243, 234, 0.14);
  --line-light-strong: rgba(247, 243, 234, 0.28);

  /* Engineering grid — hairline (0.5px) ink, ground only, always masked */
  --grid: rgba(46, 51, 59, 0.09);
  --grid-soft: rgba(46, 51, 59, 0.045);  /* card-interior rendition */
  --grid-light: rgba(247, 243, 234, 0.07);

  /* One family for everything */
  --font-display: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --font-body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;

  /* Form */
  --radius-object: 4px;     /* cards, plates, tags — soft square */
  --radius-control: 100px;  /* pill — INTERACTIVE controls only (law 3) */
  --shadow-object: 0 44px 90px rgba(34, 38, 45, 0.10), 0 8px 24px rgba(34, 38, 45, 0.05);
  --shadow-object-soft: 0 36px 80px rgba(34, 38, 45, 0.07);

  /* Spacing scale — use these steps; don't free-hand gaps */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 14px;
  --space-4: 20px;
  --space-5: 28px;
  --space-6: 40px;
  --space-7: 56px;
  --space-8: 90px;
  --space-9: 140px;

  /* Layout */
  --measure: 1280px;         /* page container */
  --measure-narrow: 820px;   /* centered reading / head column */
  --gutter: 40px;            /* page side padding (24px under 720px) */

  /* Motion — never faster than a breath */
  --ease-breath: cubic-bezier(0.16, 1, 0.3, 1);
}


/* ============================================================================
   02 · BASE + TYPE RAMP
   ========================================================================== */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--ivory);
  color: var(--slate);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
strong { font-weight: 600; }

/* Headers: bold 700, tight tracking (the Ledger graft). All-slate — a header
   never carries an accent-colored word on any surface (law 2). The one
   exception in the whole brand is the locked landing hero H1. */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--slate);
}

h1 { font-size: clamp(44px, 5.2vw, 76px); line-height: 0.98; }
h2 { font-size: clamp(38px, 4.6vw, 64px); line-height: 1.0; }
h3 { font-size: clamp(22px, 2.5vw, 30px); line-height: 1.06; letter-spacing: -0.03em; }
h4 { font-size: 21px; line-height: 1.18; letter-spacing: -0.025em; }

/* Working surfaces (apps, documents) run the ramp one register quieter —
   put .surface-app on <body> and h1 lands at ~44–52px instead of hero scale. */
.surface-app h1 { font-size: clamp(36px, 3.6vw, 52px); }
.surface-app h2 { font-size: clamp(26px, 2.8vw, 36px); }

/* Emphasis is color only — never italic, never bold-as-emphasis (R05).
   Use <em> sparingly in BODY copy; never inside a header (law 2). */
em { font-style: normal; color: var(--majorelle); }
.dark em { color: var(--majorelle-soft); }

.lede { color: var(--slate-mid); font-size: 18px; line-height: 1.75; font-weight: 400; }
.small { color: var(--slate-mid); font-size: 13.5px; line-height: 1.7; }

/* Figures: hairline 300 — the deliberate bold-header / thin-figure contrast.
   NEVER bold a figure, never set a display numeral in majorelle (law 4). */
.figure-num {
  display: block;
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 300;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--slate);
}

.figure-lbl {
  display: block;
  margin-top: 8px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--slate-mid);
  line-height: 1.6;
}


/* ============================================================================
   03 · MARKS  (wordmark, lockup, utility mark)
   ----------------------------------------------------------------------------
   PLACE MARKS AS IMAGES from assets/logos/ — never re-typeset them in
   CSS/HTML. The assets carry the exact glyphs, tracking, and (in the
   -clearspace variants) the spacing ratio baked in.

   Wordmark — FOUR OPTICAL RENDITIONS (ladder ratified 2026-07-08): weight and
   tracking relax as the mark grows. Pick by CAP HEIGHT (the tight image's
   rendered height); never scale one rendition across ranges:
     S  ≤24px cap   600/0.26em  benali-wordmark-{on-light,on-dark,current}.svg      (w = cap × 6.386)
     M  24–48px cap 500/0.22em  benali-wordmark-m-*.svg                             (w = cap × 6.049)
     L  48–64px cap 500/0.18em  benali-wordmark-l-*.svg                             (w = cap × 5.762)
     D  >64px cap   400/0.16em  benali-wordmark-d-*.svg                             (w = cap × 5.570)
   Each also ships *-clearspace.svg (1 cap height baked into the viewBox on
   all sides — place flush; at image height H the cap height is H/3).
   Utility:   assets/logos/utility-mark/ — the dark tile IS the favicon/app
              icon (full PNG set 16-512); the bone object form for covers.
   The Light: assets/logos/the-light/ — avatar / live dot.

   The .mark text class below is the LIVE-TEXT FALLBACK only (email
   signatures, plain-text contexts where an image can't load). */

/* Tight-cropped wordmark SVG at nav scale. The image height IS the cap
   height; 9.8px matches the ratified landing nav rendering (live text at
   font-size 14px -> cap 14 x 0.697 = 9.8px). BOTH dimensions are set
   explicitly — Safari won't reliably derive an SVG image's width from height
   alone (especially as a flex item). To resize, override BOTH, keeping the
   ratio: tight wordmark is 6.386:1 (w = h × 6.386), clearspace variant is
   2.795:1 (w = h × 2.795). (Ratios reflect the ratified +0.26em tracking.) */
.mark-img {
  display: block;
  height: 9.8px;
  width: 62.6px;
  flex-shrink: 0;
}

/* For *-clearspace.svg assets: the SAME optical wordmark (9.8px cap) with the
   baked clearspace around it (total height = cap × 3). */
.mark-img-clearspace {
  display: block;
  height: 29.4px;
  width: 82.2px;
  flex-shrink: 0;
}

/* Live-text fallback: Hanken 600 tracked caps. Clearspace = one cap height.
   The wordmark is always slate on light / bone on dark — never majorelle. */
.mark {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--slate);
}

.dark .mark { color: var(--bone); }

/* Lockup: wordmark (image, via .mark-img) + hairline divider + surface/client
   title. The wordmark is the constant; the title is quieter (sentence case,
   slate-mid) so the mark stays dominant. Use for app nav bars and document
   headers. */
.mark-lockup {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.mark-lockup .mark { position: relative; top: 1px; } /* text-fallback baseline */

.mark-lockup .lockup-divider {
  width: 1px;
  height: 16px;
  background: var(--line-strong);
}

.mark-lockup .lockup-title {
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--slate-mid);
}

/* Utility mark: the capital B in a hairline plate, for surfaces too small to
   track the wordmark. The B follows WORDMARK coloring — never majorelle
   (majorelle B retired 2026-06-30). Do NOT rebuild it in CSS — place the
   asset: assets/logos/utility-mark/svg/benali-utility-{on-light,on-dark}.svg
   (dark tile = THE favicon/app icon; PNG set covers 16-512). */


/* ============================================================================
   04 · CONTROLS  (interactive elements — the ONLY things that may be a
                   filled pill, per law 3)
   ========================================================================== */

/* Buttons: pill, sentence case (the only non-tracked controls in the brand).
   Resting primary = slate fill, bone text. NEVER majorelle-filled (R11). */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 26px;
  border-radius: var(--radius-control);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 220ms ease, color 220ms ease, transform 220ms ease,
              border-color 220ms ease, box-shadow 220ms ease;
  white-space: nowrap;
  border: 0;
  cursor: pointer;
}

.btn-primary { background: var(--slate); color: var(--bone); }

.btn-primary:hover {
  background: var(--slate-deep);
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(34, 38, 45, 0.18);
}

.btn-ghost {
  background: transparent;
  color: var(--slate);
  border: 1px solid var(--line-strong);
}

.btn-ghost:hover { border-color: var(--slate); background: rgba(252, 250, 244, 0.6); }

/* Compact rendition for working surfaces (card actions, toolbars) */
.btn-small { min-height: 36px; padding: 0 18px; font-size: 13px; }

.dark .btn-primary { background: var(--bone); color: var(--slate); }
.dark .btn-primary:hover { background: #fff; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.3); }
.dark .btn-ghost { color: var(--bone); border-color: var(--line-light-strong); }
.dark .btn-ghost:hover { border-color: var(--bone); background: rgba(252, 250, 244, 0.06); }

.arrow { transition: transform 220ms ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* Text links: slate with a hairline underline; majorelle arrives on hover
   (accent = live response, not a permanent link color — protects the 2% rule
   on link-dense working surfaces). */
.link {
  color: var(--slate);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  transition: color 200ms ease, text-decoration-color 200ms ease;
}

.link:hover { color: var(--majorelle); text-decoration-color: currentColor; }
.dark .link { color: var(--bone); text-decoration-color: var(--line-light-strong); }
.dark .link:hover { color: var(--majorelle-soft); }

/* Nav bar: wordmark lockup left, tracked-caps links right. Sticky, blurred
   ivory. The current page is marked by ink weight (slate vs slate-mid) and a
   hairline underline — NEVER by a filled pill (law 3). */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 243, 234, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-links { display: flex; align-items: center; gap: 36px; }

.nav-links a:not(.btn) {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate-mid);
  transition: color 200ms ease;
  padding: 4px 0;
}

.nav-links a:not(.btn):hover { color: var(--slate); }

.nav-links a:not(.btn).active,
.nav-links a:not(.btn)[aria-current] {
  color: var(--slate);
  box-shadow: 0 1px 0 0 var(--slate);  /* hairline underline, no layout shift */
}


/* ============================================================================
   05 · STATIC LABELS  (never interactive, never a filled pill — law 3)
   ----------------------------------------------------------------------------
   Four species. Pick by job:
   - .kicker  — names what a block is about (eyebrow above a header)
   - .status  — a state that is live/current (dot + tracked caps, no chrome)
   - .tag     — a category/classification (hairline chip, objects radius)
   - counts   — plain text, accent number allowed; NEVER a filled circle
   ========================================================================== */

/* Kicker: tracked caps in majorelle — where the accent lives (R05b). */
.kicker {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--majorelle);
}

.dark .kicker { color: var(--majorelle-soft); }

/* Kicker pill: the HERO-SCALE rendition only (bordered pill + pulsing dot —
   naked kickers get lost at hero scale). On working surfaces use the naked
   .kicker; don't scatter pills. */
.kicker-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px 10px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: rgba(252, 250, 244, 0.55);
}

.kicker-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--majorelle);
  animation: quietPulse 3s ease-in-out infinite;
}

/* Status: a dot + tracked caps, no chrome. The brand's state language:
   filled dot = live, hairline ring = mapped/pending (from the Meridian
   ledger). Pulse only when the state is genuinely live. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--slate-mid);
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--majorelle);
  flex-shrink: 0;
}

.status.live::before { animation: quietPulse 3s ease-in-out infinite; }

.status.mapped::before {           /* pending / draft / not yet live */
  background: transparent;
  border: 1px solid var(--majorelle);
}

.status.neutral::before { background: var(--taupe); }  /* archived / inert */

.dark .status { color: rgba(247, 243, 234, 0.6); }
.dark .status::before { background: var(--majorelle-soft); }
.dark .status.mapped::before { background: transparent; border-color: var(--majorelle-soft); }

/* Tag: a category chip. Objects radius (4px) + hairline — deliberately NOT a
   pill, so it can never be mistaken for a button. Neutral ink; a tag never
   carries majorelle (categories aren't "live"). */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-object);
  background: color-mix(in srgb, var(--cream) 40%, transparent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate-mid);
  white-space: nowrap;
}

.dark .tag {
  border-color: var(--line-light);
  background: rgba(247, 243, 234, 0.05);
  color: rgba(247, 243, 234, 0.6);
}

/* Counts: text, not chrome. "Questions (15)" or a kicker with an accent
   number. Never a filled majorelle circle — that's paint, not ink (law 1). */
.count { color: var(--majorelle); font-weight: 600; }
.dark .count { color: var(--majorelle-soft); }


/* ============================================================================
   06 · OBJECTS  (cards, rules, the Atlas line)
   ========================================================================== */

/* The container stance: a watch on a tray — hairline border + ONE soft
   shadow. Card borders are always neutral hairlines, never majorelle. */
.card {
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: var(--radius-object);
  box-shadow: var(--shadow-object-soft);
}

.card-pad { padding: var(--space-5); }

/* Flat rendition — for dense working surfaces where stacked shadows get
   heavy (lists of cards, rails). Same anatomy, no lift. */
.card-flat { box-shadow: none; }

/* Hairline card on dark grounds (the conviction-card graft from Ledger) */
.dark .card,
.card-dark {
  background: rgba(247, 243, 234, 0.04);
  border: 1px solid var(--line-light);
  border-radius: 3px;
  box-shadow: none;
}

/* Rules: static hairlines end blocks. */
.rule { height: 1px; background: var(--line); border: 0; }
.dark .rule { background: var(--line-light); }

.rule-fade {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

/* List rows: hairline-divided entries (ledger DNA). Quieter than cards —
   prefer rows over a stack of boxed cards for repeated records. */
.rows > * {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line-faint);
}

.rows > *:last-child { border-bottom: 0; }

/* The Atlas line: the travelling light. SPARING — at most ONE per page,
   closing the page's single most important record (R06). Everything else
   closes on a static .rule. Internal class name is historical. */
.meridian, .atlas-line {
  position: relative;
  height: 1px;
  background: var(--line);
}

.meridian::after, .atlas-line::after {
  content: "";
  position: absolute;
  top: -2.5px;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--majorelle);
  box-shadow: 0 0 12px rgba(74, 82, 216, 0.5);
  animation: glide 12s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.dark .meridian, .dark .atlas-line { background: var(--line-light); }
.dark .meridian::after, .dark .atlas-line::after {
  background: var(--majorelle-soft);
  box-shadow: 0 0 12px rgba(154, 160, 238, 0.5);
}

/* Diamond spinner — capacity/reliability readouts. A rotated square, never
   a circular ring (R12). Pair with .figure-num inside .spinner-wrap sibling. */
.spinner-wrap {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-top-color: var(--majorelle);
  animation: spinnerTurn 12s var(--ease-breath) infinite;
}


/* ============================================================================
   07 · LAYOUT PRIMITIVES
   ----------------------------------------------------------------------------
   Composable pieces, not a page template. Compose what the content needs:
   band > container > (page-head | section-head | grid-N | split | rows).
   Alignment law: everything inside a band aligns to the container's left
   edge (or its center in a .centered head) — no free-floating columns.
   ========================================================================== */

.container { max-width: var(--measure); margin: 0 auto; }
.container-narrow { max-width: var(--measure-narrow); margin: 0 auto; }

/* Band: a full-width surface slice. Grounds: default ivory; .bone; .dark
   (dark = a moment of weight — at most two per page, law 6). */
.band {
  position: relative;
  padding: var(--space-8) var(--gutter);
  border-bottom: 1px solid var(--line);
}

.band.bone { background: var(--bone); }

.band.dark, .dark {
  background: var(--slate-deep);
  color: rgba(247, 243, 234, 0.72);
}

.band.dark { border-bottom-color: var(--line-light); }
.dark h1, .dark h2, .dark h3, .dark h4 { color: var(--bone); }
.dark .lede { color: rgba(247, 243, 234, 0.66); }
.dark .figure-num { color: var(--bone); }
.dark .figure-lbl { color: rgba(247, 243, 234, 0.6); }

/* Hero-weight band (page top) */
.band.band-hero { padding-top: var(--space-9); padding-bottom: var(--space-8); }

/* Page head: kicker → h1 → lede. The reading column stays narrower than the
   container so long titles wrap cleanly. */
.page-head { position: relative; z-index: 1; }
.page-head .kicker, .page-head .status { display: inline-flex; margin-bottom: var(--space-4); }
.page-head h1 { max-width: 880px; }
.page-head .lede { max-width: 640px; margin-top: 26px; }

.page-head.centered { text-align: center; }
.page-head.centered h1 { margin-inline: auto; }
.page-head.centered .lede { margin-inline: auto; }

/* Section head: the landing's 220px kicker rail + content column. Use for
   major sections inside long surfaces; .centered for centered bodies. */
.section-head {
  position: relative;
  z-index: 1;
  max-width: 1160px;
  margin: 0 auto var(--space-8);
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}

.section-head .kicker { padding-top: 14px; }
.section-head h2 { max-width: 780px; }
.section-head .lede { max-width: 640px; margin-top: 26px; }

.section-head.centered {
  display: block;
  max-width: var(--measure-narrow);
  text-align: center;
}

.section-head.centered .kicker { display: block; padding-top: 0; margin-bottom: 20px; }
.section-head.centered .lede { margin: 26px auto 0; }

/* Equal-column grids. Cards in a grid use .card-flat + one shared gap. */
.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Split: main column + side rail (annotations, open questions, metadata).
   The rail is subordinate — it never carries its own cards-with-shadows;
   use .card-flat or bare content anchored by rules. */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 64px;
  align-items: start;
}

.split > .rail { position: sticky; top: 96px; }

/* Flow: vertical rhythm inside a column without per-element margins */
.flow > * + * { margin-top: var(--space-4); }
.flow-loose > * + * { margin-top: var(--space-6); }


/* ============================================================================
   08 · THE ENGINEERING GRID  (graft 2 — a ground, never wallpaper)
   ----------------------------------------------------------------------------
   Laws (R07/R08 + law 5):
   - Open architectural grounds only (a hero band, a dark moment of weight,
     a stage behind a diagram). Max 2–3 gridded surfaces per page.
   - ALWAYS masked — it dissolves before content speaks. Never edge-to-edge
     at full strength, never behind a reading column, never above an object.
   - 0.5px hairlines (one device pixel). If your renderer can't draw 0.5px,
     drop the alpha, never thicken the line.
   Apply ONE mask variant with the base class:
     <header class="band band-hero ground-grid grid-fade-down">
   ========================================================================== */

.ground-grid::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--grid) 0.5px, transparent 0.5px),
    linear-gradient(0deg, var(--grid) 0.5px, transparent 0.5px);
  background-size: 76px 76px;
  pointer-events: none;
}

/* Content inside a gridded ground rides above it */
.ground-grid > * { position: relative; z-index: 1; }
.ground-grid::before { z-index: 0; }

.dark.ground-grid::before, .band.dark.ground-grid::before {
  background:
    linear-gradient(90deg, var(--grid-light) 0.5px, transparent 0.5px),
    linear-gradient(0deg, var(--grid-light) 0.5px, transparent 0.5px);
  background-size: 80px 80px;
}

/* Mask variants — one is REQUIRED (an unmasked grid is off-brand) */
.grid-fade-down::before {
  mask-image: linear-gradient(180deg, black, transparent 88%);
  -webkit-mask-image: linear-gradient(180deg, black, transparent 88%);
}

.grid-fade-ends::before {
  mask-image: linear-gradient(180deg, transparent, black 30%, black 70%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, black 30%, black 70%, transparent);
}

.grid-radial::before {
  mask-image: radial-gradient(ellipse 78% 68% at 50% 42%, black, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse 78% 68% at 50% 42%, black, transparent 76%);
}

/* Stage rendition: card-interior vellum (inside a .card behind a diagram) —
   wider-read soft ink at 50px pitch over a cream bloom, radially masked. */
.ground-grid.grid-stage {
  background:
    radial-gradient(ellipse 94% 80% at 50% 40%, color-mix(in srgb, var(--cream) 44%, transparent), transparent 72%),
    var(--bone);
}

.ground-grid.grid-stage::before {
  background:
    linear-gradient(90deg, var(--grid-soft) 0.5px, transparent 0.5px),
    linear-gradient(0deg, var(--grid-soft) 0.5px, transparent 0.5px);
  background-size: 50px 50px;
  mask-image: radial-gradient(ellipse 78% 68% at 50% 42%, black, transparent 76%);
  -webkit-mask-image: radial-gradient(ellipse 78% 68% at 50% 42%, black, transparent 76%);
}


/* ============================================================================
   09 · MOTION  (never faster than a breath; nothing re-animates on scroll)
   ========================================================================== */

@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.rise { animation: rise 0.9s var(--ease-breath) both; }
.rise:nth-child(2) { animation-delay: 0.08s; }
.rise:nth-child(3) { animation-delay: 0.16s; }
.rise:nth-child(4) { animation-delay: 0.24s; }
.rise:nth-child(5) { animation-delay: 0.32s; }

@keyframes quietPulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@keyframes glide {
  0% { left: 0; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: calc(100% - 6px); opacity: 0; }
}

@keyframes spinnerTurn {
  0% { transform: rotate(45deg); }
  55%, 70% { transform: rotate(225deg); }
  100% { transform: rotate(405deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}


/* ============================================================================
   10 · RESPONSIVE
   ========================================================================== */

@media (max-width: 1180px) {
  .section-head { grid-template-columns: 1fr; gap: 24px; }
  .section-head .kicker { padding-top: 0; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; gap: 44px; }
  .split > .rail { position: static; }
}

@media (max-width: 880px) {
  .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --gutter: 24px; }
  .nav-inner { padding: 14px var(--gutter); }
  .nav-links a:not(.btn) { display: none; }
  .nav-links { gap: 12px; }
  .band { padding-top: var(--space-8); padding-bottom: var(--space-8); }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
}
