/* MIRASTACK LABS corporate site. All tokens on :root; dark follows the system unless the toggle says otherwise. */

:root {
  --bg: #ffffff;
  --bg-band: #f6f5f1;
  --surface: #ffffff;
  --ink: #0a0a0a;
  --text: #1c1c1c;
  --muted: #5e5e5e;
  --line: #e4e2dc;
  --accent: #00695f;
  --signal: #ff671f;
  --logo-teal: #007a6e;
  --btn-bg: #0a0a0a;
  --btn-text: #ffffff;
  --sheet-bg: #ffffff;

  --display: Oswald, "Arial Narrow", Arial, sans-serif;
  --sans: Oswald, "Arial Narrow", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: 24px;
  --section-pad: 128px;
  --header-h: 72px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a;
    --bg-band: #000000;
    --surface: #191919;
    --ink: #ffffff;
    --text: #e6e6e6;
    --muted: #8f8f8f;
    --line: #272727;
    --accent: #2bd4bf;
    --logo-teal: #00c9b1;
    --btn-bg: #ffffff;
    --btn-text: #0a0a0a;
    --sheet-bg: #0a0a0a;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --bg-band: #000000;
  --surface: #191919;
  --ink: #ffffff;
  --text: #e6e6e6;
  --muted: #8f8f8f;
  --line: #272727;
  --accent: #2bd4bf;
  --logo-teal: #00c9b1;
  --btn-bg: #ffffff;
  --btn-text: #0a0a0a;
  --sheet-bg: #0a0a0a;
  color-scheme: dark;
}

@media (max-width: 1023px) { :root { --section-pad: 80px; } }
@media (max-width: 639px) { :root { --section-pad: 64px; --header-h: 64px; } }
@media (max-width: 399px) { :root { --gutter: 16px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.125rem;
  font-weight: 400;
  letter-spacing: .005em;
  line-height: 1.6;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0; padding: 0; }
h1, h2, h3 { font-family: var(--display); color: var(--ink); font-weight: 600; margin: 0 0 .5em; letter-spacing: -.01em; }
h1, h2 { text-transform: uppercase; }
h1 { font-size: clamp(2.75rem, 6.2vw, 5.5rem); line-height: 1; letter-spacing: -.01em; }
h2 { font-size: clamp(2rem, 3.8vw, 3.25rem); line-height: 1.05; }
h3 { font-size: 1.375rem; line-height: 1.3; font-weight: 500; letter-spacing: .005em; }
strong { color: var(--ink); font-weight: 600; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { overflow-wrap: break-word; }

.skip { position: absolute; left: 16px; top: -100px; z-index: 100; background: var(--btn-bg); color: var(--btn-text); padding: 12px 16px; border-radius: 4px; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-height: 44px; flex: none; }
.logo svg { width: 32px; height: 26px; flex: none; }
.logo .b1 { fill: var(--logo-teal); }
.logo .b2 { fill: #ff671f; }
.logo .b3 { fill: #ced4da; }
.wordmark { font-family: var(--mono); font-size: 1rem; line-height: 1; white-space: nowrap; }
.wordmark b { font-weight: 700; letter-spacing: .08em; color: var(--ink); }
.wordmark span { font-weight: 400; color: var(--muted); margin-left: .5ch; letter-spacing: .08em; }

.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; display: flex; align-items: center; gap: 4px; }
.site-nav a.nav-link { display: inline-flex; white-space: nowrap; align-items: center; min-height: 44px; padding: 0 12px; color: var(--text); text-decoration: none; font-size: .875rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; border-bottom: 2px solid transparent; }
.site-nav a.nav-link:hover { color: var(--ink); }
.site-nav a.nav-link[aria-current="page"] { color: var(--ink); border-bottom-color: var(--signal); }
.site-nav li.nav-cta { margin-left: 12px; }

.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: none; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); cursor: pointer; flex: none; font: inherit; }
.icon-btn:hover { border-color: var(--muted); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.menu-btn { display: none; }
.theme-btn .i-moon { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: block; }
}
.menu-btn .i-close { display: none; }
.menu-btn[aria-expanded="true"] .i-open { display: none; }
.menu-btn[aria-expanded="true"] .i-close { display: block; }

@media (max-width: 1219px) {
  .site-header .wrap { gap: 8px; }
  .theme-btn { margin-left: auto; }
  .menu-btn { display: inline-flex; }
  .site-nav { margin: 0; }
  .js .site-nav { display: none; }
  .js .site-nav.open { display: block; position: fixed; inset: var(--header-h) 0 0 0; background: var(--sheet-bg); overflow-y: auto; padding: 24px var(--gutter) 48px; z-index: 40; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav a.nav-link { min-height: 56px; padding: 0; font-family: var(--display); font-size: 1.5rem; font-weight: 500; text-transform: uppercase; letter-spacing: .02em; border-bottom: 1px solid var(--line); width: 100%; }
  .site-nav a.nav-link[aria-current="page"] { border-bottom-color: var(--line); box-shadow: inset 3px 0 0 var(--signal); padding-left: 14px; }
  .site-nav li.nav-cta { margin: 24px 0 0; }
  .site-nav li.nav-cta .btn { width: 100%; }
  /* no-JS fallback: nav drops below the bar */
  html:not(.js) .site-header .wrap { flex-wrap: wrap; padding-bottom: 8px; }
  html:not(.js) .site-nav { flex-basis: 100%; }
  html:not(.js) .site-nav ul { flex-direction: row; flex-wrap: wrap; gap: 0 8px; }
  html:not(.js) .site-nav a.nav-link { width: auto; font: 500 .875rem var(--sans); border: 0; padding: 0 8px; }
  html:not(.js) .theme-btn { display: none; }
}
html.menu-open { overflow: hidden; }

/* Buttons and links */
.btn { display: inline-flex; white-space: nowrap; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; border-radius: 4px; border: 1px solid var(--btn-bg); background: var(--btn-bg); color: var(--btn-text); font: 600 .875rem var(--sans); text-transform: uppercase; letter-spacing: .08em; text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { opacity: .9; text-decoration: none; }
.btn-sm { padding: 0 16px; }
.link-arrow { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: none; }
.link-arrow::after { content: "\2192"; margin-left: .45em; transition: transform .15s ease; }
.link-arrow.ext::after { content: "\2197"; }
.link-arrow:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.link-arrow:hover::after { transform: translateX(3px); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; margin-top: 32px; }

/* Typography helpers */
.eyebrow { font-family: var(--display); font-weight: 500; font-size: .8125rem; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin: 0 0 20px; line-height: 1.5; }
.lede { font-size: clamp(1.125rem, 1.6vw, 1.3125rem); line-height: 1.6; color: var(--text); max-width: 46rem; }
.measure { max-width: 46rem; }
.muted { color: var(--muted); }
.small { font-size: .9375rem; }

/* Sections */
.hero { padding: clamp(64px, 10vw, 152px) 0 clamp(56px, 8vw, 112px); }
.hero h1 { max-width: 18ch; }
.hero.wide h1 { max-width: 22ch; }
.section { padding: var(--section-pad) 0; border-top: 1px solid var(--line); }
.section.band { background: var(--bg-band); }
.section-head { margin-bottom: 56px; max-width: 46rem; }
.section-head h2 { margin-bottom: .3em; }
@media (max-width: 639px) { .section-head { margin-bottom: 36px; } }

/* Spectrum strip */
.spectrum { padding: 40px 0 56px; border-top: 1px solid var(--line); }
.spectrum-ends { display: flex; justify-content: space-between; font-family: var(--display); font-size: .75rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 16px; }
.spectrum-ends span:first-child::before { content: "\2190  "; }
.spectrum-ends span:last-child::after { content: "  \2192"; }
.spectrum ol { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--signal); }
.spectrum li { padding: 20px 16px 0 0; }
.spectrum li a { color: var(--ink); text-decoration: none; display: block; }
.spectrum li a:hover .sp-name { text-decoration: underline; }
.sp-name { display: block; font-family: var(--display); font-weight: 600; font-size: .9375rem; }
.sp-for { display: block; font-size: .875rem; color: var(--muted); margin-top: 4px; line-height: 1.45; }
@media (max-width: 767px) {
  .spectrum .wrap { display: flex; flex-direction: column; } .spectrum-ends { display: contents; } .spectrum-ends span:first-child { margin-bottom: 12px; } .spectrum-ends span:last-child { order: 2; margin-top: 12px; } .spectrum ol { order: 1; }
  .spectrum-ends span:first-child::before, .spectrum-ends span:last-child::after { content: none; }
  .spectrum ol { grid-template-columns: 1fr; border-top: 0; border-left: 2px solid var(--signal); }
  .spectrum li { padding: 12px 0 12px 20px; }
}

/* Cards */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; list-style: none; }
.cards.three { grid-template-columns: repeat(3, 1fr); }
.cards.two { grid-template-columns: repeat(2, 1fr); }
.card { border: 1px solid var(--line); border-radius: 2px; background: var(--surface); padding: 28px; display: flex; flex-direction: column; min-width: 0; }
.card h3 { margin-bottom: .4em; }
.card .tag { font-family: var(--display); font-size: .75rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0 0 14px; }
.card p { font-size: 1rem; color: var(--text); }
.card .link-arrow { margin-top: auto; align-self: flex-start; }
.card p:last-of-type { margin-bottom: 20px; }
.card.plain p:last-child { margin-bottom: 0; }
@media (max-width: 1099px) { .cards, .cards.three { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 639px) { .cards, .cards.three, .cards.two { grid-template-columns: 1fr; gap: 16px; } .card { padding: 24px 20px; } }

/* Lists */
.rule-list { list-style: none; border-top: 1px solid var(--line); }
.rule-list li { padding: 18px 0; border-bottom: 1px solid var(--line); }
.rule-list li strong { display: block; font-family: var(--display); font-size: 1.25rem; font-weight: 600; margin-bottom: 2px; }
.rule-list.cols { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 48px; }
@media (max-width: 767px) { .rule-list.cols { grid-template-columns: 1fr; } }
.plain-list { list-style: none; }
.plain-list li { padding: 8px 0 8px 22px; position: relative; }
.plain-list li::before { content: ""; position: absolute; left: 0; top: 1.05em; width: 10px; height: 2px; background: var(--accent); }

.three-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 48px; list-style: none; }
.three-points li { border-top: 2px solid var(--signal); padding-top: 18px; }
.three-points strong { display: block; font-family: var(--display); font-size: 1.375rem; font-weight: 600; margin-bottom: 6px; }
@media (max-width: 767px) { .three-points { grid-template-columns: 1fr; gap: 28px; margin-top: 36px; } }

.split { display: grid; grid-template-columns: 5fr 7fr; gap: 64px; align-items: start; }
@media (max-width: 899px) { .split { grid-template-columns: 1fr; gap: 28px; } }

/* Numbered steps */
.steps { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 32px 40px; }
.steps li { counter-increment: s; border-top: 1px solid var(--line); padding-top: 16px; }
.steps li::before { content: counter(s, decimal-leading-zero); display: block; font-family: var(--display); font-size: .8125rem; letter-spacing: .1em; color: var(--accent); margin-bottom: 8px; }
.steps strong { display: block; font-family: var(--display); font-size: 1.25rem; font-weight: 600; margin-bottom: 4px; }

/* Day 0/1/2 timeline */
.timeline { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; position: relative; }
.timeline li { padding: 36px 32px 0 0; position: relative; border-top: 2px solid var(--line); }
.timeline li::before { content: ""; position: absolute; top: -7px; left: 0; width: 12px; height: 12px; background: var(--signal); border-radius: 50%; }
.timeline .day { font-family: var(--display); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 8px; }
.timeline h3 { margin-bottom: .5em; }
@media (max-width: 899px) {
  .timeline { grid-template-columns: 1fr; border-left: 2px solid var(--line); }
  .timeline li { border-top: 0; padding: 0 0 40px 28px; }
  .timeline li:last-child { padding-bottom: 0; }
  .timeline li::before { top: 4px; left: -8px; }
}

/* Comparison table */
.table-wrap { width: 100%; }
.compare { width: 100%; border-collapse: collapse; font-size: 1rem; }
.compare th, .compare td { text-align: left; vertical-align: top; padding: 18px 20px 18px 0; border-bottom: 1px solid var(--line); }
.compare thead th { font-family: var(--display); font-size: .75rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 400; border-bottom: 2px solid var(--ink); }
.compare thead th:last-child { color: var(--accent); }
.compare tbody th { font-family: var(--display); font-weight: 600; font-size: 1.125rem; color: var(--ink); width: 22%; }
.compare td:last-child { color: var(--ink); }
@media (max-width: 767px) {
  .compare, .compare tbody, .compare tr, .compare th, .compare td { display: block; width: auto; }
  .compare thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .compare tr { padding: 20px 0; border-bottom: 1px solid var(--line); }
  .compare th, .compare td { border: 0; padding: 4px 0; }
  .compare tbody th { width: auto; padding-bottom: 8px; }
  .compare td::before { content: attr(data-label); display: block; font-family: var(--display); font-size: .6875rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin-bottom: 2px; }
  .compare td:last-child::before { color: var(--accent); }
}

/* Coverage chips and scope list */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { border: 1px solid var(--line); background: var(--surface); padding: 6px 14px; font-size: .9375rem; border-radius: 2px; }
.chips.mono li { font-family: var(--mono); font-size: .8125rem; letter-spacing: .06em; }
.status { display: inline-block; font-family: var(--display); font-size: .6875rem; letter-spacing: .14em; text-transform: uppercase; border: 1px solid var(--line); padding: 2px 8px; color: var(--muted); margin-left: 8px; vertical-align: middle; }

/* Closing band */
.closing { background: var(--bg-band); border-top: 1px solid var(--line); padding: var(--section-pad) 0; }
.closing h2 { max-width: 20ch; }
.closing .mail { font-family: var(--mono); font-size: .9375rem; }

.note { border-left: 2px solid var(--signal); padding: 4px 0 4px 20px; max-width: 46rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 72px 0 40px; font-size: .9375rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-grid h2 { font-family: var(--display); font-size: .75rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 400; margin-bottom: 12px; }
.footer-grid ul { list-style: none; }
.footer-grid li a { display: inline-flex; align-items: center; min-height: 44px; color: var(--text); text-decoration: none; }
.footer-grid li a:hover { color: var(--ink); text-decoration: underline; }
.footer-tag { color: var(--muted); max-width: 22rem; margin-top: 16px; }
.footer-legal { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8125rem; line-height: 1.6; }
.footer-legal p { max-width: 60rem; margin-bottom: .6em; }
@media (max-width: 899px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }
@media (max-width: 479px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } .site-footer { padding-top: 56px; } }

/* Contact */
.contact-list { list-style: none; border-top: 1px solid var(--line); max-width: 46rem; }
.contact-list li { display: grid; grid-template-columns: 9rem 1fr; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.contact-list .k { font-family: var(--display); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.contact-list a { overflow-wrap: anywhere; }
@media (max-width: 479px) { .contact-list li { grid-template-columns: 1fr; gap: 4px; } }

.big-404 { font-family: var(--display); font-size: .875rem; letter-spacing: .14em; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .site-header, .site-footer .footer-grid, .skip { display: none; }
}

/* Diagrams */
.diagram { margin: 0; }
.diagram figcaption, .fig-cap { font-family: var(--display); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 16px; line-height: 1.6; }
.mono-label { font-family: var(--display); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); display: block; margin-bottom: 6px; }

/* Diagram A: platform stack */
.stack { display: grid; grid-template-columns: minmax(120px, 180px) minmax(0, 1fr) minmax(120px, 180px); gap: 20px; align-items: stretch; }
.stack-layers { list-style: none; display: grid; gap: 22px; }
.stack-layers li { position: relative; border: 1px solid var(--line); border-left: 2px solid var(--signal); background: var(--surface); padding: 18px 22px; min-width: 0; }
.stack-layers li:not(:last-child)::after { content: ""; position: absolute; left: 32px; bottom: -23px; height: 22px; width: 1px; background: var(--muted); }
.stack-layers li:not(:last-child)::before { content: ""; position: absolute; left: 28px; bottom: -23px; width: 7px; height: 7px; border-right: 1px solid var(--muted); border-bottom: 1px solid var(--muted); transform: rotate(45deg) translate(-1px, -1px); }
.stack-layers strong { display: block; font-family: var(--display); font-size: 1.375rem; font-weight: 600; line-height: 1.25; }
.stack-layers p { margin: 4px 0 0; font-size: .9375rem; color: var(--text); }
.stack-rail { border: 1px dashed var(--accent); padding: 16px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.stack-rail p { margin: 0; font-size: .9375rem; color: var(--text); }
.stack.compact { gap: 14px; }
.stack.compact .stack-layers { gap: 16px; }
.stack.compact .stack-layers li { padding: 12px 18px; }
.stack.compact .stack-layers li:not(:last-child)::after { bottom: -17px; height: 16px; }
.stack.compact .stack-layers li:not(:last-child)::before { bottom: -17px; }
.stack.compact .stack-layers strong { font-size: 1.125rem; }
.stack.compact .stack-layers p { display: none; }
.stack.compact .stack-rail { padding: 12px; }
@media (max-width: 767px) {
  .stack { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .stack-rail { padding: 12px 16px; }
}

/* Diagram B/F: step pipeline */
.pipe { list-style: none; counter-reset: p; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 32px; }
.pipe li { counter-increment: p; position: relative; border: 1px solid var(--line); background: var(--surface); padding: 18px 18px 20px; min-width: 0; }
.pipe li::before { content: counter(p, decimal-leading-zero); display: block; font-family: var(--display); font-size: .8125rem; letter-spacing: .1em; color: var(--accent); margin-bottom: 8px; }
.pipe li:not(:last-child)::after { content: "\2192"; position: absolute; right: -24px; top: 50%; width: 16px; margin-top: -12px; text-align: center; font-size: 1.125rem; line-height: 1; color: var(--muted); }
.pipe strong { display: block; font-family: var(--display); font-size: 1.125rem; font-weight: 600; line-height: 1.3; margin-bottom: 4px; }
.pipe p { margin: 0; font-size: .9375rem; color: var(--muted); }
.pipe code { font-size: .8125rem; }
@media (max-width: 1023px) {
  .pipe { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .pipe li:not(:last-child)::after { content: "\2193"; right: auto; left: 20px; top: auto; bottom: -26px; margin: 0; }
}

/* Diagram C and E: illustrated charts (shapes only, labels in HTML) */
.chart svg { width: 100%; height: auto; border: 1px solid var(--line); background: var(--surface); }
.c-axis { stroke: var(--muted); stroke-width: 1.5; fill: none; }
.c-curve { stroke: var(--ink); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.c-flat { stroke: var(--accent); stroke-width: 3; fill: none; stroke-linecap: round; }
.c-floor { stroke: var(--signal); stroke-width: 2; stroke-dasharray: 8 6; fill: none; }
.c-area { fill: var(--accent); fill-opacity: .14; stroke: none; }
.c-drop { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 4; fill: none; }
.c-knee { fill: var(--surface); stroke: var(--accent); stroke-width: 3; }
.chart-axes { display: flex; justify-content: space-between; gap: 16px; font-family: var(--display); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 10px 0 0; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 16px; font-size: .9375rem; }
.legend li { display: flex; align-items: center; gap: 10px; }
.legend li::before { content: ""; flex: none; width: 22px; height: 0; border-top: 3px solid var(--ink); }
.legend .l-floor::before { border-top: 2px dashed var(--signal); }
.legend .l-flat::before { border-top-color: var(--accent); }
.legend .l-area::before { height: 12px; border: 0; background: var(--accent); opacity: .3; }
.legend .l-knee::before { width: 12px; height: 12px; border: 3px solid var(--accent); border-radius: 50%; margin: 0 5px; }
.chart-wrap { max-width: 56rem; margin-top: 48px; }
.proofs { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 40px; }
.proofs li { border-top: 2px solid var(--signal); padding-top: 14px; font-family: var(--display); font-size: 1.25rem; font-weight: 600; color: var(--ink); line-height: 1.3; }
@media (max-width: 767px) { .proofs { grid-template-columns: minmax(0, 1fr); gap: 20px; } }

/* Diagram D: four ways to split a model */
.splits { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.splits li { border: 1px solid var(--line); background: var(--surface); padding: 20px; min-width: 0; }
.splits svg { width: 100%; max-width: 220px; height: auto; margin-bottom: 14px; }
.splits h3 { font-size: 1.1875rem; margin-bottom: .3em; }
.splits p { margin: 0; font-size: .9375rem; color: var(--muted); }
.g-gpu { fill: none; stroke: var(--muted); stroke-width: 2; }
.g-a { fill: var(--accent); fill-opacity: .85; }
.g-b { fill: var(--ink); fill-opacity: .7; }
.g-c { fill: var(--signal); fill-opacity: .9; }
.g-in { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 3; }
.g-flow { fill: none; stroke: var(--muted); stroke-width: 2; }
@media (max-width: 1023px) { .splits { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .splits { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

/* Research timeline */
.episodes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; margin-top: 8px; }
.episodes h3 { font-family: var(--display); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 400; margin-bottom: 14px; }
.ep-list { list-style: none; counter-reset: e; border-left: 2px solid var(--accent); }
.ep-list li { counter-increment: e; position: relative; padding: 10px 0 10px 28px; color: var(--ink); }
.ep-list li::before { content: ""; position: absolute; left: -7px; top: 1.1em; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.ep-list li span { display: block; font-family: var(--display); font-size: .75rem; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; }
.episodes .plan-list { list-style: none; border-left: 2px dashed var(--line); }
.plan-list li { position: relative; padding: 8px 0 8px 28px; color: var(--text); }
.plan-list li::before { content: ""; position: absolute; left: -7px; top: 1.1em; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--muted); }
@media (max-width: 767px) { .episodes { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
.scopes { columns: 1; }
.proofs + .measure { margin-top: 28px; }
.stack + .fig-cap { margin-bottom: 20px; }

/* Factory figure (/ai-factory/): one SVG at final coordinates, camera + reveals driven by data-scene / has-N on .factory (assets/js/factory.js) */
.factory { margin: 0; }
.f-list { display: grid; gap: 14px; padding-left: 1.5em; color: var(--text); max-width: 46rem; }
.f-list strong { display: block; }
.factory.f-ready .f-list { display: none; }
.f-stage { display: none; background: var(--bg-band); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.factory.f-ready .f-stage { display: block; }
.f-svg { width: 100%; height: auto; aspect-ratio: 1200 / 760; }

/* Progress: one segment per scene; the current one fills while playing; the last one (the finished factory) is orange. */
.f-progress { margin-top: 10px; }
.f-progress[hidden] { display: none; }
.f-bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.f-seg { display: block; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.f-seg i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left center; }
.f-seg.last i { background: var(--signal); }
.f-seg.done i, .f-seg.now i { transform: scaleX(1); }
.factory.is-playing .f-seg.now i { animation: f-fill 3.4s linear both; }
@keyframes f-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.f-prog-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; font-family: var(--display); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.f-prog-end::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 1px; background: var(--signal); margin-right: 6px; vertical-align: 1px; }
.factory.is-done .f-prog-meta [data-f-prog-now] { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .factory.is-playing .f-seg.now i { animation: none; } }

.f-panel { margin-top: 20px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px 32px; align-items: start; }
.f-panel[hidden] { display: none; }
.f-live { grid-column: 1; grid-row: 1; min-height: 8.5rem; }
.f-count { font-family: var(--display); font-size: .8125rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 6px; }
.f-title { margin: 0 0 .25em; font-size: clamp(1.5rem, 2.6vw, 2rem); text-transform: uppercase; font-weight: 600; letter-spacing: 0; }
.f-cap { margin: 0; max-width: 40rem; font-size: 1.0625rem; line-height: 1.55; color: var(--text); }
.f-ctl { grid-column: 2; grid-row: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.f-steps { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.f-legend { grid-column: 1 / -1; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; }

.f-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; background: none; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); font: 600 .875rem var(--sans); text-transform: uppercase; letter-spacing: .08em; cursor: pointer; }
.f-btn:hover { border-color: var(--muted); }
.f-btn[aria-disabled="true"] { opacity: .4; cursor: default; }
.f-btn[aria-disabled="true"]:hover { border-color: var(--line); }
.f-play { min-width: 92px; }

.f-step { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 0; padding: 0 6px; background: none; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font: 500 .8125rem var(--sans); text-transform: uppercase; letter-spacing: .08em; cursor: pointer; }
.f-step:hover { border-color: var(--muted); color: var(--ink); }
.f-step.seen { color: var(--text); }
.f-step[aria-current="step"] { color: var(--ink); border-color: var(--accent); box-shadow: inset 0 -3px 0 var(--accent); }
.f-sn { font-family: var(--mono); font-size: .8125rem; }
.f-st { display: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-sc { display: none; }
@media (min-width: 1000px) { .f-st { display: inline; } }

.lg { display: inline-flex; align-items: center; gap: 8px; font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); opacity: .4; transition: opacity .4s ease; }
.sw { display: inline-block; width: 18px; flex: none; }
.sw-gpu { height: 10px; width: 10px; margin: 0 4px; background: var(--accent); }
.sw-su { border-top: 2px solid var(--accent); }
.sw-fab { border-top: 1px solid var(--accent); }
.sw-sto { border-top: 2px solid var(--signal); }
.sw-inb { border-top: 1px dashed var(--muted); }
.sw-oob { border-top: 2px dotted var(--muted); }
.has-1 .lg-1, .has-2 .lg-2, .has-5 .lg-5, .has-8 .lg-8 { opacity: 1; }

@media (max-width: 719px) {
  .f-panel { grid-template-columns: minmax(0, 1fr); }
  .f-live { min-height: 11.5rem; }
  .f-ctl { grid-column: 1; grid-row: auto; }
  .f-ctl .f-btn, .f-ctl .btn { flex: 1 1 calc(50% - 4px); }
  .f-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Desktop: the scenes become a vertical flowchart beside the film (all three films share this player).
   The panel's children join the figure grid (display: contents): film + progress on the left, the stage rail on the right
   spanning their height, caption under the film, playback under the rail, legend across the bottom.
   Each step is one equal-height row: a numbered node, its label, and a connector to the next node that turns teal once the
   step is done. The current node is ringed; the final node is orange, like the last progress segment. */
@media (min-width: 1024px) {
  .factory.f-ready { display: grid; grid-template-columns: minmax(0, 1fr) 232px; column-gap: 28px; align-items: start; }
  /* One screen (site rule): film + progress + legend on the left and rail + playback on the right fit the slide. The film's
     width is capped so its height (1200 x 760 frame) leaves room for the section heading and the chrome under it. */
  .factory.f-ready { --f-chrome: 300px; --f-w: max(440px, calc((100svh - var(--header-h) - 2 * var(--section-pad) - var(--f-chrome)) * 1.5789)); }
  .factory.f-ready > .f-stage, .factory.f-ready > .f-progress, .factory.f-ready .f-legend { width: 100%; max-width: var(--f-w); justify-self: end; }
  .factory.f-ready > .f-stage { grid-column: 1; grid-row: 1; }
  .factory.f-ready > .f-progress { grid-column: 1; grid-row: 2; }
  .factory.f-ready > .f-panel { display: contents; }
  /* The caption block is shown under the current step on the rail instead; it stays in the page as the aria-live announcer. */
  .factory.f-ready .f-live { position: absolute; width: 1px; height: 1px; min-height: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .factory.f-ready .f-ctl { grid-column: 2; grid-row: 3; margin-top: 12px; }
  .factory.f-ready .f-ctl .f-btn { flex: 1 1 calc(50% - 4px); padding: 0 10px; }
  .factory.f-ready .f-legend { grid-column: 1; grid-row: 3; margin-top: 12px; align-self: start; }
  .factory.f-ready .f-step .f-st { white-space: normal; overflow: visible; }
  .factory.f-ready .f-step[aria-current="step"] .f-sc { display: block; margin-top: 4px; font-weight: 400; font-size: .875rem; line-height: 1.4; letter-spacing: 0; text-transform: none; color: var(--text); }
  .factory.f-ready .f-steps { grid-column: 2; grid-row: 1 / span 2; align-self: stretch; display: flex; flex-direction: column; gap: 0; padding: 6px 0; }
  .factory.f-ready .f-step { flex: 1 1 0; position: relative; justify-content: flex-start; min-height: 44px; padding: 0 0 0 46px; border: 0; border-radius: 0; box-shadow: none; text-align: left; font-size: .875rem; }
  .factory.f-ready .f-step .f-st { display: inline; }
  .factory.f-ready .f-step .f-sn { position: absolute; left: 0; top: 50%; transform: translateY(-50%); z-index: 1; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: var(--bg); color: var(--muted); transition: background-color .3s ease, border-color .3s ease, color .3s ease; }
  .factory.f-ready .f-step:not(:last-child)::after { content: ""; position: absolute; left: 15px; width: 2px; top: calc(50% + 16px); bottom: calc(-50% + 16px); background: var(--line); transition: background-color .4s ease; }
  .factory.f-ready .f-step.seen::after { background: var(--accent); }
  .factory.f-ready .f-step.seen .f-sn { background: var(--accent); border-color: var(--accent); color: var(--bg); }
  .factory.f-ready .f-step[aria-current="step"] { color: var(--ink); font-weight: 600; }
  .factory.f-ready .f-step[aria-current="step"] .f-sn { border: 2px solid var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--bg-band); }
  .factory.f-ready .f-step:last-child .f-sn { border-color: var(--signal); color: var(--signal); }
  .factory.f-ready .f-step:last-child[aria-current="step"] .f-sn { background: var(--signal); color: var(--bg); }
  .factory.f-ready .f-step:hover { color: var(--ink); }
  .factory.f-ready .f-step:hover .f-sn { border-color: var(--muted); }
  .factory.f-ready .f-step:focus-visible { outline-offset: 2px; }
}

/* SVG shapes: theme tokens only, hairlines stay 1px at every zoom */
.f-svg rect, .f-svg path, .f-svg polygon { vector-effect: non-scaling-stroke; }
/* drawn-in links use pathLength dashes, which do not combine with non-scaling strokes: their widths are in user units */
.f-svg .lk { vector-effect: none; }
.f-floor { fill: none; stroke: var(--muted); stroke-opacity: .5; }
.f-rack { fill: var(--surface); stroke: var(--muted); stroke-opacity: .55; }
.f-rack.net { stroke: var(--accent); stroke-opacity: .75; }
.f-slot { fill: var(--bg-band); stroke: var(--muted); stroke-opacity: .4; }
.f-port { fill: var(--muted); fill-opacity: .7; stroke: none; }
.f-pwr { fill: var(--muted); fill-opacity: .35; stroke: none; }
.f-vent { fill: none; stroke: var(--muted); stroke-opacity: .6; }
.f-node { fill: var(--bg-band); stroke: var(--muted); stroke-opacity: .55; }
.f-gpu { fill: var(--accent); }
.f-die { fill: var(--bg-band); fill-opacity: .55; }
.f-su { fill: none; stroke: var(--accent); stroke-width: 2; }
.f-stub { stroke-width: 1.5; }
.f-leaf, .f-spine { fill: var(--accent); fill-opacity: .16; stroke: var(--accent); stroke-width: 1.2; }
.f-sleaf { fill: var(--signal); stroke: var(--signal); }
.f-plane-body { fill: var(--surface); stroke: var(--muted); stroke-opacity: .65; stroke-dasharray: 6 5; }
.f-rail { fill: none; stroke: var(--accent); stroke-width: 1.3; }
.f-rail.r0 { stroke-opacity: .55; }
.f-rail.r1 { stroke-opacity: .28; }
.f-ls { fill: none; stroke: var(--accent); stroke-opacity: .45; stroke-width: 1.5; }
.f-sto { fill: none; stroke: var(--signal); stroke-opacity: .85; stroke-width: 1.8; }
.f-srv { fill: var(--surface); stroke: var(--muted); stroke-opacity: .55; }
.f-inb { fill: none; stroke: var(--muted); stroke-dasharray: 6 4; }
.f-oob { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 1 5; stroke-linecap: round; }
.f-gw { fill: var(--ink); fill-opacity: .78; }
.f-sig { fill: var(--signal); }
.f-drop { fill: none; stroke: var(--ink); stroke-opacity: .55; stroke-width: 1.8; }

/* Camera: one transform per scene on the group that holds the whole picture */
.f-camera { transform-box: view-box; transform-origin: 0 0; transition: transform 1.6s cubic-bezier(.65, 0, .35, 1); }
.factory[data-scene="1"] .f-camera { transform: translate(-3366px, -6244px) scale(12); }
.factory[data-scene="2"] .f-camera { transform: translate(-2096px, -4108px) scale(8); }
.factory[data-scene="3"] .f-camera { transform: translate(-545.8px, -1745px) scale(3.4); }
.factory[data-scene="4"] .f-camera { transform: translate(-29.7px, -471.4px) scale(1.36); }
.factory[data-scene="5"] .f-camera { transform: translate(44.4px, -292px) scale(1.2); }
.factory[data-scene="6"] .f-camera { transform: translate(48px, -172px) scale(1.15); }
.factory[data-scene="7"] .f-camera { transform: translate(31.3px, -96.3px) scale(1.1); }
.factory[data-scene="8"] .f-camera { transform: translate(0, 0) scale(1); }

/* Reveals: element is hidden until scene N (rv-N) is reached; d0..d17 stagger the delay (55 ms steps) */
.rv { opacity: 0; transition: opacity .55s ease, transform .6s cubic-bezier(.2, .7, .2, 1); }
.rv.sl { transform: translateY(14px); }
.rv.pop { transform-box: fill-box; transform-origin: center; transform: scale(.3); }
.has-1 .rv-1, .has-2 .rv-2, .has-3 .rv-3, .has-4 .rv-4, .has-5 .rv-5, .has-6 .rv-6, .has-7 .rv-7, .has-8 .rv-8 { opacity: 1; transform: none; }
/* hero node scale-up fabric grows out from the middle bar (scene 2) */
.su-bar, .su-stub { transform-box: fill-box; transition: transform .8s ease; }
.su-bar { transform-origin: 0 50%; transform: scaleX(0); }
.su-stub { transform-origin: 50% 50%; transform: scaleY(0); }
.has-2 .su-bar, .has-2 .su-stub { transform: none; }
.lk { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .9s ease; }
.has-5 .lk-5, .has-6 .lk-6, .has-8 .lk-8 { stroke-dashoffset: 0; }
.d0 { transition-delay: 0s; } .d1 { transition-delay: .055s; } .d2 { transition-delay: .11s; } .d3 { transition-delay: .165s; }
.d4 { transition-delay: .22s; } .d5 { transition-delay: .275s; } .d6 { transition-delay: .33s; } .d7 { transition-delay: .385s; }
.d8 { transition-delay: .44s; } .d9 { transition-delay: .495s; } .d10 { transition-delay: .55s; } .d11 { transition-delay: .605s; }
.d12 { transition-delay: .66s; } .d13 { transition-delay: .715s; } .d14 { transition-delay: .77s; } .d15 { transition-delay: .825s; }
.d16 { transition-delay: .88s; } .d17 { transition-delay: .935s; }
.factory[data-dir="back"] .rv, .factory[data-dir="back"] .lk, .factory[data-dir="back"] .su-bar, .factory[data-dir="back"] .su-stub { transition-delay: 0s; transition-duration: .3s; }

/* Planes: back planes slide out from behind the front plane */
.f-plane { opacity: 0; transition: opacity .6s ease, transform 1.2s cubic-bezier(.65, 0, .35, 1); }
.has-7 .f-plane { opacity: 1; }
.has-7 .pl-1 { transform: translate(24px, -30px); }
.has-7 .pl-2 { transform: translate(48px, -60px); transition-delay: .12s; }
.has-7 .pl-3 { transform: translate(72px, -90px); transition-delay: .24s; }
.pl-1 .f-spine { fill-opacity: .12; stroke-opacity: .7; }
.pl-2 .f-spine { fill-opacity: .09; stroke-opacity: .5; }
.pl-3 .f-spine { fill-opacity: .06; stroke-opacity: .35; }
.pl-2 .f-plane-body { stroke-opacity: .5; }
.pl-3 .f-plane-body { stroke-opacity: .35; }
.factory[data-dir="back"] .f-plane { transition-delay: 0s; transition-duration: .3s; }

/* Traffic: dashes travel along the fabric links once the last scene has drawn */
.is-flowing .lk-flow { stroke-dasharray: .04 .08; animation: f-flow 1.6s linear infinite; }
.is-offscreen .lk-flow { animation-play-state: paused; }
@keyframes f-flow { to { stroke-dashoffset: -.12; } }

@media (prefers-reduced-motion: reduce) {
  .factory *, .factory *::before { transition: none !important; animation: none !important; }
}

/* Films (/teams/, /dedicated/): same player as the factory (.factory + .f-*, assets/js/film.js). Shapes are prefixed per film: t- teams, d- dedicated.
   Scene time stays 3.4s (f-fill, film.js stepMs). Colours only via theme tokens: --accent teal, --signal orange as the single highlight. */
.t-camera, .d-camera { transform-box: view-box; transform-origin: 0 0; transition: transform 1.6s cubic-bezier(.65, 0, .35, 1); }
.has-1 .lk-1, .has-2 .lk-2, .has-3 .lk-3, .has-4 .lk-4, .has-7 .lk-7 { stroke-dashoffset: 0; }
.has-3 .lg-3, .has-4 .lg-4, .has-6 .lg-6, .has-7 .lg-7 { opacity: 1; }
.f-svg circle { vector-effect: non-scaling-stroke; }

.factory[data-scene="1"] .t-camera { transform: translate(-120px, -484px) scale(12); }
.factory[data-scene="2"] .t-camera { transform: translate(49px, -10px) scale(2.6); }
.factory[data-scene="3"] .t-camera { transform: translate(82.5px, 12px) scale(2.3); }
.factory[data-scene="4"] .t-camera { transform: translate(6px, -70px) scale(1.8); }
.factory[data-scene="5"] .t-camera { transform: translate(-60px, -192px) scale(1.1); }
.factory[data-scene="6"] .t-camera { transform: translate(-30px, -61px) scale(1.05); }
.factory[data-scene="7"] .t-camera, .factory[data-scene="8"] .t-camera { transform: none; }
.factory[data-scene="1"] .d-camera { transform: translate(184px, -4px) scale(3.2); }
.factory[data-scene="2"] .d-camera { transform: translate(-30px, 33.5px) scale(1.05); }
.factory[data-scene="3"] .d-camera { transform: translate(-420px, -164px) scale(1.7); }
.factory[data-scene="4"] .d-camera { transform: translate(-420px, -11px) scale(1.7); }
.factory[data-scene="5"] .d-camera { transform: translate(-600px, -80px) scale(2); }
.factory[data-scene="6"] .d-camera { transform: translate(-120px, -52px) scale(1.2); }
.factory[data-scene="7"] .d-camera { transform: translate(-60px, -60px) scale(1.1); }
.factory[data-scene="8"] .d-camera { transform: none; }

/* Teams shapes */
.t-head, .t-body { fill: var(--bg-band); stroke: var(--muted); stroke-width: 1.2; }
.t-key { fill: var(--muted); transition-property: fill; transition-duration: .5s; }
.t-key.lit, .has-2 .t-key, .has-1 .t-key.hero { fill: var(--accent); }
.t-key.hero { transition-delay: .3s; }
.t-key.k0 { transition-delay: .9s; } .t-key.k1 { transition-delay: 1.1s; } .t-key.k2 { transition-delay: 1.3s; }
.t-key.k3 { transition-delay: 1.5s; } .t-key.k4 { transition-delay: 1.7s; } .t-key.k5 { transition-delay: 1.9s; }
.factory[data-dir="back"] .t-key { transition-delay: 0s; }
.t-ks { fill: none; stroke: var(--muted); stroke-width: 1.2; stroke-linecap: round; }
.t-tool { fill: var(--surface); stroke: var(--muted); stroke-width: 1.2; }
.t-tl { fill: none; stroke: var(--ink); stroke-opacity: .6; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.t-ah { fill: var(--ink); fill-opacity: .6; stroke: none; }
.t-row { fill: none; stroke: var(--muted); stroke-opacity: .5; stroke-width: 1.2; }
.t-bus { fill: none; stroke: var(--accent); stroke-opacity: .6; stroke-width: 1.3; }
.t-gw { fill: var(--surface); stroke: var(--ink); stroke-opacity: .7; stroke-width: 1.4; }
.t-sig { fill: var(--signal); }
.t-lane { fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; }
.t-q { fill: var(--bg-band); stroke: var(--muted); stroke-opacity: .7; }
.t-q.on { fill: var(--accent); fill-opacity: .5; stroke: var(--accent); }
.t-drop { fill: none; stroke: var(--accent); stroke-opacity: .7; stroke-width: 1.6; }
.t-meter { fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.t-meterd { fill: var(--muted); }
.t-void { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.t-track { fill: var(--bg-band); stroke: var(--line); }
.t-tick { fill: none; stroke: var(--muted); stroke-opacity: .6; }
.t-day { fill: var(--accent); fill-opacity: .55; transform-box: fill-box; transform-origin: 0 50%; transform: scaleX(0); transition: transform .3s ease; }
.has-6 .t-day { transform: scaleX(1); transition: transform 3.1s linear .25s; }
.factory[data-dir="back"] .t-day { transition-duration: .3s; transition-delay: 0s; }
.t-frame { fill: none; stroke: var(--signal); stroke-opacity: .8; stroke-width: 1.6; stroke-dasharray: 8 6; }
.t-doc { fill: var(--surface); stroke: var(--ink); stroke-opacity: .7; stroke-width: 1.4; }
.t-docf { fill: none; stroke: var(--signal); stroke-width: 1.4; }
.rv.t-slx { transform: translateX(40px); }
.has-7 .rv-7.t-slx { transform: none; }

/* Dedicated shapes */
.d-doc { fill: var(--surface); stroke: var(--ink); stroke-opacity: .7; stroke-width: 1.5; }
.d-docf { fill: none; stroke: var(--ink); stroke-opacity: .7; stroke-width: 1.5; }
.d-head { fill: none; stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; }
.d-tl { fill: none; stroke: var(--ink); stroke-opacity: .55; stroke-width: 3; stroke-linecap: round; }
.d-box { fill: none; stroke: var(--accent); stroke-width: 1.3; }
.d-lift, .d-dim { transition: opacity .6s ease, transform .7s cubic-bezier(.65, 0, .35, 1); }
.has-3 .d-lift { transform: translateY(-14px); }
.has-3 .d-dim { opacity: .3; }
.factory[data-dir="back"] .d-lift, .factory[data-dir="back"] .d-dim { transition-duration: .3s; }
.d-slice { fill: var(--accent); fill-opacity: .06; stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 7 5; }
.d-ep { fill: var(--ink); fill-opacity: .78; }
.d-epm { fill: var(--accent); }
.d-conn { fill: none; stroke: var(--accent); stroke-width: 1.8; }
.d-str { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; }
.d-str.up { stroke-opacity: .55; }
.is-flowing .lk-flow.d-str { stroke-dasharray: .03 .05; animation: d-flow .8s linear infinite; }
.is-offscreen .lk-flow.d-str { animation-play-state: paused; }
@keyframes d-flow { to { stroke-dashoffset: -.08; } }
.d-track { fill: none; stroke: var(--muted); stroke-width: 2; }
.d-fill { fill: var(--accent); fill-opacity: .8; transform-box: fill-box; transform-origin: 0 50%; transform: scaleX(0); transition: transform .3s ease; }
.has-6 .d-fill { transform: scaleX(1); transition: transform 3.1s linear .25s; }
.d-tick { fill: none; stroke: var(--muted); stroke-width: 2; }
.d-mark { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.d-cur { transition: transform .3s ease; }
.has-6 .d-cur { transform: translateX(880px); transition: transform 3.1s linear .25s; }
.factory[data-dir="back"] .d-fill, .factory[data-dir="back"] .d-cur { transition-duration: .3s; transition-delay: 0s; }
.d-curl { fill: none; stroke: var(--signal); stroke-width: 2; }
.d-curd { fill: var(--signal); }
.d-ext, .d-rel { fill: none; stroke: var(--signal); stroke-width: 2.2; }
.d-ext { stroke-dasharray: 8 6; }
.d-extah, .d-relah { fill: var(--signal); }

/* Film legend swatches */
.sw-seat { height: 8px; width: 8px; margin: 0 5px; border-radius: 50%; background: var(--accent); }
.sw-tool { height: 10px; width: 14px; margin: 0 2px; border: 1px solid var(--muted); border-radius: 2px; }
.sw-gate { height: 10px; border: 1px solid var(--ink); border-left: 4px solid var(--signal); }
.sw-agr { height: 10px; border: 1px dashed var(--signal); }
.sw-time { height: 6px; background: var(--accent); opacity: .7; }
.sw-slice { height: 10px; border: 1px dashed var(--accent); }
.sw-end { height: 8px; background: var(--ink); opacity: .78; }
.sw-str { border-top: 2px dotted var(--accent); }
.sw-term { height: 9px; width: 9px; margin: 0 4px; border: 2px solid var(--accent); border-radius: 50%; }
.sw-ext { border-top: 2px dashed var(--signal); }
.sw-doc { height: 12px; width: 10px; margin: 0 4px; border: 1px solid var(--ink); border-radius: 1px; }
.nowrap { white-space: nowrap; }

/* ---------- Slides (site rule, aarvee 2026-11-03) ----------
   Every section of every page is a slide: on desktop one scroll moves exactly one section, like advancing a slide, and each
   section fills the screen under the sticky header with its content centred. The footer snaps to the end of the page.
   Smaller or short screens snap gently (proximity), because sections there are taller than the screen. Blog articles are long
   reads and do not snap. A section taller than the screen still scrolls inside itself before moving on. */
html { scroll-padding-top: calc(var(--header-h) + 1px); scroll-snap-type: y proximity; }
main > section { scroll-snap-align: start; }
.site-footer { scroll-snap-align: end; }
:root:has(.blog-post) { scroll-snap-type: none; }
.hero:has(.spectrum) { padding-bottom: 0; }
.hero .spectrum { margin-top: clamp(40px, 6vh, 72px); }
@media (min-width: 1024px) and (min-height: 600px) {
  html { scroll-snap-type: y mandatory; }
  :root { --section-pad: clamp(32px, 6vh, 96px); }
  main > section { scroll-snap-stop: always; min-height: calc(100svh - var(--header-h) - 1px); display: grid; align-content: center; }
  .hero { padding: var(--section-pad) 0; }
  .section-head { margin-bottom: clamp(28px, 4vh, 48px); }
  /* Film slides: tighter padding and a two-column heading, so the whole film (stage, progress, rail, legend) fits one screen. */
  main > section:has(.factory) { padding: 20px 0; }
  main > section:has(.factory) .section-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 48px; max-width: none; margin-bottom: 24px; }
  main > section:has(.factory) .section-head .eyebrow { grid-column: 1 / -1; margin-bottom: 12px; }
  main > section:has(.factory) .section-head h2 { margin: 0; align-self: end; }
  main > section:has(.factory) .section-head .lede { margin: 0; align-self: end; font-size: 1.0625rem; }
}
:root:has(.blog-post) main > section { min-height: 0; }
@media (min-width: 1024px) and (max-height: 760px) { .factory.f-ready .f-step { min-height: 36px; } }

/* Slide fit: sections that would be taller than one screen use the width on desktop (>=1024px). Classes: .slide-cols on .wrap
   (heading column left, content right), .slide-main (right column), .slide-aside (left column under the heading),
   .slide-full (full row), .slide-contents (wrapper dissolves into the grid), .head-split (heading left, lede right). */
@media (min-width: 1024px) and (min-height: 600px) {
  .slide-cols { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: clamp(40px, 5vw, 72px); row-gap: 0; align-items: center; }
  .slide-cols > .section-head { grid-column: 1; grid-row: 1; margin-bottom: 0; align-self: end; }
  .slide-cols > .slide-aside { grid-column: 1; margin-top: clamp(20px, 3vh, 32px); max-width: none; align-self: start; }
  .slide-cols > .slide-contents { display: contents; }
  .slide-cols > .slide-contents > .slide-aside { grid-column: 1; margin-top: clamp(20px, 3vh, 32px); align-self: start; }
  .slide-cols > .slide-main, .slide-cols > .slide-contents > .slide-main, .slide-cols > .stack { grid-column: 2; grid-row: 1 / span 6; margin-top: 0; max-width: none; align-self: center; }
  .slide-cols > .slide-full { grid-column: 1 / -1; margin-top: clamp(24px, 4vh, 40px); }
  .slide-cols .cards.slide-main { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .slide-cols .cards.slide-main .card { padding: 20px 22px; }
  .slide-cols .rule-list.slide-main.cols { grid-template-columns: 1fr; }
  .slide-cols .chart-wrap { margin-top: 0; max-width: none; }
  .slide-cols > .slide-aside.chart { margin-top: clamp(20px, 3vh, 32px); }
  .slide-cols .proofs { grid-template-columns: 1fr; gap: 12px; margin-top: clamp(20px, 3vh, 32px); }
  .slide-cols .proofs li { padding-top: 10px; font-size: 1.125rem; }
  .head-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 48px; max-width: none; margin-bottom: clamp(20px, 3vh, 32px); }
  .head-split .eyebrow { grid-column: 1 / -1; margin-bottom: 12px; }
  .head-split h2 { margin: 0; align-self: end; }
  .head-split .lede { margin: 0; align-self: end; font-size: 1.0625rem; }
  .section-head + .diagram .pipe { margin-top: 0; }
}
@media (min-width: 1024px) and (min-height: 600px) {
  .slide-cols .rule-list.slide-main li { padding: 11px 0; }
  .slide-cols .rule-list.slide-main li strong { font-size: 1.125rem; }
  .slide-cols .stack { grid-template-columns: minmax(96px, 128px) minmax(0, 1fr) minmax(96px, 128px); gap: 14px; }
  .slide-cols .stack-layers { gap: 18px; }
  .slide-cols .stack-layers li { padding: 12px 20px; }
  .slide-cols .stack-layers li:not(:last-child)::after { bottom: -19px; height: 18px; }
  .slide-cols .stack-layers li:not(:last-child)::before { bottom: -19px; }
  .slide-cols .stack-layers strong { font-size: 1.25rem; }
  .slide-cols .stack-rail { padding: 12px; }
}
@media (min-width: 1024px) and (min-height: 600px) and (max-height: 820px) { :root { --section-pad: clamp(24px, 4vh, 40px); } }
@media (min-width: 1024px) and (min-height: 600px) {
  .slide-cols .proofs.slide-full { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: clamp(20px, 3vh, 32px); }
  .slide-cols .measure.slide-full { max-width: none; margin-top: clamp(12px, 2vh, 20px); }
  .slide-cols .chart-wrap.slide-main { max-width: 44rem; justify-self: end; width: 100%; }
}
@media (min-width: 1024px) and (min-height: 600px) and (max-height: 780px) {
  .slide-cols .rule-list.slide-main li { padding: 8px 0; }
  .hero .spectrum { margin-top: 24px; }
}
@media (min-width: 1024px) and (min-height: 600px) { .slide-cols.slide-5 { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); } }
@media (min-width: 1024px) and (min-height: 600px) { .slide-cols > .slide-cap { grid-column: 2; grid-row: 7; margin: 12px 0 0; } }
@media (min-width: 1024px) and (min-height: 600px) and (max-height: 780px) { .slide-cols .stack-layers li { padding: 9px 20px; } }
@media (min-width: 1024px) and (min-height: 600px) and (max-height: 780px) { .slide-cols > .section-head h2 { font-size: 2.5rem; } .slide-cols > .section-head .lede { font-size: 1.0625rem; } }
/* Very short desktop screens (1280x720 and similar): trim the slide padding so every section still fits one screen. */
@media (min-width: 1024px) and (max-height: 740px) { :root { --section-pad: 20px; } .hero .spectrum { margin-top: 24px; } .hero h1 { font-size: 4rem; } .factory.f-ready { --f-chrome: 330px; } }
