/* Covern Bastion — brand tokens taken from the logo: navy #0F1E3C, gold #C8A24D.
   The theme is set as data-theme="light" | "dark" on <html> by the inline script in <head>. */
:root {
  --navy: #0F1E3C;
  --navy-2: #172a50;
  --navy-deep: #0A1428;
  --gold: #C8A24D;
  --gold-hover: #d6b25e;
  --gold-soft: rgba(200, 162, 77, 0.14);
  --white: #ffffff;

  /* Light theme */
  --bg: #FAF8F3;
  --bg-alt: #F1ECE1;
  --surface: #ffffff;
  --surface-2: #F6F2EA;
  --text: #18223a;
  --heading: #0F1E3C;
  --muted: #55607a;
  --line: #e2dccd;
  --line-strong: #cfc6b1;
  --accent-text: #9c7a2c;  /* gold dark enough for text on light backgrounds */
  --header-bg: rgba(250, 248, 243, 0.9);
  --btn-bg: #0F1E3C;
  --btn-fg: #ffffff;
  --btn-hover: #172a50;
  --band-bg: #0F1E3C;
  --band-card: #172a50;
  --band-line: rgba(255, 255, 255, 0.12);
  --band-text: #b9c2d6;
  --footer-bg: #0b1730;
  --shadow: 0 1px 2px rgba(15, 30, 60, .04), 0 18px 40px -18px rgba(15, 30, 60, .18);
  --shadow-lg: 0 2px 4px rgba(15, 30, 60, .05), 0 40px 80px -30px rgba(15, 30, 60, .35);
  --glow: rgba(200, 162, 77, 0.14);

  /* The product mock-ups are always dark, like the product interface. */
  --app-bg: #0B1322;
  --app-side: #0E1830;
  --app-panel: #121E36;
  --app-line: #22314e;
  --app-text: #d5dcea;
  --app-muted: #8390aa;
  --ok: #3FB68B;
  --warn: #E0B04A;
  --info: #6EA8FE;
  --risk: #E0716C;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --radius: 14px;
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0A1324;
  --bg-alt: #0E192F;
  --surface: #12203B;
  --surface-2: #0F1B33;
  --text: #d9dfea;
  --heading: #F4EFE3;
  --muted: #9aa6bf;
  --line: #22314e;
  --line-strong: #2e4066;
  --accent-text: #C8A24D;
  --header-bg: rgba(10, 19, 36, 0.86);
  --btn-bg: #C8A24D;
  --btn-fg: #0F1E3C;
  --btn-hover: #d6b25e;
  --band-bg: #10203F;
  --band-card: #17294C;
  --band-line: rgba(255, 255, 255, 0.10);
  --band-text: #b4bed3;
  --footer-bg: #060D1A;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .6);
  --shadow-lg: 0 40px 80px -30px rgba(0, 0, 0, .75);
  --glow: rgba(200, 162, 77, 0.10);

  color-scheme: dark;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }
/* Pages with a sticky section bar need room for it too. */
html:has(.subnav) { scroll-padding-top: 150px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

/* Logo swap: each themed logo appears only in its own theme. */
.logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  color: var(--heading);
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 5.2vw, 4rem); letter-spacing: -0.015em; }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.75rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--btn-bg); color: var(--btn-fg); padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px;
  font-weight: 600; font-size: 0.98rem; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; font-family: inherit;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-small { padding: 9px 18px; font-size: 0.92rem; }
.btn-primary { background: var(--btn-bg); color: var(--btn-fg); }
.btn-primary:hover { background: var(--btn-hover); }
.btn-ghost { border-color: var(--heading); color: var(--heading); }
.btn-ghost:hover { background: var(--heading); color: var(--bg); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-hover); }
.btn-outline-light { border-color: rgba(255, 255, 255, .35); color: var(--white); }
.btn-outline-light:hover { border-color: var(--gold); color: var(--gold); }
.btn .arrow { transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.text-link { color: var(--accent-text); font-weight: 600; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }

.eyebrow {
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-text); margin-bottom: 14px;
}
.eyebrow-gold { color: var(--gold); }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 8px; border-radius: 999px;
  font-size: 0.85rem; font-weight: 500;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); color: #dfe5f0;
}
.pill-dot {
  display: inline-grid; place-items: center; padding: 2px 8px; border-radius: 999px;
  background: var(--gold); color: var(--navy); font-size: 0.72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.header-actions { display: flex; align-items: center; gap: 18px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; color: var(--heading); letter-spacing: 0.01em; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-tagline {
  margin-top: 4px; font-size: 0.6rem; font-weight: 600; letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--accent-text); white-space: nowrap;
}

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a:not(.btn) { text-decoration: none; font-weight: 500; font-size: 0.95rem; color: var(--text); position: relative; white-space: nowrap; }
.site-nav a:not(.btn):hover { color: var(--accent-text); }
.site-nav a[aria-current="page"] { color: var(--accent-text); }
.site-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; background: var(--gold); border-radius: 2px;
}

.theme-toggle {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--heading); cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.theme-toggle:hover { border-color: var(--accent-text); color: var(--accent-text); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.nav-toggle {
  display: none; width: 44px; height: 44px; border: 0; background: none; cursor: pointer;
  position: relative; border-radius: 8px;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  position: absolute; left: 11px; width: 22px; height: 2px; background: var(--heading);
  border-radius: 2px; content: ""; transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before { left: 0; top: -7px; }
.nav-toggle-bar::after { left: 0; top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1120px) {
  .header-actions { gap: 6px; }
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .site-nav a[aria-current="page"]::after { display: none; }
  .site-nav .btn { margin-top: 16px; }
}

/* ---------- Stage: the dark hero used at the top of every page ---------- */
.stage {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--navy-deep); color: #c9d2e3;
  padding: clamp(64px, 9vw, 120px) 0 clamp(64px, 8vw, 104px);
}
.stage::before {
  /* Faint blueprint grid, faded towards the edges. */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 40%, transparent 100%);
}
.stage::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(700px 420px at 85% 0%, rgba(200, 162, 77, .22), transparent 70%),
    radial-gradient(600px 400px at 0% 100%, rgba(80, 120, 200, .16), transparent 70%);
}
.stage h1, .stage h2, .stage h3 { color: var(--white); }
.stage .lede { color: #b9c2d6; }
.stage .eyebrow { color: var(--gold); }
.stage-compact { padding: clamp(56px, 8vw, 96px) 0 clamp(48px, 7vw, 80px); }

.hero-grid {
  display: grid; grid-template-columns: 0.95fr 1.05fr; gap: clamp(40px, 5vw, 72px); align-items: center;
}
.hero-copy .pill { margin-bottom: 26px; }
.hero-copy h1 { font-size: clamp(2.3rem, 3.7vw, 3.15rem); }
.hero-solo { max-width: 860px; text-align: center; }
.hero-solo h1 { font-size: clamp(2.4rem, 4.6vw, 3.7rem); }
.hero-solo .lede { margin-left: auto; margin-right: auto; }
.hero-solo .hero-actions { justify-content: center; }
.hero-solo .covern-logo { height: 84px; margin: 0 auto; }
.lede { font-size: 1.15rem; color: var(--muted); margin-top: 22px; max-width: 36em; }
.lede strong { color: var(--white); font-weight: 600; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-facts {
  display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 36px 0 0; padding: 0; list-style: none;
  font-size: 0.92rem; color: #aeb8cc;
}
.hero-facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero-facts svg { width: 16px; height: 16px; stroke: var(--gold); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

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

/* ---------- App window mock-up ---------- */
.app {
  position: relative;
  background: var(--app-bg); color: var(--app-text);
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px;
  box-shadow: 0 50px 100px -30px rgba(0, 0, 0, .7), 0 0 0 1px rgba(200, 162, 77, .08);
  overflow: hidden; font-size: 13px; line-height: 1.45;
}
.app-bar {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  background: #0A111F; border-bottom: 1px solid var(--app-line);
}
.app-dots { display: flex; gap: 6px; }
.app-dots i { width: 10px; height: 10px; border-radius: 50%; background: #2a3550; }
.app-url {
  flex: 1; max-width: 340px; margin: 0 auto; text-align: center;
  padding: 4px 12px; border-radius: 6px; background: #111a2c; color: var(--app-muted);
  font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-body { display: grid; grid-template-columns: 150px 1fr; min-height: 380px; }
.app-side { background: var(--app-side); border-right: 1px solid var(--app-line); padding: 16px 10px; }
.app-side-brand {
  display: flex; align-items: center; gap: 8px; line-height: 1.25;
  font-size: 10px; letter-spacing: .16em; font-weight: 700; color: #e9edf5; padding: 0 8px 14px;
}

/* ---------- Covern logo: the arrow follows the hour hand (see main.js) ---------- */
.covern-logo { display: block; height: 64px; width: auto; }
.hero-wordmark { margin: 0 0 26px; }
.app-side-brand .covern-logo { height: 22px; }
.app-side a {
  display: block; padding: 6px 8px; border-radius: 6px; color: var(--app-muted); text-decoration: none; font-size: 12px;
}
.app-side a.on { background: #18284a; color: #fff; box-shadow: inset 2px 0 0 var(--gold); }
.app-main { padding: 18px 20px; min-width: 0; }
.app-crumb { font-size: 11px; color: var(--app-muted); }
.app-title { display: flex; align-items: center; gap: 10px; margin: 4px 0 2px; font-size: 18px; font-weight: 700; color: #fff; font-family: var(--sans); }
.app-sub { color: var(--app-muted); font-size: 12px; }

.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-ok { color: var(--ok); background: rgba(63, 182, 139, .12); border-color: rgba(63, 182, 139, .3); }
.tag-warn { color: var(--warn); background: rgba(224, 176, 74, .12); border-color: rgba(224, 176, 74, .3); }
.tag-info { color: var(--info); background: rgba(110, 168, 254, .12); border-color: rgba(110, 168, 254, .3); }
.tag-risk { color: var(--risk); background: rgba(224, 113, 108, .12); border-color: rgba(224, 113, 108, .3); }

/* Journey steps inside the mock-up */
.journey { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 16px 0 14px; }
.journey-step {
  padding: 8px; border-radius: 8px; background: var(--app-panel); border: 1px solid var(--app-line);
  font-size: 10.5px; color: var(--app-muted); min-width: 0;
}
.journey-step b { display: block; color: #e6ebf4; font-size: 11px; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.journey-step .bar { height: 3px; border-radius: 3px; background: #22314e; margin-top: 7px; overflow: hidden; }
.journey-step .bar i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 3px; }
.journey-step.done .bar i { width: 100%; background: var(--ok); }
.journey-step.active { border-color: rgba(200, 162, 77, .55); box-shadow: 0 0 0 1px rgba(200, 162, 77, .25); }

.app-table { width: 100%; border-collapse: collapse; }
.app-table th {
  text-align: left; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--app-muted);
  padding: 8px 10px; background: var(--app-panel); font-weight: 600;
}
.app-table td { padding: 9px 10px; border-top: 1px solid var(--app-line); vertical-align: top; }
.app-table .ref { font-family: var(--mono); font-size: 11px; color: var(--gold); white-space: nowrap; }
.app-table .txt { color: #dfe5f0; }
.app-table .conf { font-family: var(--mono); font-size: 11px; color: var(--app-muted); white-space: nowrap; }

/* Animated rows: each row fades in after the previous one. */
/* Rows start hidden only when JavaScript will play the animation. */
.js .anim-rows tr { opacity: 0; }
.js .anim-rows.play tr { animation: rowIn .5s ease both; }
.js .anim-rows.play tr:nth-child(1) { animation-delay: .3s; }
.js .anim-rows.play tr:nth-child(2) { animation-delay: .7s; }
.js .anim-rows.play tr:nth-child(3) { animation-delay: 1.1s; }
.js .anim-rows.play tr:nth-child(4) { animation-delay: 1.5s; }
.js .anim-rows.play tr:nth-child(5) { animation-delay: 1.9s; }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.js .journey.play .journey-step.active .bar i { animation: fill 2.6s ease .3s forwards; }
@keyframes fill { to { width: 72%; } }

.app-float {
  /* Sits over the window's empty top-right corner so it never covers table text. */
  position: absolute; right: -18px; top: -30px; z-index: 2;
  background: #fff; color: var(--navy); border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .5); font-size: 12.5px; width: 230px;
}
.app-float b { display: block; font-size: 13px; margin-bottom: 2px; }
.app-float .meter { height: 6px; border-radius: 6px; background: #e8e2d4; margin-top: 8px; overflow: hidden; }
.app-float .meter i { display: block; height: 100%; width: 64%; background: linear-gradient(90deg, var(--gold), #e2c27a); }

.hero-visual { position: relative; }
@media (max-width: 1020px) { .app-float { right: 12px; } }
@media (max-width: 620px) {
  .app-body { grid-template-columns: 1fr; }
  .app-side { display: none; }
  .journey { grid-template-columns: repeat(3, 1fr); }
  .journey-step:nth-child(n+4) { display: none; }
  .app-table .conf-col { display: none; }
  .app-float { position: static; width: auto; margin: 12px; }
}

/* ---------- Frameworks band ---------- */
.frameworks { border-bottom: 1px solid var(--line); background: var(--surface); padding: 56px 0 60px; }
.frameworks-inner { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(32px, 5vw, 64px); align-items: center; }
.frameworks-title { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.frameworks-copy p { margin-top: 14px; color: var(--muted); }
.frameworks-copy .text-link { margin-top: 18px; }
.framework-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; gap: 12px;
}
.framework-list li {
  font-family: var(--serif); font-weight: 600; font-size: 1.1rem; color: var(--heading);
  padding: 10px 20px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg);
}
.framework-list .framework-own { font-style: italic; font-weight: 500; color: var(--accent-text); border-style: dashed; background: transparent; }
.import-callout {
  margin-top: 22px; display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px; border-radius: 12px; background: var(--gold-soft); border: 1px solid rgba(200, 162, 77, .4);
}
.import-callout svg { flex: none; width: 24px; height: 24px; stroke: var(--accent-text); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }
.import-callout p { color: var(--text); font-size: 0.97rem; }
.import-callout strong { color: var(--heading); }

@media (max-width: 900px) { .frameworks-inner { grid-template-columns: 1fr; } }

/* ---------- Sections ---------- */
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section-tight { padding: clamp(56px, 7vw, 88px) 0; }
.section-sand { background: var(--bg-alt); }
.section-surface { background: var(--surface); }
.section-navy { background: var(--band-bg); color: #d8deea; }
.section-navy h2, .section-navy h3, .section-navy h4 { color: var(--white); }
.section-navy .eyebrow { color: var(--gold); }
.section-head { max-width: 780px; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-lede { margin-top: 18px; font-size: 1.1rem; color: var(--muted); }
.section-navy .section-lede { color: var(--band-text); }

/* ---------- Import pipeline ---------- */
.pipeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: stage; position: relative; }
.pipeline::before {
  content: ""; position: absolute; left: 4%; right: 4%; top: 31px; height: 2px;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 8px, transparent 8px 14px);
}
.pipe {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 24px; box-shadow: var(--shadow);
}
.pipe-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--navy); margin-bottom: 18px; position: relative; z-index: 1;
}
.pipe-icon svg { width: 22px; height: 22px; stroke: var(--gold); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pipe-num { position: absolute; top: 20px; right: 20px; font-family: var(--serif); font-weight: 600; color: var(--accent-text); font-size: 0.95rem; }
.pipe p { margin-top: 8px; color: var(--muted); font-size: 0.95rem; }
.pipe-detail { margin: 14px 0 0; padding: 12px 0 0; border-top: 1px dashed var(--line); list-style: none; font-size: 0.86rem; color: var(--muted); display: grid; gap: 6px; }
.pipe-detail li { display: flex; gap: 8px; }
.pipe-detail li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 8px; border-radius: 50%; background: var(--gold); }

@media (max-width: 980px) {
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .pipeline::before { display: none; }
}
@media (max-width: 560px) { .pipeline { grid-template-columns: 1fr; } }

/* Nine-step journey: a plain grid without the connecting line. */
.pipeline-grid { grid-template-columns: repeat(3, 1fr); }
.pipeline-grid::before { display: none; }
.pipeline-grid .pipe h3 { padding-right: 32px; }
@media (max-width: 980px) { .pipeline-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pipeline-grid { grid-template-columns: 1fr; } }

[data-theme="dark"] .card-icon,
[data-theme="dark"] .pipe-icon { background: #0B1630; border: 1px solid rgba(200, 162, 77, .35); }

/* Confidence routing */
.routing {
  margin-top: 28px; display: grid; grid-template-columns: auto 1fr 1fr 1fr; gap: 0; align-items: stretch;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface);
}
.routing-label { padding: 22px; background: var(--surface-2); border-right: 1px solid var(--line); max-width: 240px; }
.routing-label h4 { margin-bottom: 6px; }
.routing-label p { font-size: 0.9rem; color: var(--muted); }
.route { padding: 22px; border-right: 1px solid var(--line); }
.route:last-child { border-right: 0; }
.route .tag { font-size: 11.5px; padding: 3px 10px; }
.route p { margin-top: 10px; font-size: 0.92rem; color: var(--muted); }
.route .tag-ok { color: #1f8a63; }
.route .tag-warn { color: #a87a14; }
.route .tag-risk { color: #b8443f; }
[data-theme="dark"] .route .tag-ok { color: var(--ok); }
[data-theme="dark"] .route .tag-warn { color: var(--warn); }
[data-theme="dark"] .route .tag-risk { color: var(--risk); }

@media (max-width: 900px) {
  .routing { grid-template-columns: 1fr; }
  .routing-label { max-width: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .route { border-right: 0; border-bottom: 1px solid var(--line); }
  .route:last-child { border-bottom: 0; }
}

/* ---------- Module explorer (tabs) ---------- */
.tabs { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }
.tab-list { display: flex; flex-direction: column; gap: 6px; }
.tab {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 14px 16px; border-radius: 12px; cursor: pointer; font: inherit; font-weight: 600; font-size: 0.98rem;
  background: transparent; color: #c9d2e3; border: 1px solid transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.tab svg { flex: none; width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.tab:hover { background: rgba(255, 255, 255, .04); color: var(--white); }
.tab[aria-selected="true"] { background: var(--band-card); border-color: var(--band-line); color: var(--white); box-shadow: inset 3px 0 0 var(--gold); }
.tab[aria-selected="true"] svg { stroke: var(--gold); opacity: 1; }

.tab-panel {
  background: var(--band-card); border: 1px solid var(--band-line); border-radius: 18px;
  padding: clamp(24px, 3vw, 36px); display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 32px;
}
.tab-panel[hidden] { display: none; }
.tab-panel h3 { font-size: 1.6rem; }
.tab-panel > div > p { margin-top: 12px; color: var(--band-text); }
.check-list { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 12px; }
.check-list li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; color: #d8deea; font-size: 0.97rem; }
.check-list li::before {
  content: ""; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%;
  background: var(--gold-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C8A24D' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat;
  border: 1px solid rgba(200, 162, 77, .45);
}
.light-list li { color: var(--text); }

.mini { background: var(--app-bg); border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; padding: 16px; font-size: 12.5px; color: var(--app-text); align-self: start; }
.mini-title { display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: #fff; margin-bottom: 12px; font-size: 12.5px; }
.mini-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--app-line); }
.mini-row span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-muted { color: var(--app-muted); font-size: 11.5px; }

/* 5 × 5 risk heat map */
.heat { display: grid; grid-template-columns: 18px repeat(5, 1fr); gap: 4px; align-items: center; }
.heat span { aspect-ratio: 1.6; border-radius: 4px; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; color: rgba(0, 0, 0, .65); }
.heat .ax { aspect-ratio: auto; color: var(--app-muted); font-weight: 500; }
.h1 { background: #2f7d5b; } .h2 { background: #6aa84f; } .h3 { background: #d9b13b; } .h4 { background: #e07b39; } .h5 { background: #c9453f; }
.heat-x { display: grid; grid-template-columns: 18px repeat(5, 1fr); gap: 4px; margin-top: 4px; font-size: 10px; color: var(--app-muted); text-align: center; }

@media (max-width: 980px) {
  .tabs { grid-template-columns: 1fr; }
  .tab-list { flex-direction: row; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .tab { white-space: nowrap; width: auto; }
  .tab-panel { grid-template-columns: 1fr; }
}

/* ---------- Bento grid ---------- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px;
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.card p { color: var(--muted); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; }
.card-visual { margin-top: auto; padding-top: 18px; }
.card-link { margin-top: auto; padding-top: 6px; }
.card-icon {
  width: 44px; height: 44px; padding: 10px; border-radius: 12px; margin-bottom: 6px;
  background: var(--navy); stroke: var(--gold); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

@media (max-width: 980px) { .span-2, .span-3, .span-4 { grid-column: span 3; } }
@media (max-width: 680px) { .bento { grid-template-columns: 1fr; } .span-2, .span-3, .span-4 { grid-column: auto; } }

/* Audit trail timeline */
.trail { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; font-size: 0.88rem; }
.trail li { display: grid; grid-template-columns: 74px 14px 1fr; gap: 10px; align-items: start; padding-bottom: 12px; position: relative; }
.trail time { color: var(--muted); font-family: var(--mono); font-size: 0.78rem; padding-top: 2px; }
.trail i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--gold); margin-top: 5px; background: var(--surface); position: relative; z-index: 1; }
.trail li:not(:last-child)::after { content: ""; position: absolute; left: 89px; top: 16px; bottom: 0; width: 2px; background: var(--line); }
.trail b { color: var(--heading); font-weight: 600; }

/* Language card */
.lang { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lang div { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); font-size: 0.92rem; }
.lang small { display: block; color: var(--muted); font-size: 0.75rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.lang [dir="rtl"] { font-family: "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif; font-size: 1rem; }

/* Evidence freshness */
.fresh { display: grid; gap: 10px; font-size: 0.88rem; }
.fresh-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.fresh-bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.fresh-bar i { display: block; height: 100%; border-radius: 6px; }

/* ---------- Comparison ---------- */
.compare { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }
.compare th, .compare td { padding: 18px 22px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.compare tr:last-child td { border-bottom: 0; }
.compare thead th { background: var(--surface-2); font-size: 0.8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.compare thead th:last-child { color: var(--accent-text); }
.compare td:first-child { font-weight: 600; color: var(--heading); width: 22%; }
.compare td:nth-child(2) { color: var(--muted); }
.compare td:last-child { background: var(--gold-soft); color: var(--text); }
@media (max-width: 760px) {
  .compare, .compare tbody, .compare tr, .compare td { display: block; width: 100%; }
  .compare thead { display: none; }
  .compare tr { border-bottom: 1px solid var(--line); }
  .compare td { border-bottom: 0; padding: 12px 18px; }
  .compare td:first-child { width: auto; padding-top: 18px; }
  .compare td:nth-child(2)::before { content: "Today: "; font-weight: 600; }
  .compare td:last-child::before { content: "With Covern Bastion: "; font-weight: 600; color: var(--accent-text); }
}

/* ---------- Deployment diagram ---------- */
.deploy { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 5vw, 72px); align-items: start; }
.arch { position: relative; font-size: 0.88rem; }
.arch-boundary {
  border: 2px dashed rgba(200, 162, 77, .55); border-radius: 20px; padding: 40px 20px 20px; position: relative;
  background: rgba(200, 162, 77, .04);
}
.arch-label {
  position: absolute; top: -13px; left: 20px; background: var(--band-bg); padding: 0 10px;
  color: var(--gold); font-size: 0.75rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700;
}
.arch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.arch-box {
  background: var(--band-card); border: 1px solid var(--band-line); border-radius: 12px; padding: 14px;
  color: #e6ebf4; min-width: 0;
}
.arch-box b { display: block; color: #fff; margin-bottom: 4px; font-size: 0.92rem; }
.arch-box span { color: var(--band-text); font-size: 0.8rem; line-height: 1.4; display: block; }
.arch-box.core { grid-column: 1 / -1; border-color: rgba(200, 162, 77, .5); background: linear-gradient(180deg, rgba(200, 162, 77, .14), rgba(200, 162, 77, .04)); }
.arch-sources { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.arch-sources .arch-box { background: transparent; border-style: dashed; }
.arch-link { text-align: center; color: var(--band-text); font-size: 0.78rem; letter-spacing: .08em; text-transform: uppercase; margin: 14px 0 10px; }
.arch-box.arch-ai { border: 1px dashed rgba(143, 166, 255, .6); background: rgba(143, 166, 255, .08); text-align: center; }
.arch-arrow { text-align: center; color: var(--gold); font-size: 0.78rem; letter-spacing: .1em; text-transform: uppercase; margin-top: 12px; }
@media (max-width: 900px) { .deploy { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .arch-grid, .arch-sources { grid-template-columns: 1fr 1fr; } }

/* ---------- Audience ---------- */
.audience-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.audience { padding: 30px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.audience p { color: var(--muted); }
.audience .bundle { margin-top: auto; padding-top: 16px; border-top: 1px dashed var(--line); font-size: 0.86rem; color: var(--muted); }
.audience .bundle b { color: var(--heading); }
@media (max-width: 900px) { .audience-grid { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq { max-width: 860px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 0 22px; }
.faq summary {
  cursor: pointer; list-style: none; padding: 20px 32px 20px 0; position: relative;
  font-family: var(--serif); font-weight: 600; font-size: 1.12rem; color: var(--heading);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 2px; top: 50%; width: 10px; height: 10px; margin-top: -7px;
  border-right: 2px solid var(--accent-text); border-bottom: 2px solid var(--accent-text); transform: rotate(45deg);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { padding: 0 0 20px; color: var(--muted); }

/* ---------- Detail rows (platform page) ---------- */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 5vw, 72px); align-items: center; padding: clamp(48px, 6vw, 80px) 0; border-top: 1px solid var(--line); }
.detail:first-of-type { border-top: 0; padding-top: 0; }
.detail.flip > :first-child { order: 2; }
.detail h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.detail .lede { color: var(--muted); }
.detail .mini { box-shadow: var(--shadow-lg); }
/* Long module lists: keep the illustration in view instead of centring it beside the list. */
.detail { align-items: start; }
.detail > .mini, .detail > .observation { position: sticky; top: 140px; }
@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; }
  .detail > .mini, .detail > .observation { position: static; }
  .detail.flip > :first-child { order: 0; }
}

.subnav {
  position: sticky; top: 72px; z-index: 40; background: var(--header-bg); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.subnav-inner { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; scrollbar-width: none; }
.subnav-inner::-webkit-scrollbar { display: none; }
.subnav a {
  white-space: nowrap; text-decoration: none; font-size: 0.9rem; font-weight: 500; color: var(--muted);
  padding: 7px 14px; border-radius: 999px; border: 1px solid transparent;
}
.subnav a[aria-current] { color: var(--accent-text); background: var(--gold-soft); border-color: rgba(200, 162, 77, .55); }
/* Hover only where there is a mouse, so a tap on a phone does not leave a stuck highlight. */
@media (hover: hover) { .subnav a:not([aria-current]):hover { color: var(--heading); border-color: var(--line); } }

/* ---------- About & contact ---------- */
.about { display: grid; grid-template-columns: 220px 1fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.about-mark {
  display: grid; place-items: center; aspect-ratio: 1;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
}
.about-mark img { width: 58%; height: auto; }
.about-copy p:not(.eyebrow) { margin-top: 18px; color: var(--muted); max-width: 42em; }

/* ---------- Platform Modules: outcome visual ---------- */
.outcome { background: var(--app-bg); border: 1px solid rgba(255, 255, 255, .08); border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.outcome-icon { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: rgba(200, 162, 77, .14); margin-bottom: 8px; }
.outcome-icon svg { width: 28px; height: 28px; stroke: var(--gold); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.outcome-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .04); color: var(--app-text); font-size: 0.95rem; }
.outcome-row::before {
  content: ""; flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--gold-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C8A24D' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12l4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat;
  border: 1px solid rgba(200, 162, 77, .45);
}
.js .outcome.anim-target .outcome-row { opacity: .2; transform: translateX(-8px); transition: opacity .45s ease, transform .45s ease; transition-delay: calc(var(--i) * .3s + .2s); }
.js .outcome.play .outcome-row { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .outcome.anim-target .outcome-row { opacity: 1; transform: none; transition: none; }
}

/* ---------- Home: USPs ---------- */
.usp-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.usp { display: flex; flex-direction: column; gap: 14px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.usp .card-icon { margin: 0; }
.usp p { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 1.12rem; line-height: 1.35; color: var(--heading); }
@media (max-width: 980px) { .usp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) {
  .usp-grid { grid-template-columns: 1fr; gap: 10px; }
  .usp { flex-direction: row; align-items: center; padding: 14px 16px; }
  .usp p { font-size: 1rem; }
}

/* ---------- Home: ownership track ---------- */
.track { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; position: relative; }
.track::before { content: ""; position: absolute; top: 28px; left: 10%; right: 10%; height: 2px; background: var(--band-line); }
.track-step { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.track-dot { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--band-card); border: 1px solid var(--band-line); }
.track-dot svg { width: 24px; height: 24px; stroke: var(--gold); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.track-text b { display: block; color: var(--white); font-family: var(--serif); font-size: 1.15rem; }
.track-text span { display: block; margin-top: 4px; color: var(--band-text); font-size: 0.92rem; }
.js .track.anim-target .track-step { opacity: .25; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; transition-delay: calc(var(--i) * .35s); }
.js .track.play .track-step { opacity: 1; transform: none; }
.js .track.play .track-dot { border-color: rgba(200, 162, 77, .6); background: rgba(200, 162, 77, .14); transition: background .5s ease, border-color .5s ease; transition-delay: calc(var(--i) * .35s); }
@media (max-width: 760px) {
  .track { grid-template-columns: 1fr; gap: 22px; }
  .track::before { top: 0; bottom: 0; left: 27px; right: auto; width: 2px; height: auto; }
  .track-step { flex-direction: row; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .js .track.anim-target .track-step { opacity: 1; transform: none; transition: none; }
}

/* ---------- Company page ---------- */
.contrast { display: grid; grid-template-columns: 1fr auto 1.3fr; gap: 20px; align-items: stretch; }
.contrast-then { opacity: .72; }
.contrast-now { border-color: rgba(200, 162, 77, .55); box-shadow: var(--shadow); }
.contrast-arrow { align-self: center; font-size: 2rem; color: var(--accent-text); }
.contrast .check-list { margin-top: 6px; }
.pull-quote { font-family: var(--serif); font-size: clamp(1.6rem, 3.2vw, 2.5rem); line-height: 1.3; color: var(--white); max-width: 30em; margin: 16px 0 0; }
@media (max-width: 760px) {
  .contrast { grid-template-columns: 1fr; }
  .contrast-arrow { justify-self: center; transform: rotate(90deg); }
}
@media (max-width: 720px) {
  .about { grid-template-columns: 1fr; }
  .about-mark { width: 150px; }
}

.cta {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--navy-deep); color: #c9d2e3; padding: clamp(72px, 9vw, 112px) 0;
}
.cta::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(700px 360px at 50% 120%, rgba(200, 162, 77, .28), transparent 70%);
}
.cta h2 { color: var(--white); }
.cta-inner { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.cta p { margin-top: 16px; color: #b9c2d6; font-size: 1.08rem; }
.contact-card {
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .12); border-radius: 20px;
  padding: 32px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start;
}
.contact-label { font-size: 0.82rem; letter-spacing: 0.12em; text-transform: uppercase; color: #9aa6bf; font-weight: 600; }
.contact-email { font-family: var(--serif); font-size: clamp(1.15rem, 2.4vw, 1.45rem); color: var(--white); text-decoration: none; word-break: break-all; }
.contact-email:hover { color: var(--gold); }
.contact-card .btn { margin-top: 10px; }
.contact-points { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; color: #c9d2e3; }
.contact-points li { display: flex; gap: 10px; }
.contact-points li::before { content: "→"; color: var(--gold); }
@media (max-width: 820px) { .cta-inner { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: #9aa6bf; padding: 56px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { font-family: var(--sans); color: var(--white); font-size: 0.82rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-grid a { text-decoration: none; font-size: 0.94rem; }
.footer-grid a:hover { color: var(--gold); }
.footer-about p { margin-top: 16px; font-size: 0.92rem; max-width: 30em; }
.brand-footer .brand-name { color: var(--white); font-size: 1.1rem; }
.brand-footer .brand-tagline { color: var(--gold); font-size: 0.55rem; }
.footer-legal { margin-top: 40px; font-size: 0.88rem; border-top: 1px solid var(--band-line); padding-top: 20px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .anim-rows.play tr, .js .journey.play .journey-step.active .bar i { animation: none; }
  .js .anim-rows tr { opacity: 1; }
  .journey-step.active .bar i { width: 72%; }
}

/* 404 */
.notfound { min-height: calc(100vh - 72px - 140px); display: grid; place-items: center; text-align: center; padding: 80px 0; }
.notfound img { margin: 0 auto 28px; }
.notfound p { color: var(--muted); margin: 14px 0 28px; }

/* ---------- Automation labels ----------
   Three kinds of automation are labelled consistently across the site:
   automatic (no person involved), AI-assisted (a person decides) and
   confidence-routed (approved automatically above a threshold). */
:root { --auto: #C8A24D; --ai: #8FA6FF; --route: #3FB68B; --auto-text: #8a6a1f; --ai-text: #3f5bd1; --route-text: #1f8a63; }
:root[data-theme="dark"] { --auto-text: #C8A24D; --ai-text: #a9bbff; --route-text: #4fcf9f; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 600; letter-spacing: .02em; white-space: nowrap; border: 1px solid;
}
.chip svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chip-auto { color: var(--auto-text); border-color: rgba(200, 162, 77, .5); background: rgba(200, 162, 77, .1); }
.chip-ai { color: var(--ai-text); border-color: rgba(143, 166, 255, .5); background: rgba(143, 166, 255, .1); }
.chip-route { color: var(--route-text); border-color: rgba(63, 182, 139, .45); background: rgba(63, 182, 139, .1); }
.chip-soon { color: var(--navy); background: var(--gold); border-color: var(--gold); }
/* On the always-dark bands the chips use their bright variants. */
.section-navy .chip-auto, .stage .chip-auto, .tab-panel .chip-auto { color: var(--auto); }
.section-navy .chip-ai, .stage .chip-ai, .tab-panel .chip-ai { color: #a9bbff; }
.section-navy .chip-route, .stage .chip-route, .tab-panel .chip-route { color: #4fcf9f; }

.auto-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* Grouped automation lists inside module panels and detail rows */
.auto-groups { display: grid; gap: 18px; margin-top: 22px; }
.auto-group ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.auto-group li { position: relative; padding-left: 18px; font-size: 0.96rem; }
.auto-group li::before { content: ""; position: absolute; left: 2px; top: 10px; width: 7px; height: 7px; border-radius: 50%; }
.auto-group.g-auto li::before { background: var(--auto); }
.auto-group.g-ai li::before { background: var(--ai); }
.auto-group.g-route li::before { background: var(--route); }
.tab-panel .auto-group li { color: #d8deea; }
.detail .auto-group li { color: var(--text); }

/* Automation matrix */
.matrix-wrap { overflow-x: auto; border: 1px solid var(--band-line); border-radius: 18px; }
.matrix { width: 100%; min-width: 860px; border-collapse: collapse; font-size: 0.92rem; }
.matrix th, .matrix td { padding: 16px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--band-line); }
.matrix thead th { background: rgba(255, 255, 255, .04); font-size: 0.78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--band-text); font-weight: 600; }
.matrix thead th .chip { margin-top: 8px; letter-spacing: .02em; text-transform: none; }
.matrix tbody th { color: var(--white); font-family: var(--serif); font-weight: 600; font-size: 1.02rem; width: 17%; }
.matrix td { color: #cfd7e6; }
.matrix tr:last-child th, .matrix tr:last-child td { border-bottom: 0; }
.matrix .none { color: #64708a; }

/* Coming soon */
.soon-card {
  position: relative; border: 1px dashed rgba(200, 162, 77, .6); border-radius: 18px; padding: clamp(24px, 3vw, 36px);
  background: linear-gradient(180deg, rgba(200, 162, 77, .08), transparent);
}
.soon-card .chip-soon { position: absolute; top: -12px; left: 24px; }
.tab .chip-soon { margin-left: auto; font-size: 0.66rem; padding: 2px 8px; }

/* Observation card (sample AI output) */
.observation { background: var(--app-bg); border: 1px solid rgba(255, 255, 255, .08); border-radius: 12px; padding: 16px; font-size: 12.5px; color: var(--app-text); }
.observation h5 { margin: 0 0 6px; font: 600 12.5px/1.4 var(--sans); color: #fff; display: flex; justify-content: space-between; gap: 10px; }
.observation p { color: var(--app-muted); margin: 0 0 10px; font-size: 12px; line-height: 1.5; }
.observation .rec { border-top: 1px solid var(--app-line); padding-top: 10px; color: #dfe5f0; font-size: 12px; }
.observation .rec b { color: var(--gold); font-weight: 600; }
