/* ============================================================
   Track — brand identity
   Warm paper · graphite ink · ONE forest-green accent · Hanken Grotesk body ·
   Source Serif 4 display.
   Loaded AFTER each page's inline <style> so these declarations win the cascade.
   Source of truth: demo_ui design-system. Edit here, applies to every page.

   Glass era (supersedes the prior "no gradients / no neon" rule): an ambient
   blob backdrop built from this file's own --product/--risk/--regulatory
   family (not an invented palette — see "Ambient field" below), floating
   translucent chrome (.glass-panel / .glass-nav), and softer radii layered
   over the squared-geometry rules below (still present for anything not yet
   migrated — see "Originality pass" further down, now superseded but left
   documented rather than silently contradicted).
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600&family=Hanken+Grotesk:wght@400;500;600;700;800;900&family=Source+Serif+4:opsz,wght@8..60,300;8..60,400;8..60,600;8..60,700&display=swap');

/* ---------- Palette: dark (graphite) ---------- */
:root, [data-theme="dark"] {
  --product: #3E9A66;        --product-bright: #54B27D;   --product-soft: #2E7A4E;
  --risk: #C24A4A;           --risk-bright: #D96B6B;
  --regulatory: #9C7A36;     --regulatory-bright: #C09548;
  --allow: #3E9A66;          --allow-bright: #54B27D;
  --warn: #C8973A;           --warn-bright: #DDB05A;
  --bg: #16181B;             --bg-alt: #1C1F23;
  --bg-card: #1F2329;        --bg-card-alt: #262B31;
  --bg-deep: #131518;        --bg-pipe: #20252B;          --bg-pipe-line: #2A3036;
  --border: #2C3137;         --border-strong: #3A4047;    --border-light: #4C535B;
  --text-strong: #F2EFE8;    --text: #E7E3D9;             --text-2: #D8D3C7;
  --text-3: #C2BCAF;         --text-4: #ABA597;           --text-soft: #9A9486;
  --text-dim: #847E70;       --text-mute: #645F54;
  --nav-bg: rgba(22,24,27,0.82);   --nav-border: rgba(44,49,55,0.6);
  --shadow-drop: rgba(0,0,0,0.40);  --shadow-drop-soft: rgba(0,0,0,0.30);

  /* Glass era — dark variant. `screen` (not `multiply`) because multiplying
     colour onto a near-black base is a no-op; screen adds light instead, so
     the blobs read as a glow. Bloom follows suit (dim graphite, not white —
     white `screen`-blended over near-black would blow out). */
  --font-display: 'Source Serif 4', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --amb-bloom: var(--bg-card-alt);
  --amb-blend: screen;
  --glass-border: rgba(255,255,255,0.10);
}

/* ---------- Palette: light (warm paper) — the default ---------- */
[data-theme="light"] {
  --product: #1E5C3A;        --product-bright: #2A7249;   --product-soft: #16472C;
  --risk: #8C2A2A;           --risk-bright: #A33636;
  --regulatory: #6E5320;     --regulatory-bright: #8A6A2C;
  --allow: #1E5C3A;          --allow-bright: #2A7249;
  --warn: #9A6B1F;           --warn-bright: #B5832B;
  --bg: #F2EFE8;             --bg-alt: #ECE7DC;
  --bg-card: #FBF9F4;        --bg-card-alt: #F1ECE1;
  --bg-deep: #E6E0D2;        --bg-pipe: #ECE7DC;          --bg-pipe-line: #DCD5C6;
  --border: #DED7C8;         --border-strong: #C8C0AD;    --border-light: #A89E89;
  --text-strong: #16181B;    --text: #26292D;             --text-2: #33373C;
  --text-3: #474B51;         --text-4: #5A5E64;           --text-soft: #6B6F76;
  --text-dim: #837E72;       --text-mute: #A89E89;
  --nav-bg: rgba(242,239,232,0.86); --nav-border: rgba(200,192,173,0.7);
  --shadow-drop: rgba(22,24,27,0.10); --shadow-drop-soft: rgba(22,24,27,0.07);
  color-scheme: light;

  /* Glass era — canonical light variant. `multiply` over the warm-paper base
     reads as a watercolor wash; the bloom blob is pure white and is blended
     `normal` per-layer below (multiplying white is a no-op). */
  --font-display: 'Source Serif 4', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --amb-bloom: #FFFFFF;
  --amb-blend: multiply;
  --glass-border: rgba(255,255,255,0.55);
}

/* ---------- Typography: Hanken Grotesk body, Source Serif 4 display (mono stays Geist/JetBrains) ---------- */
body, button, input, select, textarea { font-family: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
body { letter-spacing: -0.01em; }
.mono, .hero-artifact, .pipe-node, .step .s-tech, .pillar .p-step, .art-key, .art-val,
.sa-code, .v5-num, .s-num, .pt-tag, .an-step-body, .stat-value {
  font-family: 'Geist Mono', 'JetBrains Mono', 'SF Mono', monospace;
}
/* Display face — headings only; body/data/mono above are unchanged. */
h1, h2, h3 { font-family: var(--font-display), 'Hanken Grotesk', sans-serif; }

/* ---------- Ambient field ----------
   A fixed, slow-drifting backdrop behind every glass-adopting page — one CSS
   rule, no per-page markup. Layered radial-gradients standing in for blobs,
   composited per-layer via background-blend-mode (`multiply` in light =
   watercolor wash, `screen` in dark = glow — see --amb-blend per theme
   above). Colors are this file's OWN --product/--risk/--regulatory-bright
   family, not an invented palette. Freezes under reduced-motion. */
body { position: relative; }
body::before {
  content: "";
  position: fixed;
  inset: -10%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 18%, var(--regulatory-bright), transparent 45%),
    radial-gradient(circle at 88% 12%, var(--product-bright), transparent 50%),
    radial-gradient(circle at 26% 92%, var(--risk-bright), transparent 38%),
    radial-gradient(circle at 82% 88%, var(--amb-bloom), transparent 40%),
    var(--bg);
  background-blend-mode: var(--amb-blend), var(--amb-blend), var(--amb-blend), normal, normal;
  filter: blur(70px);
  opacity: 0.55;
  animation: amb-drift 90s ease-in-out infinite alternate;
}
@keyframes amb-drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(3%, -3%) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
}

/* ---------- Glass primitives ----------
   Floating translucent chrome, layered over (not replacing) the flat
   .bg-card surfaces still used where a page hasn't adopted glass yet.
   color-mix() derives the translucency from this file's own existing
   tokens rather than a parallel RGB-channel system. */
.glass-panel {
  background: color-mix(in srgb, var(--bg-card) 72%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  box-shadow: 0 20px 50px var(--shadow-drop);
}

/* Promotes the existing per-page nav (already `background: var(--nav-bg);
   backdrop-filter: blur(14px);` inline) to the same blur/saturation as
   every other glass surface, rather than a separate weaker treatment. */
nav {
  -webkit-backdrop-filter: blur(24px) saturate(165%) !important;
  backdrop-filter: blur(24px) saturate(165%) !important;
}

/* ---------- Kill gradients + neon glows ---------- */
.hero::before, .hero::after { display: none !important; }
.cta-section::before { display: none !important; }
.hero-artifact::before, .anatomy::before { display: none !important; }

.btn-primary {
  background: var(--product) !important;
  box-shadow: 0 1px 2px rgba(22,24,27,0.18) !important;
}
.btn-primary:hover {
  background: var(--product-soft) !important;
  filter: none !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px var(--shadow-drop) !important;
}
.section-cta a { background: var(--product); box-shadow: none !important; }
.section-cta a:hover { background: var(--product-soft); box-shadow: 0 4px 14px var(--shadow-drop) !important; }

.hero-eyebrow { background: rgba(30,92,58,0.08); border-color: rgba(30,92,58,0.24); color: var(--product-bright); }
.hero-eyebrow .dot, .cta-reassure .dot { background: var(--product); box-shadow: none !important; }

/* Paper-ize the formerly dark/navy artifact + anatomy cards */
.hero-artifact, .anatomy {
  background: var(--bg-card) !important;
  border-color: var(--border-strong) !important;
  box-shadow: 0 12px 36px var(--shadow-drop) !important;
}
.an-header, .an-footer { background: var(--bg-alt) !important; }

.contrast-conclusion { background: rgba(30,92,58,0.06) !important; border-color: rgba(30,92,58,0.22) !important; }
.trust-item .t-icon { background: rgba(30,92,58,0.10) !important; }

/* Soften the assorted card hover glows to a neutral drop shadow */
.step:hover, .decision-card:hover, .scenario:hover, .pillar:hover, .v5-card:hover,
.pipe-node:hover, .pipe-node.active, .q-card:hover {
  box-shadow: 0 8px 24px var(--shadow-drop) !important;
}
.step:hover, .pillar:hover { border-color: var(--border-light) !important; }
.hb-dot.green, .hb-dot.blue, .hb-dot.purple { box-shadow: none !important; }
.art-pulse { animation: none !important; }

/* Brand-tint the form focus ring + dotted links (were cyan) */
.wl-form input:focus, .wl-form select:focus {
  border-color: var(--product) !important;
  box-shadow: 0 0 0 3px rgba(30,92,58,0.16) !important;
}
.wl-fine a, .stat-source a, .t-label a { border-bottom-color: rgba(42,114,73,0.45) !important; }

/* Pipe-node top accents (architecture page) → green family, no neon */
.pipe-node { border-top-color: var(--product) !important; }

/* Remaining hardcoded cyan/purple → brand green */
.arch-box.track { background: rgba(30,92,58,0.10) !important; color: var(--product-bright) !important; border-color: rgba(30,92,58,0.35) !important; }
.arch-vpc { border-color: rgba(30,92,58,0.30) !important; }
.arch-vpc-label { color: var(--product-bright) !important; }
.hb-dot.green, .hb-dot.blue, .hb-dot.purple { background: var(--product) !important; }
.page-rail-item.is-active { background: rgba(30,92,58,0.07) !important; border-left-color: var(--product) !important; }
.dc-oblig .dc-bar, .pt-tag.purple { background: var(--regulatory) !important; }
.dc-oblig .dc-icon { background: rgba(110,83,32,0.14) !important; }
.dc-oblig .dc-name, .regulatory-bright { color: var(--regulatory-bright) !important; }

/* ---------- Logo (folded double-chevron mark + Hanken Grotesk wordmark) ---------- */
.logo, .foot-logo { width: auto !important; height: auto !important; color: var(--text-strong); gap: 9px; }
.logo img, .foot-logo img { display: none; }            /* hide any leftover PNG */
.logo svg, .foot-logo svg { display: block; flex: 0 0 auto; }
.logo .logo-word, .foot-logo .logo-word {
  font-family: 'Hanken Grotesk', sans-serif; font-weight: 600; letter-spacing: -0.02em; color: var(--text-strong); line-height: 1;
}
.logo .logo-word { font-size: 21px; }
.foot-logo .logo-word { font-size: 16px; }

/* ---------- Recolor hardcoded SVG icon strokes (CSS stroke beats the attribute) ---------- */
.console-list .c-check { background: rgba(30,92,58,0.10) !important; border-color: rgba(30,92,58,0.30) !important; }
.console-list .c-check svg path { stroke: var(--product) !important; }
.trust-item .t-icon svg path { stroke: var(--product) !important; }
.d-check svg path { stroke: var(--product) !important; }

/* Sibling-page cards that used dark/navy gradients → flat paper */
.bench-badge, .fw-card { background: var(--bg-card) !important; box-shadow: none !important; }

/* ============================================================
   "Audit ledger / dossier" treatment — ruled monospace kickers,
   no fake terminal traffic-lights. The squared-geometry radii this
   section originally shipped (differentiating from the rounded-
   bubble AI-SaaS template) are superseded by the glass era's softer
   scale below — this section now supplies the soft equivalent,
   keeping the rest of the ledger/dossier vocabulary (brand, ruled
   kickers, no pill-chips-as-decoration) unchanged.
   ============================================================ */

/* --- Glass-era geometry: soft radii, not the consumer-SaaS default
   pill/bubble scale, but not the original squared 2px/3px either. --- */
.btn-primary, .btn-ghost, .nav-cta, .section-cta a, .wl-form input, .wl-form select,
.wl-form button, .hb, .hero-eyebrow { border-radius: 10px !important; }
.hero-artifact, .anatomy, .step, .pillar, .decision-card, .scenario, .v5-card,
.q-card, .stat-item, .trust-item, .pipe-node, .arch-box, .arch-vpc,
.bench-badge, .fw-card, .card { border-radius: 16px !important; }

/* --- Primary action: flat institutional green, no glow/gradient (radius comes from the rule above) --- */
.btn-primary {
  background: var(--product) !important; color: #fff !important;
  border: 1px solid var(--product-soft) !important; box-shadow: none !important;
}
.btn-primary:hover { background: var(--product-soft) !important; box-shadow: none !important; transform: none !important; filter: none !important; }
.btn-ghost { background: transparent !important; }

/* --- Nav: a single hairline rule instead of a floaty bar --- */
nav { border-bottom: 1px solid var(--nav-border) !important; }

/* --- Eyebrows: small pill kickers above headlines, Solidroad-reference
   style (was previously dropped sitewide — "headlines lead, no kicker
   labels" — but the short-page rhythm this file now targets uses them
   consistently above every major headline, so restyle rather than hide). --- */
.hero-eyebrow, .s-eyebrow, .eyebrow, .section-eyebrow {
  display: inline-flex !important; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0.02em;
  padding: 6px 13px; border-radius: 999px;
  background: color-mix(in srgb, var(--product) 9%, var(--bg-card)) !important;
  border: 1px solid color-mix(in srgb, var(--product) 22%, transparent) !important;
  color: var(--product-bright) !important;
}

/* --- Hero badges → squared spec tags with a small square marker (not glowing pills) --- */
.hb {
  background: transparent !important; border: 1px solid var(--border-strong) !important;
  color: var(--text-2) !important; font-weight: 500 !important;
}
.hb-dot {
  width: 5px !important; height: 5px !important; border-radius: 50% !important;
  box-shadow: none !important; background: var(--product) !important;
}

/* --- Artifact card: drop the fake traffic-light dots; label it like a record --- */
.art-dots span { display: none !important; }
.art-dots::before {
  content: "// estate.log";
  font-family: 'Geist Mono', 'JetBrains Mono', monospace;
  font-size: 10.5px; letter-spacing: 0.04em; color: var(--text-dim);
}

/* --- Headline: tracking tuned for Hanken's warmer metrics --- */
.hero h1 { letter-spacing: -0.02em !important; }

/* ============================================================
   Short-page components — hero-forward homepage rhythm: a light
   editorial display weight, one shared two-tone headline
   convention, a full-bleed glass-on-gradient carousel, a
   halftone dot field for CTA/footer bands, and a scroll-reveal
   primitive. Shared here (not per-page) so any page can adopt
   the same short-form rhythm, not just the homepage.
   ============================================================ */

/* ---------- Two-tone headline: setup quiet, payoff full ink ----------
   Default text stays full-strength (--text-strong via inherited color);
   wrap only the setup clause in .tone-quiet. (.accent / .mute are the
   older per-section variants and are left as-is where already in use.) */
.tone-quiet { color: var(--text-soft); }

/* ---------- Light editorial display weight ----------
   Opt-in for hero-scale and pull-quote moments only — not forced onto
   every h1–h3, which stay legible at card-title scale. */
.display-light { font-weight: 300; }

/* ---------- Halftone dot field ----------
   CSS-only radiating dot texture for warm CTA/footer bands, standing in
   for the reference's photographic halftone without an image asset.
   Sweep origin is set per-instance via --dot-x/--dot-y (default bottom-left). */
.dot-field { position: relative; overflow: hidden; }
.dot-field::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, var(--text-mute) 1px, transparent 1.4px);
  background-size: 9px 9px;
  -webkit-mask-image: radial-gradient(circle at var(--dot-x, 12%) var(--dot-y, 88%), black 0%, black 30%, transparent 68%);
          mask-image: radial-gradient(circle at var(--dot-x, 12%) var(--dot-y, 88%), black 0%, black 30%, transparent 68%);
  opacity: 0.5;
  pointer-events: none;
}

/* ---------- Pastel tint cards ----------
   Feature-card backgrounds derived from the site's own product/risk/
   regulatory family via color-mix (not an invented palette), theme-aware
   since --bg-card already flips with [data-theme]. */
.tint-product { background: color-mix(in srgb, var(--product) 16%, var(--bg-card)); }
.tint-risk { background: color-mix(in srgb, var(--risk) 13%, var(--bg-card)); }
.tint-regulatory { background: color-mix(in srgb, var(--regulatory) 14%, var(--bg-card)); }

/* ---------- Slim auto-advancing carousel ----------
   Track/slides + a thin progress-bar indicator (not dots) + round arrow
   buttons. JS (per-page, see index.html) toggles .is-active and drives
   the progress-bar width; this file only owns the visual base. */
.carousel { position: relative; }
.carousel-track {
  display: flex; gap: 20px; overflow: hidden;
  scroll-behavior: smooth;
}
.carousel-slide {
  flex: 0 0 auto; opacity: 0.4; transform: scale(0.98);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.carousel-slide.is-active { opacity: 1; transform: scale(1); }
.carousel-progress {
  height: 2px; background: var(--border); border-radius: 2px; overflow: hidden; flex: 1;
}
.carousel-progress-bar {
  height: 100%; width: 0%; background: var(--product); transition: width linear;
}
.carousel-controls { display: flex; align-items: center; gap: 16px; margin-top: 22px; }
.carousel-count { font-family: 'Geist Mono', monospace; font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.carousel-arrows { display: flex; gap: 8px; }
.carousel-arrow {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--bg-card); color: var(--text-2); display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.carousel-arrow:hover { border-color: var(--border-light); background: var(--bg-card-alt); }
.carousel-arrow:disabled { opacity: 0.35; cursor: default; }
@media (prefers-reduced-motion: reduce) {
  .carousel-progress-bar { transition: none; }
  .carousel-slide { transition: none; }
}

/* ---------- Scroll reveal ----------
   Fade + rise as a section enters the viewport. JS (per-page) adds
   .is-visible via IntersectionObserver; .reveal-stagger children read
   --stagger-i (set inline per child) for a cascaded delay. */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }
.reveal-stagger > * {
  opacity: 0; transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: calc(var(--stagger-i, 0) * 90ms);
}
.reveal-stagger.is-visible > * { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > * { opacity: 1; transform: none; transition: none; }
}
