/* N1: primary #3d434a, secondary #8299ab. */
:root {
  --theme-bg: #3d434a;
  --theme-secondary: #8299ab;
  --theme-surface: #474f57;
  --theme-hover: #535e67;
  --theme-ink: #f2f4f6;
  --theme-muted: #cbd2d8;
  --theme-line: #64707b;
  --theme-accent: #d0e2f1;
  --theme-status: #d8cdac;
  --secondary-ink: #10202c;
  --secondary-muted: #172b39;
  --secondary-accent: #132d40;
  --secondary-line: #5c7589;
  --secondary-status: #243e33;
  --secondary-scheme: light;
}

:root {
  --paper: var(--theme-bg);
  --ink: var(--theme-ink);
  --muted: var(--theme-muted);
  --line: var(--theme-line);
  --blue: var(--theme-accent);
  --blue-dark: var(--theme-accent);
  --lime: var(--theme-status);
  --white: #ffffff;
  --canvas-line: color-mix(in srgb, var(--theme-accent) 45%, transparent);
  --canvas-link: color-mix(in srgb, var(--theme-accent) 75%, transparent);
  color-scheme: dark;
  color: var(--ink);
  background: var(--paper);
}
body, .tensor-page main { color: var(--ink); background: var(--paper); }
::selection { color: var(--theme-bg); background: var(--theme-accent); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.site-header, .site-footer {
  color: var(--ink);
  background: var(--theme-bg);
  border-color: var(--line);
}
.site-header-inner > .brand, .primary-nav a, .primary-nav > .nav-repository-button,
.nav-group-row { border-color: var(--line); }
.brand-mark { color: var(--theme-bg); background: var(--theme-accent); }
.primary-nav a, .primary-nav .nav-submenu a, .primary-nav > .nav-repository-button,
.nav-group-row > button { color: var(--muted); }
.primary-nav a:hover, .primary-nav a:focus-visible,
.primary-nav > .nav-repository-button:hover, .primary-nav > .nav-repository-button:focus-visible,
.nav-group-row:hover, .nav-group-row:focus-within {
  color: var(--ink); background: var(--theme-hover);
}
.primary-nav a[aria-current="page"] { color: var(--ink); }
.nav-submenu { background: var(--theme-surface); box-shadow: 0 16px 32px #0005; }
.primary-nav .nav-submenu a[aria-current="page"] { color: var(--blue); background: var(--theme-hover); }
.section-rail { color: var(--ink); border-color: var(--line); background: var(--theme-surface); box-shadow: 0 8px 24px #0003; }
.section-rail a { color: var(--muted); border-color: var(--line); }
.section-rail a:hover, .section-rail a:focus-visible { color: var(--ink); background: var(--theme-hover); }
.section-rail a[aria-current="true"] { color: var(--theme-bg); background: var(--theme-accent); }
.skip-link { color: var(--theme-bg); background: var(--theme-accent); }

.hero, .modules-hero, .tensor-hero { color: var(--ink); background: var(--theme-bg); }
.hero, .hero-copy { min-height: min(680px, calc(100svh - var(--header-height) - 160px)); max-height: none; }
.hero h1 { font-size: 84px; line-height: 1.12; }
.hero-copy { padding-top: 64px; padding-bottom: 100px; }
.hero-intro { max-width: 560px; font-size: 18px; }
.intro-section { padding-top: 72px; }
.hero-grid {
  opacity: .45;
  background-image: linear-gradient(color-mix(in srgb, var(--theme-accent) 9%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--theme-accent) 9%, transparent) 1px, transparent 1px);
}
.hero::after {
  background: linear-gradient(90deg, var(--theme-bg) 0%, color-mix(in srgb, var(--theme-bg) 96%, transparent) 38%, color-mix(in srgb, var(--theme-bg) 12%, transparent) 72%, color-mix(in srgb, var(--theme-bg) 30%, transparent) 100%);
}
.eyebrow, .hero-intro, .hero-status { color: var(--muted); }
.eyebrow span { background: var(--blue); }
.status-dot { background: var(--lime); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 12%, transparent); }
.button-primary, .button-light { color: var(--theme-bg); background: var(--theme-accent); }
.button-primary:hover, .button-light:hover { background: color-mix(in srgb, var(--theme-accent) 84%, white); }
.signal-strip { background: var(--theme-surface); border-color: var(--line); }
.signal-strip span { color: var(--muted); border-color: var(--line); }
.section-heading h2, .workflow-copy h2, .resource-title-row h2, .community-section h2 { font-size: 56px; line-height: 1.18; }
.architecture-heading h2 { font-size: 60px; line-height: 1.16; }
.tensor-hero-copy h1 { font-size: 68px; line-height: 1.15; }
.qml-hero .tensor-hero-copy h1 { font-size: 64px; line-height: 1.15; }
.tensor-section-heading h2 { font-size: 52px; line-height: 1.18; }
h1, h2, h3 { overflow-wrap: break-word; }

/* Secondary surfaces carry their own readable foreground palette. */
.capability-card, .system-component > button, .architecture-detail,
.code-workbench, .module-card, .tensor-hero-visual, .qnn-result-slide {
  --ink: var(--secondary-ink);
  --muted: var(--secondary-muted);
  --blue: var(--secondary-accent);
  --lime: var(--secondary-status);
  --line: var(--secondary-line);
  color: var(--ink);
  border-color: var(--line);
  background: var(--theme-secondary);
  color-scheme: var(--secondary-scheme);
}
.capability-grid { gap: 20px; padding-bottom: 80px; border-left: 0; }
.capability-card { min-height: 480px; padding: 28px 32px 32px; border: 1px solid var(--line); border-radius: 4px; }
.capability-card h3 { font-size: 29px; }
.card-dark .card-number, .card-dark p { color: var(--muted); }
.card-dark > a { border-color: var(--line); }
.circuit-icon, .metric-visual, .topology-visual { right: 32px; left: 32px; }
.circuit-icon::before, .circuit-icon::after, .topology-visual i { background: var(--theme-secondary); }
.topology-visual { background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); }

.architecture-section { color: var(--ink); background: var(--theme-surface); }
.architecture-heading { background: transparent; border-color: var(--line); }
.architecture-summary > p, .architecture-facts span, .architecture-stage-label, .system-map-legend,
.system-layer-title p, .deployment-modes span, .acceleration-stack span { color: var(--muted); }
.architecture-facts b, .deployment-modes b { color: var(--ink); }
.system-map, .system-layer, .system-layer-title, .architecture-facts,
.deployment-modes, .deployment-modes span, .acceleration-stack,
.acceleration-stack b, .acceleration-stack b:last-child { border-color: var(--line); }
.system-layer { background: transparent; }
.system-layer-title > span, .system-component-meta { color: var(--blue); }
.system-component > button { border-radius: 4px; }
.system-component > button > small { color: var(--muted); }
.system-component:hover > button, .system-component:focus-within > button, .system-component.is-open > button {
  border-color: var(--blue); background: var(--theme-secondary);
  box-shadow: 0 8px 20px #0003; transform: translateY(-2px);
}
.architecture-detail { box-shadow: 0 20px 44px #0006; }
.synthesis-glyph i { border-color: var(--blue); }
.synthesis-glyph i:nth-child(2) { background: var(--blue); }
.mapping-glyph { background-image: linear-gradient(25deg, transparent 48%, var(--line) 49%, var(--line) 51%, transparent 52%), linear-gradient(-22deg, transparent 48%, var(--line) 49%, var(--line) 51%, transparent 52%); }
.mapping-glyph i { border-color: var(--blue); background: var(--theme-secondary); }
.mapping-glyph b { background: var(--lime); }
.pulse-glyph i { background: var(--line); }
.pulse-glyph i::after { border-color: var(--lime); }
.mini-pipeline i { color: var(--muted); border-color: var(--line); }
.research-mark i { background: var(--line); }
.research-mark i::after { border-color: var(--lime); background: var(--theme-secondary); }
.foundation-symbol { color: var(--blue); }
.simulator-symbol { color: var(--lime); }
.acceleration-stack b, .acceleration-stack b:last-child {
  color: var(--secondary-ink); background: var(--theme-secondary);
}
.system-map-legend i { background: var(--blue); }
.system-map-legend span:nth-child(2) i { background: var(--muted); }
.system-map-legend span:nth-child(3) i { background: var(--lime); }

.workflow-section, .workflow-copy { color: var(--theme-ink); background: var(--theme-bg); border-color: var(--theme-line); }
.workflow-section, .stats-section { box-shadow: 0 0 0 100vmax var(--theme-bg); }
.workflow-copy > p:not(.kicker), .workflow-steps button { color: var(--theme-muted); }
.workflow-steps, .workflow-steps li { border-color: var(--theme-line); }
.workflow-steps li.is-active button, .workflow-steps button:hover,
.workflow-steps li.is-active button::after { color: var(--theme-accent); }
.code-toolbar, .compile-result { border-color: var(--line); }
.code-tabs button, .copy-button { color: var(--muted); }
.code-tabs button.is-active { color: var(--ink); }
.code-workbench pre { color: #e8edf2; background: var(--theme-bg); }
.code-muted { color: #aab4c0; }
.code-keyword { color: #a8caff; }
.code-number { color: #b7d9b3; }
.code-string { color: #e9c591; }
.compile-result { color: var(--muted); background: transparent; }
.compile-result i { background: var(--lime); }
.stats-section { background: var(--theme-bg); }
.stat, .stats-intro { border-color: var(--line); }
.resource-list, .resource-list > a { border-color: var(--line); }
.resource-list > a:hover { background: var(--theme-hover); }
.community-section, .tensor-resources { color: var(--ink); border-color: var(--line); background: var(--theme-surface); }
.community-section > p:not(.kicker) { color: var(--muted); }
.community-grid { display: none; }
.footer-brand p, .footer-links a, .footer-repository-button, .footer-bottom { color: var(--muted); }
.footer-bottom { border-color: var(--line); }

.module-card:hover, .module-card:focus-within { border-color: var(--blue); box-shadow: 0 12px 28px #0003; }
.module-keywords span, .module-pending { color: var(--muted); border-color: var(--line); }
.learning-figure, .learning-backward::before, .upcoming-figure,
.upcoming-figure > span { color: var(--muted); background: var(--theme-secondary); }
.learning-track i { color: var(--blue); background: var(--theme-secondary); }
.learning-track i:last-child { color: var(--theme-secondary); background: var(--blue); }
.learning-backward { color: var(--blue); border-color: var(--blue); }
.contraction-figure { background-color: var(--theme-bg); }
.tensor-network-left i, .tensor-network-left b, .contraction-tree i { background: var(--theme-bg); border-color: var(--theme-accent); }
.contraction-tree b, .contraction-tree::before, .contraction-tree::after { background: var(--theme-status); }
.contraction-figure .figure-arrow { color: var(--theme-status); }
.breadcrumb, .tensor-facts dt, .tensor-visual-label { color: var(--muted); }
.annealing-chain i, .qml-circuit b { background: var(--line); }
.annealing-chain i::after, .qml-circuit i { border-color: var(--blue); background: var(--theme-secondary); }
.chain-hot i::after { border-color: var(--muted); }
.chain-cold i::after { border-color: var(--lime); }
.chain-exchange { color: var(--muted); }
.tensor-visual-output { color: var(--ink); background: transparent; border-top: 1px solid var(--line); }
.qml-loop { color: var(--muted); background: transparent; }
.tensor-method, .performance-overview, .circuit-results, .qnn-results-section, .vqe-detail-section { background: var(--theme-bg); }
.metric-results, .circuit-results-option-alt, .qml-workflow-section, .vqe-overview-section { background: var(--theme-surface); }
.method-flow, .qml-workflow-grid, .metric-carousel-shell, .carousel-toolbar,
.circuit-display, .chart-tab-list, .qnn-view-switch, .qnn-view-switch button + button,
.vqe-overview-figure, .tensor-resource-links, .tensor-resource-links a,
.tensor-resource-links button, .metric-comparison-block, .metric-comparison-block li { border-color: var(--line); }
.performance-overview-note, .carousel-toolbar > p, .qnn-carousel-status { color: var(--muted); }
.carousel-controls button, .metric-slide > button, .circuit-chart-button { border-color: var(--line); }
.carousel-controls button:hover, .carousel-controls button:focus-visible { background: var(--theme-hover); }
.chart-tab-list button, .circuit-arrow-switcher > .chart-tab-list, .qnn-view-switch button {
  color: var(--muted); border-color: var(--line); background: var(--theme-surface);
}
.qnn-view-switch button:hover, .qnn-view-switch button:focus-visible { color: var(--ink); background: var(--theme-hover); }
.chart-tab-list button[aria-selected="true"], .chart-tab-list button[aria-pressed="true"],
.qnn-view-switch button[aria-pressed="true"] { color: var(--theme-bg); background: var(--theme-accent); }
.carousel-side-control, .circuit-scene-arrow, .qnn-carousel-arrow {
  color: var(--theme-ink); border-color: var(--theme-line); background: var(--theme-surface);
}
.circuit-scene-arrow:hover, .circuit-scene-arrow:focus-visible,
.qnn-carousel-arrow:hover, .qnn-carousel-arrow:focus-visible { color: var(--theme-bg); background: var(--theme-accent); }
.qnn-carousel-arrow:disabled { color: var(--theme-muted); border-color: var(--theme-line); background: var(--theme-bg); opacity: .6; }
.qnn-result-slide > header { color: var(--ink); }
.qnn-chart figcaption { color: var(--theme-ink); border-color: var(--theme-line); background: var(--theme-bg); }

/* Benchmark bitmaps retain their original plotting colors. */
.performance-chart-button, .metric-slide > button, .circuit-chart-button,
.qnn-chart, .qnn-chart button, .vqe-overview-figure { background: #fff; }

.lightbox-dialog, .repository-dialog { color: var(--ink); border-color: var(--line); background: var(--theme-surface); box-shadow: 0 24px 64px #0008; }
.lightbox-toolbar, .repository-dialog-heading, .repository-dialog-footer { border-color: var(--line); }
.lightbox-stage, .repository-dialog-footer { background: var(--theme-bg); }
.lightbox-toolbar button, .lightbox-stage button, .repository-dialog-heading button { color: var(--ink); }
.lightbox-toolbar button:hover, .lightbox-toolbar button:focus-visible,
.lightbox-stage button:hover, .lightbox-stage button:focus-visible,
.repository-dialog-heading button:hover, .repository-dialog-heading button:focus-visible { background: var(--theme-hover); }
.repository-dialog-content > span, .repository-dialog-footer > span { color: var(--muted); }
.repository-dialog-footer button { color: var(--theme-bg); border-color: var(--line); background: var(--theme-accent); }

@media (max-width: 1759px) {
  .section-rail { width: 36px; right: 12px; }
  .section-rail a { grid-template-columns: 1fr; padding: 0; justify-items: center; }
  .section-rail .rail-label { display: none; }
}
@media (max-width: 1200px) {
  .tensor-hero-grid { gap: 48px; }
  .tensor-hero-copy h1, .qml-hero .tensor-hero-copy h1 { font-size: 56px; }
}
@media (max-width: 980px) {
  .primary-nav { background: var(--theme-bg); }
  .hero h1 { font-size: 64px; }
  .architecture-heading h2 { font-size: 48px; }
  .tensor-section-heading h2 { font-size: 44px; }
  .capability-grid { gap: 16px; }
  .rail-label { color: var(--theme-ink); background: var(--theme-surface); }
  .section-rail a[aria-current="true"] .rail-label { color: var(--theme-ink); }
}
@media (max-width: 640px) {
  .hero, .hero-copy { min-height: min(620px, calc(100svh - var(--header-height) - 140px)); }
  .section-rail { display: none; }
  .quantum-canvas { opacity: .24; }
  .intro-section { padding-top: 40px; }
  .hero-copy { padding-top: 48px; padding-bottom: 100px; }
  .hero h1 { font-size: 44px; }
  .hero-intro { font-size: 16px; }
  .hero::after { background: linear-gradient(90deg, color-mix(in srgb, var(--theme-bg) 98%, transparent), color-mix(in srgb, var(--theme-bg) 65%, transparent)); }
  .section-heading h2, .workflow-copy h2, .resource-title-row h2,
  .community-section h2 { font-size: 36px; }
  .architecture-heading h2 { font-size: 36px; }
  .tensor-hero-copy h1, .qml-hero .tensor-hero-copy h1 { font-size: 40px; }
  .tensor-section-heading h2 { font-size: 32px; }
  .capability-grid { padding-bottom: 64px; }
  .capability-card { min-height: 460px; }
  .section-rail a[aria-current="true"] .rail-index::after { background: var(--theme-bg); }
  .architecture-facts span, .system-layer-title, .deployment-modes span,
  .acceleration-stack b, .acceleration-stack b:last-child { border-color: var(--line); }
}

/* Refined hierarchy: neutral reading areas, colored diagrams and core flow. */
:root {
  --surface-fill: var(--theme-surface);
  --canvas-line: color-mix(in srgb, var(--theme-accent) 48%, transparent);
  --canvas-link: var(--theme-accent);
  --code-bg: #293139;
  --code-ink: #edf2f6;
  --code-muted: #bac6d0;
  --code-keyword: #b6d5f1;
  --code-number: #c3dfbe;
  --code-string: #e9cea2;
}
.site-header { background: color-mix(in srgb, var(--theme-bg) 92%, #18212a); }
.site-header-inner > .brand, .primary-nav > a, .nav-group-row,
.primary-nav > .nav-repository-button { border-left: 0; border-right: 0; }
.brand-mark { width: 30px; height: 30px; border-radius: 3px; }
.primary-nav > a, .primary-nav > .nav-group, .primary-nav > .nav-repository-button { flex-basis: 100px; width: 100px; }
.hero { min-height: 570px; border-bottom: 0; }
.hero::after, .hero-grid { display: none; }
.hero-copy { width: 53%; min-height: 570px; padding-top: 68px; padding-bottom: 80px; }
.hero .eyebrow { margin-bottom: 26px; color: var(--theme-muted); font-size: 11px; }
.hero h1 { font-family: "Inter", "Segoe UI", sans-serif; font-size: 88px; font-weight: 600; line-height: 1.05; }
.hero-tagline { margin: 24px 0 0; color: var(--theme-ink); font-size: 30px; font-weight: 400; line-height: 1.45; }
.hero-intro { max-width: 490px; margin-top: 22px; font-size: 16px; line-height: 1.85; }
.hero-actions { margin-top: 30px; gap: 28px; }
.hero-actions .button { min-height: 48px; border-radius: 3px; font-size: 14px; gap: 32px; }
.hero-actions .text-link { font-size: 14px; }
.hero-status { bottom: 35px; font-size: 11px; gap: 24px; }
.quantum-canvas { opacity: 1; }
.signal-strip { min-height: 52px; background: transparent; }
.signal-strip span { border-right: 0; }
.section-rail { box-shadow: none; }
.intro-section { grid-template-columns: 48px 1.2fr 1fr; gap: 32px; padding-top: 86px; padding-bottom: 48px; border-bottom: 0; }
.section-heading h2, .workflow-copy h2, .resource-title-row h2, .community-section h2 { font-size: 40px; line-height: 1.3; }
.section-heading h2 { font-size: 34px; }
.section-lead { font-size: 15px; }
.kicker { margin-bottom: 18px; font-size: 11px; }

.capability-card, .system-component > button, .module-card,
.code-workbench, .qnn-result-slide {
  --ink: var(--theme-ink);
  --muted: var(--theme-muted);
  --blue: var(--theme-accent);
  --lime: var(--theme-status);
  --line: var(--theme-line);
  --surface-fill: var(--theme-surface);
  color: var(--ink);
  background: var(--surface-fill);
  color-scheme: dark;
}
.compiler-pipeline .system-component > button, .architecture-detail,
.tensor-hero-visual, .learning-figure {
  --ink: var(--secondary-ink);
  --muted: var(--secondary-muted);
  --blue: var(--secondary-accent);
  --lime: var(--secondary-status);
  --line: var(--secondary-line);
  --surface-fill: var(--theme-secondary);
  color: var(--ink);
  background: var(--surface-fill);
  color-scheme: var(--secondary-scheme);
}
.capability-grid { gap: 32px; padding-bottom: 86px; }
.capability-card {
  min-height: 408px; padding: 0; border: 0; border-radius: 0;
  background: transparent; isolation: isolate;
}
.capability-card::before { content: ""; position: absolute; z-index: -1; inset: 0 0 auto; height: 208px; background: var(--theme-surface); border-radius: 4px; }
.capability-card .card-number { position: absolute; top: 16px; left: 20px; font-size: 10px; }
.circuit-icon, .metric-visual, .topology-visual { position: relative; top: auto; right: auto; left: auto; height: 130px; min-height: 130px; flex: 0 0 130px; margin: 46px 24px 52px; }
.capability-card h3 { margin: 0 0 13px; font-size: 24px; }
.capability-card p { min-height: 74px; margin-bottom: 16px; font-size: 14px; }
.capability-card > a { margin-top: auto; font-size: 12px; }
.metric-visual strong { font-size: 46px; }
.metric-visual div { height: 54px; }
.circuit-icon::before, .circuit-icon::after, .topology-visual i { background: var(--theme-surface); }
.circuit-icon b { box-shadow: none; width: 9px; height: 9px; }
.topology-visual { background-image: none; }
.card-accent::before { background: var(--theme-secondary); }
.card-accent .card-number, .card-accent .metric-visual {
  --blue: var(--secondary-accent); --muted: var(--secondary-muted); --line: var(--secondary-line);
  color: var(--secondary-muted);
}

.architecture-section { background: var(--theme-bg); border-top: 1px solid var(--theme-line); }
.architecture-heading { padding-top: 76px; padding-bottom: 42px; gap: 64px; border: 0; }
.architecture-heading h2 { font-size: 42px; line-height: 1.3; }
.architecture-summary > p { font-size: 15px; margin-bottom: 24px; }
.architecture-facts { border-bottom: 0; }
.architecture-stage { padding-top: 12px; padding-bottom: 72px; }
.architecture-stage-label { margin-bottom: 24px; }
.system-map { border: 0; }
.system-layer { grid-template-columns: 210px minmax(0, 1fr); padding: 22px 0; border: 0; border-top: 1px solid var(--theme-line); background: transparent; }
.system-layer-title { padding: 16px 30px 16px 0; border: 0; }
.system-layer-title h3 { margin-top: 14px; font-size: 19px; }
.system-layer-title p { font-size: 11px; }
.system-product-grid, .compiler-pipeline, .capability-pipelines, .foundation-grid { padding: 0; gap: 16px; align-items: stretch; }
.system-component > button { min-height: 164px; padding: 19px 20px; border: 1px solid transparent; border-radius: 4px; }
.system-component > button > strong { font-size: 18px; }
.system-component > button > small { font-size: 11px; }
.system-component:hover > button, .system-component:focus-within > button, .system-component.is-open > button {
  background: var(--surface-fill); border-color: var(--blue); box-shadow: none; transform: translateY(-2px);
}
.system-component-meta { font-size: 9px; }
.system-glyph { height: 42px; margin: 16px 0; }
.compiler-pipeline .system-component:not(:last-child)::after { right: -15px; top: 84px; }
.deployment-modes { border: 0; border-left: 1px solid var(--theme-line); }
.deployment-modes span { padding: 6px 18px; border: 0; }
.system-layer-title > span { color: var(--theme-accent); }
.mapping-glyph { background: none; }
.mapping-glyph::before, .mapping-glyph::after { content: ""; position: absolute; top: 50%; left: 12%; width: 74%; height: 1px; background: var(--line); transform: rotate(12deg); }
.mapping-glyph::after { transform: rotate(-12deg); }
.mapping-glyph i { z-index: 1; background: var(--surface-fill); }
.research-mark i::after { background: var(--surface-fill); }
.pulse-glyph i::after {
  top: -14px; left: 12%; height: 28px; width: 76%; border: 0; background: var(--lime);
  clip-path: polygon(0 46%, 16% 46%, 16% 0, 34% 0, 34% 92%, 53% 92%, 53% 20%, 73% 20%, 73% 46%, 100% 46%, 100% 54%, 69% 54%, 69% 28%, 57% 28%, 57% 100%, 30% 100%, 30% 8%, 20% 8%, 20% 54%, 0 54%);
}
.acceleration-stack { border: 0; background: transparent; }
.acceleration-stack b, .acceleration-stack b:last-child { color: var(--theme-accent); background: var(--theme-surface); border-color: var(--theme-bg); }
.mini-pipeline i { border: 0; border-bottom: 1px solid var(--line); }
.architecture-detail { box-shadow: 0 12px 26px #0004; border-radius: 4px; }

.workflow-section { gap: 56px; padding-top: 72px; padding-bottom: 72px; grid-template-columns: .8fr 1.2fr; clip-path: none; box-shadow: none; }
.workflow-copy { padding: 20px 0; border: 0; }
.workflow-copy > p:not(.kicker) { margin-bottom: 32px; font-size: 15px; }
.workflow-steps button { padding: 16px 0; font-size: 13px; }
.code-workbench { padding: 0; border: 1px solid var(--theme-line); border-radius: 4px; overflow: hidden; scroll-margin-top: 100px; }
.code-toolbar { min-height: 55px; padding: 0 24px; border: 0; }
.code-tabs { gap: 24px; }
.code-workbench pre { min-height: 380px; padding: 28px 24px; color: var(--code-ink); background: var(--code-bg); font-size: 13px; line-height: 1.85; }
.code-muted { color: var(--code-muted); }
.code-keyword { color: var(--code-keyword); }
.code-number { color: var(--code-number); }
.code-string { color: var(--code-string); }
.compile-result { padding: 0 18px; border-top: 0; }
.compile-result span { border: 0; }
.stats-section { border-top: 1px solid var(--theme-line); }
.stats-intro, .stat { min-height: 192px; padding: 34px 24px; border-right: 0; }
.stats-intro { padding-left: 0; }
.stat strong { font-size: 42px; }
.resource-section { padding-top: 76px; padding-bottom: 76px; }
.resource-title-row { margin-bottom: 38px; }
.resource-list > a { min-height: 100px; }
.resource-list strong { font-size: 18px; }
.community-section { padding-top: 72px; padding-bottom: 72px; background: var(--theme-surface); }
.community-section h2 { font-size: 38px; }
.community-section > p:not(.kicker) { font-size: 15px; }

.modules-hero { padding-top: 70px; padding-bottom: 60px; }
.modules-hero h1 { font-size: 60px; }
.module-gallery { gap: 28px; padding-top: 40px; }
.module-card { border: 0; border-radius: 4px; overflow: hidden; min-height: 560px; }
.module-card:last-child { border: 0; }
.module-card-body { padding: 26px; }
.module-card h2 { font-size: 26px; line-height: 1.45; }
.module-figure { height: 224px; flex-basis: 224px; border-bottom: 0; }
.learning-track i, .learning-backward::before { background: var(--surface-fill); }
.learning-track i:last-child { background: var(--blue); color: var(--surface-fill); }
.upcoming-figure, .upcoming-figure > span { background: var(--theme-surface); }
.tensor-hero-grid { min-height: 520px; gap: 64px; padding-top: 50px; padding-bottom: 48px; }
.tensor-hero-copy h1, .qml-hero .tensor-hero-copy h1 { font-size: 54px; line-height: 1.25; }
.tensor-hero-visual { border: 0; border-radius: 4px; padding: 28px; }
.tensor-hero-copy > p:not(.kicker) { font-size: 16px; }
.tensor-section-heading h2 { font-size: 40px; line-height: 1.3; }
.tensor-method, .performance-overview, .metric-results, .circuit-results,
.qml-workflow-section, .qnn-results-section, .vqe-overview-section { padding-top: 80px; padding-bottom: 80px; }
.tensor-section-heading { margin-bottom: 40px; }
.method-flow li, .qml-workflow-grid article { min-height: 190px; }
.qml-workflow-grid strong { font-size: 18px; }
.qnn-result-slide { border-radius: 4px; }
.qnn-result-slide > header { min-height: 64px; }
.qnn-result-slide > header h3 { font-size: 19px; }
.performance-overview-note { padding-left: 0; }
.metric-comparison-block h3 { font-size: 17px; }

@media (min-width: 1760px) {
  .hero-copy { width: calc((100% - 1440px) / 2 + 700px); }
}
@media (max-width: 1200px) {
  .hero h1 { font-size: 72px; }
  .hero-tagline { font-size: 26px; }
  .system-layer { grid-template-columns: 170px minmax(0, 1fr); }
  .system-layer-title { padding-right: 20px; }
  .system-product-grid, .compiler-pipeline, .capability-pipelines, .foundation-grid { gap: 12px; }
  .workflow-section { gap: 32px; }
  .tensor-hero-grid { gap: 36px; }
  .tensor-hero-copy h1, .qml-hero .tensor-hero-copy h1 { font-size: 44px; }
}
@media (max-width: 980px) {
  .primary-nav > a, .primary-nav > .nav-group, .primary-nav > .nav-repository-button { width: 100%; flex: 0 0 auto; }
  .hero, .hero-copy { min-height: 520px; }
  .hero-copy { width: 58%; }
  .hero h1 { font-size: 60px; }
  .hero-tagline { font-size: 22px; }
  .hero-intro { font-size: 15px; }
  .intro-section { grid-template-columns: 36px 1fr; gap: 24px; }
  .capability-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .capability-card h3 { font-size: 20px; }
  .capability-card p { min-height: 100px; font-size: 13px; }
  .metric-visual strong { font-size: 36px; }
  .circuit-icon, .metric-visual, .topology-visual { margin-inline: 16px; }
  .architecture-heading { gap: 36px; }
  .architecture-heading h2 { font-size: 34px; }
  .workflow-section { grid-template-columns: 1fr; gap: 24px; }
  .code-workbench { padding: 0; }
  .tensor-hero-grid { min-height: auto; }
  .tensor-hero-visual { min-height: 320px; }
}
@media (max-width: 760px) {
  .system-layer { grid-template-columns: 1fr; padding-top: 16px; padding-bottom: 24px; }
  .system-layer-title { padding: 10px 0 22px; border: 0; }
  .system-layer-title p { max-width: none; }
  .system-product-grid, .compiler-pipeline, .capability-pipelines, .foundation-grid { grid-template-columns: 1fr; padding: 0; }
  .system-component > button { min-height: 164px; }
  .compiler-pipeline .system-component:not(:last-child)::after { top: auto; right: calc(50% - 6px); bottom: -13px; }
  .deployment-modes { border-left: 0; border-top: 1px solid var(--theme-line); }
  .deployment-modes span { padding: 12px 0; }
  .architecture-detail { box-shadow: none; }
}
@media (max-width: 640px) {
  .hero { min-height: auto; padding-bottom: 196px; }
  .hero-copy { width: 100%; min-height: auto; padding: 44px 20px 26px; }
  .hero h1 { font-size: 54px; }
  .hero .eyebrow { margin-bottom: 22px; font-size: 10px; }
  .hero-tagline { margin-top: 18px; font-size: 21px; }
  .hero-intro { margin-top: 20px; font-size: 14px; }
  .hero-actions { flex-direction: row; align-items: center; gap: 20px; margin-top: 24px; }
  .hero-actions .button { width: auto; min-height: 44px; padding-inline: 14px; gap: 20px; }
  .hero-actions .text-link { font-size: 12px; gap: 10px; }
  .hero-status { bottom: 18px; font-size: 10px; }
  .intro-section { padding-top: 52px; padding-bottom: 32px; grid-template-columns: 1fr; gap: 12px; }
  .section-index { display: none; }
  .section-heading h2 { font-size: 28px; }
  .section-lead { font-size: 14px; margin-top: 6px; }
  .capability-grid { grid-template-columns: 1fr; gap: 36px; padding-bottom: 56px; }
  .capability-card { min-height: 390px; }
  .capability-card h3 { font-size: 23px; }
  .capability-card p { min-height: 0; font-size: 14px; margin-bottom: 24px; }
  .metric-visual strong { font-size: 46px; }
  .architecture-heading { padding-top: 54px; padding-bottom: 32px; gap: 28px; }
  .architecture-heading h2 { font-size: 32px; }
  .architecture-stage { padding-bottom: 48px; }
  .workflow-section { padding-top: 48px; padding-bottom: 48px; }
  .workflow-copy h2, .resource-title-row h2, .community-section h2 { font-size: 30px; }
  .workflow-copy { padding-top: 0; padding-bottom: 0; }
  .code-workbench pre { min-height: 360px; padding: 24px 16px; font-size: 11px; }
  .code-toolbar { padding-inline: 16px; }
  .compile-result { padding-inline: 12px; }
  .stats-intro, .stat { min-height: 144px; padding: 24px 10px; }
  .stats-intro { padding-left: 0; }
  .stat strong { font-size: 30px; }
  .stat span { font-size: 12px; }
  .resource-section, .community-section { padding-top: 52px; padding-bottom: 52px; }
  .modules-hero { padding-top: 48px; padding-bottom: 40px; }
  .modules-hero h1 { font-size: 42px; }
  .module-gallery { gap: 28px; }
  .module-card h2 { font-size: 25px; }
  .module-card-body { padding: 24px; }
  .tensor-hero-copy h1, .qml-hero .tensor-hero-copy h1 { font-size: 34px; }
  .tensor-hero-grid { padding-top: 40px; gap: 28px; }
  .tensor-section-heading h2 { font-size: 30px; }
  .tensor-hero-visual { padding: 22px; }
  .tensor-method, .performance-overview, .metric-results, .circuit-results,
  .qml-workflow-section, .qnn-results-section, .vqe-overview-section { padding-top: 56px; padding-bottom: 56px; }

}
@media (max-width: 360px) {
  .hero h1 { font-size: 46px; }
  .hero-tagline { font-size: 19px; }
  .hero-actions { gap: 14px; }
  .hero-actions .button { gap: 14px; }
}

/* Steel-blue surfaces emphasize the compiler flow and editor toolbar. */
.code-toolbar { --ink: var(--secondary-ink); --muted: var(--secondary-muted); --blue: var(--secondary-accent); background: var(--theme-secondary); }
.system-component-rust > button { border-top: 3px solid var(--theme-secondary); }
.tensor-hero-visual { background: #90a4b4; }

/* Desktop presentation: one continuous secondary-color capability band. */
@media (min-width: 981px) {
  .intro-section, .capability-grid {
    --ink: var(--secondary-ink);
    --muted: var(--secondary-muted);
    --blue: var(--secondary-accent);
    --line: var(--secondary-line);
    color: var(--ink);
    background: var(--theme-secondary);
    box-shadow: 0 0 0 100vmax var(--theme-secondary);
    clip-path: inset(0 -100vmax);
  }
  .intro-section { padding-top: 64px; }
  .capability-grid { padding-bottom: 64px; }
  .capability-grid .capability-card {
    --ink: var(--secondary-ink);
    --muted: var(--secondary-muted);
    --blue: var(--secondary-accent);
    --lime: var(--secondary-status);
    --line: var(--secondary-line);
    color: var(--ink);
    background: transparent;
  }
  .capability-card::before { background: color-mix(in srgb, var(--theme-secondary) 85%, white); }
  .card-accent::before { background: color-mix(in srgb, var(--theme-secondary) 70%, white); }
  .capability-card .card-number { color: var(--secondary-muted); }
  .capability-grid .circuit-icon::before, .capability-grid .circuit-icon::after,
  .capability-grid .topology-visual i { background: color-mix(in srgb, var(--theme-secondary) 85%, white); }
}

/* Deep ink and cool ivory, desktop study. */
@media (min-width: 981px) {
  :root {
    --theme-bg: #171e26;
    --theme-secondary: #ddd7cb;
    --theme-surface: #242e38;
    --theme-hover: #303c47;
    --theme-ink: #eceef0;
    --theme-muted: #adb7c0;
    --theme-line: #3b4752;
    --theme-accent: #8eaabe;
    --theme-status: #a4b8ac;
    --secondary-ink: #252a30;
    --secondary-muted: #5d6265;
    --secondary-accent: #385569;
    --secondary-line: #bbb7ae;
  }

  .site-header { height: 68px; background: #121920; }
  .site-header-inner { grid-template-columns: 300px 1fr; }
  .site-header-inner > .brand { padding-left: 0; }
  .brand { gap: 14px; font-size: 17px; font-weight: 500; }
  .brand-mark { width: 28px; height: 28px; border-radius: 0; font-size: 12px; }
  .primary-nav { gap: 8px; }
  .primary-nav > a, .primary-nav > .nav-group,
  .primary-nav > .nav-repository-button { width: auto; min-width: 88px; flex-basis: auto; }
  .primary-nav > a, .nav-group-row > a,
  .primary-nav > .nav-repository-button { font-size: 13px; }
  .primary-nav a[aria-current="page"], .nav-group-current .nav-group-row {
    box-shadow: inset 0 -2px var(--theme-accent);
  }

  .section-rail { right: 22px; width: 34px; background: #1b242d; border-color: #3b4752; }
  .section-rail a { min-height: 42px; }
  .section-rail a[aria-current="true"] { color: #252a30; background: var(--theme-secondary); }

  .hero { min-height: 610px; background: #171e26; }
  .hero-copy { width: 52%; min-height: 610px; padding-top: 84px; padding-bottom: 104px; }
  .hero .eyebrow { margin-bottom: 32px; color: var(--theme-accent); }
  .hero h1 {
    max-width: 650px;
    font-family: var(--font-sans);
    font-size: 76px;
    font-weight: 500;
    line-height: 1.12;
  }
  .hero-intro { max-width: 520px; margin-top: 30px; color: #b9c1c8; font-size: 16px; line-height: 1.85; }
  .hero-actions { margin-top: 34px; }
  .hero-actions .button { min-width: 146px; color: #252a30; background: var(--theme-secondary); }
  .hero-actions .button:hover { background: #ece7dd; }
  .quantum-canvas { opacity: .9; }
  .hero-status { bottom: 30px; color: #9eacb7; }
  .signal-strip { min-height: 46px; border-top: 1px solid #35414c; border-bottom: 1px solid #35414c; background: #1b242d; }
  .signal-strip span { color: #aeb9c2; }

  .intro-section, .capability-grid {
    background: var(--theme-secondary);
    box-shadow: 0 0 0 100vmax var(--theme-secondary);
    clip-path: inset(0 -100vmax);
  }
  .intro-section {
    grid-template-columns: 72px minmax(380px, .95fr) minmax(320px, .8fr);
    gap: 54px;
    padding-top: 76px;
    padding-bottom: 58px;
  }
  .intro-section .section-index { padding-top: 3px; color: #666b6c; }
  .intro-section .kicker { color: #385569; }
  .section-heading h2 { max-width: 630px; color: #252a30; font-size: 42px; line-height: 1.25; }
  .intro-section .section-lead { max-width: 500px; color: #5d6265; font-size: 16px; line-height: 1.85; }

  .capability-grid { gap: 0; padding-bottom: 78px; }
  .capability-card {
    min-height: 400px;
    padding: 0 34px 0;
    border-left: 1px solid #bbb7ae;
    background: transparent;
  }
  .capability-card:first-child { padding-left: 0; border-left: 0; }
  .capability-card:last-child { padding-right: 0; }
  .capability-card::before { inset: 0 34px auto; height: 186px; border-radius: 0; background: rgba(255, 255, 255, .26); }
  .capability-card:first-child::before { left: 0; }
  .capability-card:last-child::before { right: 0; }
  .capability-card .card-number { top: 14px; left: 52px; color: #666b6c; }
  .capability-card:first-child .card-number { left: 18px; }
  .circuit-icon, .metric-visual, .topology-visual { height: 112px; min-height: 112px; margin: 46px 18px 54px; }
  .capability-card:first-child .circuit-icon { margin-left: 0; }
  .capability-card:last-child .topology-visual { margin-right: 0; }
  .capability-card h3 { color: #252a30; font-size: 24px; }
  .capability-card p { max-width: 350px; color: #5d6265; font-size: 14px; line-height: 1.75; }
  .capability-card > a { color: #385569; border-color: #bbb7ae; }
  .capability-grid .circuit-icon::before, .capability-grid .circuit-icon::after,
  .capability-grid .topology-visual i { background: #e9e4da; }

  .architecture-section { background: #171e26; border-top: 0; }
  .architecture-heading {
    grid-template-columns: minmax(420px, .9fr) minmax(500px, 1fr);
    padding-top: 92px;
    padding-bottom: 64px;
    border-bottom: 1px solid #35414c;
  }
  .architecture-heading h2 { max-width: 580px; font-size: 50px; line-height: 1.2; }
  .architecture-summary > p { color: #b5bfc8; font-size: 16px; line-height: 1.8; }
  .architecture-facts { border-color: #3b4752; }
  .architecture-stage { padding-top: 34px; padding-bottom: 94px; }
  .architecture-stage-label { margin-bottom: 32px; color: #a5b1bb; }
  .system-layer {
    grid-template-columns: 220px minmax(0, 1fr);
    padding: 30px 0;
    border-top: 1px solid #35414c;
  }
  .system-layer-title { padding: 10px 42px 10px 0; }
  .system-layer-title > span { color: #8eaabe; }
  .system-layer-title h3 { margin-top: 16px; font-size: 21px; }
  .system-layer-title p { color: #a5b1bb; line-height: 1.7; }
  .system-product-grid, .capability-pipelines, .foundation-grid { gap: 12px; }
  .system-component > button { min-height: 156px; background: #242e38; border: 0; border-top: 2px solid #3b4752; }
  .system-component > button > small { color: #b4bec6; }
  .system-component-meta { color: #8eaabe; }
  .system-product-layer .system-component-rust > button { border-left: 0; border-top-color: #ddd7cb; }
  .system-compiler-layer {
    margin: 8px 0;
    padding: 32px 24px;
    color: #252a30;
    background: #ddd7cb;
    border-top: 0;
  }
  .system-compiler-layer .system-layer-title { padding-left: 0; }
  .system-compiler-layer .system-layer-title > span,
  .system-compiler-layer .system-layer-title p { color: #5d6265; }
  .compiler-pipeline { gap: 2px; }
  .compiler-pipeline .system-component > button {
    min-height: 172px;
    color: #252a30;
    background: rgba(255, 255, 255, .24);
    border: 0;
  }
  .compiler-pipeline .system-component-meta,
  .compiler-pipeline .system-component > button > small { color: #5d6265; }
  .compiler-pipeline .system-component:not(:last-child)::after { z-index: 5; color: #385569; }
  .system-component:hover > button, .system-component:focus-within > button,
  .system-component.is-open > button { border-color: var(--theme-accent); background: #303c47; }
  .compiler-pipeline .system-component:hover > button,
  .compiler-pipeline .system-component:focus-within > button,
  .compiler-pipeline .system-component.is-open > button { color: #252a30; background: rgba(255,255,255,.62); }
  .deployment-modes { border-left-color: #3b4752; }

  .workflow-section {
    gap: 76px;
    padding-top: 92px;
    padding-bottom: 92px;
    background: #121920;
  }
  .workflow-copy { padding-top: 8px; }
  .workflow-copy h2 { font-size: 44px; }
  .workflow-copy > p:not(.kicker) { color: #b4bec6; line-height: 1.8; }
  .code-workbench { background: #242e38; border: 0; border-radius: 0; }
  .code-toolbar { color: #252a30; background: #ddd7cb; }
  .code-workbench pre { background: #121920; }
  .compile-result { background: #202a34; }
  .stats-section { background: #171e26; border-color: #35414c; }
  .stats-intro, .stat { border-bottom: 0; }
  .resource-section { padding-top: 94px; padding-bottom: 94px; }
  .resource-title-row h2 { font-size: 44px; }
  .resource-list > a { border-color: #35414c; }
  .resource-list > a:hover { background: #242e38; }
  .community-section { padding-top: 86px; padding-bottom: 86px; color: #252a30; background: #ddd7cb; }
  .community-section .kicker, .community-section > p:not(.kicker) { color: #5d6265; }
  .community-section .button-light { color: #eceef0; background: #252f39; }

  .hero h1 { color: #ece8df; letter-spacing: 0; }
  .brand-mark { color: #171e26; background: #ddd7cb; }
  .section-rail { box-shadow: none; }
  .capability-card { border-radius: 0; border-top: 0; border-right: 0; border-bottom: 0; }
  .capability-card::before { background: transparent; border-bottom: 1px solid #bbb7ae; }
  .system-component > button { border-radius: 0; }
  .system-compiler-layer { border-left: 3px solid #ddd7cb; background: #242e38; color: #eceef0; }
  .system-compiler-layer .system-layer-title > span { color: #ddd7cb; }
  .system-compiler-layer .system-layer-title p { color: #adb7c0; }
  .compiler-pipeline .system-component > button {
    --ink: #eceef0; --muted: #adb7c0; --blue: #8eaabe; --lime: #a4b8ac; --line: #52616e;
    color: var(--ink); background: #2c3741;
  }
  .compiler-pipeline .system-component-meta,
  .compiler-pipeline .system-component > button > small { color: #adb7c0; }
  .compiler-pipeline .system-component:not(:last-child)::after { color: #8eaabe; }
  .compiler-pipeline .system-component:hover > button,
  .compiler-pipeline .system-component:focus-within > button,
  .compiler-pipeline .system-component.is-open > button { color: #eceef0; background: #36434e; }
  .mapping-glyph i { background: #2c3741; }
  .workflow-section { background: transparent; }
  .code-toolbar { border-bottom: 1px solid #414d58; color: #eceef0; background: #242e38; }
  .code-toolbar .code-tabs button, .code-toolbar .copy-button { color: #b4bec6; }
  .code-toolbar .code-tabs button[aria-selected="true"] { color: #ddd7cb; border-color: #ddd7cb; }
  .tensor-hero-visual { background: #ddd7cb; }
  .community-section { padding-top: 64px; padding-bottom: 64px; }

  /* Paper-like results sections integrate original white chart bitmaps. */
  .performance-overview, .metric-results, .circuit-results,
  .qnn-results-section, .vqe-overview-section, .vqe-detail-section {
    --ink: #252a30; --muted: #5d6265; --blue: #385569; --line: #cbc8c0;
    --theme-bg: #f5f3ee; --theme-surface: #e8e4db; --theme-hover: #ddd7cb;
    --theme-ink: #252a30; --theme-muted: #5d6265; --theme-line: #cbc8c0; --theme-accent: #385569;
    color: var(--ink); background: #f5f3ee; color-scheme: light;
    border-color: #cbc8c0;
  }
  .performance-overview, .qnn-results-section { border-top: 5px solid #ddd7cb; }
  .tensor-section-heading h2 { font-size: 44px; }
  .performance-overview-figure { background: #fff; padding: 24px; }
  .performance-chart-button, .metric-slide > button, .circuit-chart-button { border: 0; }
  .qnn-result-slide { background: #fff; border-color: #d8d4cb; border-radius: 0; }
  .qnn-result-slide > header { background: #e8e4db; border-color: #cbc8c0; }
  .qnn-chart figcaption { color: #385569; border-color: #d8d4cb; background: #f5f3ee; }
  .metric-carousel-shell, .circuit-display { background: #fff; }
  .carousel-toolbar, .circuit-arrow-switcher > .chart-tab-list { background: #e8e4db; }
  .vqe-overview-figure { padding: 20px; }
}

/* Homepage-only satin-black color study. */
@media (min-width: 981px) {
  .hero#top {
    --theme-bg: #202830;
    --canvas-line: color-mix(in srgb, var(--theme-accent) 56%, transparent);
    background: #202830;
    border-top: 1px solid #39434c;
  }
}

/* Multitone alpha: section backgrounds share four restrained surface families. */
@media (min-width: 981px) {
  :root {
    --section-ink: #171e26;
    --section-steel: #2b3943;
    --section-ivory: #e9e5dc;
    --section-sage: #b7c3bf;
  }

  .tensor-method, .workflow-section, .module-gallery {
    --theme-bg: var(--section-steel);
    --theme-surface: #344650;
    --theme-line: #52636d;
    --theme-muted: #c0cbd1;
    --line: #52636d;
    --muted: #c0cbd1;
    color: #eceef0;
    background: var(--section-steel);
    border-color: var(--line);
  }
  .qml-workflow-section { background: var(--section-ink); }
  .workflow-section {
    box-shadow: 0 0 0 100vmax var(--section-steel);
    clip-path: inset(0 -100vmax);
  }
  .workflow-copy { background: transparent; }
  .workflow-steps, .workflow-steps li { border-color: #52636d; }
  .code-toolbar { background: #344650; }
  .stats-section { box-shadow: 0 0 0 100vmax var(--section-ink); }

  .performance-overview, .circuit-results, .qnn-results-section {
    --theme-bg: var(--section-ivory);
    --theme-surface: #ddd7cb;
    background: var(--section-ivory);
    border-top: 1px solid #cbc8c0;
  }
  .metric-results, .vqe-overview-section, .resource-section {
    --theme-bg: var(--section-sage);
    --theme-surface: #ccd5d0;
    --theme-hover: #dce3de;
    --theme-ink: #253331;
    --theme-muted: #465c56;
    --theme-line: #8eaaa0;
    --theme-accent: #34594f;
    --ink: #253331;
    --muted: #465c56;
    --line: #8eaaa0;
    --blue: #34594f;
    color: var(--ink);
    background: var(--section-sage);
    border-color: var(--line);
    color-scheme: light;
  }
  .metric-results .carousel-toolbar { background: #ccd5d0; }
  .metric-results .carousel-toolbar > p { color: #465c56; }
  .metric-results .carousel-controls button { color: #253331; border-color: #8eaaa0; }
  .resource-list, .resource-list > a { border-color: #8eaaa0; }
  .resource-list > a:hover { background: #ccd5d0; }
  .community-section { background: var(--section-ivory); }
  .tensor-resources { background: var(--section-steel); }

  .module-gallery {
    padding-bottom: 64px;
    box-shadow: 0 0 0 100vmax var(--section-steel);
    clip-path: inset(0 -100vmax);
  }
  .module-card {
    --ink: #253331;
    --muted: #465c56;
    --blue: #34594f;
    --line: #94a49b;
    --theme-ink: #253331;
    --theme-muted: #465c56;
    --theme-accent: #34594f;
    --surface-fill: var(--section-ivory);
    color: var(--ink);
    color-scheme: light;
    background: var(--section-ivory);
    border-radius: 0;
  }
  .contraction-figure {
    --theme-accent: #8eaabe;
    --theme-status: #a4b8ac;
  }
  .module-card-learning {
    --theme-secondary: var(--section-sage);
    --surface-fill: var(--section-sage);
    background: var(--section-sage);
  }
  .module-card-learning .learning-figure { background: #ccd5d0; }
  .module-card-upcoming { --surface-fill: #d5dcd9; background: #d5dcd9; }

}

/* Controls and text use their own palette, independent of section surfaces. */
@media (min-width: 981px) {
  :root {
    --action-fill: #d9dde1;
    --action-hover: #eef0f2;
    --action-text: #202327;
  }
  .hero h1 { color: #f0f2f4; }
  .hero#top {
    --theme-bg: #101214;
    --theme-secondary: #c9ced3;
    --theme-accent: #b7c0c8;
    --canvas-line: rgba(183, 192, 200, .32);
    --canvas-link: #aeb8c1;
    background: #101214;
    border-top-color: #2a2e32;
  }
  body:has(.hero#top) .site-header { background: #101214; border-color: #2a2e32; }
  body:has(.hero#top) .brand-mark { background: #d9dde1; color: #202327; }
  body:has(.hero#top) .signal-strip { background: #191c1f; border-color: #30353a; }
  body:has(.hero#top) .section-rail { background: #191c1f; border-color: #373c41; }
  body:has(.hero#top) .section-rail a[aria-current="true"] { background: #d9dde1; color: #202327; }
  .hero-intro { color: #bac2c9; }
  .hero-actions .button-primary, .tensor-hero-actions .button-primary,
  .community-section .button-light {
    color: var(--action-text);
    background: var(--action-fill);
    border: 1px solid #b5bdc4;
    border-radius: 3px;
  }
  .hero-actions .button-primary:hover, .tensor-hero-actions .button-primary:hover,
  .community-section .button-light:hover { color: var(--action-text); background: var(--action-hover); }
  .community-section .button-light { color: #303438; background: transparent; border-color: #7d8388; }
  .community-section .button-light:hover { color: #202327; background: #d5d7d6; }
  .hero-actions .text-link, .tensor-hero-actions .text-link { color: #d1d7dd; }
  .hero-actions .text-link:hover, .tensor-hero-actions .text-link:hover { color: #fff; }
  .intro-section .section-heading h2, .capability-card h3,
  .resource-title-row h2, .community-section h2 { color: #303438; }
  .intro-section .section-lead, .capability-card p,
  .community-section > p:not(.kicker) { color: #565c60; }
  .capability-card > a, .resource-list > a, .resource-title-row > a { color: #365d77; }
  .capability-card > a:hover, .resource-list > a:hover,
  .resource-title-row > a:hover { color: #24465d; }
}

/* System map: restrained dark cards, with the canvas visible between them. */
@media (min-width: 981px) {
  #architecture {
    --theme-bg: #101214;
    --theme-surface: #191c20;
    --theme-line: #2b3036;
    --theme-accent: #b2bdc6;
    background: #101214;
  }
  #architecture .architecture-heading, #architecture .system-layer,
  #architecture .architecture-facts, #architecture .deployment-modes { border-color: #292e33; }
  #architecture .system-compiler-layer {
    padding: 30px 0;
    margin: 0;
    border: 0;
    border-top: 1px solid #292e33;
    background: transparent;
  }
  #architecture .system-product-grid, #architecture .compiler-pipeline,
  #architecture .capability-pipelines, #architecture .foundation-grid { gap: 18px; }
  #architecture .system-component > button {
    --ink: #e8ebee; --muted: #aeb7bf; --blue: #a3b4c1;
    --lime: #9fb4a8; --line: #3e4952; --surface-fill: #191c20;
    color: var(--ink);
    background: #191c20;
    border: 1px solid #ffffff0e;
    border-radius: 12px;
    box-shadow: none;
  }
  #architecture .system-component:hover > button,
  #architecture .system-component:focus-within > button,
  #architecture .system-component.is-open > button {
    background: #202429;
    border-color: #ffffff20;
    box-shadow: none;
    transform: none;
  }
  #architecture .system-component > button > small { color: #aeb7bf; }
  #architecture .system-component-meta, #architecture .system-layer-title > span { color: #98a7b2; }
  #architecture .system-compiler-layer .system-layer-title p { color: #a5b1bb; }
  #architecture .compiler-pipeline .system-component:not(:last-child)::after { right: -17px; color: #87949f; }
  #architecture .mapping-glyph i, #architecture .research-mark i::after { background: #191c20; }
  #architecture .acceleration-stack b, #architecture .acceleration-stack b:last-child {
    background: #191c20; border: 1px solid #ffffff0e; border-radius: 8px; color: #aeb7bf;
  }
  #architecture .architecture-detail {
    --ink: #e8ebee; --muted: #b5bec6; --blue: #bdcbd5; --line: #ffffff18;
    color: var(--ink); background: #202429; border: 1px solid #ffffff18;
    border-radius: 12px; box-shadow: 0 12px 28px #0005; color-scheme: dark;
  }
}
/* Homepage: alternate ink and ivory sections; keep the editor dark. */
@media (min-width: 981px) {
  body:has(.hero#top) .intro-section,
  body:has(.hero#top) .capability-grid {
    --theme-secondary: #e5e3dd;
    background: #e5e3dd;
    box-shadow: 0 0 0 100vmax #e5e3dd;
  }
  #workflow.workflow-section {
    --theme-bg: #e5e3dd;
    --theme-ink: #303438;
    --theme-muted: #565c60;
    --theme-accent: #365d77;
    --theme-line: #bfc2bd;
    --ink: #303438; --muted: #565c60; --blue: #365d77;
    color: #303438;
    background: #e5e3dd;
    border-top: 0;
    box-shadow: 0 0 0 100vmax #e5e3dd;
  }
  #workflow .workflow-copy { background: transparent; }
  #workflow .workflow-copy h2 { color: #303438; }
  #workflow .workflow-copy > p:not(.kicker) { color: #565c60; }
  #workflow .workflow-steps, #workflow .workflow-steps li { border-color: #bfc2bd; }
  #workflow .code-workbench { background: #191c20; border: 1px solid #ffffff0e; border-radius: 12px; }
  #workflow .code-toolbar { background: #1d2024; border-color: #ffffff0e; }
  #workflow .code-toolbar .code-tabs button[aria-selected="true"] { color: #eef0f2; border-color: #bdc5cc; }
  #workflow .code-workbench pre { background: #16191c; }
  #workflow .compile-result { --ink: #eef0f2; --theme-ink: #eef0f2; --theme-muted: #b5bec6; color: #b5bec6; background: #1d2024; }
  #workflow .compile-result strong { color: #eef0f2; }
  body:has(.hero#top) .community-section {
    --theme-bg: #e5e3dd; --theme-surface: #d9dad5;
    --ink: #303438; --muted: #565c60; --line: #bfc2bd;
    background: #e5e3dd; border-color: #bfc2bd;
  }
  body:has(.hero#top) .resource-section {
    --theme-bg: #101214; --theme-surface: #191c20;
    --theme-ink: #eef0f2; --theme-muted: #aeb7bf; --theme-accent: #bdcbd5;
    --ink: #eef0f2; --muted: #aeb7bf; --blue: #bdcbd5; --line: #2b3036;
    color: #eef0f2; background: #101214; border-color: #2b3036; color-scheme: dark;
  }
  body:has(.hero#top) .resource-title-row h2 { color: #eef0f2; }
  body:has(.hero#top) .resource-list > a,
  body:has(.hero#top) .resource-title-row > a { color: #d1d9df; }
  body:has(.hero#top) .resource-list > a:hover,
  body:has(.hero#top) .resource-title-row > a:hover { color: #fff; }
  body:has(.hero#top) .resource-list,
  body:has(.hero#top) .resource-list > a { border-color: #2b3036; }
  body:has(.hero#top) .resource-list > a:hover { background: #191c20; }
  body:has(.hero#top) .site-footer { background: #101214; border-color: #2b3036; }
}

/* Shared navigation popover: neutral charcoal on every theme page. */
@media (min-width: 981px) {
  .primary-nav .nav-submenu {
    color: #d1d7dd; background: #191c20;
    border: 1px solid #ffffff14; border-radius: 10px;
    box-shadow: 0 12px 28px #0005; padding: 6px;
  }
  .primary-nav .nav-submenu a { color: #c2cad1; border-radius: 6px; border-color: transparent; }
  .primary-nav .nav-submenu a:hover,
  .primary-nav .nav-submenu a:focus-visible,
  .primary-nav .nav-submenu a[aria-current="page"] { color: #f0f2f4; background: #292d32; }
  .primary-nav .nav-group-row:hover, .primary-nav .nav-group-row:focus-within { background: #202429; }
}

/* Community introduction and compact contributor profiles. */
#community .community-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .8fr);
  align-items: start;
  gap: clamp(32px, 6vw, 96px);
}
#community .community-intro h2 { max-width: 680px; }
#community .community-invitation p {
  max-width: 500px;
  margin: 0 0 24px;
  color: var(--theme-muted);
  font-size: 15px;
  line-height: 1.8;
}
#community .community-invitation .button { min-height: 46px; font-size: 13px; gap: 28px; }
#community .community-people { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--theme-line); }
#community .contributors-heading { display: flex; align-items: baseline; gap: 16px 32px; margin-bottom: 16px; }
#community .contributors-heading h3 { margin: 0; font-size: 22px; font-weight: 500; }
#community .contributors-heading p { margin: 0; color: var(--theme-muted); font-size: 13px; line-height: 1.7; }
#community .contributor-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 16px; margin: 0; padding: 0; list-style: none; }
#community .contributor-list > li { min-width: 0; }
#community .contributor-card {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 80px;
  height: 100%;
  padding: 12px;
  border-radius: 4px;
  background: transparent;
  color: var(--theme-ink);
  text-align: left;
  transition: background .2s;
}
#community .contributor-card:hover { background: var(--theme-hover); }
#community .contributor-avatar {
  display: block;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
  background: var(--theme-surface);
}
#community .contributor-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#community .contributor-info strong { font-size: 16px; font-weight: 500; line-height: 1.45; overflow-wrap: anywhere; }
#community .contributor-handle { color: var(--theme-muted); font-size: 12px; line-height: 1.6; }
@media (max-width: 1199px) {
  #community .contributor-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  #community .community-intro { grid-template-columns: 1fr; gap: 24px; }
  #community .community-people { margin-top: 36px; }
  #community .contributors-heading { flex-direction: column; gap: 8px; }
}
@media (max-width: 640px) {
  #community .contributor-list { grid-template-columns: 1fr; }
}

/* Keep section names visible within the compact right-hand navigation. */
@media (min-width: 641px) {
  body:has(.hero#top) .section-rail {
    --rail-width: 64px;
    /* Follow the centered content edge, with a 12px gap at every width. */
    right: max(0px, calc((100% - var(--content-max)) / 2 - var(--rail-width) - 12px));
    width: var(--rail-width);
  }
  body:has(.hero#top) .section-rail a {
    min-height: 60px;
    grid-template-columns: 1fr;
    align-content: center;
    justify-items: center;
    gap: 5px;
    padding: 8px 4px;
  }
  body:has(.hero#top) .section-rail .rail-label {
    display: block;
    position: static;
    padding: 0;
    color: inherit;
    background: transparent;
    box-shadow: none;
    font-size: 11px;
    line-height: 1.4;
    visibility: visible;
    opacity: 1;
    transform: none;
  }
  body:has(.hero#top) .section-rail a:focus-visible { outline: 2px solid currentColor; outline-offset: -3px; }
}
@media (min-width: 1760px) {
  body:has(.hero#top) .section-rail { --rail-width: 136px; }
  body:has(.hero#top) .section-rail a { min-height: 44px; grid-template-columns: 24px 1fr; justify-items: start; gap: 8px; padding: 8px 12px; }
  body:has(.hero#top) .section-rail .rail-label { font-size: 12px; }
}

/* Reflow also serves browser zoom: keep content and controls reachable. */
.architecture-heading > *, .intro-section > *, .community-intro > *,
.module-card-body, .tensor-section-heading > * { min-width: 0; }
.primary-nav .nav-submenu a, .breadcrumb, .tensor-facts dd,
.tensor-visual-label, .qml-loop span { overflow-wrap: anywhere; }
.repository-dialog { max-height: calc(100dvh - 24px); overflow-y: auto; }
.repository-dialog-heading { position: sticky; top: 0; background: var(--theme-bg); }
.repository-dialog-heading button, .lightbox-toolbar button { flex-shrink: 0; }
.lightbox-dialog { overflow-y: auto; }
.lightbox-toolbar strong { min-width: 0; padding-block: 10px; overflow-wrap: anywhere; }

@media (min-width: 981px) {
  :root { --header-height: 68px; }
  .architecture-heading { grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); }
}
@media (min-width: 641px) and (max-width: 1759px) {
  /* Reserve the rail's full width, including at tablet breakpoints. */
  body:has(.hero#top) { --page-pad: 76px; }
}
@media (max-width: 980px) {
  /* A filtered header otherwise traps its fixed menu inside the header box. */
  .site-header { backdrop-filter: none; }
  .primary-nav {
    height: calc(100dvh - var(--header-height));
    overflow-y: auto;
    overscroll-behavior-y: contain;
    padding-block: 16px max(16px, env(safe-area-inset-bottom));
  }
  .nav-group-row { height: auto; }
  .nav-group-row > a { justify-content: flex-start; }
  .primary-nav .nav-submenu a { padding: 12px 16px; }
  .primary-nav a, .primary-nav > .nav-repository-button { min-height: 48px; }
  .hero { min-height: auto; padding-bottom: 196px; }
  .hero-copy { width: 100%; max-width: 680px; }
  .hero-copy { min-height: auto; padding-bottom: 26px; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .capability-grid { grid-template-columns: 1fr; gap: 24px; }
  .capability-card p { min-height: 0; }
  .architecture-heading { grid-template-columns: 1fr; }
  .system-layer { grid-template-columns: 1fr; }
  .system-layer-title { padding-bottom: 20px; }
}
@media (max-width: 640px) {
  .site-header-inner { grid-template-columns: minmax(0, 1fr) 48px; }
  .site-header-inner > .brand { min-width: 0; padding-inline: 12px; gap: 8px; }
  .menu-toggle { width: 48px; }
  .hero-actions { flex-wrap: wrap; }
  .code-toolbar { flex-wrap: wrap; gap: 8px; padding-block: 8px; }
  .code-toolbar, .code-workbench pre, .compile-result { margin-right: 0; }
  .code-tabs { flex-wrap: wrap; gap: 12px; }
  .tensor-visual-label { flex-wrap: wrap; gap: 8px; }
  .qml-loop { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .chart-tab-list { flex-wrap: wrap; }
  .chart-tab-list button { flex-basis: 40%; padding: 12px; }
}
@media (max-width: 360px) {
  .hero h1 { font-size: clamp(32px, 12vw, 43px); }
  .footer-links { grid-template-columns: 1fr; gap: 24px; }
  .module-card-body { padding: 20px 16px; }
  .tensor-hero-visual { padding: 16px 12px; }
}
@media (max-width: 760px) {
  #architecture .system-component:is(:hover, :focus-within, .is-open) > .architecture-detail {
    max-height: none;
    padding: 22px 20px;
    border-width: 1px;
  }
}
@media (max-height: 480px) {
  body:has(.hero#top) .section-rail {
    max-height: calc(100dvh - var(--header-height) - 16px);
    overflow-y: auto;
  }

  .lightbox-dialog { grid-template-rows: auto minmax(44px, 1fr) auto; }
  .lightbox-stage img { max-height: max(44px, calc(100dvh - 150px)); }
}

/* Compact site footer, aligned with the main content column. */
.site-footer-inner {
  width: min(calc(100% - var(--page-pad) - var(--page-pad)), var(--content-max));
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 24px 32px;
  padding: 32px 0 16px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px 28px;
}
.footer-links a, .footer-repository-button { display: inline-flex; min-height: 44px; align-items: center; }
.footer-repository-button { align-self: auto; }
.footer-bottom {
  align-items: center;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 0;
  padding-top: 12px;
  font-family: var(--font-sans);
  font-size: 12px;
}
.footer-back-top { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; }
.footer-back-top:hover { color: var(--theme-accent); }
@media (max-width: 760px) {
  .site-footer-inner { grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 28px; }
  .footer-links { justify-content: flex-start; gap: 0 24px; }
}
