:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px)
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  background: var(--color-bg);
  z-index: 30
}

[hidden] {
  display: none !important
}

/*
  tokens.css
  Non-color design tokens: type, spacing, layout, shape, motion, control sizes.
  Colors live in theme.css. Change a value here and every component follows.

  Breakpoints (custom properties cannot be used inside @media, so these values
  are repeated literally in the stylesheets):
    compact  40rem
    wide     48rem
    desktop  64rem
*/

:root {
  /* Typeface roles */
  --font-display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Display face width axis and weights */
  --display-stretch: 118%;
  --display-stretch-wide: 125%;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-display: 700;
  --weight-display-heavy: 800;

  /* Type scale */
  --text-2xs: 0.6875rem;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.3125rem;
  --text-xl: clamp(1.5rem, 1rem + 1.8vw, 2.125rem);
  --text-2xl: clamp(1.875rem, 1rem + 3vw, 3.125rem);
  --text-hero: clamp(1.5rem, 7.6vw, 4.75rem);

  --leading-tight: 1.05;
  --leading-snug: 1.3;
  --leading-body: 1.6;
  --tracking-label: 0.08em;
  --tracking-display: -0.015em;

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-section: clamp(3.5rem, 2rem + 6vw, 7rem);

  /* Layout */
  --container-max: 76rem;
  --measure: 62ch;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --nav-height: 2.5rem;

  /* Shape */
  --radius-none: 0;
  --radius-control: 0;
  --radius-panel: 0;
  --border-width: 1px;

  /* Focus treatment (thin and quiet, always present for keyboard users) */
  --focus-width: 1.5px;
  --focus-offset: 2px;

  /* Controls */
  --control-height: 2.75rem;
  --control-height-compact: 2.25rem;

  /* Motion */
  --duration-fast: 120ms;
  --duration-base: 220ms;
  --duration-slow: 600ms;
  --ease-standard: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* Relative compute per lane (L0 Rust tool to L3 frontier), used by the demo bars */
  --budget-l0: 0.04;
  --budget-l1: 0.24;
  --budget-l2: 0.56;
  --budget-l3: 0.94;

  /* Pill badges and reveal motion */
  --radius-pill: 0;
  --duration-reveal: 700ms;
  --stagger: 70ms;
  --reveal-distance: 14px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Flow diagrams */
  --flow-link-h: 3rem;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration-fast: 0ms;
    --duration-base: 0ms;
    --duration-slow: 0ms;
  }
}

/*
  theme.css
  Every color token. The page is dark-first: neutral black shades with no hue
  in the greys, and one cobalt accent. Dark values live on bare :root so the
  page is black for every viewer. A neutral light theme is available through
  data-theme="light" (the theme toggle and the host's explicit light setting).

  Lane colors (--color-tier-*) form one sequential ramp: the more compute a
  lane uses, the brighter the color.
*/

:root {
  --color-bg: #0a0a0b;
  --color-surface: #18181a;
  --color-surface-sunken: #111112;
  --color-text: #ededed;
  --color-text-muted: #a0a0a4;
  --color-line: #28282b;
  --color-line-strong: #66666b;

  --color-accent: #8fa4ff;
  --color-accent-strong: #b2c0ff;
  --color-accent-tint: #1f2644;
  --color-on-accent: #0b1530;
  --color-focus: #ededed;

  --color-success: #5cc28d;
  --color-danger: #ff8a70;

  --color-badge-bg: #26262a;
  --color-badge-text: #b4b4b8;
  --color-badge-accent-bg: #232a4d;
  --color-badge-accent-text: #b2c0ff;
  --color-badge-success-bg: #14291f;
  --color-badge-success-text: #6fd1a0;
  --color-badge-danger-bg: #33201b;
  --color-badge-danger-text: #ff9c85;

  --color-tier-0: #66666b;
  --color-tier-1: #5c72d0;
  --color-tier-2: #6f86f0;
  --color-tier-3: #a7b7ff;

  --color-band-bg: #1e1e21;
  --color-band-text: #ededed;
  --color-band-muted: #a0a0a4;
  --color-band-accent: #8fa4ff;

  --elevation-raised: 0 1px 2px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --color-bg: #ebebec;
  --color-surface: #f7f7f7;
  --color-surface-sunken: #e0e0e1;
  --color-text: #111112;
  --color-text-muted: #4a4a4e;
  --color-line: #c6c6c8;
  --color-line-strong: #727277;

  --color-accent: #2742d6;
  --color-accent-strong: #1b31a8;
  --color-accent-tint: #d6dcf5;
  --color-on-accent: #ffffff;
  --color-focus: #111112;

  --color-success: #1f7a4d;
  --color-danger: #b3361f;

  --color-badge-bg: #dcdcde;
  --color-badge-text: #3d3d41;
  --color-badge-accent-bg: #d6dcf5;
  --color-badge-accent-text: #1b31a8;
  --color-badge-success-bg: #d3ead9;
  --color-badge-success-text: #165a38;
  --color-badge-danger-bg: #f2d9d2;
  --color-badge-danger-text: #9c2c18;

  --color-tier-0: #727277;
  --color-tier-1: #93a5ee;
  --color-tier-2: #5f79e6;
  --color-tier-3: #2742d6;

  --color-band-bg: #111112;
  --color-band-text: #ebebec;
  --color-band-muted: #a0a0a4;
  --color-band-accent: #9db0ff;

  --elevation-raised: 0 1px 2px rgba(17, 17, 18, 0.28);
  color-scheme: light;
}

/*
  typography.css
  Type roles: display (Archivo, variable width), body (IBM Plex Sans),
  utility (IBM Plex Mono). All sizes come from tokens.css.
*/

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  font-weight: var(--weight-display);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-hero);
  font-weight: var(--weight-display-heavy);
  font-stretch: var(--display-stretch-wide);
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-lg);
  line-height: var(--leading-snug);
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.lede {
  max-width: var(--measure);
  font-size: var(--text-md);
}

.text-muted {
  color: var(--color-text-muted);
}

/*
  global.css
  Reset, page background, shared layout patterns and the single shared
  keyboard focus treatment.
*/

*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: 0 !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + var(--space-4));
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
}

::selection {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

/* All scrollbars invisible across the entire page */
*,
*::before,
*::after {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

*::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Shared focus treatment: thin, quiet, never removed entirely */
:where(a, button, [role="tab"]):focus {
  outline: none;
}

:where(a, button, [role="tab"]):focus-visible {
  outline: var(--focus-width) solid var(--color-focus);
  outline-offset: var(--focus-offset);
}

/* Layout */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--space-section);
}

.section--sunken {
  background: var(--color-surface-sunken);
}

.section__header {
  display: grid;
  gap: var(--space-4);
  max-width: 48rem;
}

.stack {
  display: grid;
  gap: var(--space-7);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-7);
}

.split__lead {
  display: grid;
  gap: var(--space-4);
  align-content: start;
}

.columns-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-7);
}

@media (min-width: 48rem) {
  .columns-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-8);
  }
}

@media (min-width: 64rem) {
  .split {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    column-gap: var(--space-8);
  }

  .split__lead {
    position: sticky;
    top: calc(var(--nav-height) + var(--space-6));
    align-self: start;
  }
}

/*
  utilities.css
  Small single-purpose helpers. Visual design belongs in tokens, theme and
  component files, not here.
*/

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

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 40;
  padding: var(--space-2) var(--space-4);
  background: var(--color-text);
  color: var(--color-bg);
  font-size: var(--text-sm);
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/*
  buttons.css
  One button component. Variants: primary, secondary, inverse (on the band),
  icon, compact.
*/

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-height);
  padding-inline: var(--space-5);
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button--primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-on-accent);
}

.button--primary:hover,
.button--primary:active {
  background: var(--color-accent-strong);
  border-color: var(--color-accent-strong);
}

.button--secondary {
  border-color: var(--color-line-strong);
}

.button--secondary:hover,
.button--secondary:active {
  border-color: var(--color-text);
}

.button--inverse {
  background: var(--color-band-text);
  border-color: var(--color-band-text);
  color: var(--color-band-bg);
}

.button--inverse:hover,
.button--inverse:active {
  background: transparent;
  color: var(--color-band-text);
}

.button--compact {
  min-height: var(--control-height-compact);
  padding-inline: var(--space-4);
}

.button--icon {
  width: var(--control-height);
  padding-inline: 0;
}

.icon {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
}

/*
  navigation.css
  Sticky site bar and the wordmark.
*/

.site-nav {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: var(--color-bg);
  border-bottom: var(--border-width) solid var(--color-line);
}

.site-nav__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--nav-height);
  padding-block: var(--space-2);
}

.site-nav__links {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-1) var(--space-5);
  margin-inline-start: auto;
  font-size: var(--text-sm);
}

.site-nav__links a {
  padding-block: var(--space-2);
  border-bottom: var(--border-width) solid transparent;
  color: var(--color-text-muted);
  text-decoration: none;
  transition:
    color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard);
}

.site-nav__links a:hover {
  color: var(--color-text);
  border-bottom-color: var(--color-line-strong);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-stretch: var(--display-stretch-wide);
  font-weight: var(--weight-display-heavy);
  letter-spacing: 0.01em;
  text-decoration: none;
}

.wordmark__mark {
  width: 1.75rem;
  height: 1.75rem;
  overflow: visible;
}

/* Left half: Claude's spark. Right half: a horned demon head (dānava).
   The halves are cut at a shared seam and never overlap. */
.wordmark__spark {
  fill: none;
  stroke: var(--color-tier-2);
  stroke-width: 2.6;
  stroke-linecap: round;
}

.wordmark__head {
  fill: var(--color-tier-3);
}

.wordmark__half {
  transition: transform var(--duration-base) var(--ease-standard);
}

.wordmark:hover .wordmark__half--spark {
  transform: translateX(-0.8px);
}

.wordmark:hover .wordmark__half--head {
  transform: translateX(0.8px);
}

.site-nav__links a[aria-current="location"] {
  color: var(--color-text);
}

.site-nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.site-nav__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-height-compact);
  height: var(--control-height-compact);
  min-height: var(--control-height-compact);
  padding: 0;
  border-radius: var(--radius-control);
  border: var(--border-width) solid var(--color-line-strong);
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}

.site-nav__btn:hover {
  border-color: var(--color-text);
  background: var(--color-surface);
}

.site-nav__toggle {
  display: none;
}

.site-nav__toggle .icon--close {
  display: none;
}

/* Sliding underline that follows the section in view */
.site-nav__indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--indicator-w, 0);
  height: 2px;
  background: var(--color-accent);
  opacity: 0;
  transform: translate(var(--indicator-x, 0), var(--indicator-y, 0));
  pointer-events: none;
}

.site-nav__links.has-active .site-nav__indicator {
  opacity: 1;
}

.site-nav__links.is-ready .site-nav__indicator {
  transition:
    transform var(--duration-slow) var(--ease-out),
    width var(--duration-slow) var(--ease-out),
    opacity var(--duration-base) var(--ease-standard);
}

@media (max-width: 47.99rem) {
  html {
    scroll-padding-top: calc(3.5rem + var(--space-3) + env(safe-area-inset-top, 0px));
  }

  .site-nav__inner {
    min-height: 3.25rem;
    padding-block: var(--space-2);
    justify-content: space-between;
  }

  .site-nav__toggle {
    display: inline-flex;
  }

  .site-nav.is-open .site-nav__toggle .icon--menu {
    display: none;
  }

  .site-nav.is-open .site-nav__toggle .icon--close {
    display: block;
  }

  .site-nav__links {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: var(--gutter);
    left: auto;
    width: min(calc(100vw - 2 * var(--gutter)), 16rem);
    display: none;
    flex-direction: column;
    gap: var(--space-1);
    background: var(--color-surface);
    border: var(--border-width) solid var(--color-line-strong);
    border-radius: var(--radius-panel);
    padding: var(--space-2);
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-inline-start: 0;
    transform-origin: top right;
  }

  .site-nav.is-open .site-nav__links {
    display: flex;
    animation: popover-in var(--duration-base) var(--ease-out);
  }

  .site-nav__links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: var(--border-width) solid transparent;
    border-radius: var(--radius-control);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--color-text-muted);
  }

  .site-nav__links a::after {
    content: attr(data-index);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--color-line-strong);
    letter-spacing: var(--tracking-label);
  }

  .site-nav__links a:hover,
  .site-nav__links a:active {
    background: var(--color-surface-sunken);
    color: var(--color-text);
    border-color: var(--color-line);
  }

  .site-nav__links a[aria-current="location"] {
    background: var(--color-surface-sunken);
    color: var(--color-accent);
    border-color: var(--color-line);
    font-weight: var(--weight-semibold);
  }

  .site-nav__links a[aria-current="location"]::after {
    color: var(--color-accent);
  }

  .site-nav__indicator {
    display: none !important;
  }
}

@keyframes popover-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/*
  tabs.css
  Segmented tab control. Selected and unselected tabs share the same border
  width so nothing shifts when the selection changes. Labels never wrap.
*/

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  justify-self: start;
  gap: 2px;
  padding: 2px;
  border: var(--border-width) solid var(--color-line-strong);
  border-radius: var(--radius-control);
  background: var(--color-surface);
}

.segmented__tab {
  min-height: var(--control-height);
  padding-inline: var(--space-5);
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}

.segmented__tab:hover {
  color: var(--color-text);
}

.segmented__tab[aria-selected="true"] {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

/*
  hero.css
  Opening region. Sized to its content, never to the viewport.
*/

.hero {
  padding-top: var(--space-7);
  padding-bottom: var(--space-section);
}

.hero__inner {
  display: grid;
  gap: var(--space-5);
}

.hero__title {
  max-width: 16em;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

.hero__intro {
  display: grid;
  gap: var(--space-5);
  align-items: end;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

@media (min-width: 64rem) {
  .hero__intro {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    column-gap: var(--space-7);
  }

  .hero__actions {
    justify-content: flex-end;
  }
}

/*
  view-switch.css
  Controls Human vs. Agent view mode.
*/

.hero__eyebrow-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  flex-wrap: wrap;
  width: 100%;
}

.hero__eyebrow-row .eyebrow {
  margin: 0;
}

.view-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: var(--border-width) solid var(--color-line-strong);
  border-radius: 0;
  background: var(--color-surface);
  max-width: 100%;
  flex-wrap: wrap;
}

.view-switch__tab {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border: var(--border-width) solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  font-weight: var(--weight-medium);
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}

.view-switch__tab:hover {
  color: var(--color-text);
}

.view-switch__tab.is-active,
.view-switch__tab[aria-selected="true"] {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.view-switch__icon {
  display: block;
  flex: none;
}

/* Visibility toggling by view mode */
body:not([data-view="agent"]) .agent-only {
  display: none !important;
}

body[data-view="agent"] .human-only {
  display: none !important;
}

.hero__human-block {
  display: contents;
}

/* Agent Markdown View */
.agent-view {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 100%;
}

.agent-view__card {
  border: var(--border-width) solid var(--color-line-strong);
  border-radius: var(--radius-panel);
  background: var(--color-surface);
  overflow: hidden;
}

.agent-view__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-width) solid var(--color-line);
  background: var(--color-surface-sunken);
  flex-wrap: wrap;
}

.agent-view__title-group {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.agent-view__pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  background: var(--color-accent-tint);
  border: var(--border-width) solid var(--color-accent);
  color: var(--color-accent);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
}

.agent-view__format {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--color-text-muted);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
}

.agent-view__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.agent-view__terminal {
  padding: var(--space-5);
  background: var(--color-bg);
  overflow-x: auto;
  max-height: 80vh;
  overflow-y: auto;
}

.agent-view__code {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.7;
  color: var(--color-text);
  white-space: pre-wrap;
  word-break: break-word;
}

/*
  scale-frame.css
  A fixed-ratio container. The canvas is laid out once at its design width and
  scaled as a whole to fit the frame, so nothing reflows, wraps differently or
  breaks as the page gets narrower or wider. Script sets --scale and
  --canvas-height on the frame (runtime values) and marks it data-ready.

  Without script the canvas stays at its design size and scrolls sideways
  inside the frame.
*/

.scale-frame {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
}

.scale-canvas {
  width: var(--canvas-width, 62.5rem);
  transform-origin: top left;
}

.scale-frame[data-ready] {
  height: calc(var(--canvas-height) * var(--scale));
  overflow: hidden;
}

.scale-frame[data-ready] .scale-canvas {
  transform: scale(var(--scale));
}

/*
  stage.css
  The System One routing demo: requests on the left, the router in the middle, lanes on
  the right. It is a scale canvas (see scale-frame.css), so it always uses this
  one three-column layout. Wires and the moving token are positioned by script
  from the measured layout (runtime values); everything else is styled here.
*/

.stage {
  --canvas-width: 62.5rem;
  border: var(--border-width) solid var(--color-line-strong);
  border-radius: var(--radius-panel);
  background: var(--color-surface);
}

.stage__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-bottom: var(--border-width) solid var(--color-line);
}

.stage__head .eyebrow {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.stage__body {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(0, 1.25fr);
  column-gap: 2.25rem;
  padding: var(--space-6);
}

.stage__col {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.stage__col--router {
  justify-content: center;
  gap: var(--space-2);
}

.stage__col-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

/* Requests */
.stage__requests,
.stage__levels {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.request {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: var(--space-1);
  width: 100%;
  min-height: 4.5rem;
  padding: var(--space-3) var(--space-4);
  border: var(--border-width) solid var(--color-line-strong);
  border-radius: var(--radius-control);
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition:
    background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard);
}

.request:hover {
  border-color: var(--color-text);
}

.request[aria-current="true"] {
  border-color: var(--color-accent);
  background: var(--color-accent-tint);
}

.request__text {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: var(--leading-snug);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.request__kind {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
}

/* Router */
.router {
  position: relative;
  display: grid;
  gap: var(--space-3);
  margin-block: 0;
  padding: var(--space-4);
  overflow: hidden;
  border: var(--border-width) solid var(--color-text);
  border-radius: var(--radius-control);
  background: var(--color-bg);
}

.router__bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 2px;
  background: var(--color-accent);
  opacity: 0;
  transform: translateX(-100%);
}

.router[data-state="thinking"] .router__bar {
  opacity: 1;
  animation: router-scan 900ms linear infinite;
}

@keyframes router-scan {
  to {
    transform: translateX(250%);
  }
}

.router__readout {
  display: grid;
  gap: var(--space-2);
  margin: 0;
}

.router__row {
  display: grid;
  grid-template-columns: 3.75rem minmax(0, 1fr);
  gap: var(--space-2);
  align-items: center;
}

.router__row dt {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  padding-top: 0.1em;
}

.router__row dd {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

/* Levels */
.level {
  --level-color: var(--color-tier-0);
  --level-budget: var(--budget-l0);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: var(--border-width) solid var(--color-line-strong);
  border-radius: var(--radius-control);
  background: var(--color-bg);
  overflow: hidden;
  transition:
    background-color var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard);
}

.level[data-level="1"] {
  --level-color: var(--color-tier-1);
  --level-budget: var(--budget-l1);
}

.level[data-level="2"] {
  --level-color: var(--color-tier-2);
  --level-budget: var(--budget-l2);
}

.level[data-level="3"] {
  --level-color: var(--color-tier-3);
  --level-budget: var(--budget-l3);
}

.level__head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  width: 100%;
}

.level__swatch {
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  background: var(--level-color);
}

.level__id {
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  white-space: nowrap;
}

.level__name {
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.level__status {
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.level__note {
  display: block;
  width: 100%;
  max-width: 100%;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.level__budget {
  height: 4px;
  background: var(--color-line);
}

.level__fill {
  display: block;
  height: 100%;
  background: var(--level-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-slow) var(--ease-standard);
}

.level[data-state="active"],
.level[data-state="checking"] {
  border-color: var(--color-accent);
  background: var(--color-accent-tint);
}

.level[data-state="passed"] {
  border-color: var(--color-success);
}

.level[data-state="passed"] .level__status {
  color: var(--color-success);
}

.level[data-state="failed"] {
  border-color: var(--color-danger);
}

.level[data-state="failed"] .level__status {
  color: var(--color-danger);
}

.level:is([data-state="active"], [data-state="checking"], [data-state="passed"], [data-state="failed"]) .level__fill {
  transform: scaleX(var(--level-budget));
}

/* Wires and token */
.stage__wires {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.wire {
  fill: none;
  stroke: var(--color-line-strong);
  stroke-width: 1;
  opacity: 0.55;
}

.wire.is-active {
  stroke: var(--color-accent);
  stroke-width: 2;
  opacity: 1;
}

.stage__token {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  width: 0.875rem;
  height: 0.875rem;
  border: 2px solid var(--color-bg);
  background: var(--color-accent);
  box-shadow: var(--elevation-raised);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-standard);
}

.stage__token[data-visible="true"] {
  opacity: 1;
}

/* Result strip */
.stage__result {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-top: var(--border-width) solid var(--color-line);
  min-width: 0;
}

.stage__result-label {
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.stage__result-text {
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
  font-size: var(--text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.stage__result-chip {
  flex: none;
  padding: 0.25rem 0.625rem;
  border: var(--border-width) solid currentColor;
  border-radius: var(--radius-control);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.stage__result[data-state="working"] .stage__result-chip {
  color: var(--color-accent);
}

.stage__result[data-state="done"] .stage__result-chip {
  color: var(--color-success);
}

@media (prefers-reduced-motion: reduce) {
  .router[data-state="thinking"] .router__bar {
    animation: none;
    transform: none;
    width: 100%;
  }
}

/*
  steps.css
  Step lists (context_pack pipeline and roadmap). The rail fills as each step scrolls past the
  reading line (script toggles .is-passed). Text is always visible.
*/

.steps {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  column-gap: var(--space-4);
  padding-bottom: var(--space-6);
}

.step:last-child {
  padding-bottom: 0;
}

.step__marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: var(--border-width) solid var(--color-line-strong);
  background: var(--color-bg);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  transition:
    background-color var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard),
    color var(--duration-base) var(--ease-standard);
}

/* Connector from this marker down to the next one */
.step:not(:last-child)::before,
.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 1.25rem;
  bottom: -1.25rem;
  left: calc(1.25rem - 1px);
  width: 2px;
}

.step:not(:last-child)::before {
  background: var(--color-line);
}

.step:not(:last-child)::after {
  background: var(--color-accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform var(--duration-slow) var(--ease-standard);
}

.step.is-passed .step__marker {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-on-accent);
}

.step.is-passed:not(:last-child)::after {
  transform: scaleY(1);
}

.step__body {
  display: grid;
  gap: var(--space-2);
  padding-top: var(--space-1);
  min-width: 0;
}

.step__tag {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.step__text {
  max-width: var(--measure);
  color: var(--color-text-muted);
}

/*
  topology.css
  Where the server runs. A scale canvas (see scale-frame.css) holding the tabs
  and the diagram, so both keep one layout at every size. The three modes
  differ in enclosure and in the distance between client and server, set by
  data-mode.
*/

.topology-canvas {
  --canvas-width: 56rem;
  display: grid;
  gap: var(--space-5);
}

.topology {
  --link-length: 9rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--link-length) minmax(0, 1fr);
  gap: var(--space-4) var(--space-6);
  padding: 0;
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-panel);
  transition:
    border-color var(--duration-base) var(--ease-standard),
    grid-template-columns var(--duration-slow) var(--ease-standard);
}

.topology[data-mode="desktop"] {
  --link-length: 9rem;
}

.topology[data-mode="web"] {
  --link-length: 14rem;
}

.topology[data-mode="cli"] {
  --link-length: 13rem;
}

.topology__site {
  align-content: start;
  display: grid;
  gap: var(--space-3);
  min-width: 0;
  padding: 0;
  border: var(--border-width) solid transparent;
  border-radius: var(--radius-panel);
  transition:
    border-color var(--duration-base) var(--ease-standard),
    background-color var(--duration-base) var(--ease-standard);
}

.topology[data-mode="lan"] .topology__site,
.topology[data-mode="remote"] .topology__site {
  border-color: var(--color-line-strong);
  background: var(--color-surface);
}

.topology__site-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.node {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-4);
  border: var(--border-width) solid var(--color-text);
  border-radius: var(--radius-control);
  background: var(--color-bg);
}

.node__role {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.node__detail {
  font-size: var(--text-sm);
}

/* Relative machine load: the server uses the whole machine, the client stays light */
.node__meter {
  display: grid;
  gap: var(--space-2);
}

.node__meter[data-load="high"] {
  --meter-level: var(--budget-l3);
}

.node__meter[data-load="low"] {
  --meter-level: var(--budget-l1);
}

.node__meter-label,
.node__list-label {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.node__meter-track {
  height: 4px;
  background: var(--color-line);
}

.node__meter-fill {
  display: block;
  height: 100%;
  background: var(--color-accent);
  transform: scaleX(var(--meter-level));
  transform-origin: left;
}

.node__group {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-2);
  padding-top: var(--space-3);
  border-top: var(--border-width) solid var(--color-line);
}

.node__list {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-sm);
}

.node__list li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.node__list li::before {
  content: "";
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  background: var(--color-accent);
}

.node__list--tiers li:nth-child(1)::before {
  background: var(--color-tier-0);
}

.node__list--tiers li:nth-child(2)::before {
  background: var(--color-tier-1);
}

.node__list--tiers li:nth-child(3)::before {
  background: var(--color-tier-2);
}

.node__list--tiers li:nth-child(4)::before {
  background: var(--color-tier-3);
}

/* Link between the two sites. Dashes move from client to server. */
.topology__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-width: 0;
  padding-inline: var(--space-3);
}

.topology__link-label {
  max-width: 100%;
  padding-inline: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  letter-spacing: var(--tracking-label);
  text-align: center;
  text-transform: uppercase;
  color: var(--color-text-muted);
  word-break: normal;
  overflow-wrap: normal;
  white-space: normal;
  line-height: var(--leading-snug);
}

.topology__line {
  width: 100%;
  height: 2px;
  background-image: linear-gradient(90deg, var(--color-accent) 50%, transparent 50%);
  background-size: 14px 100%;
  animation: topology-flow 700ms linear infinite;
}

.topology__caption {
  grid-column: 1 / -1;
  min-height: calc(var(--leading-body) * 2em);
  padding-inline: 0;
  color: var(--color-text-muted);
}

@keyframes topology-flow {
  to {
    background-position-x: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topology__line {
    animation: none;
  }
}

/*
  lists.css
  Marker list (square markers) for capabilities, and the definition list used for the problem statement and the 110 features.
*/

.product {
  display: grid;
  gap: var(--space-4);
  align-content: start;
  min-width: 0;
}

.marker-list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.marker-list li {
  display: grid;
  grid-template-columns: 0.375rem minmax(0, 1fr);
  column-gap: var(--space-3);
}

.marker-list li::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  margin-top: 0.6em;
  background: var(--color-accent);
}

.definition-list {
  display: grid;
  margin: 0;
  border-top: var(--border-width) solid var(--color-text);
}

.definition-list__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-2);
  padding-block: var(--space-4);
  border-bottom: var(--border-width) solid var(--color-line);
}

.definition-list__term {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-stretch: var(--display-stretch);
  font-weight: var(--weight-display);
  line-height: var(--leading-snug);
}

.definition-list__desc {
  max-width: var(--measure);
  margin: 0;
}

@media (min-width: 48rem) {
  .definition-list__row {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    column-gap: var(--space-6);
    align-items: baseline;
  }
}

/*
  band.css
  Full-width closing statement on the inverse surface.
*/

.band {
  padding-block: var(--space-section);
  background: var(--color-band-bg);
  color: var(--color-band-text);
}

.band__inner {
  display: grid;
  gap: var(--space-5);
  justify-items: start;
}

.band__eyebrow {
  color: var(--color-band-muted);
}

.band__statement {
  max-width: 24em;
  font-size: var(--text-xl);
}

.band__text {
  max-width: var(--measure);
  color: var(--color-band-muted);
}

.band :focus-visible {
  outline-color: var(--color-band-text);
}

/*
  footer.css
*/

.site-footer {
  position: relative;
  padding-top: var(--space-6);
  padding-bottom: 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  overflow: hidden;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-6);
}

.site-footer__note {
  max-width: var(--measure);
}

.site-footer__giant {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding-top: clamp(2rem, 5vw, 4.5rem);
  padding-inline: var(--space-4);
  margin-inline: auto;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}

.giant-wordmark {
  width: 100%;
  max-width: min(100%, 1100px);
  height: auto;
  display: block;
}

[data-theme="light"] #danav-footer-metal stop:nth-child(1) {
  stop-color: #111112;
  stop-opacity: 0.95;
}

[data-theme="light"] #danav-footer-metal stop:nth-child(2) {
  stop-color: #3f3f46;
  stop-opacity: 0.8;
}

[data-theme="light"] #danav-footer-metal stop:nth-child(3) {
  stop-color: #71717a;
  stop-opacity: 0.3;
}

[data-theme="light"] #danav-footer-metal stop:nth-child(4) {
  stop-color: #f4f4f5;
  stop-opacity: 0.0;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) #danav-footer-metal stop:nth-child(1) {
    stop-color: #111112;
    stop-opacity: 0.95;
  }

  :root:not([data-theme="dark"]) #danav-footer-metal stop:nth-child(2) {
    stop-color: #3f3f46;
    stop-opacity: 0.8;
  }

  :root:not([data-theme="dark"]) #danav-footer-metal stop:nth-child(3) {
    stop-color: #71717a;
    stop-opacity: 0.3;
  }

  :root:not([data-theme="dark"]) #danav-footer-metal stop:nth-child(4) {
    stop-color: #f4f4f5;
    stop-opacity: 0.0;
  }
}

/* spec.css: markdown prose, formulas, feature groups. Uses existing tokens only. */
.prose {
  display: grid;
  gap: var(--space-4);
  min-width: 0
}

.prose h3 {
  margin-top: var(--space-5)
}

.prose h3:first-child {
  margin-top: 0
}

.prose h4 {
  font-family: var(--font-display);
  font-size: var(--text-md)
}

.prose ul,
.prose ol {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: var(--space-2)
}

.prose li>ul,
.prose li>ol {
  margin-top: var(--space-1)
}

.prose li {
  display: list-item
}

.prose p {
  max-width: var(--measure)
}

.prose code,
.definition-list code,
.step__text code,
.marker-list code,
.lede code,
.text-muted code {
  font-family: var(--font-mono);
  font-size: .86em;
  padding: .1em .4em;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--color-badge-bg);
  color: var(--color-text);
  overflow-wrap: anywhere;
  display: inline-block;
  vertical-align: baseline
}

.prose pre {
  margin: 0;
  padding: var(--space-4);
  overflow-x: auto;
  border: var(--border-width) solid var(--color-line);
  border-radius: var(--radius-panel);
  background: var(--color-surface);
  font-size: var(--text-xs);
  line-height: 1.35
}

.prose pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  overflow-wrap: normal;
  white-space: pre
}

.prose table,
table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  font-size: var(--text-sm);
  scrollbar-width: none;
  -ms-overflow-style: none
}

.prose table::-webkit-scrollbar,
table::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0
}

.prose th,
.prose td {
  padding: var(--space-3);
  border-bottom: var(--border-width) solid var(--color-line);
  text-align: left;
  vertical-align: top;
  min-width: 9rem
}

.prose th {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-bottom-color: var(--color-text)
}

.prose hr {
  border: 0;
  border-top: var(--border-width) solid var(--color-line)
}

.prose>hr:last-child {
  display: none
}

.prose a {
  color: var(--color-accent)
}

.math {
  margin-block: var(--space-2);
  padding: var(--space-2) var(--space-3);
  overflow-x: auto;
  text-align: center;
  font-family: var(--font-body);
  font-size: var(--text-md);
  border: var(--border-width) solid var(--color-line);
  border-radius: var(--radius-control);
  background: var(--color-surface)
}

.m {
  font-family: var(--font-body);
  white-space: nowrap
}

.frac {
  display: inline-block;
  vertical-align: middle;
  text-align: center
}

.frac .num {
  display: block;
  padding: 0 var(--space-2) 2px;
  border-bottom: var(--border-width) solid var(--color-text)
}

.frac .den {
  display: block;
  padding: 2px var(--space-2) 0
}

.step__text ul {
  margin: var(--space-3) 0 0
}

.step__text {
  display: grid;
  gap: var(--space-2)
}

.dg-fig {
  margin: 0;
  display: grid;
  gap: var(--space-3)
}

.dg-scroll {
  overflow: hidden;
  border: var(--border-width) solid var(--color-line);
  border-radius: 0;
  background: var(--color-surface-sunken);
}

.dg {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: auto;
}

.dg-fig figcaption {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: var(--measure)
}

.dg-panel {
  fill: var(--color-surface);
  stroke: var(--color-line-strong);
  stroke-width: 1
}

.dg-card {
  fill: var(--color-bg);
  stroke: var(--color-line-strong);
  stroke-width: 1
}

.dg-base {
  fill: none;
  stroke: var(--color-line-strong);
  stroke-width: 1;
  stroke-dasharray: 5 4
}

.dg-sq {
  fill: var(--color-accent)
}

.dg-label,
.dg-labelr,
.dg-tag,
.dg-chiptxt,
.dg-pilltxt,
.dg-basetxt {
  font-family: var(--font-mono);
  font-weight: 500
}

.dg-label {
  font-size: 12px;
  letter-spacing: .08em;
  fill: var(--color-text)
}

.dg-labelr {
  font-size: 10.5px;
  letter-spacing: .08em;
  fill: var(--color-text-muted)
}

.dg-title {
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  font-weight: 700;
  font-size: 16px;
  fill: var(--color-text)
}

.dg-title.sm {
  font-size: 14.5px
}

.dg-sub {
  font-family: var(--font-body);
  font-size: 12.5px;
  fill: var(--color-text-muted)
}

.dg-tag {
  font-size: 11px;
  fill: var(--color-accent)
}

.dg-chip {
  fill: var(--color-badge-accent-bg);
  stroke: none;
  rx: 0;
}

.dg-chiptxt {
  font-size: 11px;
  fill: var(--color-badge-accent-text)
}

.dg-pill {
  fill: var(--color-accent);
  rx: 0;
}

.dg-pilltxt {
  font-size: 12.5px;
  fill: var(--color-on-accent)
}

.dg-basetxt {
  font-size: 11.5px;
  letter-spacing: .04em;
  fill: var(--color-text-muted)
}

.dg-bar.t0 {
  fill: var(--color-tier-0)
}

.dg-bar.t1 {
  fill: var(--color-tier-1)
}

.dg-bar.t2 {
  fill: var(--color-tier-2)
}

.dg-bar.t3 {
  fill: var(--color-tier-3)
}

.dg-ico {
  fill: none;
  stroke: var(--color-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round
}

.dg-icof rect {
  fill: var(--color-accent)
}

.dg-flow {
  stroke: var(--color-accent);
  stroke-width: 2;
  stroke-dasharray: 5 5;
  fill: none
}

.dg-arrf {
  fill: var(--color-accent)
}

@media (prefers-reduced-motion:no-preference) {
  .dg-flow {
    animation: dg-dash 1.4s linear infinite
  }
}

@keyframes dg-dash {
  to {
    stroke-dashoffset: -20
  }
}

.feature-tools {
  display: flex;
  justify-content: flex-end
}

.feature-groups {
  display: grid;
  gap: 0;
  border-top: var(--border-width) solid var(--color-text)
}

.feature-group {
  border-bottom: var(--border-width) solid var(--color-line)
}

.feature-group summary {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: baseline;
  padding-block: var(--space-4);
  cursor: pointer;
  list-style: none
}

.feature-group summary::-webkit-details-marker {
  display: none
}

.feature-group summary:focus-visible {
  outline: var(--focus-width) solid var(--color-focus);
  outline-offset: var(--focus-offset)
}

.feature-group__num {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-accent)
}

.feature-group__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-stretch: var(--display-stretch);
  font-weight: var(--weight-display);
  line-height: var(--leading-snug)
}

.feature-group__count {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted)
}

.feature-group__count::after {
  content: " +";
  color: var(--color-accent)
}

.feature-group[open] .feature-group__count::after {
  content: " \2212"
}

.feature-group .definition-list {
  border-top: var(--border-width) solid var(--color-line);
  margin-bottom: 0
}

.feature-group .definition-list .definition-list__row:last-child {
  border-bottom: none
}

.feature__n {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--color-accent);
  letter-spacing: var(--tracking-label)
}

.feature-group .definition-list__desc {
  display: block
}

.feature-group .definition-list__desc>*+* {
  margin-top: var(--space-3)
}

.feature-group .definition-list__desc code {
  display: inline-block;
  white-space: nowrap
}

.feature-group .definition-list__row {
  grid-template-columns: minmax(0, 1fr)
}

@media (min-width:48rem) {
  .feature-group .definition-list__row {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr)
  }
}

/*
  badges.css
  Pill badges. Filled and never outlined: the tint carries the meaning, so no
  badge has a border. Variants: neutral (default), accent, success, danger.
  Existing status labels share the same base so they stay consistent.
*/

.badge,
.request__kind,
.level__status,
.step__tag,
.stage__result-chip {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  width: fit-content;
  padding: 0.2rem 0.65rem;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--color-badge-bg);
  color: var(--color-badge-text);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
  transition:
    background-color var(--duration-base) var(--ease-standard),
    color var(--duration-base) var(--ease-standard);
}

.badge--accent {
  background: var(--color-badge-accent-bg);
  color: var(--color-badge-accent-text);
}

.badge--success {
  background: var(--color-badge-success-bg);
  color: var(--color-badge-success-text);
}

.badge--danger {
  background: var(--color-badge-danger-bg);
  color: var(--color-badge-danger-text);
}

.badge--text {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  letter-spacing: 0;
  text-transform: none;
}

/* Lane status follows the lane state */
.level[data-state="active"] .level__status,
.level[data-state="checking"] .level__status {
  background: var(--color-badge-accent-bg);
  color: var(--color-badge-accent-text);
}

.level[data-state="passed"] .level__status {
  background: var(--color-badge-success-bg);
  color: var(--color-badge-success-text);
}

.level[data-state="failed"] .level__status {
  background: var(--color-badge-danger-bg);
  color: var(--color-badge-danger-text);
}

/* Result chip follows the demo state */
.stage__result[data-state="working"] .stage__result-chip {
  background: var(--color-badge-accent-bg);
  color: var(--color-badge-accent-text);
}

.stage__result[data-state="done"] .stage__result-chip {
  background: var(--color-badge-success-bg);
  color: var(--color-badge-success-text);
}

/*
  flow.css
  Architecture flow, workspace tree and pipeline. Tokens only. Lines carry a
  quiet accent pulse once the figure is on screen (motion respects the user's
  reduced-motion setting).
*/

.flow {
  margin: 0;
  display: grid;
  gap: 0;
}

.flow .flow__layer {
  display: grid;
  gap: 0;
  padding: var(--space-5);
  border: var(--border-width) solid var(--color-line-strong);
  border-radius: var(--radius-panel);
  background: var(--color-surface);
}

.flow .flow__label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-text);
  max-width: none;
}

.flow .flow__label::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--color-accent);
}

.flow .flow__clients {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Cards */
.flow .flow__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow .flow__card,
.pipeline__stage {
  --flow-accent: var(--color-tier-1);
  position: relative;
  display: grid;
  gap: var(--space-1);
  align-content: start;
  min-width: 0;
  padding: var(--space-4);
  border: var(--border-width) solid var(--color-line-strong);
  border-top: 4px solid var(--flow-accent);
  border-radius: var(--radius-control);
  background: var(--color-bg);
  transition: border-color var(--duration-fast) var(--ease-standard);
}

.flow .flow__card:hover {
  border-color: var(--color-text);
  border-top-color: var(--flow-accent);
}

.flow__card--1 {
  --flow-accent: var(--color-tier-1);
}

.flow__card--2 {
  --flow-accent: var(--color-tier-2);
}

.flow__card--3 {
  --flow-accent: var(--color-tier-3);
}

.flow .flow__card--wide {
  --flow-accent: var(--color-accent);
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--space-4);
}

.flow .flow__name {
  max-width: none;
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-stretch: var(--display-stretch);
  font-weight: var(--weight-display);
  line-height: var(--leading-snug);
}

.flow .flow__tech {
  max-width: none;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.flow .flow__caption {
  margin-top: var(--space-4);
  max-width: var(--measure);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Protocol Pipeline Bus (Option B) */
.flow .flow__bus-frame {
  margin-block: var(--space-2);
  width: 100%;
  overflow: hidden;
}

.flow .flow__bus {
  --bus-offset: 2.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  margin-block: 0;
  width: 100%;
}

.flow .flow__bus.scale-canvas {
  width: 100%;
  min-width: 36rem;
  transform-origin: top left;
}

.flow .flow__bus-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 11px;
}

.flow .flow__bus-drop--in {
  margin-left: var(--bus-offset);
  transform: translateX(-4.5px);
}

.flow .flow__bus-drop--out {
  align-self: flex-end;
  margin-right: var(--bus-offset);
  transform: translateX(4.5px);
}

.flow .flow__bus-line--v {
  display: block;
  width: 2px;
  height: 1.25rem;
  background-color: var(--color-line-strong);
}

.flow .flow__bus-track {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-left: var(--bus-offset);
  margin-right: var(--bus-offset);
  width: calc(100% - (var(--bus-offset) * 2));
  padding: 0.25rem 0;
}

.flow .flow__bus-seg {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 0;
  min-width: 1.5rem;
  height: 14px;
}

.flow .flow__bus-line--h {
  display: block;
  flex: 1 1 0;
  min-width: 4px;
  height: 2px;
  background-color: var(--color-line-strong);
}

.flow .flow__bus-chevron {
  display: block;
  flex-shrink: 0;
  color: var(--color-line-strong);
}

.flow .flow__bus-chevron--right {
  width: 7px;
  height: 11px;
  margin-left: 2px;
}

.flow .flow__bus-chevron--down {
  width: 11px;
  height: 7px;
  margin-top: 1px;
}

.flow .flow__protocol {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-tier-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  white-space: nowrap;
}

.flow .flow__label code {
  text-transform: none;
  letter-spacing: 0;
}

.flow .flow__line {
  --line-h: var(--flow-link-h);
  position: relative;
  display: block;
  width: 2px;
  height: var(--line-h);
  background-color: var(--color-line-strong);
  background-repeat: no-repeat;
  background-size: 100% 14px;
  background-position: 0 -14px;
}

.flow .flow__line--half {
  --line-h: calc(var(--flow-link-h) / 2);
}

.flow .flow__line--arrow::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  border-inline: 5px solid transparent;
  border-top: 7px solid var(--color-line-strong);
  transform: translateX(-50%);
}

.flow .flow__merge,
.flow .flow__split {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-items: center;
}

.flow .flow__merge::before,
.flow .flow__split::before {
  content: "";
  position: absolute;
  top: calc(var(--flow-link-h) / 2 - 1px);
  right: calc(100% / 6);
  left: calc(100% / 6);
  height: 2px;
  background: var(--color-line-strong);
}

.flow .flow__merge-out {
  grid-column: 2;
  grid-row: 2;
}

.flow .flow__split-in {
  grid-column: 2;
  grid-row: 1;
}

.flow .flow__split-in::after {
  display: none;
}

.flow .flow__split> :nth-child(2) {
  grid-column: 1;
  grid-row: 2;
}

.flow .flow__split> :nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.flow .flow__split> :nth-child(4) {
  grid-column: 3;
  grid-row: 2;
}

.flow .flow__merge,
.flow .flow__split {
  margin-block: 0;
}

@media (max-width: 47.99rem) {
  .flow .flow__layer {
    padding: var(--space-4);
  }

  .flow .flow__row {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-3);
  }

  .flow .flow__bus-frame {
    margin-block: var(--space-2);
    overflow: hidden;
  }

  .flow .flow__bus {
    --bus-offset: 0.75rem;
    margin-block: 0;
    overflow: visible;
  }

  .flow .flow__bus-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 9px;
  }

  .flow .flow__bus-drop--in {
    margin-left: var(--bus-offset);
    transform: translateX(-3.5px);
  }

  .flow .flow__bus-drop--out {
    margin-right: var(--bus-offset);
    transform: translateX(3.5px);
  }

  .flow .flow__bus-line--v {
    height: 0.85rem;
  }

  .flow .flow__bus-track {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-left: var(--bus-offset);
    margin-right: var(--bus-offset);
    width: calc(100% - (var(--bus-offset) * 2));
    min-width: calc(100% - (var(--bus-offset) * 2));
    padding: 0.15rem 0;
  }

  .flow .flow__bus-seg {
    min-width: 0.75rem;
    height: 12px;
  }

  .flow .flow__bus-line--h {
    flex: 1 1 0;
    min-width: 2px;
    height: 2px;
  }

  .flow .flow__bus-chevron--right {
    width: 6px;
    height: 10px;
    margin-left: 1px;
  }

  .flow .flow__bus-chevron--down {
    width: 9px;
    height: 6px;
    margin-top: 1px;
  }

  .flow .flow__protocol {
    padding: 0.2rem 0.4rem;
    font-size: clamp(0.52rem, 2vw, 0.65rem);
    letter-spacing: 0.02em;
    margin-left: 0;
  }

  .flow .flow__card--wide {
    grid-template-columns: minmax(0, 1fr);
  }

  .flow .flow__merge::before,
  .flow .flow__split::before,
  .flow .flow__merge> :nth-child(-n + 3),
  .flow .flow__split-out {
    display: none;
  }

  .flow .flow__merge-out,
  .flow .flow__split-in {
    --line-h: 2.5rem;
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .flow .flow__split-in::after {
    display: block;
  }

  .flow .flow__merge,
  .flow .flow__split {
    margin-block: var(--space-3);
  }


}

@media (prefers-reduced-motion: no-preference) {
  .flow.is-in .flow__line {
    background-image: linear-gradient(var(--color-accent), var(--color-accent));
    animation: flow-pulse 2.4s var(--ease-standard) infinite;
    animation-delay: var(--pulse-delay, 0s);
  }

  .flow.is-in .flow__merge .flow__line {
    --pulse-delay: 0.4s;
  }

  .flow.is-in .flow__merge .flow__merge-out {
    --pulse-delay: 0.8s;
  }

  .flow.is-in .flow__split .flow__split-in {
    --pulse-delay: 1.2s;
  }

  .flow.is-in .flow__split .flow__split-out {
    --pulse-delay: 1.6s;
  }

  .flow.is-in .flow__bus-line--v {
    background-image: linear-gradient(var(--color-accent), var(--color-accent));
    background-repeat: no-repeat;
    background-size: 100% 14px;
    background-position: 0 -14px;
    animation: flow-pulse 2.2s var(--ease-standard) infinite;
  }

  .flow.is-in .flow__bus-drop--out .flow__bus-line--v {
    animation-delay: 1.2s;
  }

  .flow.is-in .flow__bus-line--h {
    background-image: linear-gradient(to right, var(--color-accent), var(--color-accent));
    background-repeat: no-repeat;
    background-size: 14px 100%;
    background-position: -14px 0;
    animation: flow-pulse-h 2.2s var(--ease-standard) infinite;
  }

  .flow.is-in .flow__bus-seg:nth-child(1) .flow__bus-line--h {
    animation-delay: 0.2s;
  }

  .flow.is-in .flow__bus-seg:nth-child(3) .flow__bus-line--h {
    animation-delay: 0.5s;
  }

  .flow.is-in .flow__bus-seg:nth-child(5) .flow__bus-line--h {
    animation-delay: 0.8s;
  }

  .flow.is-in .flow__bus-seg:nth-child(7) .flow__bus-line--h {
    animation-delay: 1.0s;
  }
}

@keyframes flow-pulse {
  0% {
    background-position: 0 -14px;
  }

  60%,
  100% {
    background-position: 0 var(--line-h);
  }
}

@keyframes flow-pulse-h {
  0% {
    background-position: -14px 0;
  }

  60%,
  100% {
    background-position: 100% 0;
  }
}

/* Workspace tree */
.tree {
  --stagger: 35ms;
  margin: 0;
  padding: var(--space-5);
  border: var(--border-width) solid var(--color-line);
  border-radius: var(--radius-panel);
  background: var(--color-surface);
  overflow-x: auto;
}

.tree .tree__root {
  margin-bottom: var(--space-2);
  max-width: none;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-accent);
}

.tree .tree__branch {
  display: block;
  margin: 0;
  padding: 0 0 0 var(--space-3);
  list-style: none;
}

.tree .tree__item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  column-gap: var(--space-4);
  padding: var(--space-2) 0 var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
}

.tree .tree__item--dir {
  display: block;
}

.tree .tree__item::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-left: var(--border-width) solid var(--color-line-strong);
}

.tree .tree__item:last-child::before {
  bottom: auto;
  height: calc(var(--space-2) + 0.65em);
}

.tree .tree__item::after {
  content: "";
  position: absolute;
  top: calc(var(--space-2) + 0.65em);
  left: 0;
  width: var(--space-4);
  border-top: var(--border-width) solid var(--color-line-strong);
}

.tree .tree__name {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  overflow-wrap: anywhere;
}

.tree .tree__item--dir>.tree__name {
  display: block;
  color: var(--color-accent);
  font-weight: var(--weight-semibold);
}

.tree .tree__item--dir>.tree__branch {
  margin-top: var(--space-1);
  padding-left: var(--space-3);
}

.tree .tree__note {
  color: var(--color-text-muted);
}

@media (max-width: 47.99rem) {
  .tree .tree__item {
    grid-template-columns: minmax(0, 1fr);
    row-gap: var(--space-1);
  }
}

/* Pipeline (DAG compile, execute, enforce) */
.prose .pipeline {
  --pipeline-gap: var(--space-6);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--pipeline-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pipeline__stage {
  padding: var(--space-5);
  gap: var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-panel);
}

.pipeline__stage:nth-child(1) {
  --flow-accent: var(--color-tier-1);
}

.pipeline__stage:nth-child(2) {
  --flow-accent: var(--color-tier-2);
}

.pipeline__stage:nth-child(3) {
  --flow-accent: var(--color-tier-3);
}

.prose .pipeline__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-stretch: var(--display-stretch);
  font-weight: var(--weight-display);
  line-height: var(--leading-snug);
}

.prose .pipeline__text {
  max-width: none;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* Connector between stages: vertical when stacked, horizontal when side by side */
.pipeline__stage:not(:last-child)::after,
.pipeline__stage:not(:last-child)::before {
  content: "";
  position: absolute;
  pointer-events: none;
}

.pipeline__stage:not(:last-child)::after {
  top: calc(100% + 4px);
  left: calc(var(--space-5) + 0.5rem);
  width: 2px;
  height: calc(var(--pipeline-gap) - 4px);
  background-color: var(--color-line-strong);
  background-repeat: no-repeat;
  background-size: 100% 14px;
  background-position: 0 -14px;
}

.pipeline__stage:not(:last-child)::before {
  top: calc(100% + var(--pipeline-gap) - 7px);
  left: calc(var(--space-5) + 0.5rem - 4px);
  border-inline: 5px solid transparent;
  border-top: 7px solid var(--color-line-strong);
}

@media (min-width: 64rem) {
  .prose .pipeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .pipeline__stage:not(:last-child)::after {
    top: 2.25rem;
    left: calc(100% + 1px);
    width: calc(var(--pipeline-gap) - 1px);
    height: 2px;
    background-size: 14px 100%;
    background-position: -14px 0;
  }

  .pipeline__stage:not(:last-child)::before {
    top: calc(2.25rem - 4px);
    left: calc(100% + var(--pipeline-gap) - 7px);
    border-inline: 0;
    border-block: 5px solid transparent;
    border-left: 7px solid var(--color-line-strong);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .pipeline.is-in .pipeline__stage:not(:last-child)::after {
    background-image: linear-gradient(var(--color-accent), var(--color-accent));
    animation: pipeline-pulse-y 2.2s var(--ease-standard) infinite;
  }

  .pipeline.is-in .pipeline__stage:nth-child(2)::after {
    animation-delay: 0.7s;
  }

  @media (min-width: 64rem) {
    .pipeline.is-in .pipeline__stage:not(:last-child)::after {
      animation-name: pipeline-pulse-x;
    }
  }
}

@keyframes pipeline-pulse-y {
  0% {
    background-position: 0 -14px;
  }

  60%,
  100% {
    background-position: 0 var(--pipeline-gap);
  }
}

@keyframes pipeline-pulse-x {
  0% {
    background-position: -14px 0;
  }

  60%,
  100% {
    background-position: var(--pipeline-gap) 0;
  }
}

/*
  motion.css
  One motion system. Page load runs a single orchestrated sequence (hero and
  logo). Below the fold, headers, lists and figures reveal once as they enter
  the viewport. Only opacity and transform animate. Everything is gated on
  prefers-reduced-motion, and content stays visible without JavaScript.
*/

:root {
  interpolate-size: allow-keywords;
}

@media (prefers-reduced-motion: no-preference) {

  /* Hero sequence */
  .hero__inner>* {
    animation: rise var(--duration-reveal) var(--ease-out) backwards;
  }

  .hero__inner> :nth-child(1) {
    animation-delay: 80ms;
  }

  .hero__inner> :nth-child(2) {
    animation-delay: 160ms;
  }

  .hero__inner> :nth-child(3) {
    animation-delay: 260ms;
  }

  .hero__inner> :nth-child(4) {
    animation-delay: 380ms;
  }

  /* Logo: the two halves slide together and lock */
  .site-nav .wordmark__half--spark {
    animation: mark-spark 800ms var(--ease-out) 100ms backwards;
  }

  .site-nav .wordmark__half--head {
    animation: mark-head 800ms var(--ease-out) 100ms backwards;
  }

  .site-nav .wordmark>span {
    animation: rise 600ms var(--ease-out) 350ms backwards;
  }

  /* Scroll reveal (once) */
  .js [data-reveal]:not(.is-in),
  .js [data-reveal-group]:not(.is-in) [data-reveal-item] {
    opacity: 0;
  }

  .js [data-reveal].is-in {
    animation: rise var(--duration-reveal) var(--ease-out) backwards;
  }

  .js [data-reveal-group].is-in [data-reveal-item] {
    animation: rise var(--duration-reveal) var(--ease-out) backwards;
    animation-delay: calc(var(--reveal-index, 0) * var(--stagger));
  }

  /* Feature accordion: height follows the content */
  .feature-group::details-content {
    block-size: 0;
    overflow: hidden;
    transition:
      block-size var(--duration-slow) var(--ease-standard),
      content-visibility var(--duration-slow) allow-discrete;
  }

  .feature-group[open]::details-content {
    block-size: auto;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(var(--reveal-distance));
  }
}

@keyframes mark-spark {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
}

@keyframes mark-head {
  from {
    opacity: 0;
    transform: translateX(6px);
  }
}

/* Accordion indicator turns from plus to cross */
.feature-group__count::after {
  content: " +";
  display: inline-block;
  transition: transform var(--duration-base) var(--ease-standard);
}

.feature-group[open] .feature-group__count::after {
  content: " +";
  transform: rotate(45deg);
}