/* ==========================================================================
   Zentropy — "Zero Entropy" design system
   Concept: the page moves from chaos (dark, noisy) to order (light, still).
   Accent colours are taken from the logo: Zentropy Blue on warm graphite.
   ========================================================================== */

:root {
  /* Brand (from logo) */
  --z-blue: #3a93e8;
  --z-blue-ink: #1d6cc0;     /* blue for small text on paper (AA contrast) */
  --z-blue-glow: #6cb2f2;    /* blue for small text on ink */
  --z-graphite: #4a4444;

  /* Entropy state (dark) */
  --ink: #121110;
  --ink-2: #1b1a19;
  --ink-fg: #ece9e4;
  --ink-muted: #948e88;
  --ink-line: rgba(236, 233, 228, 0.12);

  /* Order state (light) */
  --paper: #f2f0eb;
  --paper-2: #ffffff;
  --paper-fg: #1a1817;
  --paper-muted: #6b6560;
  --paper-line: rgba(26, 24, 23, 0.12);

  --up: #2fbf71;
  --down: #e5484d;

  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-body: "Inter Tight", "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
  --radius: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Live entropy (0 = ordered, 1 = chaotic). Updated by JS on scroll. */
  --S: 1;
}

/* Register theme tokens as colours so they interpolate: every element using
   var(--bg) / var(--fg) etc. crossfades when the visitor switches theme. */
@property --bg { syntax: '<color>'; inherits: true; initial-value: #121110; }
@property --bg-2 { syntax: '<color>'; inherits: true; initial-value: #1a1918; }
@property --fg { syntax: '<color>'; inherits: true; initial-value: #f2f0eb; }
@property --muted { syntax: '<color>'; inherits: true; initial-value: #8a8680; }
@property --line { syntax: '<color>'; inherits: true; initial-value: rgba(255,255,255,.1); }
@property --accent-text { syntax: '<color>'; inherits: true; initial-value: #6cb2f2; }

/* Theme tokens applied to <body data-theme="..."> */
body[data-theme="dark"] {
  --bg: var(--ink);
  --bg-2: var(--ink-2);
  --fg: var(--ink-fg);
  --muted: var(--ink-muted);
  --line: var(--ink-line);
  --accent-text: var(--z-blue-glow);
  /* emboss: light from above, a lit top edge and a soft shadow underneath */
  --paper-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.97 0 0 0 0 0.92 0.28 0 0 0 -0.12'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23n%29'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='640'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006' numOctaves='3' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.8 0 0 0 -0.27'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23n%29'/%3E%3C/svg%3E");
  --paper-dot: rgba(236, 233, 228, 0.13);
  --plate-top: #1d1c1a;
  --plate-bot: #171615;
  --emb-hi: rgba(255, 255, 255, 0.09);
  --emb-edge: rgba(0, 0, 0, 0.5);
  --emb-side: rgba(255, 255, 255, 0.03);
  --emb-lo: rgba(0, 0, 0, 0.7);
  --emb-soft: rgba(0, 0, 0, 0.4);
}
body[data-theme="light"] {
  --bg: var(--paper);
  --bg-2: var(--paper-2);
  --fg: var(--paper-fg);
  --muted: var(--paper-muted);
  --line: var(--paper-line);
  --accent-text: var(--z-blue-ink);
  --paper-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.24 0 0 0 0 0.16 0.5 0 0 0 -0.21'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23n%29'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='640' height='640'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.006' numOctaves='3' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.36 0 0 0 0 0.24 0.3 0 0 0 -0.1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23n%29'/%3E%3C/svg%3E");
  --paper-dot: rgba(60, 48, 36, 0.2);
  --plate-top: #f8f7f3;
  --plate-bot: #efede7;
  --emb-hi: rgba(255, 255, 255, 1);
  --emb-edge: rgba(60, 45, 30, 0.1);
  --emb-side: rgba(255, 255, 255, 0.6);
  --emb-lo: rgba(60, 45, 30, 0.14);
  --emb-soft: rgba(60, 45, 30, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--bg);
  /* dotted notebook paper: a fine dot grid over a soft paper grain */
  background-image: radial-gradient(circle, var(--paper-dot) 1px, transparent 1.4px), var(--paper-tex);
  background-size: 22px 22px, auto, auto;
  background-position: 11px 11px, 0 0, 0 0;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  --theme-t: 0.6s cubic-bezier(0.45, 0, 0.25, 1);
  transition: --bg var(--theme-t), --bg-2 var(--theme-t), --fg var(--theme-t), --muted var(--theme-t), --line var(--theme-t), --accent-text var(--theme-t);
}
img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--z-blue); color: #fff; }
:focus-visible { outline: 2px solid var(--z-blue); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--z-blue); color: #fff; padding: 10px 14px; border-radius: 8px;
  font-family: var(--font-mono); font-size: 13px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Atmosphere: lattice (order) ---------- */
.lattice {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: calc((1 - var(--S)) * 0.5);
  transition: opacity 0.4s linear;
}
.lattice-inner {
  height: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: repeat(12, 1fr);
}
.lattice-inner span { border-left: 1px solid var(--line); }
.lattice-inner span:last-child { border-right: 1px solid var(--line); }
@media (max-width: 720px) {
  .lattice-inner { grid-template-columns: repeat(4, 1fr); }
  .lattice-inner span:nth-child(n+5) { display: none; }
  .lattice-inner span:nth-child(4) { border-right: 1px solid var(--line); }
}

main, footer, header { position: relative; z-index: 1; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(80px, 10vw, 140px) 0; position: relative; }
.section--tight { padding: clamp(64px, 9vw, 120px) 0; }

/* ---------- Type ---------- */
.mono, .eyebrow {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  font-weight: 500;
}
.eyebrow { color: var(--muted); display: inline-flex; align-items: center; gap: 10px; margin: 0 0 28px; }
.eyebrow::before {
  content: ""; width: 8px; height: 8px; background: var(--z-blue);
  clip-path: polygon(0 0, 100% 0, 100% 22%, 22% 100%, 0 100%); /* nod to the Z corner */
}
.display, .h2, .h3 {
  font-family: var(--font-display); font-weight: 400;
  letter-spacing: -0.015em; margin: 0;
}
.display { font-size: clamp(52px, 9vw, 140px); line-height: 0.92; }
.h2 { font-size: clamp(38px, 5.6vw, 84px); line-height: 0.98; }
.h3 { font-size: clamp(28px, 3vw, 40px); line-height: 1.05; }
.display em, .h2 em, .h3 em { font-style: italic; color: var(--z-blue); }
.lede { font-size: clamp(18px, 1.6vw, 21px); color: var(--muted); max-width: 60ch; margin: 28px 0 0; }
.muted { color: var(--muted); }
p { margin: 0 0 1em; }

/* ---------- Buttons ---------- */
.btn {
  --h: 52px;
  display: inline-flex; align-items: center; gap: 12px;
  height: var(--h); padding: 0 22px; border-radius: 4px;
  font-family: var(--font-body); font-size: 15px; font-weight: 500; letter-spacing: 0.005em;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.4s var(--ease), background-color 0.3s, color 0.3s, border-color 0.3s;
}
.btn svg { transition: transform 0.4s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn--primary { background: var(--z-blue); color: #fff; }
.btn--primary:hover { background: #2f84d6; }
.btn--ghost { border-color: var(--line); color: var(--fg); background: transparent; }
.btn--ghost:hover { border-color: var(--fg); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background-color 0.4s, border-color 0.4s, backdrop-filter 0.4s;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-word { font-family: var(--font-body); font-weight: 600; font-size: 21px; letter-spacing: -0.01em; color: var(--z-blue); }
.nav-links { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links > li > a { display: inline-block; line-height: 1.6; }
.nav-links a {
  transition: color 0.25s, background-color 0.25s;
  font-family: var(--font-body); font-size: 14.5px; font-weight: 500; letter-spacing: 0.005em;
  text-decoration: none; color: var(--muted); padding: 8px 11px; border-radius: 4px;
  transition: color 0.2s, background-color 0.2s;
}
.nav-links a:hover, .nav-links a[aria-current] { color: var(--fg); }
.nav-links a[aria-current] { background: color-mix(in srgb, var(--fg) 8%, transparent); }
/* "Company" dropdown holding the separate pages */
.has-menu { position: relative; }
.menu-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font: 500 14.5px/1.6 var(--font-body); letter-spacing: 0.005em; color: var(--muted);
  background: transparent; border: 0; padding: 8px 11px; border-radius: 4px; transition: color 0.25s, background-color 0.25s;
}
.menu-btn svg { transition: transform 0.25s var(--ease); }
.menu-btn:hover, .has-menu.is-open .menu-btn, .has-menu.is-current .menu-btn { color: var(--fg); }
.has-menu.is-current .menu-btn { background: color-mix(in srgb, var(--fg) 8%, transparent); }
.has-menu.is-open .menu-btn svg { transform: rotate(180deg); }
.submenu {
  position: absolute; top: calc(100% + 10px); left: 0; min-width: 200px; list-style: none; margin: 0; padding: 6px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity 0.2s, transform 0.2s var(--ease);
}
.submenu::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; } /* hover bridge */
.has-menu.is-open .submenu { opacity: 1; transform: none; pointer-events: auto; }
.submenu a { display: block; padding: 9px 12px; }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-cta { --h: 40px; padding: 0 18px; font-size: 14px; }
.theme-switch { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; }
.theme-switch button {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}
.theme-switch button:hover { color: var(--fg); }
.theme-switch button[aria-pressed="true"] { color: var(--fg); background: color-mix(in srgb, var(--fg) 10%, transparent); }


.nav-toggle {
  display: none; width: 44px; height: 44px; border-radius: 6px; border: 1px solid var(--line);
  background: transparent; color: var(--fg); cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 16px; height: 1.5px; background: currentColor; position: relative; transition: transform 0.3s var(--ease);
}
.nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -5px; }
.nav-toggle span::after { top: 5px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { transform: translateY(5px) rotate(45deg); }
.nav-open .nav-toggle span::after { transform: translateY(-5px) rotate(-45deg); }

@media (max-width: 1080px) {
  .nav-links {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 24px; transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity 0.3s, transform 0.3s var(--ease);
  }
  .nav-open .nav-links { opacity: 1; transform: none; pointer-events: auto; }
  .nav-links { align-items: stretch; }
  .nav-links a, .nav-links > li > a { display: block; font-size: 15px; padding: 14px 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav-links a[aria-current] { background: none; color: var(--z-blue); }
  .has-menu { position: static; }
  .menu-btn { width: 100%; justify-content: space-between; padding: 14px 0; font-size: 15px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .has-menu.is-current .menu-btn { background: none; }
  .submenu { position: static; min-width: 0; padding: 0 0 0 16px; background: none; border: 0; box-shadow: none; transform: none; display: none; opacity: 1; pointer-events: auto; }
  .has-menu.is-open .submenu { display: block; }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 560px) {
  .nav-cta { display: none; }
}

/* ---------- Hero: the entropy chamber ---------- */
.hero { position: relative; }
.hero-stick {
  position: relative; height: 100vh; height: 100svh; min-height: 640px; overflow: hidden;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-content { position: relative; z-index: 2; height: 100%; display: flex; align-items: center; padding-top: 72px; padding-bottom: 48px; pointer-events: none; }
.hero-copy { width: fit-content; max-width: 100%; pointer-events: auto; }
.hero .display { font-size: clamp(56px, 7.4vw, 140px); }
.hero .lede { max-width: 25em; margin: 32px 0 40px; font-size: clamp(17px, 1.15vw, 21px); color: var(--muted); }
.hero .btn-row { margin-top: 0; }

/* Exhibit captions (positioned by hero-chamber.js) */
.hud { position: absolute; inset: 0; z-index: 1; pointer-events: none; font: 400 11px/1 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.hud.off { display: none; }
.hud > * { position: absolute; white-space: nowrap; }
.hud b { font-weight: 500; color: var(--fg); font-variant-numeric: tabular-nums; }
.hud-r { transform: translateX(-100%); }
.hud .q { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; text-transform: none; letter-spacing: 0; font: 600 22px/1 var(--font-hand, cursive); }
.hud .q span { color: var(--fg); }
.hud .q b { font-weight: 500; font-size: 19px; color: var(--muted); }
.hud .q--sig span, .hud .q--sig b { color: var(--accent-text); }

/* Embossed plate behind the hero copy: a raised panel, lit from above */
.hero-copy {
  position: relative; padding: clamp(32px, 3.4vw, 52px) clamp(28px, 3.4vw, 52px);
  background: linear-gradient(180deg, var(--plate-top), var(--plate-bot));
  border-radius: var(--radius);
  box-shadow:
    inset 0 1px 0 var(--emb-hi),
    inset 0 -1px 0 var(--emb-edge),
    inset 1px 0 0 var(--emb-side), inset -1px 0 0 var(--emb-side),
    0 1px 1px var(--emb-lo),
    0 4px 8px var(--emb-soft),
    0 24px 48px var(--emb-soft);
}
@media (max-width: 899px) { .hero-copy { padding: 28px 22px; } }

/* Handwritten margin notes around Exhibit 1 (positioned by hero-chamber.js) */
:root { --font-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive; }
.hud .note {
  margin: 0; white-space: normal; text-transform: none; letter-spacing: 0;
  font: 500 21px/1.08 var(--font-hand); color: var(--accent-text);
}
.hud .note:nth-of-type(odd) { transform: rotate(-1.5deg); }
.hud .note:nth-of-type(even) { transform: rotate(1.2deg); }

/* Credentials under the hero copy */
.hero-creds { display: flex; gap: 0; list-style: none; margin: 40px 0 0; padding: 0; }
.hero-creds li { display: flex; flex-direction: column; gap: 6px; padding: 0 24px; border-left: 1px solid var(--line); }
.hero-creds li:first-child { padding-left: 0; border-left: 0; }
.hero-creds b { font-family: var(--font-display); font-weight: 400; font-size: 26px; line-height: 1; color: var(--fg); }
.hero-creds span { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* Static capabilities bar */
.hero .tape { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 48px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 72%, transparent); }
.hero-bar { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; list-style: none; margin: 0 auto; }
.hero-bar li { font: 400 11px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.hero-bar li + li { padding-left: 24px; border-left: 1px solid var(--line); }
@media (max-width: 1180px) { .hero-bar li:nth-child(4) { display: none; } }
@media (max-width: 860px) { .hero-bar li:nth-child(n+3) { display: none; } .hero-bar { justify-content: flex-start; } }
@media (max-width: 480px) { .hero-creds li { padding: 0 14px; } .hero-creds b { font-size: 22px; } .hero-bar li:nth-child(n+2) { display: none; } }
@media (max-height: 820px) { .hero .eyebrow { margin-bottom: 18px; } .hero .lede { margin: 22px 0 26px; } .hero-creds { margin-top: 26px; } }

/* ---------- Problem: stacked statements ---------- */
.stack { list-style: none; margin: 64px 0 0; padding: 0; border-top: 1px solid var(--line); }
.stack li {
  display: grid; grid-template-columns: 80px 1fr auto; align-items: baseline; gap: 24px;
  padding: 28px 0; border-bottom: 1px solid var(--line);
}
.stack .idx { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.stack .stmt { font-family: var(--font-display); font-size: clamp(28px, 3.8vw, 56px); line-height: 1.05; }
.stack .tag { font-family: var(--font-mono); font-size: 12px; color: var(--down); letter-spacing: 0.1em; }
@media (max-width: 720px) {
  .stack li { grid-template-columns: 40px 1fr; }
  .stack .tag { grid-column: 2; }
}

/* ---------- Thesis / the name ---------- */
.thesis-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(40px, 6vw, 96px); align-items: end; }
.formula {
  font-family: var(--font-display); font-size: clamp(40px, 6vw, 92px); line-height: 1; margin: 0 0 32px;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25em;
}
.formula .op { color: var(--muted); font-size: 0.6em; }
.formula .res { color: var(--z-blue); font-style: italic; }
.facts { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); margin-top: 40px; }
.facts div { padding: 20px 0; border-bottom: 1px solid var(--line); }
.facts div:nth-child(odd) { padding-right: 16px; }
.facts dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.facts dd { margin: 6px 0 0; font-size: 20px; font-weight: 500; }
@media (max-width: 860px) { .thesis-grid { grid-template-columns: 1fr; } }

/* ---------- Problem: symptoms ---------- */
.symptoms { list-style: none; margin: 72px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.symptoms li { padding: 28px 32px 8px 0; }
.symptoms li + li { padding-left: 32px; border-left: 1px solid var(--line); }
.symptoms .num { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; color: var(--accent-text); }
.symptoms h3 { font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.1; margin: 14px 0 12px; }
.symptoms p { margin: 0; color: var(--muted); font-size: 16px; max-width: 36ch; }
@media (max-width: 860px) {
  .symptoms { grid-template-columns: 1fr; }
  .symptoms li, .symptoms li + li { padding: 24px 0; border-left: 0; }
  .symptoms li + li { border-top: 1px solid var(--line); }
}

/* ---------- "Snap into order" ---------- */
[data-order] > * {
  transition: transform 1.1s var(--ease), opacity 0.9s var(--ease);
  transition-delay: calc(var(--i, 0) * 70ms);
}
[data-order]:not(.is-ordered) > * {
  transform: translateY(var(--dy, 24px));
  opacity: 0;
}

/* ---------- Services: five states of order ---------- */
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 32px; flex-wrap: wrap; margin-bottom: 64px; }
.section-head .lede { margin-top: 0; max-width: 46ch; }
.cards-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card {
  background: var(--bg); padding: 28px 24px 32px; display: flex; flex-direction: column; gap: 16px; min-height: 360px;
  position: relative;
}
.card:hover { background: var(--bg-2); transition: background-color 0.3s; }
.card .num { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.card h3 { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.05; margin: auto 0 0; }
.card p { color: var(--muted); font-size: 15px; margin: 0; }
@media (max-width: 1080px) { .cards-5 { grid-template-columns: repeat(2, 1fr); } .cards-5 > :last-child { grid-column: span 2; } }
@media (max-width: 600px) { .cards-5 { grid-template-columns: 1fr; } .cards-5 > :last-child { grid-column: auto; } .card { min-height: 0; } .card h3 { margin-top: 24px; } }

/* Glyph: dots that go from noise to pattern */
.glyph { width: 64px; height: 64px; }
.glyph circle { fill: var(--muted); transition: transform 1s var(--ease), fill 0.6s; transform-box: fill-box; }
.glyph circle.on { fill: var(--z-blue); }
.glyph-host:not(.is-ordered) .glyph circle { transform: translate(var(--gx), var(--gy)); }
.glyph-host:not(.is-ordered) .glyph circle.on { fill: var(--muted); }

/* ---------- Order layer: Exhibit 2 (research-note schematic) ---------- */
.exhibit { margin: 56px 0 0; border-top: 1px solid var(--fg); border-bottom: 1px solid var(--line); }
.exhibit-head { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font: 400 11px/1.4 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.exhibit-head b { color: var(--fg); font-weight: 500; }
@media (max-width: 640px) { .exhibit-head span:last-child { display: none; } }
.exhibit-note { margin: 0; padding: 14px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.diagram { padding: clamp(24px, 3vw, 40px) 0; }
.diagram svg { width: 100%; height: auto; display: block; overflow: visible; }
.diagram .d-col { fill: var(--muted); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.16em; }
.diagram .d-rule { stroke: var(--line); stroke-width: 1; }
.diagram .d-rule.dash { stroke-dasharray: 2 4; }
.diagram .d-row .d-rule { stroke: color-mix(in srgb, var(--fg) 35%, transparent); }
.diagram .d-name { fill: var(--fg); font-family: var(--font-body); font-size: 15px; font-weight: 500; }
.diagram .d-sub { fill: var(--muted); font-family: var(--font-body); font-size: 12.5px; }
.diagram .d-idx { fill: var(--muted); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; }
.diagram .d-frame { fill: none; stroke: color-mix(in srgb, var(--fg) 55%, transparent); stroke-width: 1; }
.diagram .d-title { fill: var(--fg); font-family: var(--font-display); font-size: 26px; }
.diagram .d-num { fill: var(--muted); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; }
.diagram .d-stitle { fill: var(--fg); font-family: var(--font-display); font-size: 21px; }
.diagram .d-item { fill: var(--muted); font-family: var(--font-body); font-size: 13px; }
.diagram .d-chev { fill: none; stroke: var(--muted); stroke-width: 1; }
.diagram .d-rail { fill: var(--muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; }
.diagram .d-lead { fill: none; stroke: color-mix(in srgb, var(--fg) 45%, transparent); stroke-width: 1; stroke-dasharray: var(--len); stroke-dashoffset: var(--len); transition: stroke-dashoffset 1s var(--ease) 0.35s; }
.diagram .d-lead.out { stroke: var(--z-blue); transition-delay: 0.85s; }
.diagram .d-head { fill: none; stroke: var(--z-blue); stroke-width: 1; opacity: 0; transition: opacity 0.3s 1.6s; }
.diagram .d-dot { fill: color-mix(in srgb, var(--fg) 55%, transparent); opacity: 0; transition: opacity 0.3s 0.35s; }
.diagram .d-rv { opacity: 0; transition: opacity 0.7s var(--ease); transition-delay: var(--d, 0ms); }
.diagram.is-built .d-rv, .diagram.is-built .d-head, .diagram.is-built .d-dot { opacity: 1; }
.diagram.is-built .d-lead { stroke-dashoffset: 0; }
.diagram-caption { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; color: var(--muted); }

/* Tabs */
.tabs { margin-top: 72px; }
.tab-list { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
.tab {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 10px 16px; border-radius: 4px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.tab-panel { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 80px); padding-top: 40px; }
.tab-panel[hidden] { display: none; }
.tab-panel p { color: var(--muted); font-size: 18px; }
.checks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.checks li { padding: 16px 0 16px 32px; border-bottom: 1px solid var(--line); position: relative; }
.checks li::before { content: "→"; position: absolute; left: 0; color: var(--z-blue); font-family: var(--font-mono); }
@media (max-width: 860px) { .tab-panel { grid-template-columns: 1fr; } }

.pull {
  margin: clamp(80px, 10vw, 140px) 0 0; text-align: center;
  font-family: var(--font-display); font-size: clamp(36px, 5.4vw, 80px); line-height: 1.02;
}
.pull em { color: var(--z-blue); }

/* ---------- Domain lattice ---------- */
.ptable { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cell { background: var(--bg); padding: 28px; position: relative; }
.cell:hover { transition: background-color 0.4s; }
.cell:hover { background: var(--bg-2); }
.cell-top { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.cell h3 { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.1; margin: 36px 0 20px; transition: color 0.3s; }
.cell:hover h3 { color: var(--accent-text); }
.cell ul { list-style: none; margin: 0; padding: 0; font-size: 15px; color: var(--muted); }
.cell li { padding: 6px 0; border-top: 1px dashed var(--line); }
@media (max-width: 960px) { .ptable { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .ptable { grid-template-columns: 1fr; } }

/* ---------- Integrations matrix ---------- */
.matrix { display: grid; grid-template-columns: 220px 1fr; border-top: 1px solid var(--line); }
.matrix > div { padding: 28px 0; border-bottom: 1px solid var(--line); }
.matrix .m-label { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-right: 24px; }
.m-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px 32px; }
.m-item strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.1; }
.m-item span { display: block; color: var(--muted); font-size: 14px; margin-top: 6px; }
.m-item .sub { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 4px; }
@media (max-width: 720px) { .matrix { grid-template-columns: 1fr; } .matrix .m-label { padding-bottom: 0; border-bottom: 0 !important; } }

/* ---------- Readouts ---------- */
.readouts { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.readout { padding: 32px 28px; border-right: 1px solid var(--line); }
.readout:last-child { border-right: 0; }
.readout .r-key { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.readout .r-val { font-family: var(--font-display); font-size: clamp(48px, 5.4vw, 80px); line-height: 1; margin-top: 18px; font-variant-numeric: tabular-nums; }
.readout .r-val small { font-size: 0.45em; color: var(--z-blue); }
@media (max-width: 860px) {
  .readouts { grid-template-columns: 1fr 1fr; }
  .readout:nth-child(2) { border-right: 0; }
  .readout:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

/* ---------- Closing CTA ---------- */
.cta { text-align: center; padding: clamp(120px, 16vw, 220px) 0; }
.cta .display { font-size: clamp(56px, 10vw, 160px); }
.cta .lede { margin-left: auto; margin-right: auto; }
.cta .btn-row { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 40px; }
.foot-zero {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  padding-bottom: 28px; border-bottom: 1px solid var(--line);
}
.foot-zero .big { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; color: var(--muted); }
.foot-zero .big em { font-style: normal; color: var(--accent-text); }
.foot-zero p { color: var(--muted); margin: 0; font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding: 48px 0; }
.foot-grid h4 { font-family: var(--font-mono); font-weight: 500; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; }
.foot-grid li { margin: 0 0 10px; }
.foot-grid a { text-decoration: none; color: var(--fg); }
.foot-grid a:hover { color: var(--z-blue); }
.foot-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot-bottom a { color: var(--muted); }
.socials { display: flex; gap: 10px; margin-top: 20px; }
.socials a { width: 40px; height: 40px; border-radius: 4px; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: var(--fg); }
.socials a:hover { border-color: var(--z-blue); color: var(--z-blue); }
@media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > :first-child { grid-column: span 2; } }

/* ---------- Cookie banner ---------- */
.cookie {
  position: fixed; left: var(--gutter); right: var(--gutter); bottom: 16px; z-index: 150; max-width: 560px;
  background: var(--ink-2); color: var(--ink-fg); border: 1px solid var(--ink-line); border-radius: var(--radius);
  padding: 18px 20px; font-size: 14px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.cookie[hidden] { display: none; }
.cookie p { margin: 0; flex: 1 1 260px; color: var(--ink-muted); }
.cookie a { color: var(--ink-fg); }
.cookie-actions { display: flex; gap: 8px; }
.cookie .btn { --h: 38px; padding: 0 16px; font-size: 14px; }
.cookie .btn--ghost { color: var(--ink-fg); border-color: var(--ink-line); }

/* ==========================================================================
   Inner pages
   ========================================================================== */
.page-hero { position: relative; padding: 160px 0 80px; overflow: hidden; border-bottom: 1px solid var(--line); }
.page-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.page-hero .wrap { position: relative; }
.crumbs { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 40px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--fg); }

/* Offerings: numbered rows */
.rows { border-top: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 80px 1fr 1.2fr 80px; gap: clamp(20px, 3vw, 48px); align-items: start;
  padding: clamp(32px, 4vw, 56px) 0; border-bottom: 1px solid var(--line);
}
.row .num { font-family: var(--font-mono); font-size: 12px; color: var(--muted); padding-top: 14px; }
.row h2 { font-family: var(--font-display); font-weight: 400; font-size: clamp(36px, 4.4vw, 64px); line-height: 1; margin: 0; }
.row p { color: var(--muted); font-size: 18px; margin: 8px 0 0; }
.row .glyph { justify-self: end; }
@media (max-width: 860px) {
  .row { grid-template-columns: 1fr auto; }
  .row .num { grid-column: 1; padding: 0; }
  .row .glyph { grid-column: 2; grid-row: 1; }
  .row h2, .row p { grid-column: 1 / -1; }
}

/* Capabilities grid */
.cap-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cap-grid .card { min-height: 320px; }
.cap-grid .card h3 { font-size: 28px; }
@media (max-width: 1080px) { .cap-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cap-grid { grid-template-columns: 1fr; } .cap-grid .card { min-height: 0; } }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.chip { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em; padding: 10px 16px; border: 1px solid var(--line); border-radius: 4px; }
.chip:hover { border-color: var(--z-blue); color: var(--accent-text); }

/* Support: incident log */
.support-grid { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.log {
  background: var(--ink); color: var(--ink-fg); border-radius: var(--radius); border: 1px solid var(--ink-line);
  font-family: var(--font-mono); font-size: 14px; overflow: hidden;
}
.log-bar { display: flex; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--ink-line); color: var(--ink-muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; }
.log-bar .live { color: var(--up); display: inline-flex; align-items: center; gap: 8px; }
.log-bar .live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--up); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.25; } }
.log ol { list-style: none; margin: 0; padding: 12px 0; }
.log li {
  display: grid; grid-template-columns: 84px 56px 1fr; gap: 12px; padding: 12px 18px; line-height: 1.5;
  opacity: 0; transform: translateY(6px); transition: opacity 0.5s, transform 0.5s var(--ease);
}
.log.is-ordered li { opacity: 1; transform: none; transition-delay: calc(var(--i) * 260ms); }
.log .t { color: var(--ink-muted); }
.log .ok { color: var(--up); }
.big-stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.big-stat .r-val { font-family: var(--font-display); font-size: clamp(96px, 12vw, 180px); line-height: 0.9; }
.big-stat .r-val em { color: var(--z-blue); }
@media (max-width: 860px) { .support-grid { grid-template-columns: 1fr; } .log li { grid-template-columns: 64px 1fr; } .log li .ok { display: none; } }

/* Team */
.team { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); }
.member figure { margin: 0; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--bg-2); position: relative; }
.member img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transition: filter 0.6s, transform 1s var(--ease); }
.member:hover img { filter: grayscale(0); transform: scale(1.03); }
.member figure::after { content: ""; position: absolute; inset: 0; background: var(--z-blue); mix-blend-mode: color; opacity: 0.35; transition: opacity 0.6s; }
.member:hover figure::after { opacity: 0; }
.member .role { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-text); margin: 24px 0 6px; }
.member h2 { font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1.05; margin: 0 0 12px; }
.member p { color: var(--muted); font-size: 16px; }
.member a.li { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
.member a.li:hover { color: var(--z-blue); }
@media (max-width: 860px) { .team { grid-template-columns: 1fr; max-width: 480px; } }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(40px, 6vw, 96px); }
.form { display: grid; gap: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.field label { display: block; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--fg); background: transparent;
  border: 0; border-bottom: 1px solid var(--line); padding: 10px 0 14px; border-radius: 0;
  transition: border-color 0.3s;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--z-blue); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 0.6; }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.consent input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--z-blue); flex: none; }
.form-status { font-family: var(--font-mono); font-size: 13px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line); }
.form-status.success { color: var(--up); border-color: currentColor; }
.form-status.error { color: var(--down); border-color: currentColor; }
.offices { display: grid; gap: 0; border-top: 1px solid var(--line); }
.office { padding: 28px 0; border-bottom: 1px solid var(--line); }
.office h3 { font-family: var(--font-display); font-weight: 400; font-size: 32px; margin: 8px 0; }
.office p { color: var(--muted); margin: 0 0 12px; }
.office a { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; color: var(--accent-text); }
.office .big-link { font-family: var(--font-display); font-size: 28px; letter-spacing: 0; text-transform: none; color: var(--fg); display: block; margin: 4px 0; }
.office .big-link:hover { color: var(--z-blue); }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } .form-row { grid-template-columns: 1fr; } }

/* Legal */
.legal { max-width: 760px; }
.legal h2 { font-family: var(--font-display); font-weight: 400; font-size: 36px; line-height: 1.1; margin: 64px 0 16px; scroll-margin-top: 100px; }
.legal h3 { font-size: 18px; font-weight: 600; margin: 32px 0 8px; }
.legal p, .legal li { color: var(--muted); }
.legal strong { color: var(--fg); font-weight: 600; }
.legal a { color: var(--accent-text); }
.legal hr { border: 0; border-top: 1px solid var(--line); margin: 64px 0; }
.legal ul { padding-left: 20px; }
.legal .meta { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; }

/* ---------- Text scramble helper ---------- */
.scr-ch { color: var(--z-blue); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  [data-order]:not(.is-ordered) > * { transform: none; opacity: 1; }
  .glyph-host:not(.is-ordered) .glyph circle { transform: none; }
  .log li { opacity: 1; transform: none; }
}

/* ==========================================================================
   Self-reconciling ledger
   ========================================================================== */

/* ---------- Self-reconciling ledger ---------- */
.recon-intro { margin-top: 120px; max-width: 60ch; }
.recon-intro .h3 { margin: 14px 0 12px; }
.recon-scroller { position: relative; margin-top: 40px; }
.recon { border: 1px solid var(--line); border-radius: var(--radius); background: color-mix(in srgb, var(--bg-2) 70%, transparent); overflow: hidden; font-family: var(--font-mono); }
.recon-head, .recon-foot { display: grid; grid-template-columns: 1fr 270px 1fr; gap: 0; align-items: center; }
.recon-head { border-bottom: 1px solid var(--line); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.recon-head > div { padding: 14px 18px; }
.recon-head > div:nth-child(2) { text-align: center; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.recon-body { position: relative; display: grid; grid-template-columns: 1fr 270px 1fr; }
.recon-col, .recon-mid { position: relative; }
.recon-mid { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.r-row {
  position: absolute; left: 10px; right: 10px; top: 0; height: 40px; margin-top: 6px;
  display: grid; grid-template-columns: 1.2fr 0.8fr 0.6fr 1fr 1fr; align-items: center; gap: 8px; padding: 0 12px;
  font-size: 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg);
  will-change: transform; backface-visibility: hidden; transition: border-color 0.3s, background-color 0.3s;
}
.r-row .id { color: var(--muted); }
.r-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.r-row .side-b { color: var(--up); }
.r-row .side-s { color: var(--down); }
.r-row.is-matched { border-color: color-mix(in srgb, var(--up) 55%, transparent); }
.r-row.is-break { border-color: #e0a526; }
.r-row .bad { color: #e0a526; text-decoration: underline wavy; text-underline-offset: 3px; }
.r-row.is-missing { justify-content: center; grid-template-columns: 1fr; text-align: center; color: var(--muted); border-style: dashed; }
.r-row.flash { background: color-mix(in srgb, var(--up) 18%, var(--bg)); }
/* Agent lane: a connector per row with a status pill riding on it */
.agent-h { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--fg); }
.agent-h .live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--z-blue); box-shadow: 0 0 0 0 rgba(58, 147, 232, 0.6); animation: agentPulse 1.8s infinite; }
@keyframes agentPulse { 0% { box-shadow: 0 0 0 0 rgba(58, 147, 232, 0.55); } 70% { box-shadow: 0 0 0 7px rgba(58, 147, 232, 0); } 100% { box-shadow: 0 0 0 0 rgba(58, 147, 232, 0); } }
.r-chip {
  --lane: var(--line);
  position: absolute; left: 0; right: 0; top: 0; height: 40px; margin-top: 6px;
  display: flex; align-items: center; justify-content: center;
}
.r-chip::before { /* the connector between the two ledgers */
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; transform: translateY(-0.5px);
  background: var(--lane); transition: background-color 0.3s, opacity 0.3s;
}
.r-chip::after { /* end caps where the line meets each ledger */
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 5px; transform: translateY(-50%);
  background: radial-gradient(circle at 2.5px 50%, var(--lane) 2.4px, transparent 2.6px) left / 5px 5px no-repeat,
              radial-gradient(circle at 2.5px 50%, var(--lane) 2.4px, transparent 2.6px) right / 5px 5px no-repeat;
}
.r-chip.unmatched::before { background: repeating-linear-gradient(90deg, var(--line) 0 4px, transparent 4px 9px); }
.r-chip.searching { --lane: var(--z-blue); }
.r-chip.searching::before { background: repeating-linear-gradient(90deg, var(--z-blue) 0 6px, transparent 6px 12px); background-size: 24px 1px; animation: laneFlow 0.6s linear infinite; }
@keyframes laneFlow { to { background-position: 24px 0; } }
.r-chip.matched, .r-chip.resolved { --lane: color-mix(in srgb, var(--up) 70%, transparent); }
.r-chip.resolved::before { box-shadow: 0 0 8px color-mix(in srgb, var(--up) 60%, transparent); }
.r-chip.break { --lane: #e0a526; }
.pill {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 7px; max-width: calc(100% - 28px);
  height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2);
  font-size: 11px; letter-spacing: 0.02em; white-space: nowrap; color: var(--muted);
  transition: color 0.3s, border-color 0.3s, background-color 0.3s;
}
.pill .tx { overflow: hidden; text-overflow: ellipsis; }
.pill .ic { font-style: normal; font-size: 11px; line-height: 1; width: 12px; text-align: center; }
.r-chip.searching .pill { color: var(--accent-text); border-color: color-mix(in srgb, var(--z-blue) 50%, transparent); }
.r-chip.searching .ic { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid currentColor; border-right-color: transparent; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.r-chip.matched .pill, .r-chip.resolved .pill { color: var(--up); border-color: color-mix(in srgb, var(--up) 45%, transparent); background: color-mix(in srgb, var(--up) 10%, var(--bg-2)); }
.r-chip.break .pill { color: #e0a526; border-color: color-mix(in srgb, #e0a526 55%, transparent); background: color-mix(in srgb, #e0a526 10%, var(--bg-2)); }
.r-chip.resolved .pill { animation: pillPop 0.45s var(--ease); }
@keyframes pillPop { 0% { transform: scale(0.86); } 60% { transform: scale(1.05); } 100% { transform: scale(1); } }
.recon-foot { border-top: 1px solid var(--line); font-size: 12px; letter-spacing: 0.06em; color: var(--muted); grid-template-columns: repeat(4, 1fr); }
.recon-foot > div { padding: 14px 18px; border-right: 1px solid var(--line); }
.recon-foot > div:last-child { border-right: 0; }
.recon-foot b { display: block; font-size: 22px; font-weight: 500; color: var(--fg); margin-top: 4px; font-variant-numeric: tabular-nums; }
.recon-foot b.good { color: var(--up); }
.recon-caption { margin-top: 18px; color: var(--muted); font-size: 14px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (max-width: 860px) {
  .recon-head, .recon-body { grid-template-columns: 1fr 64px 1fr; }
  .r-row { grid-template-columns: 1fr auto; font-size: 11px; padding: 0 8px; left: 4px; right: 4px; }
  .r-row .sym, .r-row .px, .r-row .side-b, .r-row .side-s { display: none; }
  .pill { padding: 0; width: 24px; justify-content: center; gap: 0; }
  .pill .tx { display: none; }
  .agent-h .live-dot { display: none; }
  .recon-head > div { padding: 12px 8px; font-size: 9px; }
  .recon-foot { grid-template-columns: 1fr 1fr; }
  .recon-foot > div:nth-child(2) { border-right: 0; }
  .recon-foot > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
}

/* ---------- Clients: sectors + representative engagements ---------- */
.sectors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sector { background: var(--bg); padding: 32px 28px; display: flex; flex-direction: column; gap: 14px; }
.sector .mono { font-size: 12px; letter-spacing: 0.1em; margin: 0; }
.sector h3 { font-family: var(--font-display); font-weight: 400; font-size: 34px; line-height: 1.05; margin: 12px 0 0; }
.sector > p:not(.mono) { margin: 0; color: var(--muted); font-size: 16px; }
.sector ul { list-style: none; margin: auto 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--font-mono); font-size: 12.5px; color: var(--fg); }
.cases-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 88px 0 24px; }
.cases-head .eyebrow, .cases-head .muted { margin: 0; }
.cases-head .muted { font-size: 14px; }
.cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.case { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; background: var(--bg-2); display: flex; flex-direction: column; }
.case-tag { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-text); padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.case-tag span + span { color: var(--muted); }
.case h3 { font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.1; margin: 24px 0 20px; }
.case dl { margin: 0; display: grid; gap: 16px; }
.case dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.case dd { margin: 0; font-size: 15.5px; line-height: 1.55; }
.case div:last-child dd { color: var(--fg); font-weight: 500; }
@media (max-width: 960px) { .sectors, .cases { grid-template-columns: 1fr; } }

/* ---------- Contact: what happens next ---------- */
.steps { margin-top: 48px; }
.steps h3 { font-size: 26px; }

/* ==========================================================================
   Frosted glass surfaces: translucent panels that blur the dotted paper behind
   ========================================================================== */
.cards-5, .ptable, .cap-grid, .sectors, .case, .recon {
  background: color-mix(in srgb, var(--bg-2) 26%, transparent);
  -webkit-backdrop-filter: blur(1.6px) saturate(1.05);
  backdrop-filter: blur(1.6px) saturate(1.05);
}
/* grid cells are clear; each draws its own right / bottom rule (gaps no longer show a fill) */
.card, .cell, .sector { background: transparent; }
.cards-5 > *, .ptable > *, .cap-grid > *, .sectors > * {
  box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line), 1px 1px 0 var(--line);
}
.card:hover, .cell:hover { background: color-mix(in srgb, var(--fg) 4%, transparent); }
/* ledger rows sit inside the frosted ledger, so they only need a light tint */
.r-row { background: color-mix(in srgb, var(--bg) 45%, transparent); }
/* dark panels keep their ink, frosted */
.log {
  background: color-mix(in srgb, var(--ink) 90%, transparent);
  -webkit-backdrop-filter: blur(1.6px); backdrop-filter: blur(1.6px);
}
/* floating layers need more body to stay readable over content */
.submenu {
  background: color-mix(in srgb, var(--bg-2) 72%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1);
}
.cookie {
  background: color-mix(in srgb, var(--ink-2) 86%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
