@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-variable.woff2") format("woff2");
}

:root {
  --ink: #111820;
  --graphite: rgba(17, 24, 32, 0.78);
  --muted: rgba(17, 24, 32, 0.66);
  --paper: #f4f7f5;
  --paper-soft: #e8efec;
  --white: #ffffff;
  --line: rgba(6, 43, 47, 0.10);
  --line-dark: rgba(255, 255, 255, 0.12);
  --deep: #062b2f;
  --deep-2: #0a373c;
  --teal: #3f9c9a;
  --teal-soft: rgba(63, 156, 154, 0.10);
  --gold: #c6a45a;
  --gold-soft: rgba(198, 164, 90, 0.12);
  --red: #b85c5c;
  --red-soft: rgba(184, 92, 92, 0.10);
  --shadow: 0 24px 70px rgba(6, 43, 47, 0.14);
  --soft-shadow: 0 16px 38px rgba(6, 43, 47, 0.08);
  --max: 1180px;
  --radius: 24px;
  --radius-xl: 34px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 94px;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

code {
  border: 1px solid rgba(63, 156, 154, 0.20);
  border-radius: 8px;
  padding: 1px 4px;
  background: rgba(63, 156, 154, 0.08);
  color: var(--deep);
  font-size: 0.9em;
}

.wrap {
  width: min(calc(100% - 40px), var(--max));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 0;
  border-bottom: 1px solid rgba(6, 43, 47, 0.06);
  background: rgba(244, 247, 245, 0.78);
  backdrop-filter: blur(18px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand-logo-img {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
}

.navlinks {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px;
  border: 1px solid rgba(6, 43, 47, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
}

.navlinks a {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 9px 13px;
  color: rgba(17, 24, 32, 0.68);
  font-size: 0.92rem;
  font-weight: 560;
  letter-spacing: 0;
}

.navlinks a:hover {
  color: var(--deep);
  background: rgba(6, 43, 47, 0.05);
}

.nav-cta,
.btn {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 650;
  letter-spacing: 0;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-cta {
  min-height: 42px;
  padding: 0 16px;
  font-size: 0.93rem;
  font-weight: 620;
}

.nav-cta,
.btn-main {
  background: var(--deep);
  color: var(--white);
  box-shadow: 0 12px 26px rgba(9, 43, 44, 0.16);
}

.btn-secondary {
  border-color: rgba(6, 43, 47, 0.08);
  background: rgba(255, 255, 255, 0.72);
  color: var(--deep);
}

.nav-cta:hover,
.btn:hover {
  transform: translateY(-1px);
}

.btn-main:hover {
  background: var(--deep-2);
}

.btn-secondary:hover {
  border-color: rgba(6, 43, 47, 0.12);
  background: rgba(255, 255, 255, 0.92);
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 74px 0 42px;
  background:
    radial-gradient(58% 68% at 74% 46%, rgba(63, 156, 154, 0.16), rgba(63, 156, 154, 0) 72%),
    radial-gradient(42% 46% at 90% 15%, rgba(198, 164, 90, 0.10), rgba(198, 164, 90, 0) 70%),
    var(--paper);
}

.flow-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  opacity: 0.85;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  align-items: center;
  gap: 36px;
}

.hero-copy-block {
  max-width: 650px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 820;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 22px 0 18px;
  max-width: 11.2ch;
  color: var(--deep);
  font-size: 5rem;
  line-height: 0.94;
  font-weight: 760;
}

.hero-lead {
  margin: 24px 0 0;
  max-width: 62ch;
  color: var(--graphite);
  font-size: 1.16rem;
  line-height: 1.72;
}

.hero-note {
  margin: 18px 0 0;
  max-width: 68ch;
  border-left: 4px solid var(--gold);
  padding: 10px 0 10px 16px;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.66;
  background: rgba(255, 255, 255, 0.48);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.runtime-card {
  border: 1px solid rgba(9, 43, 44, 0.2);
  border-radius: var(--radius-xl);
  background: var(--deep);
  box-shadow: var(--shadow);
  color: var(--white);
  overflow: hidden;
}

.runtime-bar {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line-dark);
  padding: 0 16px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.86rem;
  font-weight: 650;
}

.runtime-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 14px;
}

.runtime-stat {
  min-height: 100px;
  border: 1px solid var(--line-dark);
  border-radius: 20px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.runtime-stat span,
.runtime-stat small {
  display: block;
  color: rgba(255, 255, 255, 0.56);
}

.runtime-stat span {
  font-size: 0.78rem;
  font-weight: 720;
  text-transform: uppercase;
}

.runtime-stat strong {
  display: block;
  margin-top: 8px;
  color: var(--white);
  font-size: 1.1rem;
  line-height: 1.2;
}

.runtime-stat small {
  margin-top: 5px;
  font-size: 0.8rem;
}

.runtime-flow {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}

.flow-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-dark);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.flow-index {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: rgba(29, 143, 136, 0.2);
  color: #95dad3;
  font-size: 0.78rem;
  font-weight: 820;
}

.flow-row strong,
.flow-row small {
  display: block;
}

.flow-row strong {
  color: var(--white);
  font-size: 0.93rem;
  line-height: 1.3;
}

.flow-row small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.78rem;
}

.status {
  min-width: 74px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 5px 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.75rem;
  font-weight: 780;
  text-align: center;
}

.status-ok {
  border-color: rgba(91, 184, 128, 0.42);
  color: #8ed9a9;
}

.status-warn {
  border-color: rgba(184, 146, 60, 0.5);
  color: #e1c070;
}

.ledger-strip {
  border-top: 1px solid var(--line-dark);
  padding: 14px;
  background: rgba(0, 0, 0, 0.12);
}

.ledger-head,
.ledger-row {
  display: grid;
  grid-template-columns: 1fr 170px 56px;
  align-items: center;
  gap: 12px;
}

.ledger-head {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.72rem;
  font-weight: 760;
  text-transform: uppercase;
}

.ledger-row {
  min-height: 30px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.83rem;
}

.ledger-row strong {
  color: var(--white);
  font-size: 0.82rem;
  text-align: right;
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.bar-short i {
  background: var(--red);
}

.bar-net i {
  background: var(--gold);
}

.residual {
  color: var(--white);
  font-weight: 720;
}

.signal-strip {
  padding: 22px 0;
  border-bottom: none;
  background: var(--paper);
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.signal-grid > div {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(6, 43, 47, 0.08);
  border-radius: var(--radius);
  padding: 16px 22px;
  background: rgba(255, 255, 255, 0.56);
}

.signal-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(63, 156, 154, 0.24);
  border-radius: 12px;
  background: var(--teal-soft);
  color: var(--teal);
}

.signal-icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

.signal-text strong,
.signal-text span {
  display: block;
}

.signal-text strong {
  color: var(--deep);
  font-size: 0.95rem;
}

.signal-text span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.9rem;
}

section {
  padding: 82px 0;
}

.section-head {
  display: grid;
  grid-template-columns: 0.8fr 1.1fr;
  gap: 32px;
  align-items: end;
  margin-bottom: 32px;
}

.section-head .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: -12px;
}

h2 {
  margin: 0;
  max-width: 13ch;
  color: var(--deep);
  font-size: 3.2rem;
  line-height: 0.98;
  font-weight: 760;
}

.section-head p:not(.eyebrow) {
  margin: 0;
  max-width: 66ch;
  color: var(--muted);
  font-size: 1.03rem;
  line-height: 1.72;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  padding: 24px;
  box-shadow: var(--soft-shadow);
}

.feature-card {
  min-height: 286px;
}

.card-index {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(29, 143, 136, 0.24);
  border-radius: 16px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 820;
}

h3 {
  margin: 18px 0 10px;
  color: var(--deep);
  font-size: 1.16rem;
  line-height: 1.24;
  font-weight: 760;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.dark-band {
  border-top: none;
  border-bottom: none;
  background: var(--deep);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.dark-band h2,
.dark-band h3 {
  color: var(--white);
}

.dark-band .section-head p:not(.eyebrow),
.dark-band .path-step p,
.dark-band .fit-card p {
  color: rgba(255, 255, 255, 0.68);
}

.dark-band .eyebrow {
  color: #d7bd7a;
}

.dark-band code {
  border-color: rgba(149, 218, 211, 0.30);
  background: rgba(149, 218, 211, 0.13);
  color: #a9e0da;
}

.path-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.path-step {
  min-height: 270px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 20px;
  background: rgba(255, 255, 255, 0.055);
}

.path-step span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 16px;
  background: rgba(184, 146, 60, 0.2);
  color: #e1c070;
  font-size: 0.78rem;
  font-weight: 820;
}

.path-step h3 {
  margin-top: 20px;
}

.path-step p {
  margin: 0;
  font-size: 0.92rem;
}

.safety-layout {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.safety-card {
  padding: 24px;
}

.safety-card h3,
.list-card h3 {
  margin-top: 0;
}

.safety-card ul,
.list-card ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.safety-card li,
.list-card li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.safety-card li::before,
.list-card li::before {
  content: "";
  position: absolute;
  top: 0.72em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
}

.critical {
  border-color: rgba(170, 63, 69, 0.24);
  background: linear-gradient(180deg, rgba(244, 223, 224, 0.66), rgba(255, 255, 255, 0.82));
}

.critical li::before {
  background: var(--red);
}

.evidence-band {
  border-top: none;
  border-bottom: none;
  background: var(--paper);
}

.evidence-grid {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  align-items: center;
  gap: 36px;
}

.evidence-copy h2 {
  max-width: 12ch;
}

.evidence-copy p:not(.eyebrow) {
  max-width: 60ch;
  color: var(--muted);
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.proof-card {
  min-height: 168px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--soft-shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.proof-card:hover {
  transform: translateY(-2px);
  border-color: rgba(63, 156, 154, 0.28);
  box-shadow: var(--shadow);
}

.proof-card .proof-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0 0 16px;
  border: 1px solid rgba(63, 156, 154, 0.24);
  border-radius: 14px;
  background: var(--teal-soft);
  color: var(--teal);
}

.proof-card .proof-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.proof-card strong {
  display: block;
  color: var(--deep);
  font-size: 2.7rem;
  line-height: 1;
  font-weight: 850;
}

.proof-card span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
}

.boundary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.list-card {
  padding: 24px;
}

.compact-band {
  padding: 72px 0;
}

.fit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.fit-card {
  min-height: 210px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 22px;
  background: rgba(255, 255, 255, 0.055);
}

.fit-card h3 {
  margin-top: 0;
}

.fit-card p {
  margin: 0;
}

.contact-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 26px;
  border: 1px solid rgba(9, 43, 44, 0.18);
  border-radius: var(--radius-xl);
  padding: 34px;
  background: linear-gradient(135deg, var(--deep), var(--deep-2));
  color: var(--white);
  box-shadow: var(--shadow);
}

.contact-panel h2 {
  color: var(--white);
}

.contact-panel p:not(.eyebrow) {
  max-width: 68ch;
  color: rgba(255, 255, 255, 0.72);
}

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.contact-panel .btn-main {
  background: var(--gold);
  color: var(--deep);
}

.contact-panel .btn-secondary {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

footer {
  padding: 38px 0 52px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--paper);
}

.footer-grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 26px;
}

.footer-brand {
  display: grid;
  gap: 8px;
  max-width: 470px;
}

.footer-logo-img {
  display: block;
  width: 250px;
  max-width: 100%;
  height: auto;
}

.footer-brand strong {
  color: var(--deep);
}

.footer-note {
  margin: 4px 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
}

.footer-links a,
.legal-copy a {
  color: var(--deep);
  font-weight: 720;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-panel {
  display: grid;
  grid-template-columns: 0.36fr 1fr;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  background: rgba(255, 255, 255, 0.7);
}

.legal-panel h2 {
  max-width: none;
  font-size: 1.55rem;
}

.legal-copy {
  display: grid;
  gap: 14px;
}

.legal-copy p {
  margin: 0;
  color: var(--muted);
}

.legal-copy strong {
  color: var(--deep);
}

.legal-page {
  min-height: 58vh;
}

.legal-page-head {
  margin-bottom: 34px;
}

.legal-page-head h1 {
  max-width: 14ch;
  font-size: 4.4rem;
}

@media (max-width: 1100px) {
  .hero-grid,
  .section-head,
  .evidence-grid,
  .contact-panel {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 13ch;
    font-size: 4.2rem;
  }

  h2 {
    max-width: 15ch;
    font-size: 2.7rem;
  }

  .feature-grid,
  .path-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .path-step {
    min-height: 220px;
  }

  .contact-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  html {
    scroll-padding-top: 0;
  }

  .wrap {
    width: min(calc(100% - 28px), var(--max));
  }

  .topbar {
    position: static;
  }

  .nav {
    min-height: 66px;
  }

  .brand-logo-img {
    width: 188px;
  }

  .navlinks,
  .nav-cta {
    display: none;
  }

  .hero {
    padding: 52px 0 44px;
  }

  .flow-field {
    opacity: 0.3;
  }

  h1 {
    font-size: 3.1rem;
  }

  h2 {
    font-size: 2.2rem;
  }

  section {
    padding: 62px 0;
  }

  .runtime-grid,
  .signal-grid,
  .feature-grid,
  .path-grid,
  .safety-layout,
  .proof-grid,
  .boundary-grid,
  .fit-grid,
  .legal-panel {
    grid-template-columns: 1fr;
  }

  .flow-row {
    grid-template-columns: 38px 1fr;
  }

  .status {
    grid-column: 2;
    justify-self: start;
  }

  .ledger-head,
  .ledger-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .ledger-row strong {
    text-align: left;
  }

  .footer-grid {
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flow-field {
    opacity: 0.58;
  }

  .netting-diagram .flow-dot {
    display: none;
  }
}

/* Mechanism netting diagram (v3) */
.mechanism-figure {
  margin: 0 0 18px;
  padding: 26px 26px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--soft-shadow);
}

.figure-head {
  margin-bottom: 18px;
}

.figure-head .eyebrow {
  margin: 0 0 8px;
}

.figure-head h3 {
  margin: 0;
  max-width: none;
  font-size: 1.5rem;
  line-height: 1.15;
}

.diagram-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.netting-diagram {
  display: block;
  width: 100%;
  min-width: 640px;
  height: auto;
}

.mechanism-figure figcaption {
  margin-top: 16px;
  max-width: 88ch;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Runtime orchestration-loop diagram (v3) */
.runtime-figure {
  margin: 0 0 22px;
  padding: 26px 26px 22px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.04);
}

.runtime-loop {
  display: block;
  width: 100%;
  min-width: 680px;
  height: auto;
}

.runtime-figure figcaption {
  margin-top: 16px;
  max-width: 92ch;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
  .runtime-loop .rt-pulse {
    display: none;
  }
}

/* Hero runtime card — live motion (v3) */
.runtime-bar .rb-title {
  display: inline-flex;
  align-items: center;
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 9px;
  border-radius: 50%;
  background: #6fdcc6;
  animation: live-pulse 2.4s ease-out infinite;
}

@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(111, 220, 198, 0.5); }
  70% { box-shadow: 0 0 0 7px rgba(111, 220, 198, 0); }
  100% { box-shadow: 0 0 0 0 rgba(111, 220, 198, 0); }
}

/* pipeline sweep: each stage lights briefly, in sequence */
.runtime-flow .flow-row {
  animation: row-scan 6s ease-in-out infinite;
}
.runtime-flow .flow-row:nth-child(1) { animation-delay: 0s; }
.runtime-flow .flow-row:nth-child(2) { animation-delay: 1.5s; }
.runtime-flow .flow-row:nth-child(3) { animation-delay: 3s; }
.runtime-flow .flow-row:nth-child(4) { animation-delay: 4.5s; }

@keyframes row-scan {
  0%, 13%, 100% {
    background: rgba(255, 255, 255, 0.045);
    border-color: var(--line-dark);
  }
  4% {
    background: rgba(111, 220, 198, 0.08);
    border-color: rgba(111, 220, 198, 0.3);
  }
}

.runtime-flow .flow-row .status {
  animation: pill-tick 6s ease-in-out infinite;
}
.runtime-flow .flow-row:nth-child(1) .status { animation-delay: 0s; }
.runtime-flow .flow-row:nth-child(2) .status { animation-delay: 1.5s; }
.runtime-flow .flow-row:nth-child(3) .status { animation-delay: 3s; }
.runtime-flow .flow-row:nth-child(4) .status { animation-delay: 4.5s; }

@keyframes pill-tick {
  0%, 13%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
  4% { box-shadow: 0 0 9px 0 rgba(255, 255, 255, 0.22); }
}

/* ledger bars grow in on load */
.ledger-strip .bar i {
  transform-origin: left center;
  animation: bar-grow 1.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ledger-strip .ledger-row:nth-child(2) .bar i { animation-delay: 0.1s; }
.ledger-strip .ledger-row:nth-child(3) .bar i { animation-delay: 0.25s; }
.ledger-strip .ledger-row:nth-child(4) .bar i { animation-delay: 0.4s; }

@keyframes bar-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* net residual value keeps a soft live shimmer */
.ledger-row.residual strong {
  animation: net-value 3.6s ease-in-out 1.6s infinite;
}

@keyframes net-value {
  0%, 100% { color: var(--white); text-shadow: none; }
  50% { color: #ecd398; text-shadow: 0 0 10px rgba(198, 164, 90, 0.5); }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot,
  .runtime-flow .flow-row,
  .runtime-flow .flow-row .status,
  .ledger-strip .bar i,
  .ledger-row.residual strong {
    animation: none;
  }
}

/* Accessibility — visible keyboard focus (v3) */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.nav-cta:focus-visible,
.nav-toggle:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.dark-band a:focus-visible,
.contact-panel a:focus-visible,
.mobile-menu a:focus-visible {
  outline-color: #6fdcc6;
}

main:focus {
  outline: none;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--deep);
  color: var(--white);
  font-weight: 650;
  box-shadow: var(--soft-shadow);
  transition: top 160ms ease;
}

.skip-link:focus {
  top: 12px;
}

/* Mobile navigation (v3) */
.nav-toggle {
  display: none;
  width: 46px;
  height: 42px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  border: 1px solid rgba(6, 43, 47, 0.10);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--deep);
  transition: transform 220ms ease, opacity 220ms ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.mobile-menu {
  width: min(calc(100% - 28px), var(--max));
  margin: 8px auto 4px;
  padding: 8px 0 12px;
  border-top: 1px solid rgba(6, 43, 47, 0.08);
}

.mobile-menu:not([hidden]) {
  display: grid;
  gap: 4px;
}

.mobile-menu a {
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--deep);
  font-size: 1rem;
  font-weight: 620;
}

.mobile-menu a:hover {
  background: rgba(6, 43, 47, 0.05);
}

.mobile-menu a.mobile-menu-cta {
  justify-content: center;
  margin-top: 10px;
  min-height: 52px;
  color: var(--white);
  text-align: center;
}

.mobile-menu a.mobile-menu-cta:hover {
  background: var(--deep-2);
}

/* Scroll-spy active nav link (v3) */
.navlinks a.active {
  color: var(--deep);
  background: rgba(6, 43, 47, 0.07);
}

@media (max-width: 820px) {
  .nav-toggle {
    display: inline-flex;
  }
}

@media (min-width: 821px) {
  .nav-toggle,
  .mobile-menu {
    display: none !important;
  }
}

/* Horizontal-scroll affordance for wide diagrams (v3) */
.diagram-frame {
  position: relative;
}

.diagram-frame::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 64px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease;
}

.mechanism-figure .diagram-frame::after {
  background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.92));
}

.runtime-figure .diagram-frame::after {
  background: linear-gradient(to right, rgba(6, 43, 47, 0), rgba(6, 43, 47, 0.82));
}

.diagram-frame.is-scrollable:not(.at-end)::after {
  opacity: 1;
}

.scroll-cue {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: none;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 720;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.mechanism-figure .scroll-cue {
  color: var(--teal);
  background: rgba(63, 156, 154, 0.14);
  border: 1px solid rgba(63, 156, 154, 0.30);
}

.runtime-figure .scroll-cue {
  color: #95dad3;
  background: rgba(149, 218, 211, 0.12);
  border: 1px solid rgba(149, 218, 211, 0.32);
}

.diagram-frame.is-scrollable:not(.at-end) .scroll-cue {
  display: inline-flex;
}
