@import url("https://fonts.googleapis.com/css2?family=Urbanist:wght@300;400;600;700&display=swap");

/*
 * Talos Foundation CSS
 *
 * Canonical brand-token and component foundation for Talos digital pages.
 * Implementation layer of Talos Brand Memory.
 * Organized in layers:
 *
 *   1. Tokens          — colors, typography, surfaces, borders, accents
 *   2. Base            — reset, body, page shell
 *   3. Typography      — semantic type roles
 *   4. Core            — panels, pills, chips, dots, green-line, tabs, legends, tooltips
 *   5. Content         — mastheads, masthead hero, key metrics (kpi-*), view headers, compare cards, footers
 *   6. Structured data — matrices, timelines, pipelines
 *   7. Diagrams        — architecture trees, process flows
 *   8. Responsive      — breakpoint overrides
 */


/* ==========================================================================
   1. Tokens
   ========================================================================== */

:root {
  /* Brand colors */
  --green: #22caad;
  --purple: #9258d7;
  --blue: #00bcd6;
  --orange: #f0a211;
  --red: #e15b53;
  --white: #ffffff;
  --light-grey: #f8f8f8;

  /* Neutral theme layer */
  --ink-base: #ffffff;
  --paper-base: #10121a;
  --paper-surface: #161923;
  --paper-surface-elevated: #1c2030;
  --paper-surface-glass: rgba(12, 15, 22, 0.88);

  --bg-page: var(--paper-base);
  --bg-surface: var(--paper-surface);
  --bg-surface-elevated: var(--paper-surface-elevated);
  --bg-surface-glass: var(--paper-surface-glass);

  --fg-primary: var(--ink-base);
  --fg-emphasis: color-mix(in srgb, var(--ink-base) 92%, transparent);
  --fg-secondary: color-mix(in srgb, var(--ink-base) 72%, transparent);
  --fg-muted: color-mix(in srgb, var(--ink-base) 50%, transparent);
  --fg-subtle: color-mix(in srgb, var(--ink-base) 25%, transparent);
  --fg-quiet: color-mix(in srgb, var(--ink-base) 18%, transparent);

  --border-default: color-mix(in srgb, var(--ink-base) 8%, transparent);
  --border-stronger: color-mix(in srgb, var(--ink-base) 14%, transparent);
  --border-ui: color-mix(in srgb, var(--ink-base) 28%, transparent);
  --ambient-dim: color-mix(in srgb, var(--ink-base) 14%, transparent);
  --grid-line-default: color-mix(in srgb, var(--ink-base) 8%, transparent);

  --surface-soft-fill: rgba(255, 255, 255, 0.03);
  --surface-soft-fill-strong: rgba(255, 255, 255, 0.05);
  --surface-soft-fill-stronger: rgba(255, 255, 255, 0.07);
  --surface-row-alt: rgba(255, 255, 255, 0.012);
  --surface-inset-line: rgba(0, 0, 0, 0.3);
  --surface-contrast-stroke: rgba(255, 255, 255, 0.08);
  --surface-sheen-soft: rgba(255, 255, 255, 0.04);
  --surface-sheen-strong: rgba(255, 255, 255, 0.18);
  --surface-sheen-tail: rgba(255, 255, 255, 0.05);
  --surface-sheen-blend: screen;

  --shadow-soft: 0 18px 60px rgba(0, 0, 0, 0.3);
  --shadow-hover-strong: 0 22px 56px rgba(0, 0, 0, 0.4);
  --shadow-floating: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-branch-hover: 0 10px 24px rgba(0, 0, 0, 0.18);
  --shadow-branch-open: 0 14px 34px rgba(0, 0, 0, 0.22);

  --masthead-hero-overlay-default: linear-gradient(
    105deg,
    rgba(16, 18, 26, 0.97) 0%,
    rgba(16, 18, 26, 0.94) 18%,
    rgba(16, 18, 26, 0.82) 38%,
    rgba(16, 18, 26, 0.5) 58%,
    rgba(16, 18, 26, 0.18) 82%,
    rgba(16, 18, 26, 0.05) 100%
  );
  --masthead-hero-image-shadow: 0 1px 2px rgba(0, 0, 0, 0.65), 0 4px 24px rgba(0, 0, 0, 0.45);

  --footer-mark-bg: transparent;
  --footer-mark-border: transparent;
  --theme-toggle-track: color-mix(in srgb, var(--bg-surface-elevated) 92%, transparent);
  --theme-toggle-hover: var(--surface-soft-fill);
  --theme-toggle-label: var(--fg-subtle);

  /* Typography */
  --font-base: "Urbanist", sans-serif;
  --fw-light: 300;
  --fw-regular: 400;
  --fw-semibold: 600;
  --fw-bold: 700;

  --fs-caption: 10px;
  --fs-meta: 10px;
  --fs-label: 12px;
  --fs-body-sm: 12px;
  --fs-body: 14px;
  --fs-title-sm: 16px;
  --fs-title: 24px;
  --fs-metric: 20px;
  --fs-display: 32px;

  --lh-tight: 1.2;
  --lh-label: 1.35;
  --lh-body: 1.6;
  --lh-loose: 1.7;

  --ls-title: -0.015em;
  --ls-metric: -0.02em;
  --ls-display: -0.03em;
  --ls-label: 0.08em;
  --ls-eyebrow: 0.12em;
  --ls-eyebrow-wide: 0.16em;

  /* Radius scale — near-square UI corner language.
     Near-square (--radius-hairline / --radius-sm) is the default for panels, cards, chips,
     inputs, and most surfaces. --radius-pill (999px) is only for pills/chips/dots;
     --radius-round (50%) is for dots/avatars. New work references these tokens;
     the raw per-component literals elsewhere in this file (incl. two legacy 20px outliers)
     are legacy and outside the scale. */
  --radius-none: 0;
  --radius-hairline: 1px;
  --radius-sm: 3px;
  --radius-round: 50%;
  --radius-pill: 999px;

  /* Spacing rhythm — semantic tokens mirroring talos-brand-rules.md (Density and Whitespace).
     New work references these tokens; existing per-rule literals are legacy. */
  --panel-pad-block: 18px;
  --panel-pad-inline: 20px;
  --panel-head-pad-block: 11px;
  --panel-head-pad-inline: 18px;
  --grid-gap: 16px;
  --compare-gap: 12px;
  --section-gap: 28px;

  /* Digital lockup height (utility + footer logo lockups) */
  --lockup-height: 18px;

  /* Legacy neutral aliases */
  --black: var(--bg-page);
  --surface: var(--bg-surface);
  --surface2: var(--bg-surface-elevated);
  --surface3: var(--bg-surface-glass);
  --w25: var(--fg-subtle);
  --w50: var(--fg-muted);
  --w72: var(--fg-secondary);
  --w92: var(--fg-emphasis);
  --w100: var(--fg-primary);
  --border: var(--border-default);
  --border-strong: var(--border-stronger);
  --dim: var(--ambient-dim);
  --grid-line: var(--grid-line-default);

  /* Accent tints (low-opacity backgrounds) */
  --green-bg: color-mix(in srgb, var(--green) 12%, transparent);
  --blue-bg: color-mix(in srgb, var(--blue) 12%, transparent);
  --purple-bg: color-mix(in srgb, var(--purple) 12%, transparent);
  --orange-bg: color-mix(in srgb, var(--orange) 12%, transparent);
  --red-bg: color-mix(in srgb, var(--red) 12%, transparent);

  /* Accent borders (medium-opacity) */
  --green-border: color-mix(in srgb, var(--green) 30%, transparent);
  --blue-border: color-mix(in srgb, var(--blue) 30%, transparent);
  --purple-border: color-mix(in srgb, var(--purple) 30%, transparent);
  --orange-border: color-mix(in srgb, var(--orange) 30%, transparent);
  --red-border: color-mix(in srgb, var(--red) 30%, transparent);

  /* Readable accent text roles */
  --green-text: var(--green);
  --blue-text: var(--blue);
  --purple-text: var(--purple);
  --orange-text: var(--orange);
  --red-text: var(--red);

  /* Masthead hero (optional overrides per instance) */
  --masthead-hero-min-height: 280px;
  --masthead-hero-padding-block: 28px;
  --masthead-hero-padding-inline: 24px;
  /* Text + green-line column; remainder reserved for imagery or empty band */
  --masthead-hero-copy-width: 50%;

  /* Standalone data-viz layer bridge */
  --chart-shell-bg: var(--bg-surface);
  --chart-shell-bg-elevated: var(--bg-surface-elevated);
  --chart-shell-border: var(--border-default);
  --chart-axis-text: var(--fg-subtle);
  --chart-axis-stroke: var(--border-default);
  --chart-grid-stroke: var(--grid-line-default);
  --chart-caption-text: var(--fg-muted);
  --chart-focus-outline: var(--border-ui);
  --chart-selection-dim: 0.34;
  --chart-loading-fill: var(--surface-soft-fill-strong);
  --chart-loading-shimmer: var(--surface-sheen-strong);
  --chart-loading-tail: var(--surface-sheen-tail);
}

html[data-theme="light"] {
  --ink-base: #171b24;
  --paper-base: #f5f1ea;
  --paper-surface: #fdfaf5;
  --paper-surface-elevated: #f1ebe3;
  --paper-surface-glass: rgba(250, 246, 239, 0.88);

  --fg-emphasis: color-mix(in srgb, var(--ink-base) 92%, transparent);
  --fg-secondary: color-mix(in srgb, var(--ink-base) 76%, transparent);
  --fg-muted: color-mix(in srgb, var(--ink-base) 68%, transparent);
  --fg-subtle: color-mix(in srgb, var(--ink-base) 62%, transparent);
  --fg-quiet: color-mix(in srgb, var(--ink-base) 40%, transparent);

  --border-default: color-mix(in srgb, var(--ink-base) 14%, transparent);
  --border-stronger: color-mix(in srgb, var(--ink-base) 30%, transparent);
  --border-ui: color-mix(in srgb, var(--ink-base) 50%, transparent);
  --ambient-dim: color-mix(in srgb, var(--ink-base) 10%, transparent);
  --grid-line-default: color-mix(in srgb, var(--ink-base) 14%, transparent);

  --surface-soft-fill: color-mix(in srgb, var(--ink-base) 3%, transparent);
  --surface-soft-fill-strong: color-mix(in srgb, var(--ink-base) 5%, transparent);
  --surface-soft-fill-stronger: color-mix(in srgb, var(--ink-base) 7%, transparent);
  --surface-row-alt: color-mix(in srgb, var(--ink-base) 1.8%, transparent);
  --surface-inset-line: color-mix(in srgb, var(--ink-base) 10%, transparent);
  --surface-contrast-stroke: color-mix(in srgb, var(--ink-base) 12%, transparent);
  --surface-sheen-soft: color-mix(in srgb, var(--ink-base) 4%, transparent);
  --surface-sheen-strong: color-mix(in srgb, var(--ink-base) 14%, transparent);
  --surface-sheen-tail: color-mix(in srgb, var(--ink-base) 5%, transparent);
  --surface-sheen-blend: multiply;

  --shadow-soft: 0 18px 52px rgba(16, 18, 26, 0.08);
  --shadow-hover-strong: 0 24px 44px rgba(16, 18, 26, 0.12);
  --shadow-floating: 0 12px 28px rgba(16, 18, 26, 0.12);
  --shadow-branch-hover: 0 12px 26px rgba(16, 18, 26, 0.1);
  --shadow-branch-open: 0 16px 34px rgba(16, 18, 26, 0.12);

  --masthead-hero-overlay-default: linear-gradient(
    105deg,
    rgba(247, 242, 233, 0.98) 0%,
    rgba(247, 242, 233, 0.94) 18%,
    rgba(247, 242, 233, 0.82) 38%,
    rgba(247, 242, 233, 0.54) 58%,
    rgba(247, 242, 233, 0.2) 82%,
    rgba(247, 242, 233, 0.05) 100%
  );
  --masthead-hero-image-shadow: 0 1px 0 rgba(255, 255, 255, 0.65), 0 6px 20px rgba(255, 255, 255, 0.4);

  --footer-mark-bg: transparent;
  --footer-mark-border: transparent;
  --theme-toggle-track: color-mix(in srgb, var(--ink-base) 4%, transparent);
  --theme-toggle-hover: color-mix(in srgb, var(--ink-base) 5%, transparent);
  --theme-toggle-label: var(--fg-muted);

  --green-bg: color-mix(in srgb, var(--green) 12%, white 88%);
  --blue-bg: color-mix(in srgb, var(--blue) 12%, white 88%);
  --purple-bg: color-mix(in srgb, var(--purple) 12%, white 88%);
  --orange-bg: color-mix(in srgb, var(--orange) 12%, white 88%);
  --red-bg: color-mix(in srgb, var(--red) 12%, white 88%);

  --green-border: color-mix(in srgb, var(--green) 30%, white 70%);
  --blue-border: color-mix(in srgb, var(--blue) 30%, white 70%);
  --purple-border: color-mix(in srgb, var(--purple) 30%, white 70%);
  --orange-border: color-mix(in srgb, var(--orange) 30%, white 70%);
  --red-border: color-mix(in srgb, var(--red) 30%, white 70%);

  --green-text: color-mix(in srgb, var(--green) 55%, var(--ink-base));
  --blue-text: color-mix(in srgb, var(--blue) 55%, var(--ink-base));
  --purple-text: color-mix(in srgb, var(--purple) 75%, var(--ink-base));
  --orange-text: color-mix(in srgb, var(--orange) 55%, var(--ink-base));
  --red-text: color-mix(in srgb, var(--red) 70%, var(--ink-base));

  --chart-focus-outline: var(--border-ui);
}

html {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}


/* ==========================================================================
   2. Base
   ========================================================================== */

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

body {
  font-family: var(--font-base);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  background: var(--black);
  color: var(--w100);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding: 36px 24px 48px;
}

.wrap {
  max-width: 980px;
  margin: 0 auto;
}


/* ==========================================================================
   3. Typography — semantic type roles
   ========================================================================== */

.type-eyebrow {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
}

.type-meta {
  font-size: var(--fs-meta);
  font-weight: var(--fw-regular);
  line-height: var(--lh-label);
}

.type-label {
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}

.type-body-sm {
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body);
}

.type-body {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.type-title-sm {
  font-size: var(--fs-title-sm);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
}

.type-title {
  font-size: var(--fs-title);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-title);
}

.type-metric {
  font-size: var(--fs-metric);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-metric);
}

.type-display {
  font-size: var(--fs-display);
  font-weight: var(--fw-light);
  letter-spacing: var(--ls-display);
}

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


/* ==========================================================================
   4. Core — panels, pills, chips, dots, green-line, tabs, legends, tooltips
   ========================================================================== */

/* --- Panels --- */

/* .panel provides surface + border only. Inset content with .panel-body, .panel-inset, or
   header/footer regions — not padding on .panel itself (see components.md). */

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.panel-glass {
  border: 1px solid var(--border);
  background: var(--surface3);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.panel-header {
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.panel-title {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--w25);
}

.panel-meta {
  font-size: var(--fs-meta);
  line-height: var(--lh-label);
  color: var(--w25);
  text-align: right;
}

.panel-body {
  padding: 18px 20px;
}

/* Headerless panels (chart shells, scope blocks, loading → success regions). Same inset as .panel-body. */
.panel-inset {
  padding: 18px 20px;
}

.panel-footer {
  padding: 9px 20px;
  border-top: 1px solid var(--border);
  font-size: var(--fs-meta);
  color: var(--w50);
  line-height: var(--lh-loose);
}

.panel-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-grid-two {
  grid-template-columns: 1fr 1fr;
}

.panel-grid-three {
  grid-template-columns: repeat(3, 1fr);
}

/* --- Key metrics / numbers overview (kit: .panel.kpi-card + .kpi-* — see components.md) --- */

.kpi-value {
  font-size: var(--fs-display);
  font-weight: var(--fw-light);
  line-height: 1;
  letter-spacing: var(--ls-display);
  color: var(--kpi-accent-text, var(--green-text));
  margin-bottom: 10px;
}

.kpi-label {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--w25);
  margin-bottom: 4px;
}

.kpi-copy {
  font-size: var(--fs-body-sm);
  color: var(--w50);
  line-height: var(--lh-body);
}

.panel.kpi-card {
  --kpi-accent: var(--green);
  --kpi-accent-text: var(--green-text);
  --kpi-hover-accent: var(--green);
  --kpi-hover-accent: var(--kpi-accent);
  padding: 20px;
  cursor: default;
  transition:
    transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 0.45s ease;
}

@media (hover: hover) and (pointer: fine) {
  .panel.kpi-card:hover {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--kpi-hover-accent) 42%, var(--border));
    box-shadow:
      var(--shadow-hover-strong),
      0 0 0 1px color-mix(in srgb, var(--kpi-hover-accent) 30%, transparent),
      0 0 36px -6px color-mix(in srgb, var(--kpi-hover-accent) 28%, transparent);
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel.kpi-card {
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
  }

  @media (hover: hover) and (pointer: fine) {
    .panel.kpi-card:hover {
      transform: none;
      box-shadow:
        0 0 0 1px color-mix(in srgb, var(--kpi-hover-accent) 22%, transparent),
        var(--shadow-soft);
    }
  }
}

/* --- Green line accent --- */

.green-line {
  width: 2px;
  align-self: stretch;
  background: var(--green);
  border-radius: 1px;
  flex-shrink: 0;
}

.green-line-glow {
  width: 2px;
  background: var(--green);
  border-radius: 1px;
  box-shadow: 0 0 24px color-mix(in srgb, var(--green) 45%, transparent);
}

/* --- Pills (compact, squared corners) --- */

.pill {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 3px;
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  line-height: 18px;
}

.pill-green {
  background: var(--green-bg);
  color: var(--green-text);
  border: 1px solid var(--green-border);
}

.pill-blue {
  background: var(--blue-bg);
  color: var(--blue-text);
  border: 1px solid var(--blue-border);
}

.pill-purple {
  background: var(--purple-bg);
  color: var(--purple-text);
  border: 1px solid var(--purple-border);
}

.pill-orange {
  background: var(--orange-bg);
  color: var(--orange-text);
  border: 1px solid var(--orange-border);
}

.pill-red {
  background: var(--red-bg);
  color: var(--red-text);
  border: 1px solid var(--red-border);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 22px;
}

/* --- Status chips (rounded, semantic) --- */

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}

.status-chip-positive {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green-text);
}

.status-chip-info {
  background: var(--blue-bg);
  border-color: var(--blue-border);
  color: var(--blue-text);
}

.status-chip-warning {
  background: var(--orange-bg);
  border-color: var(--orange-border);
  color: var(--orange-text);
}

.status-chip-negative {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: var(--red-text);
}

.status-chip-neutral {
  background: var(--surface-soft-fill-strong);
  border-color: var(--border);
  color: var(--w25);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

/* --- Theme toggle --- */

.utility-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.utility-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  text-decoration: none;
  flex-shrink: 0;
}

.utility-brand:focus-visible {
  outline: 2px solid var(--w100);
  outline-offset: 2px;
}

.utility-logo {
  display: block;
  width: auto;
  height: 18px;
  max-width: min(208px, 42vw);
}

.utility-logo-light {
  display: none;
}

.utility-logo-dark {
  display: block;
}

html[data-theme="light"] .utility-logo-dark {
  display: none;
}

html[data-theme="light"] .utility-logo-light {
  display: block;
}

.theme-toggle-group {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--border-ui);
  background: var(--theme-toggle-track);
  flex-shrink: 0;
}

.theme-toggle-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--w50);
  font-family: var(--font-base);
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  padding: 8px 12px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.theme-toggle-button:hover {
  background: var(--theme-toggle-hover);
  color: var(--w72);
}

.theme-toggle-button:focus-visible {
  outline: 2px solid var(--w100);
  outline-offset: 1px;
}

.theme-toggle-button.is-active,
.theme-toggle-button[aria-pressed="true"] {
  background: var(--green-bg);
  color: var(--green-text);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 20%, transparent);
}

/* --- Status dots --- */

.status-dot {
  display: inline-flex;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--surface2);
}

.status-dot-positive {
  border-color: var(--green);
  background: var(--green-bg);
}

.status-dot-info {
  border-color: var(--blue);
  background: var(--blue-bg);
}

.status-dot-warning {
  border-color: var(--orange);
  background: var(--orange-bg);
}

.status-dot-negative {
  border-color: var(--red);
  background: var(--red-bg);
}

/* --- Tabs --- */

.tabs {
  display: flex;
  gap: 1px;
  margin-bottom: 20px;
  background: var(--border);
  border: 1px solid var(--border);
  overflow: hidden;
}

.tabs-button {
  flex: 1;
  padding: 12px 16px;
  cursor: pointer;
  background: var(--surface);
  border: none;
  font-family: var(--font-base);
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--w25);
  transition: all 0.18s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: var(--lh-label);
}

.tabs-button svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabs-button:hover {
  background: var(--surface-soft-fill);
  color: var(--w50);
}

html[data-theme="light"] .tabs-button {
  color: var(--w92);
}

html[data-theme="light"] .tabs-button:hover {
  color: var(--w100);
}

.tabs-button:focus-visible {
  outline: 2px solid var(--w100);
  outline-offset: -2px;
  position: relative;
  z-index: 1;
}

.tabs-button.is-active,
.tabs-button[aria-selected="true"] {
  background: var(--green-bg);
  color: var(--green-text);
  border-bottom: 2px solid var(--green-text);
}

.deck-tabs.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 20px;
  position: sticky;
  top: 10px;
  z-index: 8;
  border: 1px solid var(--deck-tabs-border, color-mix(in srgb, var(--ink-base) 8%, transparent));
  background: var(--deck-tabs-background, color-mix(in srgb, var(--ink-base) 8%, transparent));
  box-shadow: var(--deck-tabs-shadow, none);
  overflow: visible;
}

.deck-tabs .tabs-button {
  min-height: var(--deck-tabs-min-height, 60px);
  padding: var(--deck-tabs-padding, 12px 14px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: var(--deck-tabs-gap, 5px);
  text-align: left;
  line-height: var(--lh-label);
  background: var(--deck-tabs-button-background, color-mix(in srgb, var(--surface2) 95%, transparent));
  color: var(--deck-tabs-button-color, var(--w50));
  box-shadow: var(--deck-tabs-button-shadow, none);
}

.deck-tabs .tabs-button:hover {
  background: var(--deck-tabs-button-hover-background, color-mix(in srgb, var(--ink-base) 4%, var(--surface2)));
  color: var(--deck-tabs-button-hover-color, var(--w72));
  box-shadow: var(--deck-tabs-button-hover-shadow, inset 0 0 0 1px color-mix(in srgb, var(--ink-base) 8%, transparent));
  transform: translateY(-1px);
}

.deck-tabs .tabs-button.is-active,
.deck-tabs .tabs-button[aria-selected="true"] {
  background: var(--deck-tabs-active-background,
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--deck-tabs-accent, var(--green)) 10%, transparent) 0%, transparent 44%),
    linear-gradient(180deg, color-mix(in srgb, var(--green-bg) 56%, var(--surface2)) 0%, var(--surface2) 100%)
  );
  color: var(--deck-tabs-active-color, var(--w100));
  border-bottom: none;
  box-shadow: var(--deck-tabs-active-shadow, inset 0 0 0 1px var(--green-border));
}

.deck-tabs .tabs-button.is-active:hover,
.deck-tabs .tabs-button[aria-selected="true"]:hover {
  transform: none;
}

.deck-tabs .tabs-button:focus-visible {
  outline: 1px solid var(--deck-tabs-focus, var(--green));
  outline-offset: -1px;
}

html[data-theme="light"] .deck-tabs.tabs {
  border-color: var(--deck-tabs-light-border, var(--border));
  background: var(--deck-tabs-light-background, var(--border));
}

html[data-theme="light"] .deck-tabs .tabs-button {
  background: var(--deck-tabs-light-button-background, var(--surface));
  color: var(--deck-tabs-light-button-color, var(--w92));
  box-shadow: var(--deck-tabs-light-button-shadow, none);
}

html[data-theme="light"] .deck-tabs .tabs-button:hover {
  background: var(--deck-tabs-light-button-hover-background, var(--surface-soft-fill));
  color: var(--deck-tabs-light-button-hover-color, var(--w100));
  box-shadow: var(--deck-tabs-light-button-hover-shadow, inset 0 0 0 1px var(--border-ui));
}

html[data-theme="light"] .deck-tabs .tabs-button.is-active,
html[data-theme="light"] .deck-tabs .tabs-button[aria-selected="true"] {
  background: var(--deck-tabs-light-active-background,
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--deck-tabs-accent, var(--green)) 8%, transparent) 0%, transparent 44%),
    linear-gradient(180deg, color-mix(in srgb, var(--deck-tabs-accent, var(--green)) 10%, var(--surface)) 0%, var(--surface) 100%)
  );
  color: var(--deck-tabs-accent-text, var(--green-text));
  box-shadow: var(--deck-tabs-light-active-shadow,
    inset 0 0 0 1px color-mix(in srgb, var(--deck-tabs-accent, var(--green)) 24%, transparent),
    inset 0 -2px 0 0 color-mix(in srgb, var(--deck-tabs-accent, var(--green)) 42%, transparent)
  );
}

.tab-index {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--w25);
}

.deck-tabs .tabs-button.is-active .tab-index,
.deck-tabs .tabs-button[aria-selected="true"] .tab-index {
  color: var(--deck-tabs-active-index-color, var(--green-text));
}

html[data-theme="light"] .deck-tabs .tabs-button.is-active .tab-index,
html[data-theme="light"] .deck-tabs .tabs-button[aria-selected="true"] .tab-index {
  color: var(--deck-tabs-accent-text, var(--green-text));
}

.tab-copy {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-label);
  letter-spacing: 0;
}

.tabs-panel {
  display: none;
}

.tabs-panel.is-active {
  display: block;
}

.tabs-panel[hidden] {
  display: none;
}

/* --- Legends --- */

.legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}

.legend-note {
  margin-left: auto;
  font-size: var(--fs-meta);
  line-height: var(--lh-label);
  color: var(--w25);
}

.legend-swatch-line {
  width: 26px;
  height: 3px;
  border-radius: 1px;
}

.legend-swatch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid;
}

/* --- Tooltip shell --- */

.tooltip-shell {
  position: fixed;
  pointer-events: none;
  background: var(--surface2);
  padding: 13px 15px;
  min-width: 220px;
  max-width: 340px;
  border: 1px solid var(--border-ui);
  box-shadow: var(--shadow-floating);
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 999;
  font-family: var(--font-base);
}

.tooltip-shell.is-visible {
  opacity: 1;
}

.tooltip-title {
  font-size: var(--fs-title-sm);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  margin-bottom: 2px;
}

.tooltip-meta {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--w25);
  margin-bottom: 7px;
}

.tooltip-divider {
  height: 1px;
  background: var(--surface-soft-fill-stronger);
  margin: 8px 0;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.tooltip-key {
  font-size: var(--fs-caption);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--w50);
}

.tooltip-value {
  font-size: var(--fs-body-sm);
  line-height: var(--lh-body);
  color: var(--w100);
  text-align: right;
  max-width: 150px;
}

.tooltip-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}


/* ==========================================================================
   5. Content — mastheads, headers, cards, fact lists, notes, footers
   ========================================================================== */

/* --- Masthead --- */

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
  position: relative;
  flex-wrap: wrap;
  gap: 16px;
}

.masthead-left {
  display: flex;
  gap: 14px;
  align-items: stretch;
}

.label-tag {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-eyebrow-wide);
  text-transform: uppercase;
  color: var(--green-text);
  margin-bottom: 7px;
}

/* Editorial stream: add one class to .masthead / .masthead-hero; pre-heading + bar share --stream-accent */
.stream-knowledge {
  --stream-accent: var(--orange);
  --stream-accent-text: var(--orange-text);
}
.stream-product,
.stream-news {
  --stream-accent: var(--red);
  --stream-accent-text: var(--red-text);
}
.stream-analysis {
  --stream-accent: var(--green);
  --stream-accent-text: var(--green-text);
}
.stream-case-study {
  --stream-accent: var(--purple);
  --stream-accent-text: var(--purple-text);
}

.stream-knowledge .label-tag,
.stream-product .label-tag,
.stream-news .label-tag,
.stream-analysis .label-tag,
.stream-case-study .label-tag {
  color: var(--stream-accent-text);
}

.stream-knowledge .green-line,
.stream-product .green-line,
.stream-news .green-line,
.stream-analysis .green-line,
.stream-case-study .green-line {
  background: var(--stream-accent);
}

h1 {
  font-size: var(--fs-title);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-title);
  margin: 0;
}

.subtitle {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--w50);
  margin-top: 10px;
}

/* --- Masthead hero (card-style band; optional full-bleed background image) --- */

.masthead-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--masthead-hero-min-height);
  margin-bottom: 28px;
  padding: var(--masthead-hero-padding-block) var(--masthead-hero-padding-inline);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.masthead-hero-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-height: calc(
    var(--masthead-hero-min-height) - 2 * var(--masthead-hero-padding-block)
  );
}

/* Solid card (no image): content-driven height when the default band would leave dead space */
.masthead-hero:not(.masthead-hero--image) {
  min-height: 0;
}

.masthead-hero:not(.masthead-hero--image) .masthead-hero-inner {
  min-height: 0;
}

.masthead-hero:not(.masthead-hero--image) .subtitle {
  margin: 0;
}

/* masthead-left height = content only so .green-line stretch matches label + title + subtitle */
.masthead-hero .masthead-left {
  display: flex;
  align-items: stretch;
  gap: 14px;
  width: var(--masthead-hero-copy-width);
  max-width: 100%;
  flex-shrink: 0;
}

.masthead-hero .masthead-left > div:last-child {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.masthead-hero .subtitle {
  max-width: 42em;
}

/*
 * Image hero: .masthead-hero-media + .masthead-hero-tint + .masthead-hero-inner (see components.md
 * + talos-brand-rules.md). Tint + text-shadow are required for legibility; do not omit .masthead-hero-tint.
 */
.masthead-hero.masthead-hero--image {
  background-color: var(--surface);
}

.masthead-hero--image .masthead-hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: var(--surface);
  background-image: var(--masthead-hero-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.masthead-hero--image .masthead-hero-tint {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--masthead-hero-overlay, var(--masthead-hero-overlay-default));
}

/* Extra legibility on photo heroes (gradient is primary; shadow is a light safety net) */
.masthead-hero--image .masthead-hero-inner .label-tag,
.masthead-hero--image .masthead-hero-inner h1,
.masthead-hero--image .masthead-hero-inner .subtitle {
  text-shadow: var(--masthead-hero-image-shadow);
}

/* --- View header --- */

.view-hdr {
  margin-bottom: 18px;
}

.view-hdr h2 {
  font-size: var(--fs-title);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-title);
  margin: 0 0 5px;
}

.view-hdr p {
  font-size: var(--fs-body);
  color: var(--w50);
  line-height: var(--lh-loose);
  max-width: 720px;
  margin: 0;
}

.section-gap {
  margin-bottom: 16px;
}

/* --- Compare cards --- */

.compare-grid {
  display: grid;
  gap: 12px;
}

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

.compare-grid-three {
  grid-template-columns: repeat(3, 1fr);
}

.compare-card {
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.compare-card-header {
  padding: 12px 15px 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid var(--border);
}

.compare-card-header > .pill,
.compare-card-header > .chart-maturity {
  align-self: flex-start;
}

.compare-card-header h1,
.compare-card-header h2,
.compare-card-header h3,
.compare-card-header h4,
.compare-card-header h5,
.compare-card-header h6,
.compare-card-header p {
  margin: 0;
}

.compare-card-title {
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-label);
}

.compare-card-subtitle {
  font-size: var(--fs-meta);
  color: var(--w25);
  line-height: var(--lh-label);
}

.compare-card-body {
  padding: 14px 16px;
}

.compare-card-footer {
  margin-top: auto;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: var(--fs-meta);
  color: var(--w50);
  line-height: var(--lh-label);
}

/* --- Fact list --- */

.factlist {
  display: flex;
  flex-direction: column;
}

.factlist-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  gap: 10px;
}

.factlist-key {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--w50);
  padding-top: 2px;
  line-height: var(--lh-label);
}

.factlist-value {
  font-size: var(--fs-body-sm);
  color: var(--w50);
  line-height: var(--lh-body);
}

/* --- Support note --- */

.support-note {
  margin: 16px 0 20px;
  padding: 11px 18px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.support-note-label {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--w25);
  margin-bottom: 5px;
}

.support-note p {
  margin: 0;
  font-size: var(--fs-body-sm);
  color: var(--w50);
  line-height: var(--lh-loose);
}

.support-note strong {
  color: var(--w100);
}

/* --- Footer --- */

.footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}

.footer-brand a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid var(--footer-mark-border);
  background: var(--footer-mark-bg);
}

a.footer-brand-link-local {
  padding: 0;
  border: 0;
  background: transparent;
}

.footer-brand img {
  display: block;
}

.footer-brand-link-local .utility-logo-light {
  display: none;
}

.footer-brand-link-local .utility-logo-dark {
  display: block;
}

html[data-theme="light"] .footer-brand-link-local .utility-logo-dark {
  display: none;
}

html[data-theme="light"] .footer-brand-link-local .utility-logo-light {
  display: block;
}

.footer-brand-name {
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-label);
  color: var(--w25);
  letter-spacing: var(--ls-label);
}

.footer-note {
  font-size: var(--fs-meta);
  line-height: var(--lh-label);
  color: var(--w50);
}


/* ==========================================================================
   6. Structured data — matrices, timelines, pipelines
   ========================================================================== */

/* --- Matrix --- */

.matrix {
  border: 1px solid var(--border);
  overflow: hidden;
}

.matrix-header {
  background: var(--surface);
  padding: 11px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.matrix-title {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--w25);
}

.matrix-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.matrix-scroll {
  overflow-x: auto;
  background: var(--bg-page);
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.matrix-table thead tr {
  border-bottom: 1px solid var(--border);
}

.matrix-row-header {
  text-align: left;
  padding: 10px 20px;
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--w25);
  width: 190px;
}

.matrix-col-header {
  text-align: center;
  padding: 10px 8px;
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-label);
  color: var(--w25);
}

.matrix-table tbody tr {
  border-bottom: 1px solid var(--border);
}

.matrix-table tbody tr:nth-child(even) {
  background: var(--surface-row-alt);
}

.matrix-label-cell {
  padding: 9px 20px;
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--w50);
}

.matrix-state-cell {
  text-align: center;
  padding: 9px 8px;
}

.matrix-footnote {
  background: var(--surface);
  padding: 9px 20px;
  border-top: 1px solid var(--border);
  font-size: var(--fs-meta);
  color: var(--w50);
  line-height: var(--lh-loose);
}

/* --- Timeline --- */

.timeline {
  position: relative;
}

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

.timeline-track {
  position: relative;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-start;
}

.timeline-track::before {
  content: "";
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}

.timeline-event {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid var(--border-strong);
  background: var(--surface2);
}

.timeline-stem {
  width: 1px;
  height: 14px;
  background: var(--border);
}

.timeline-card {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 12px 14px;
  margin-top: 12px;
}

.timeline-date {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--w25);
  margin-bottom: 6px;
}

.timeline-title {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-body);
  color: var(--w100);
  margin-bottom: 4px;
}

.timeline-copy {
  font-size: var(--fs-body-sm);
  color: var(--w50);
  line-height: var(--lh-body);
}

/* --- Pipeline (usage: components.md, talos-brand-rules.md — pipeline-segment-current + semantic class) --- */

.pipeline {
  display: flex;
  flex-direction: column;
}

.pipeline-row {
  display: grid;
  grid-template-columns: 152px 1fr;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.pipeline-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.pipeline-name {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-label);
  text-align: right;
}

.pipeline-badge {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 20px;
  border: 1px solid;
  white-space: nowrap;
}

.pipeline-bar {
  display: flex;
  height: 42px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-soft-fill);
}

.pipeline-segment {
  position: relative;
  isolation: isolate;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border-right: 1px solid var(--surface-inset-line);
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  text-align: center;
  transition: opacity 0.2s;
  overflow: hidden;
}

.pipeline-segment-positive {
  background: var(--green-bg);
  color: var(--green-text);
}

.pipeline-segment-warning {
  background: var(--orange-bg);
  color: var(--orange-text);
}

.pipeline-segment-negative {
  background: var(--red-bg);
  color: var(--red-text);
}

/* Current segment: match reference index.html pipe-glow + pipe-sheen (transform sweep, not left) */
@keyframes pipeline-seg-glow {
  0%,
  100% {
    box-shadow:
      inset 0 0 0 0 var(--surface-soft-fill),
      0 0 0 0 color-mix(in srgb, currentColor 0%, transparent);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px var(--surface-contrast-stroke),
      0 0 10px 2px color-mix(in srgb, currentColor 24%, transparent);
  }
}

@keyframes pipeline-seg-sheen {
  0% {
    transform: translateX(-140%) skewX(-18deg);
    opacity: 0;
  }
  28% {
    opacity: 0.06;
  }
  52% {
    opacity: 0.18;
  }
  100% {
    transform: translateX(220%) skewX(-18deg);
    opacity: 0;
  }
}

.pipeline-segment-current {
  animation: pipeline-seg-glow 3.2s ease-in-out infinite;
}

/* Sheen band: flush to segment top/bottom so it aligns with the cell; clipped by .pipeline-segment overflow */
.pipeline-segment-current::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 34%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--surface-sheen-soft) 18%,
    var(--surface-sheen-strong) 50%,
    var(--surface-sheen-tail) 82%,
    transparent 100%
  );
  mix-blend-mode: var(--surface-sheen-blend);
  pointer-events: none;
  animation: pipeline-seg-sheen 3.2s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .pipeline-segment-current {
    animation: none;
    box-shadow:
      inset 0 0 0 1px var(--surface-contrast-stroke),
      0 0 6px 1px color-mix(in srgb, currentColor 18%, transparent);
  }

  .pipeline-segment-current::after {
    animation: none;
    opacity: 0;
  }
}


/* ==========================================================================
   7. Diagrams — architecture trees, process flows
   ========================================================================== */

/* --- Architecture diagram --- */

.diagram-outer {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 22px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.diagram-architecture {
  min-width: 920px;
}

.diagram-root {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.diagram-root-toggle {
  background: var(--green-bg);
  border: 1.5px solid var(--green);
  padding: 10px 32px;
  text-align: center;
}

button.diagram-root-toggle,
button.diagram-branch-toggle {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button.diagram-root-toggle {
  transition:
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button.diagram-root-toggle:hover,
button.diagram-root-toggle:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--green) 16%, transparent);
}

button.diagram-root-toggle:focus-visible,
button.diagram-branch-toggle:focus-visible {
  outline: 2px solid var(--w100);
  outline-offset: 2px;
}

.diagram-root-title {
  font-size: var(--fs-metric);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-metric);
  color: var(--green-text);
}

.diagram-root-subtitle {
  font-size: var(--fs-meta);
  line-height: var(--lh-label);
  color: var(--green-text);
  margin-top: 2px;
  letter-spacing: 0;
}

.diagram-root-connector {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 auto;
}

.diagram-branches {
  display: flex;
  justify-content: flex-start;
  gap: 14px;
  position: relative;
  align-items: flex-start;
  width: max-content;
  margin: 0 auto;
  --diagram-panel-height: 370px;
}

.diagram-branches::before {
  content: "";
  position: absolute;
  top: 0;
  left: 140px;
  right: 140px;
  height: 1px;
  background: var(--border);
}

.diagram-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 280px;
  width: 280px;
  min-height: calc(var(--diagram-panel-height) + 100px);
  transition:
    opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.diagram-branches.has-focus .diagram-branch {
  opacity: 0.56;
}

.diagram-branches.has-focus .diagram-branch.is-open {
  opacity: 1;
}

.diagram-branch-connector-top {
  width: 1px;
  height: 18px;
  background: var(--border);
}

.diagram-branch-toggle {
  padding: 10px 14px;
  text-align: center;
  border: 1.5px solid;
  width: 100%;
  transition:
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

button.diagram-branch-toggle::after {
  content: "+";
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 14px;
  line-height: 1;
  color: var(--w25);
  transition:
    transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.diagram-branch.is-open .diagram-branch-toggle::after {
  content: "\2212";
  color: var(--w50);
}

button.diagram-branch-toggle:hover,
button.diagram-branch-toggle:focus-visible {
  box-shadow: var(--shadow-branch-hover);
}

.diagram-branch.is-open .diagram-branch-toggle {
  box-shadow: var(--shadow-branch-open);
}

.diagram-branch-data {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 7%, transparent);
}

.diagram-branch-publishing {
  border-color: var(--orange);
  background: var(--orange-bg);
}

.diagram-branch-portal {
  border-color: var(--purple);
  background: color-mix(in srgb, var(--purple) 7%, transparent);
}

.diagram-branch-title {
  font-size: var(--fs-title-sm);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  margin-bottom: 3px;
}

.diagram-branch-copy {
  font-size: var(--fs-body-sm);
  color: var(--w50);
  line-height: var(--lh-body);
}

.diagram-branch-title-data { color: var(--blue-text); }
.diagram-branch-title-publishing { color: var(--orange-text); }
.diagram-branch-title-portal { color: var(--purple-text); }

.diagram-branch-connector-bottom {
  width: 1px;
  height: 14px;
  background: var(--border);
  margin: 0 auto;
}

.diagram-branch-panel {
  width: 100%;
  overflow: hidden;
  height: var(--diagram-panel-height);
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.diagram-branch.is-open .diagram-branch-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.diagram-detail-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.diagram-detail-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 9px 12px;
}

.diagram-detail-kicker {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  margin-bottom: 3px;
}

.diagram-detail-kicker-data { color: var(--blue-text); }
.diagram-detail-kicker-portal { color: var(--purple-text); }
.diagram-detail-kicker-publishing { color: var(--orange-text); }

.diagram-detail-title {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  color: var(--w100);
  line-height: var(--lh-body);
  margin-bottom: 5px;
}

.diagram-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.diagram-detail-tag {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-label);
  padding: 3px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

.diagram-detail-tag-data {
  background: var(--blue-bg);
  border: 1px solid var(--blue-border);
  color: var(--blue-text);
}

.diagram-detail-tag-portal {
  background: var(--purple-bg);
  border: 1px solid var(--purple-border);
  color: var(--purple-text);
}

.diagram-detail-tag-publishing {
  background: var(--orange-bg);
  border: 1px solid var(--orange-border);
  color: var(--orange-text);
}

.diagram-principles {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.diagram-principles-label {
  width: 100%;
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--w25);
  margin-bottom: 4px;
}

.diagram-principle-card {
  flex: 1;
  min-width: 140px;
  background: var(--surface2);
  padding: 10px 12px;
  border-left: 2px solid;
}

.diagram-principle-card-data { border-color: var(--blue); }
.diagram-principle-card-publishing { border-color: var(--orange); }

.diagram-principle-title {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.diagram-principle-title-data { color: var(--blue-text); }
.diagram-principle-title-publishing { color: var(--orange-text); }

.diagram-principle-copy {
  font-size: var(--fs-body-sm);
  color: var(--w50);
  line-height: var(--lh-body);
}

/* --- Process flow --- */

.flow-outer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 14px;
}

.flow-col {
  background: var(--surface);
}

.flow-col-hdr {
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.flow-badge {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 3px;
  flex-shrink: 0;
}

.flow-badge-portal {
  background: var(--purple-bg);
  border: 1px solid var(--purple-border);
  color: var(--purple-text);
}

.flow-badge-publishing {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: var(--green-text);
}

.flow-col-title {
  font-size: var(--fs-title-sm);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
}

.flow-col-sub {
  font-size: var(--fs-meta);
  line-height: var(--lh-label);
  color: var(--w25);
  margin-top: 2px;
}

.flow-body {
  padding: 18px 20px;
}

.flow-swim-label {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--w25);
  margin-bottom: 10px;
}

.flow-node {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 9px 13px;
  margin-bottom: 3px;
}

.flow-node-portal { border-left: 2px solid var(--purple); }
.flow-node-data { border-left: 2px solid var(--blue); }
.flow-node-publishing { border-left: 2px solid var(--orange); }
.flow-node-system { border-left: 2px solid var(--green); }

.flow-node-title {
  font-size: var(--fs-body-sm);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-label);
}

.flow-node-copy {
  font-size: var(--fs-body-sm);
  color: var(--w50);
  margin-top: 2px;
  line-height: var(--lh-body);
}

.flow-arrow {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 5px 0;
  padding: 0 4px;
}

.flow-arrow-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.flow-arrow-lbl {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--w25);
  white-space: nowrap;
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.flow-arrow-portal .flow-arrow-lbl {
  color: var(--blue-text);
  border-color: var(--blue-border);
  background: var(--blue-bg);
}

.flow-arrow-publishing .flow-arrow-lbl {
  color: var(--green-text);
  border-color: var(--green-border);
  background: var(--green-bg);
}

.flow-arrow-governance .flow-arrow-line {
  background: color-mix(in srgb, var(--orange) 28%, var(--border));
}

.flow-arrow-governance .flow-arrow-lbl {
  color: var(--orange-text);
  border-color: var(--orange-border);
  background: var(--orange-bg);
}

.flow-note {
  background: var(--surface-soft-fill);
  padding: 10px 13px;
  margin-top: 12px;
}

.flow-note p {
  font-size: var(--fs-body-sm);
  color: var(--w50);
  line-height: var(--lh-body);
  margin: 0;
}

.flow-note strong,
.flow-scope strong {
  color: var(--w100);
  font-weight: var(--fw-bold);
}

.flow-reqs {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  padding: 10px 13px;
  margin-top: 10px;
}

.flow-reqs-lbl {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--green-text);
  margin-bottom: 6px;
}

.flow-reqs ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.flow-reqs li {
  font-size: var(--fs-body-sm);
  color: var(--w50);
  padding: 3px 0;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  line-height: var(--lh-body);
}

.flow-reqs li::before {
  content: "\2192";
  color: var(--green-text);
  font-weight: 700;
  flex-shrink: 0;
  font-size: 9px;
  margin-top: 1px;
}

.flow-scope {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 12px 18px;
}

.flow-scope-lbl {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--w25);
  margin-bottom: 5px;
}

.flow-scope p {
  font-size: var(--fs-body-sm);
  color: var(--w50);
  line-height: var(--lh-loose);
  margin: 0;
}


/* ==========================================================================
   8. Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .utility-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .utility-brand {
    min-height: 0;
    min-width: 0;
  }

  .utility-logo {
    height: 18px;
    max-width: min(188px, 52vw);
  }

  .theme-toggle-group[data-theme-toggle] {
    align-self: auto;
    margin-left: auto;
  }

  .tabs {
    flex-direction: column;
  }

  .panel-grid-two,
  .panel-grid-three,
  .compare-grid-two,
  .compare-grid-three {
    grid-template-columns: 1fr;
  }

  .legend-note {
    margin-left: 0;
    width: 100%;
  }

  .matrix-header {
    align-items: flex-start;
  }

  .matrix-row-header,
  .matrix-label-cell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .timeline-track {
    flex-direction: column;
  }

  .timeline-track::before {
    display: none;
  }

  .timeline-event {
    align-items: flex-start;
    text-align: left;
  }

  .timeline-card {
    margin-top: 8px;
  }

  .timeline-scroll .timeline-track {
    flex-direction: row;
    min-width: 720px;
  }

  .timeline-scroll .timeline-track::before {
    display: block;
  }

  .timeline-scroll .timeline-event {
    align-items: center;
    text-align: center;
  }

  .timeline-scroll .timeline-card {
    margin-top: 12px;
  }

  .pipeline-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .pipeline-label {
    align-items: flex-start;
  }

  .pipeline-name {
    text-align: left;
  }

  .factlist-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .flow-outer {
    grid-template-columns: 1fr;
  }

  .masthead-hero {
    min-height: 220px;
    padding: 22px 18px;
  }

  .masthead-hero .masthead-left {
    width: 100%;
  }
}

@media (max-width: 300px) {
  .utility-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .utility-logo {
    max-width: min(168px, 72vw);
  }

  .theme-toggle-group[data-theme-toggle] {
    margin-left: 0;
    align-self: flex-start;
  }
}
