/* BoonMind Labs — design system (Option C: light professional R&D)
   European industrial supplier feel. Not Zero Overshoot product twin.
   Anti AI-template: no hero gradient blob, no glow pills, no gradient text,
   no pastel icon circles. Trust-strip = stat/label/src; left-aligned rhythm. */
:root {
  /* One hue axis: 257°. Chroma rises with darkness. */
  /* Surfaces */
  --bg:            #f3f5f8;  /* oklch(97%   .004 257) */
  --bg-band:       #edeff3;  /* oklch(95.2% .006 257) */
  --bg-soft:       #e6e9ef;  /* oklch(93.4% .008 257) */
  --bg-sunk:       #dbe0e6;  /* oklch(90.5% .010 257) */
  --bg-elev:       #ffffff;
  --bg-panel:      var(--bg-elev);
  --border-faint:  color-mix(in oklab, var(--text) 7%,  transparent);
  --border:        color-mix(in oklab, var(--text) 12%, transparent);
  --border-strong: color-mix(in oklab, var(--text) 22%, transparent);

  /* Ink */
  --text:          #0c192a;  /* 16.18:1 on --bg */
  --muted:         #46556a;  /*  6.95:1 */
  --faint:         #5b6c83;  /*  4.91:1 — was 4.36, failed AA */

  /* Accent — same hue as the neutrals, more chroma */
  --accent:        #1f3a5f;  /* navy, unchanged to the eye */
  --accent-2:      var(--accent);
  --accent-hover:  #132947;
  --accent-press:  #0e1e35;
  --link:          #15417b;  /* was #1e3a8a at 265.5° */
  --link-hover:    #072a57;

  /* Dark surfaces — same axis, no drift to 270–285° */
  --d-bg:          #080b10;
  --d-surface:     #0f1319;
  --d-raised:      #181d25;
  --d-border:      #2e3642;  /* hairline, was invisible at 1.16:1 */
  --d-border-str:  #596475;  /* interactive, 3.11:1 */
  --d-text:        #eef2f7;
  --d-muted:       #8895a6;
  --d-faint:       #758192;  /*  4.71:1 — was 3.16 */
  --d-accent:      #2d6dc4;  /* white on it: 5.13:1 */
  --d-accent-hover:#1e56a1;  /* darkens on hover: 7.24:1 */

  /* Status — equal L and C, hue is the only signal */
  --green:         #036f4f;  --green-dark: #57b38e;
  --amber:         #854f15;  --amber-dark: #cd8f57;
  --red:           #8d453e;  --red-dark:   #d8847b;
  --green-bg:      #e9f8f0;  --green-ink:  #034933;
  --amber-bg:      #fdf1e7;  --amber-ink:  #5b3101;
  --red-bg:        #fef0ee;  --red-ink:    #642722;

  /* Aliases — keep one value, not four names */
  --accent-solid: var(--accent);
  --ring:         var(--accent);
  --ring-offset:  var(--bg);
  --card:         var(--bg-elev);
  --honest-bg:    var(--red-bg);
  --honest-text:  var(--red-ink);
  --honest-border:color-mix(in oklab, var(--red) 28%, transparent);
  --trust-bg:     var(--bg-band);
  --trust-text:   var(--text);
  --trust-border: color-mix(in oklab, var(--accent) 22%, transparent);

  /* Layout — tighter radii (not soft SaaS pills) */
  --radius: 8px;
  --radius-sm: 4px;
  --radius-pill: 999px; /* status tags only; buttons do not use this */
  --shadow: 0 1px 2px rgba(12, 25, 42, 0.06), 0 4px 12px rgba(12, 25, 42, 0.04);
  --shadow-soft: 0 1px 3px rgba(12, 25, 42, 0.05);
  --max: 1080px;
  --space-section: clamp(1.25rem, 2vw, 2rem);
  --space-section-tight: clamp(0.75rem, 1.5vw, 1.25rem);
  --space-section-wide: clamp(1.5rem, 3vw, 2.5rem);
  --nav-h: 4rem;

  /* Type — system stack, not Inter-as-brand */
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  /* Belt-and-suspenders: no motion on interactive surfaces */
  .btn,
  .btn:hover,
  .card-link,
  .card-link:hover,
  .book-card,
  .book-card:hover,
  .grid-systems .card,
  .grid-systems .card:hover {
    transform: none !important;
    transition: none !important;
  }
}

body {
  margin: 0;
  font-family: var(--font);
  /* Flat light lab field — no dual radial cyan/blue glow */
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  text-align: left;
}

/* Readable defaults — navy links, not ZO ice-cyan */
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 0.15em; }
img { max-width: 100%; height: auto; display: block; }
p { overflow-wrap: anywhere; }

.wrap {
  width: min(var(--max), calc(100% - 2.5rem));
  margin: 0 auto;
}
@media (max-width: 480px) {
  .wrap { width: min(var(--max), calc(100% - 1.5rem)); }
}

/* Skip link */
.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: #0f172a;
  color: #fff;
  padding: 0.5rem 1rem;
  z-index: 100;
  border-radius: 4px;
  font-weight: 600;
}
.skip:focus {
  left: 1rem;
  top: 1rem;
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* -------------------------------------------------------------------------- */
/* Nav — sticky light strip (readable on #f4f5f7)                              */
/* -------------------------------------------------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
  min-height: var(--nav-h);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none !important;
}
.brand:hover { color: var(--text); }
/* Distinct Labs mark: monochrome geometric L-frame — NOT ZO gradient square */
.brand-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 0;
  background:
    linear-gradient(var(--text), var(--text)) left top / 100% 2.5px no-repeat,
    linear-gradient(var(--text), var(--text)) left top / 2.5px 100% no-repeat,
    linear-gradient(var(--text), var(--text)) left bottom / 55% 2.5px no-repeat,
    linear-gradient(var(--text), var(--text)) right bottom / 2.5px 45% no-repeat;
  border: none;
  box-shadow: none;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-text small {
  font-weight: 500;
  color: var(--faint);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--mono);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--font);
}
.nav-toggle:hover {
  border-color: var(--border-strong);
  background: var(--bg-soft);
}
.nav-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 0.2rem 0.85rem;
  flex-wrap: wrap;
  align-items: center;
}
.nav-links a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.35rem 0.15rem;
  border-radius: 2px;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a[aria-current="page"] {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}
/* Primary CTA in nav — flat, not soft glow pill */
.nav-links a.btn {
  padding: 0.55rem 0.95rem;
  box-shadow: none;
  margin-left: 0.15rem;
  color: #fff; /* beat .nav-links a muted; WCAG AA white-on-navy */
}
.nav-links a.btn[aria-current="page"],
.nav-links a.btn:hover {
  box-shadow: none;
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-inner { flex-wrap: wrap; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 0.35rem 0 0.85rem;
    gap: 0.15rem;
    border-top: 1px solid var(--border-faint);
    margin-top: 0.15rem;
  }
  .nav-links.is-open {
    display: flex;
  }
  .nav-links a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    width: 100%;
  }
  .nav-links a:hover {
    background: var(--bg-soft);
  }
  .nav-links a[aria-current="page"] {
    box-shadow: none;
    background: var(--trust-bg);
    border-left: 2px solid var(--accent);
    color: var(--text);
  }
  .nav-links a.btn {
    margin: 0.45rem 0 0;
    justify-content: center;
    width: 100%;
    border-left: 0;
  }
  .nav-links a.btn[aria-current="page"] {
    background: var(--accent-solid);
    color: #fff;
  }
}

/* Body lock when mobile menu open (class set by JS) */
body.nav-open {
  overflow: hidden;
}
@media (min-width: 901px) {
  body.nav-open { overflow: visible; }
}

/* -------------------------------------------------------------------------- */
/* Buttons — flat instruments, not soft glow pills                             */
/* -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: var(--radius-sm);
  padding: 0.65rem 1.05rem;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none !important;
  font-family: var(--font);
  line-height: 1.2;
  box-shadow: none;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.btn:hover {
  transform: none;
  text-decoration: none !important;
}
.btn-primary {
  background: var(--accent-solid);
  color: #fff;
  border-color: var(--accent-hover);
  box-shadow: none;
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: #0f1f33;
  color: #fff;
  box-shadow: none;
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: none;
}
.btn-ghost:hover {
  border-color: var(--text);
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: none;
}
.btn-soft {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--border);
  box-shadow: none;
}
.btn-soft:hover {
  border-color: var(--border-strong);
  background: #dde0e6;
  color: var(--text);
  box-shadow: none;
}
.btn-lg {
  padding: 0.8rem 1.25rem;
  font-size: 1.02rem;
  min-height: 48px;
}

/* -------------------------------------------------------------------------- */
/* Hero / page-hero — one loud idea, left-aligned (no centered blob stage)     */
/* -------------------------------------------------------------------------- */
.hero {
  padding: var(--space-section-wide) 0 var(--space-section);
  text-align: left;
}
.page-hero {
  padding: 2.75rem 0 1.35rem;
  text-align: left;
}
.page-hero .lede { margin-bottom: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.95rem;
  font-family: var(--mono);
}
/* Status tick — square, no soft glow halo */
.eyebrow::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 1px;
  background: var(--accent);
  box-shadow: none;
  flex-shrink: 0;
}

.hero h1,
.page-hero h1 {
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0 0 1rem;
  font-weight: 700;
  color: var(--text);
  /* Hierarchy via weight/size only — never gradient text */
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  -webkit-text-fill-color: unset;
}
.hero h1 {
  font-size: clamp(2.05rem, 5vw, 3.15rem);
  max-width: 18ch;
}
.page-hero h1 {
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  max-width: 22ch;
}

.lede {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--muted);
  max-width: 40rem;
  margin: 0 0 1.45rem;
  line-height: 1.6;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
}
.contact-line {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}
.contact-line a {
  font-weight: 600;
  font-family: var(--mono);
  font-size: 0.9rem;
}
.hero-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0.9rem 0 0;
  font-size: 0.9rem;
  font-weight: 500;
}
.hero-secondary a { color: var(--muted); text-decoration: none; }
.hero-secondary a:hover { color: var(--text); text-decoration: underline; }
.hero-secondary .sep { color: var(--faint); user-select: none; }

/* -------------------------------------------------------------------------- */
/* Cards / grids — light instrument panels                                     */
/* -------------------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem;
  box-shadow: none; /* flat panel, not soft neumorphism */
}
.card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text);
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.55;
}
.card .stat {
  font-family: var(--mono);
  font-size: clamp(1.25rem, 2.5vw, 1.45rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.card .src {
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-faint);
  font-size: 0.75rem;
  color: var(--faint);
  font-family: var(--mono);
  line-height: 1.45;
}
.card .src a { font-family: var(--mono); }

.card-link {
  display: block;
  color: inherit;
  text-decoration: none !important;
  transition: border-color 0.12s ease, background 0.12s ease;
  height: auto; /* natural height — no equal-height template polish */
}
.card-link:hover {
  border-color: rgba(30, 58, 95, 0.4);
  transform: none;
  box-shadow: none;
  background: #fafbfc;
  text-decoration: none !important;
}
.card-link:focus-visible {
  border-color: rgba(30, 58, 95, 0.55);
}

/* System portfolio cards — denser instrument feel */
.grid-systems .card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  transition: border-color 0.12s ease;
}
.grid-systems .card:hover {
  border-color: rgba(30, 58, 95, 0.35);
  box-shadow: none;
}
.grid-systems .card h3 { margin-top: 0.1rem; }
.grid-systems .card .src { margin-top: auto; }

/* Trust strip — evidence instruments: stat + label + source
   Light cards, dark ink. No pastel icon circles. No cyan wash. */
.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin-top: 2rem;
  align-items: start; /* allow uneven card heights */
}
.trust-strip .card {
  position: relative;
  overflow: hidden;
  padding-top: 1.15rem;
  background: var(--bg-elev);
  box-shadow: none;
}
/* Instrument hairline — single navy edge, not cyan marketing bar */
.trust-strip .card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0.9;
}
.trust-strip .card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
}
.trust-strip .stat {
  color: var(--text);
  font-size: clamp(1.35rem, 2.8vw, 1.55rem);
}
/* Explicit: no icon wells / pastel circles inside trust cards */
.trust-strip .icon,
.trust-strip .icon-circle,
.trust-strip [class*="icon-"] {
  display: none !important;
}
@media (max-width: 800px) {
  .trust-strip { grid-template-columns: 1fr; }
  .trust-strip .card { padding-top: 1.2rem; }
}

/* Honest bar — fail-open posture; light theme restyle */
.honest-bar {
  margin: 1.75rem 0 0;
  padding: 1rem 1.15rem 1rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--honest-border);
  border-left: 3px solid var(--red);
  background: var(--honest-bg);
  color: var(--honest-text);
  font-size: 0.94rem;
  line-height: 1.55;
}
.honest-bar strong {
  color: #7f1d1d;
  font-weight: 700;
}
.honest-bar em {
  font-style: italic;
  color: #991b1b;
}

/* Trust / context banner — steel navy, not cyan */
.banner-trust {
  margin: 1.15rem 0 0;
  padding: 0.85rem 1rem 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--trust-bg);
  border: 1px solid var(--trust-border);
  border-left: 3px solid var(--accent);
  color: var(--trust-text);
  font-size: 0.94rem;
  line-height: 1.5;
}
.banner-trust strong { color: var(--text); font-weight: 600; }

/* -------------------------------------------------------------------------- */
/* Sections — left-aligned body, asymmetric rhythm                             */
/* -------------------------------------------------------------------------- */
section {
  padding: var(--space-section) 0;
  text-align: left;
}
/* Optional rhythm modifiers (HTML may opt in; default remains even) */
section.section-tight { padding: var(--space-section-tight) 0; }
section.section-wide { padding: var(--space-section-wide) 0; }
/* Alternate band offset: content max slightly inset from full wrap feel */
section.section-offset .wrap {
  padding-left: clamp(0rem, 2vw, 1.25rem);
}
section[id] { scroll-margin-top: 5.5rem; }

section h2 {
  font-size: clamp(1.45rem, 3vw, 1.95rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.7rem;
  line-height: 1.2;
  max-width: 28ch;
  color: var(--text);
  background: none;
  -webkit-text-fill-color: unset;
}
.section-lede {
  color: var(--muted);
  max-width: 46rem;
  margin: 0 0 1.4rem;
  font-size: 1.02rem;
  text-align: left;
}

.section-band {
  border-top: 1px solid var(--border-faint);
  background: var(--bg-band);
}
/* Hard rule — flat edge, not soft fade-to-transparent “design flourish” */
.section-rule {
  border: 0;
  height: 1px;
  margin: 0;
  background: rgba(15, 23, 42, 0.1);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.grid-systems {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
/* Workbench run gallery — flat figures, no AI-template chrome */
.wb-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.wb-gallery figure {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.wb-gallery figure img {
  width: 100%;
  height: auto;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}
.wb-gallery figcaption {
  padding: 0.85rem 1rem 1rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.wb-gallery figcaption strong {
  display: block;
  color: var(--text);
  font-size: 0.92rem;
  margin-bottom: 0.25rem;
  font-weight: 600;
}
.wb-gallery .src {
  margin-top: 0.45rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.claim-chain {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.65rem;
  margin: 1.25rem 0 0;
  list-style: none;
  padding: 0;
  counter-reset: chain;
}
.claim-chain li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--text-muted);
  position: relative;
}
.claim-chain li strong {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}
@media (max-width: 900px) {
  .grid-2,
  .grid-3 { grid-template-columns: 1fr; }
  .wb-gallery { grid-template-columns: 1fr; }
  .claim-chain { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .claim-chain { grid-template-columns: 1fr; }
}

/* Pills — status tags (flat, not glow) */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--border);
  margin-bottom: 0.55rem;
  letter-spacing: 0.02em;
  font-family: var(--mono);
  line-height: 1.3;
  width: fit-content;
  max-width: 100%;
  background: var(--bg-elev);
}
.pill-green {
  color: var(--green);
  border-color: rgba(4, 120, 87, 0.35);
  background: rgba(4, 120, 87, 0.06);
}
.pill-amber {
  color: var(--amber);
  border-color: rgba(180, 83, 9, 0.35);
  background: rgba(180, 83, 9, 0.06);
}
.pill-blue {
  color: var(--accent);
  border-color: rgba(30, 58, 95, 0.3);
  background: rgba(30, 58, 95, 0.06);
}
.pill-red {
  color: var(--red);
  border-color: rgba(185, 28, 28, 0.3);
  background: rgba(185, 28, 28, 0.05);
}

/* Method loop — numbered control steps */
.loop-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: loop;
  display: grid;
  gap: 0.7rem;
}
.loop-list li {
  counter-increment: loop;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.15rem 1rem 3.35rem;
  position: relative;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}
/* Step index — mono numeral, square chip (not pastel icon circle) */
.loop-list li::before {
  content: counter(loop);
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 2px;
  background: transparent;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(30, 58, 95, 0.35);
}
.loop-list strong { color: var(--text); }

/* -------------------------------------------------------------------------- */
/* Books — philosophy layer                                                    */
/* -------------------------------------------------------------------------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}
.book-card {
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  box-shadow: none;
  transition: border-color 0.12s ease;
}
.book-card:hover {
  border-color: rgba(30, 58, 95, 0.35);
  transform: none;
  box-shadow: none;
}
.book-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  /* Flat fallback — no marketing cover gradient wash */
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.book-card .book-body {
  padding: 1.1rem 1.15rem 1.3rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.book-card .book-body h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}
.book-card .book-body p {
  flex: 1;
}
.book-card .status {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.45rem;
  font-weight: 600;
}

/* -------------------------------------------------------------------------- */
/* Tables / prose / callouts                                                   */
/* -------------------------------------------------------------------------- */
/* Horizontal scroll wrapper for comparison tables on narrow viewports */
.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 1rem;
}
.table-scroll table.simple {
  min-width: 18rem;
}

table.simple {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
table.simple th,
table.simple td {
  text-align: left;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
table.simple th {
  color: var(--faint);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--mono);
}
table.simple td { color: var(--muted); }
table.simple td strong { color: var(--text); }
table.simple tbody tr:hover td {
  background: rgba(15, 23, 42, 0.03);
}

.prose { max-width: 42rem; }
.prose p {
  color: var(--muted);
  margin: 0 0 1rem;
  font-size: 1.02rem;
}
.prose ul,
.prose ol {
  color: var(--muted);
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}
.prose li { margin: 0.4rem 0; }
.prose strong { color: var(--text); }
.prose h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  margin: 2rem 0 0.65rem;
  color: var(--text);
}
.prose h3 {
  font-size: 1.08rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
  letter-spacing: -0.01em;
}
.prose a { font-weight: 500; }
.prose code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-soft);
  border: 1px solid var(--border-faint);
  border-radius: 3px;
  padding: 0.1em 0.35em;
  color: var(--text);
}

.callout {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 0.85rem 0.75rem 1rem;
  color: var(--muted);
  margin: 1.1rem 0;
  font-size: 0.98rem;
  line-height: 1.55;
  background: var(--bg-soft, rgba(15, 23, 42, 0.03));
  border-radius: 0 var(--radius-sm, 4px) var(--radius-sm, 4px) 0;
  max-width: 100%;
  box-sizing: border-box;
}
.callout strong { color: var(--text); }

/* Scale / speed section — readable stack on narrow viewports */
.prose h2#scale-speed { scroll-margin-top: 4.5rem; }
.prose h2#corpus,
.prose h2#ecosystem { scroll-margin-top: 4.5rem; }
@media (max-width: 520px) {
  .prose h3 { font-size: 1.02rem; margin-top: 1.25rem; }
  .callout { padding: 0.7rem 0.7rem 0.7rem 0.85rem; font-size: 0.94rem; }
  .page-hero .hero-actions .btn-lg { width: 100%; justify-content: center; text-align: center; }
}

/* -------------------------------------------------------------------------- */
/* Constellation frame — embed stays dark (artifact surface)                   */
/* -------------------------------------------------------------------------- */
.constellation-frame {
  margin-top: 1.35rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #0a0a0f;
  min-height: 420px;
  box-shadow: none;
}
.constellation-frame iframe {
  width: 100%;
  height: 780px;
  border: 0;
  display: block;
}
@media (max-width: 700px) {
  .constellation-frame {
    min-height: 320px;
    border-radius: var(--radius-sm);
  }
  .constellation-frame iframe { height: 560px; }
}

/* -------------------------------------------------------------------------- */
/* Footer                                                                      */
/* -------------------------------------------------------------------------- */
.footer {
  margin-top: 1.5rem;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 0.9rem;
  background: var(--bg-band);
}
.footer a { color: var(--muted); }
.footer a:hover { color: var(--text); }
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  align-items: center;
}
.footer-nav a {
  font-size: 0.9rem;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
.footer-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Utilities */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }

/* -------------------------------------------------------------------------- */
/* Focus — visible always for keyboard; not mouse-only clutter                 */
/* -------------------------------------------------------------------------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}
.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  box-shadow: none; /* a11y ring only — no soft glow halo */
}
.nav-links a:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  color: var(--text);
}
.card-link:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}
.nav-toggle:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Selection — navy wash on light ink */
::selection {
  background: rgba(30, 58, 95, 0.18);
  color: var(--text);
}

/* -------------------------------------------------------------------------- */
/* Primary instruments — Axiom-aligned dark cards (flat, 1px border, mono)     */
/* -------------------------------------------------------------------------- */
.instrument-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-top: 0.35rem;
}
@media (min-width: 900px) {
  .instrument-grid {
    grid-template-columns: 1.15fr 1fr 1fr;
    align-items: stretch;
  }
  .instrument-card--lead {
    grid-column: 1 / -1;
  }
}
.instrument-card {
  background: #101218;
  border: 1px solid #1c2030;
  border-radius: 8px;
  padding: 1.15rem 1.25rem;
  color: #f0f2f8;
  box-shadow: none;
}
.instrument-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: #f0f2f8;
  font-weight: 650;
}
.instrument-card__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.85rem 1rem;
  align-items: start;
}
.instrument-one {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #8b93a7;
  max-width: 48rem;
}
.instrument-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: block;
}
.instrument-mark--zo {
  width: 32px;
  height: 32px;
  border: 1.5px solid #f0f2f8;
  border-radius: 2px;
  background: transparent;
  box-sizing: border-box;
  position: relative;
}
.instrument-mark--zo::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  top: 50%;
  height: 2px;
  background: #3b82f6;
  transform: translateY(-50%);
}
.instrument-mark--trader {
  width: 32px;
  height: 32px;
  border: 1px solid #1c2030;
  background: #090a0f;
  box-sizing: border-box;
  position: relative;
}
.instrument-mark--trader::before,
.instrument-mark--trader::after {
  content: "";
  position: absolute;
  background: #8b93a7;
}
.instrument-mark--trader::before {
  left: 6px;
  right: 6px;
  top: 50%;
  height: 1px;
}
.instrument-mark--trader::after {
  top: 8px;
  bottom: 8px;
  left: 50%;
  width: 1px;
}
.instrument-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
}
.instrument-card .btn-primary {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
}
.instrument-card .btn-primary:hover {
  background: #60a5fa;
  border-color: #60a5fa;
  color: #fff;
  filter: none;
}
.instrument-card .btn-ghost {
  border-color: #1c2030;
  color: #f0f2f8;
  background: transparent;
}
.instrument-card .btn-ghost:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}
.instrument-note {
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  color: #5c6478;
  font-family: var(--mono);
}
.instrument-note code {
  font-family: var(--mono);
  font-size: 0.95em;
  color: #8b93a7;
  background: #090a0f;
  padding: 0.05em 0.3em;
  border-radius: 3px;
}

.health-badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.28rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  white-space: nowrap;
  align-self: start;
}
.health-badge.is-maintenance,
.health-badge--gated {
  border-color: rgba(245, 158, 11, 0.45);
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}
.health-badge--static {
  border-color: rgba(59, 130, 246, 0.4);
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.08);
}

/* Persistent Axiom utility dock — bottom-right, unobtrusive */
.axiom-dock {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  max-width: calc(100vw - 2rem);
}
.axiom-dock__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem 0.45rem 0.5rem;
  background: #090a0f;
  border: 1px solid #1c2030;
  border-radius: 8px;
  color: #f0f2f8 !important;
  text-decoration: none !important;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: none;
}
.axiom-dock__link:hover {
  border-color: #3b82f6;
  color: #f0f2f8 !important;
}
.axiom-dock__mark {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}
.axiom-dock__label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: #8b93a7;
}
.axiom-dock__cta {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
  border-radius: 4px;
  background: #3b82f6;
  color: #fff;
  white-space: nowrap;
}
@media (max-width: 520px) {
  .axiom-dock__label { display: none; }
  .instrument-card__head {
    grid-template-columns: auto 1fr;
  }
  .health-badge {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

/* Colour audit — 257° axis. After :root so these beat hardcoded blues. */
.instrument-card       { background: var(--d-surface); border-color: var(--d-border); color: var(--d-text); }
.instrument-one        { color: var(--d-muted); }
.instrument-note       { color: var(--d-faint); }        /* 3.16 → 4.71 */
.axiom-dock__link      { background: var(--d-bg); border-color: var(--d-border); }
.constellation-frame   { background: var(--d-bg); }

.instrument-card .btn-primary       { background: var(--d-accent); border-color: var(--d-accent); }
.instrument-card .btn-primary:hover { background: var(--d-accent-hover); border-color: var(--d-accent-hover); }

.axiom-dock__cta       { background: var(--d-accent); }

.health-badge          { color: var(--green-dark); border-color: color-mix(in oklab, var(--green-dark) 45%, transparent);
                         background: color-mix(in oklab, var(--green-dark) 8%, transparent); }
.health-badge--gated,
.health-badge.is-maintenance { color: var(--amber-dark); border-color: color-mix(in oklab, var(--amber-dark) 45%, transparent);
                         background: color-mix(in oklab, var(--amber-dark) 8%, transparent); }
.health-badge--static  { color: var(--d-accent); border-color: color-mix(in oklab, var(--d-accent) 45%, transparent);
                         background: color-mix(in oklab, var(--d-accent) 8%, transparent); }

.subhead { font-size: clamp(1.05rem, 2vw, 1.2rem); color: var(--muted); max-width: 40rem; margin: 0 0 1.45rem; line-height: 1.6; }
.cta-group { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-bottom: 0.85rem; }
.btn-secondary { background: var(--bg-soft); color: var(--text); border-color: var(--border); box-shadow: none; }
.btn-secondary:hover { border-color: var(--border-strong); background: var(--bg-sunk); color: var(--text); box-shadow: none; }

.form-stack {
  display: grid;
  gap: 0.85rem;
  max-width: 36rem;
  margin-top: 1rem;
}
.form-stack label {
  display: grid;
  gap: 0.35rem;
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
}
.form-stack input,
.form-stack textarea {
  font: inherit;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
}
.form-stack textarea { min-height: 8rem; resize: vertical; }
.form-stack .form-hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.form-sent {
  margin: 0 0 1rem;
  padding: 1rem 1.15rem;
  border: 1px solid color-mix(in oklab, var(--green) 40%, transparent);
  border-left: 3px solid var(--green);
  background: var(--green-bg);
  color: var(--green-ink);
  border-radius: var(--radius-sm);
}
