@font-face {
  font-family: "Inter";
  src: url("../fonts/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMonoVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --topbar-height: 68px;
  --sidebar-width: 274px;
  --context-width: 258px;
  --content-max: 920px;
  --bg: #0d1a0d;
  --bg-grid: rgba(63, 185, 80, 0.035);
  --surface: #111e13;
  --surface-2: #152619;
  --surface-3: #1a2e20;
  --surface-hover: #1d3424;
  --border: #2b4935;
  --border-soft: #1e3425;
  --border-subtle: var(--border-soft);
  --text: #e7f0e9;
  --text-strong: #f5fbf6;
  --muted: #9aaa9e;
  --text-muted: var(--muted);
  --muted-2: #718177;
  --accent: #3fb950;
  --accent-strong: #56d364;
  --accent-hover: #2da44e;
  --accent-active: #238636;
  --accent-soft: rgba(35, 134, 54, 0.1);
  --code-bg: rgba(35, 134, 54, 0.1);
  --cyan: #4ed8d1;
  --green: #56d364;
  --yellow: #e8bd62;
  --orange: #f28b55;
  --red: #f07178;
  --purple: #b58cff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, 0.18);
  --osi-green-1: #2da44e;
  --osi-green-2: #36ad55;
  --osi-green-3: #3fb950;
  --osi-green-4: #4cc85a;
  --osi-green-5: #56d364;
  --osi-green-6: #68dc75;
  --osi-green-7: #7ee787;
  --osi-index-text: #07120a;
  --layer-1: var(--osi-green-1);
  --layer-2: var(--osi-green-2);
  --layer-3: var(--osi-green-3);
  --layer-4: var(--osi-green-4);
  --layer-5: var(--osi-green-5);
  --layer-6: var(--osi-green-6);
  --layer-7: var(--osi-green-7);
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f8f6;
  --bg-grid: rgba(26, 127, 55, 0.045);
  --surface: #ffffff;
  --surface-2: #f0f6f1;
  --surface-3: #e6efe8;
  --surface-hover: #eaf5ec;
  --border: #c7d6ca;
  --border-soft: #dde8df;
  --text: #29372d;
  --text-strong: #142018;
  --muted: #526158;
  --muted-2: #65736a;
  --accent: #1a7f37;
  --accent-strong: #2da44e;
  --accent-hover: #1a7f37;
  --accent-active: #238636;
  --accent-soft: rgba(35, 134, 54, 0.1);
  --code-bg: rgba(35, 134, 54, 0.1);
  --shadow: 0 18px 45px rgba(27, 73, 38, 0.12);
  --shadow-soft: 0 8px 24px rgba(27, 73, 38, 0.08);
  --osi-green-1: #0f5f2a;
  --osi-green-2: #116b2d;
  --osi-green-3: #1a7f37;
  --osi-green-4: #1e8039;
  --osi-green-5: #238636;
  --osi-green-6: #277f3a;
  --osi-green-7: #2c773b;
  --osi-index-text: #ffffff;
}

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

html {
  min-width: 320px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-height) + 24px);
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 36px 36px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
}

::selection {
  color: var(--text-strong);
  background: rgba(35, 134, 54, 0.3);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  z-index: 200;
  top: 10px;
  left: 12px;
  padding: 9px 14px;
  border-radius: 8px;
  color: var(--text-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateY(-150%);
  transition: transform 150ms ease;
}

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

.topbar {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto 0;
  height: var(--topbar-height);
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(280px, 620px) 44px;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 0 18px 0 22px;
  border-bottom: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px) saturate(135%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  width: max-content;
  color: var(--text-strong);
  text-decoration: none;
  line-height: 1.1;
}

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

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 14px;
  font-weight: 720;
  letter-spacing: -0.01em;
}

.brand small {
  margin-top: 4px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  padding: 7px;
  border: 1px solid rgba(35, 134, 54, 0.45);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(63, 185, 80, 0.16), rgba(86, 211, 100, 0.05));
  box-shadow: inset 0 0 18px rgba(63, 185, 80, 0.08);
}

.brand-mark i {
  display: block;
  flex: 1;
  border-radius: 1px 1px 0 0;
  background: var(--accent);
}

.brand-mark i:nth-child(1) { height: 55%; opacity: 0.65; }
.brand-mark i:nth-child(2) { height: 100%; }
.brand-mark i:nth-child(3) { height: 76%; opacity: 0.82; }

.global-search {
  position: relative;
  width: 100%;
  max-width: 620px;
  justify-self: center;
}

.global-search input {
  width: 100%;
  height: 40px;
  padding: 0 54px 0 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.global-search input::placeholder {
  color: var(--muted-2);
}

.global-search input:focus {
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.global-search > kbd {
  position: absolute;
  top: 9px;
  right: 10px;
  min-width: 23px;
  height: 22px;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted-2);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: center;
  box-shadow: 0 1px 0 var(--border);
}

.search-icon {
  position: absolute;
  z-index: 1;
  top: 11px;
  left: 13px;
  width: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-results {
  position: absolute;
  z-index: 120;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  max-height: min(570px, calc(100vh - 100px));
  overflow-y: auto;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.search-results[hidden] {
  display: none;
}

.search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 14px;
  padding: 10px 11px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

.search-result:hover,
.search-result[aria-selected="true"] {
  color: var(--text-strong);
  background: var(--surface-hover);
}

.search-result strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result em {
  align-self: center;
  padding: 1px 6px;
  border-radius: 99px;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.search-result small {
  grid-column: 1 / -1;
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.search-empty {
  padding: 24px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.icon-button:hover {
  border-color: var(--border);
  color: var(--text-strong);
  background: var(--surface-2);
}

.icon-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.theme-icon--sun { display: none; }
html[data-theme="light"] .theme-icon--sun { display: block; }
html[data-theme="light"] .theme-icon--moon { display: none; }

.mobile-only {
  display: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--context-width);
  padding-top: var(--topbar-height);
}

.sidebar,
.context-panel {
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
}

.sidebar {
  z-index: 70;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--bg) 95%, var(--surface));
}

.sidebar nav {
  flex: 1;
  overflow-y: auto;
  padding: 18px 13px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.nav-group {
  margin-top: 23px;
}

.nav-group--last {
  padding-bottom: 12px;
}

.nav-label {
  margin: 0 0 7px 11px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

.nav-link:hover {
  color: var(--text-strong);
  background: var(--surface-2);
}

.nav-link.active {
  border-color: color-mix(in srgb, var(--accent-active) 45%, transparent);
  color: var(--text-strong);
  background: var(--accent-soft);
}

.nav-link.active::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: -14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-active);
  content: "";
}

.nav-home svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.layer-nav {
  margin: 0;
  padding: 0;
  list-style: none;
}

.layer-nav .nav-link {
  min-height: 49px;
}

.layer-nav strong,
.layer-nav small {
  display: block;
}

.layer-nav strong {
  color: inherit;
  font-size: 12px;
  font-weight: 620;
  line-height: 1.25;
}

.layer-nav small {
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10px;
  line-height: 1.25;
}

.layer-index,
.nav-symbol {
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, currentColor 45%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, currentColor 9%, transparent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

.layer-1 { color: var(--layer-1); }
.layer-2 { color: var(--layer-2); }
.layer-3 { color: var(--layer-3); }
.layer-4 { color: var(--layer-4); }
.layer-5 { color: var(--layer-5); }
.layer-6 { color: var(--layer-6); }
.layer-7 { color: var(--layer-7); }

.nav-link--compact {
  min-height: 36px;
  padding-top: 5px;
  padding-bottom: 5px;
  font-size: 12px;
}

.nav-symbol {
  width: 22px;
  height: 22px;
  color: var(--accent);
  font-size: 9px;
}

.nav-symbol.power { color: var(--orange); }
.nav-symbol.storage { color: var(--cyan); }
.nav-symbol.scheduling { color: var(--purple); }
.nav-symbol.observability { color: var(--green); }

.nav-link--utility {
  justify-content: space-between;
  min-height: 34px;
  font-size: 12px;
}

.nav-link--utility span {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 45px;
  padding: 0 23px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px color-mix(in srgb, var(--green) 70%, transparent);
}

.content {
  min-width: 0;
  padding: 54px clamp(30px, 5vw, 76px) 110px;
}

.page {
  width: min(100%, var(--content-max));
  margin: 0 auto;
  animation: page-enter 240ms ease both;
}

@keyframes page-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.loading-state {
  min-height: 55vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.loading-grid {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  background:
    linear-gradient(90deg, transparent 45%, var(--accent) 45% 55%, transparent 55%),
    linear-gradient(transparent 45%, var(--accent) 45% 55%, transparent 55%);
  opacity: 0.8;
  animation: loading-spin 1.8s linear infinite;
}

@keyframes loading-spin {
  to { transform: rotate(180deg); }
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 21px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.page-header {
  position: relative;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--border-soft);
}

.page-header::after {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 82px;
  height: 2px;
  background: var(--page-color, var(--accent));
  content: "";
}

.page-kicker,
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 13px;
  color: var(--page-color, var(--accent));
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.page-kicker::before,
.eyebrow::before {
  width: 20px;
  height: 1px;
  background: currentColor;
  content: "";
}

.page-header h1,
.home-copy h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 720;
  letter-spacing: -0.045em;
  line-height: 1.04;
  text-wrap: balance;
}

.page-header h1 {
  max-width: 850px;
  font-size: clamp(31px, 4.6vw, 50px);
}

.page-summary,
.hero-lede {
  max-width: 750px;
  margin: 19px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.65;
  text-wrap: pretty;
}

.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 23px;
}

.page-actions {
  display: flex;
  margin-top: 22px;
}

.play-all-button {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.55em 1.2em;
  border: 0;
  border-radius: 6px;
  color: white;
  background: var(--accent);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.play-all-button:hover {
  color: white;
  background: var(--accent-strong);
  box-shadow: 0 3px 7px rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
}

.play-all-button.is-playing {
  background: var(--accent-active);
}

.play-all-button__icon {
  position: relative;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
}

.play-all-button__icon::before {
  position: absolute;
  top: 1px;
  left: 3px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
  content: "";
}

.play-all-button.is-playing .play-all-button__icon::before {
  top: 1px;
  left: 1px;
  width: 3px;
  height: 10px;
  border: 0;
  background: currentColor;
  box-shadow: 7px 0 0 currentColor;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.meta-chip--metric {
  border-color: color-mix(in srgb, var(--page-color, var(--accent)) 35%, var(--border));
  color: var(--page-color, var(--accent));
  background: color-mix(in srgb, var(--page-color, var(--accent)) 7%, var(--surface));
}

.article-content {
  padding-top: 20px;
  color: var(--text);
}

.article-content h2,
.article-content h3,
.article-content h4 {
  color: var(--text-strong);
  scroll-margin-top: calc(var(--topbar-height) + 22px);
  text-wrap: balance;
}

.article-content h2 {
  margin: 58px 0 17px;
  padding-top: 4px;
  font-size: clamp(23px, 3vw, 30px);
  font-weight: 690;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.article-content h2::before {
  display: inline-block;
  width: 19px;
  height: 2px;
  margin: 0 11px 0 -30px;
  vertical-align: 0.28em;
  background: var(--page-color, var(--accent));
  content: "";
}

.article-content h3 {
  margin: 34px 0 12px;
  font-size: 19px;
  font-weight: 660;
  letter-spacing: -0.018em;
}

.article-content h4 {
  margin: 25px 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.article-content p {
  margin: 0 0 18px;
}

.narrated-block {
  position: relative;
}

.audio-toggle {
  position: absolute;
  z-index: 3;
  top: 0.18em;
  left: -36px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  line-height: 1;
  transition: background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.audio-toggle:hover {
  color: white;
  background: var(--accent-strong);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transform: scale(1.1);
}

.audio-toggle.is-active {
  background: var(--accent-active);
}

.audio-toggle__icon {
  position: relative;
  width: 12px;
  height: 12px;
  display: block;
}

.audio-toggle__icon::before {
  position: absolute;
  top: 1px;
  left: 3px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
  content: "";
}

.audio-toggle.is-active .audio-toggle__icon::before {
  top: 1px;
  left: 1px;
  width: 3px;
  height: 10px;
  border: 0;
  background: currentColor;
  box-shadow: 7px 0 0 currentColor;
}

.audio-progress {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: -2px;
  left: 0;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.audio-progress__fill {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}

.narrated-block.is-playing > .audio-progress {
  opacity: 0.72;
}

.callout.narrated-block > .audio-toggle {
  top: 17px;
}

.callout.narrated-block > .audio-progress {
  right: 12px;
  bottom: 0;
  left: 12px;
}

.narrated-block--media > .audio-toggle {
  top: 10px;
  left: 10px;
}

.narrated-block--media > .audio-progress {
  bottom: 0;
}

pre.narrated-block--code > .audio-toggle {
  top: 10px;
  right: 10px;
  left: auto;
}

pre.narrated-block--code > .audio-progress {
  bottom: 0;
}

.section-sources {
  margin-top: 1.2em;
  padding-top: 0.6em;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

.section-sources__label {
  font-weight: 650;
}

.section-sources__separator {
  color: var(--muted-2);
}

.section-sources a {
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.section-sources a:hover {
  text-decoration: underline;
}

.article-content strong {
  color: var(--text-strong);
  font-weight: 650;
}

.article-content ul,
.article-content ol {
  margin: 0 0 21px;
  padding-left: 24px;
}

.article-content li {
  margin: 6px 0;
  padding-left: 3px;
}

.article-content li::marker {
  color: var(--page-color, var(--accent));
}

.article-content blockquote {
  margin: 25px 0;
  padding: 6px 0 6px 19px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}

code,
kbd,
pre {
  font-family: var(--font-mono);
}

:not(pre) > code {
  padding: 0.15em 0.38em;
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  color: color-mix(in srgb, var(--text-strong) 85%, var(--cyan));
  background: var(--surface-2);
  font-size: 0.84em;
}

pre {
  position: relative;
  max-width: 100%;
  margin: 24px 0 30px;
  overflow-x: auto;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: #d8e8dc;
  background: var(--code-bg);
  font-size: 12px;
  line-height: 1.72;
  tab-size: 2;
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--page-color, var(--accent)) 80%, transparent);
}

html[data-theme="light"] pre {
  color: #1f3926;
  background: var(--code-bg);
}

html[data-theme="light"] :not(pre) > code {
  border-color: rgba(35, 134, 54, 0.2);
  color: #145c2a;
  background: rgba(35, 134, 54, 0.08);
}

pre code {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
}

.table-wrap,
.comparison-table-wrap {
  max-width: 100%;
  margin: 25px 0 32px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  scrollbar-width: thin;
}

.article-content table,
.spec-table,
.comparison-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.5;
}

.article-content table {
  margin: 25px 0 32px;
  display: block;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.article-content th,
.article-content td,
.spec-table th,
.spec-table td,
.comparison-table th,
.comparison-table td {
  min-width: 110px;
  padding: 11px 13px;
  border-right: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  text-align: left;
  vertical-align: top;
}

.article-content th:last-child,
.article-content td:last-child,
.spec-table th:last-child,
.spec-table td:last-child,
.comparison-table th:last-child,
.comparison-table td:last-child {
  border-right: 0;
}

.article-content tr:last-child td,
.spec-table tr:last-child td,
.comparison-table tr:last-child td {
  border-bottom: 0;
}

.article-content th,
.spec-table th,
.comparison-table th {
  color: var(--text-strong);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.article-content tr:hover td,
.spec-table tr:hover td,
.comparison-table tr:hover td {
  background: color-mix(in srgb, var(--accent) 4%, transparent);
}

html[data-theme="light"] .article-content tbody tr:nth-child(even) td,
html[data-theme="light"] .spec-table tbody tr:nth-child(even) td,
html[data-theme="light"] .comparison-table tbody tr:nth-child(even) td {
  background: #f8fbf8;
}

html[data-theme="light"] .article-content tr:hover td,
html[data-theme="light"] .spec-table tr:hover td,
html[data-theme="light"] .comparison-table tr:hover td {
  background: rgba(35, 134, 54, 0.07);
}

.callout {
  position: relative;
  display: block;
  margin: 27px 0;
  padding: 17px 19px 17px 47px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: 10px;
  color: var(--text);
  background: linear-gradient(105deg, var(--accent-soft), transparent 78%);
}

.callout::before {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  content: "i";
}

.callout--warning {
  border-color: color-mix(in srgb, var(--orange) 35%, var(--border));
  background: linear-gradient(105deg, rgba(242, 139, 85, 0.12), transparent 78%);
}

.callout--warning::before {
  border-color: var(--orange);
  color: var(--orange);
  content: "!";
}

.callout strong {
  color: var(--text-strong);
}

.diagram-card {
  position: relative;
  min-height: 330px;
  margin: 30px 0 38px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 13px;
  background:
    radial-gradient(circle at 75% 15%, rgba(63, 185, 80, 0.09), transparent 30%),
    linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface-2) 70%, var(--bg)));
  box-shadow: var(--shadow-soft);
}

.diagram-card--large {
  min-height: 430px;
}

.diagram-card::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(63, 185, 80, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(63, 185, 80, 0.025) 1px, transparent 1px);
  background-size: 24px 24px;
  content: "";
}

.diagram-card svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.diagram-card svg text {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.diagram-card svg .svg-title {
  fill: var(--text-strong);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 650;
}

.diagram-card svg .svg-label {
  fill: var(--text);
  font-size: 10px;
  font-weight: 600;
}

.diagram-card svg .svg-note {
  fill: var(--muted-2);
  font-size: 8px;
}

.diagram-card svg .diagram-link {
  fill: none;
  stroke: var(--border);
  stroke-width: 1.5;
}

.diagram-card svg .diagram-node {
  fill: var(--surface-2);
  stroke: var(--border);
  stroke-width: 1;
}

.diagram-toolbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.diagram-toolbar strong {
  color: var(--text-strong);
  font-size: 12px;
}

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.segmented-control button,
.diagram-button {
  min-height: 29px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.segmented-control button:hover,
.segmented-control button[aria-pressed="true"],
.diagram-button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.diagram-caption {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 16px 13px;
  border-top: 1px solid var(--border-soft);
  color: var(--muted);
  font-size: 10px;
}

.diagram-caption code {
  color: var(--accent);
  background: transparent;
  border: 0;
}

.diagram-tooltip {
  position: fixed;
  z-index: 160;
  max-width: 260px;
  padding: 9px 11px;
  pointer-events: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 11px;
  line-height: 1.45;
}

.diagram-tooltip strong {
  display: block;
  margin-bottom: 2px;
  color: var(--text-strong);
}

.flow-dot {
  filter: drop-shadow(0 0 4px currentColor);
}

.flow-pulse {
  animation: flow-pulse 1.7s ease-in-out infinite;
}

@keyframes flow-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.page-footer-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 62px;
  padding-top: 26px;
  border-top: 1px solid var(--border-soft);
}

.page-footer-nav a {
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.page-footer-nav a:hover {
  border-color: var(--accent);
  color: var(--text-strong);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.page-footer-nav a:last-child {
  text-align: right;
}

.page-footer-nav small {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-footer-nav strong {
  margin-top: 3px;
  font-size: 13px;
}

.references-block {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
}

.references-block h2 {
  margin: 0 0 17px;
  color: var(--text-strong);
  font-size: 21px;
}

.references-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: reference;
}

.references-list li {
  position: relative;
  margin: 8px 0;
  padding-left: 32px;
  counter-increment: reference;
}

.references-list li::before {
  position: absolute;
  top: 2px;
  left: 0;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  content: counter(reference, decimal-leading-zero);
}

.references-list a {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.context-panel {
  padding: 42px 22px 32px 18px;
  overflow-y: auto;
  border-left: 1px solid var(--border-soft);
  background: color-mix(in srgb, var(--bg) 95%, var(--surface));
}

.context-heading {
  margin: 0 0 13px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.toc-list {
  margin: 0;
  padding: 0 0 0 11px;
  border-left: 1px solid var(--border);
  list-style: none;
}

.toc-list li {
  margin: 0;
}

.toc-list a {
  position: relative;
  display: block;
  padding: 5px 6px 5px 10px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
  text-decoration: none;
}

.toc-list a:hover,
.toc-list a.active {
  color: var(--text-strong);
}

.toc-list a.active::before {
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: -12px;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
  content: "";
}

.context-specs {
  margin-top: 31px;
  padding-top: 20px;
  border-top: 1px solid var(--border-soft);
}

.mini-spec {
  display: grid;
  gap: 2px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft);
}

.mini-spec strong {
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-spec span {
  color: var(--page-color, var(--accent));
  font-family: var(--font-mono);
  font-size: 9px;
}

/* Home */
.home-page {
  width: min(100%, 1120px);
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  align-items: center;
  gap: clamp(38px, 6vw, 82px);
  min-height: calc(100vh - var(--topbar-height) - 110px);
  padding-bottom: 55px;
}

.home-copy h1 span {
  display: block;
  color: var(--accent);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 27px;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  font-size: 12px;
  font-weight: 620;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  border-color: var(--accent);
  color: var(--text-strong);
  background: var(--surface-2);
}

.button--primary {
  border-color: var(--accent);
  color: #07120a;
  background: var(--accent);
}

html[data-theme="light"] .button--primary {
  color: white;
}

.button--primary:hover {
  color: #07120a;
  background: var(--accent-strong);
}

html[data-theme="light"] .button--primary:hover {
  color: white;
  background: var(--accent-active);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 38px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--border);
}

.hero-stat {
  padding: 12px;
  background: var(--surface);
}

.hero-stat strong,
.hero-stat span {
  display: block;
}

.hero-stat strong {
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 16px;
}

.hero-stat span {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.osi-container {
  position: relative;
  min-height: 550px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background:
    radial-gradient(circle at 25% 15%, rgba(35, 134, 54, 0.12), transparent 25%),
    radial-gradient(circle at 70% 80%, rgba(86, 211, 100, 0.1), transparent 30%),
    var(--surface);
  box-shadow: var(--shadow);
}

.osi-container::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image: linear-gradient(rgba(63, 185, 80, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(63, 185, 80, 0.025) 1px, transparent 1px);
  background-size: 22px 22px;
  content: "";
}

.osi-container svg {
  position: relative;
  width: 100%;
  display: block;
}

.osi-layer {
  cursor: pointer;
  transition: filter 140ms ease, transform 140ms ease;
}

.osi-layer:hover,
.osi-layer:focus {
  filter: brightness(1.18);
}

.home-section {
  padding: 70px 0 20px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}

.section-heading h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(25px, 3.5vw, 36px);
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.section-heading p {
  max-width: 480px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.quick-card {
  position: relative;
  min-height: 154px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 13px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.quick-card::after {
  position: absolute;
  right: -28px;
  bottom: -34px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--card-color) 12%, transparent);
  content: "";
}

.quick-card:hover {
  border-color: color-mix(in srgb, var(--card-color) 55%, var(--border));
  color: var(--text-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-3px);
}

.quick-card-index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--card-color) 50%, transparent);
  border-radius: 8px;
  color: var(--card-color);
  background: color-mix(in srgb, var(--card-color) 9%, transparent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}

.quick-card h3 {
  margin: 1px 0 5px;
  color: var(--text-strong);
  font-size: 15px;
}

.quick-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.quick-card code {
  grid-column: 2;
  align-self: end;
  width: max-content;
  margin-top: 8px;
  color: var(--card-color);
  background: transparent;
  border: 0;
  font-size: 10px;
}

.cross-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.cross-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 17px;
  border: 1px solid var(--border);
  border-top: 2px solid var(--card-color, var(--accent));
  border-radius: 9px;
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.cross-card:hover {
  border-color: var(--card-color, var(--accent));
  color: var(--text-strong);
  background: var(--surface-2);
}

.cross-card h3 {
  margin: 0 0 6px;
  color: var(--text-strong);
  font-size: 13px;
}

.cross-card p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.cross-card code {
  margin-top: 15px;
  color: var(--card-color, var(--accent));
  background: none;
  border: 0;
  font-size: 9px;
}

/* Comparisons */
.comparison-controls,
.glossary-controls {
  position: sticky;
  z-index: 20;
  top: calc(var(--topbar-height) + 8px);
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  margin: 27px 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(15px);
  box-shadow: var(--shadow-soft);
}

.field {
  position: relative;
}

.field input,
.field select,
.filter-select {
  width: 100%;
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
  color: var(--text);
  background: var(--surface-2);
  font-size: 12px;
}

.field input:focus,
.field select:focus,
.filter-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.comparison-section {
  margin: 51px 0 68px;
  scroll-margin-top: calc(var(--topbar-height) + 88px);
}

.comparison-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 25px;
  margin-bottom: 17px;
}

.comparison-heading h2 {
  margin: 0 0 6px;
  color: var(--text-strong);
  font-size: 24px;
  letter-spacing: -0.025em;
}

.comparison-heading p {
  max-width: 660px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.comparison-count {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.comparison-table-wrap {
  margin: 0;
}

.comparison-table th {
  padding: 0;
}

.comparison-table th button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

.comparison-table th button:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.sort-indicator {
  color: var(--muted-2);
  font-size: 8px;
}

.comparison-notes {
  margin-top: 13px;
  padding-left: 13px;
  border-left: 2px solid var(--border);
  color: var(--muted);
  font-size: 10px;
}

.comparison-notes p {
  margin: 0;
}

/* Glossary */
.glossary-controls {
  grid-template-columns: minmax(220px, 1fr) minmax(140px, 210px);
}

.glossary-summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 11px;
}

.glossary-summary strong {
  color: var(--text-strong);
  font-family: var(--font-mono);
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.glossary-term {
  position: relative;
  min-height: 145px;
  display: flex;
  flex-direction: column;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  scroll-margin-top: calc(var(--topbar-height) + 90px);
}

.glossary-term:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--surface-2);
}

.glossary-term header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.glossary-term h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 16px;
  letter-spacing: -0.015em;
}

.term-category {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 7px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.glossary-term p {
  margin: 11px 0 13px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.glossary-term > a {
  margin-top: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  text-decoration: none;
}

.glossary-empty,
.comparison-empty {
  grid-column: 1 / -1;
  padding: 50px 20px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

mark {
  padding: 0 1px;
  color: inherit;
  background: color-mix(in srgb, var(--yellow) 35%, transparent);
}

/* Master references */
.reference-groups {
  margin-top: 32px;
}

.reference-card {
  display: grid;
  grid-template-columns: 33px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border-soft);
}

.reference-number {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 8px;
}

.reference-card h2 {
  margin: 0 0 4px;
  color: var(--text-strong);
  font-size: 13px;
}

.reference-card a {
  display: block;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-contexts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.reference-contexts span {
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface-2);
  font-size: 8px;
}

.error-state {
  max-width: 650px;
  margin: 15vh auto 0;
  padding: 28px;
  border: 1px solid color-mix(in srgb, var(--red) 40%, var(--border));
  border-radius: 12px;
  background: var(--surface);
}

.error-state h1 {
  margin: 0 0 10px;
  color: var(--text-strong);
  font-size: 27px;
}

.error-state p {
  color: var(--muted);
}

.noscript {
  position: fixed;
  z-index: 300;
  inset: auto 16px 16px;
  padding: 13px;
  border: 1px solid var(--red);
  border-radius: 8px;
  color: var(--text-strong);
  background: var(--surface);
  text-align: center;
}

@media (max-width: 1280px) {
  :root { --sidebar-width: 250px; }

  .app-shell {
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: var(--sidebar-width) minmax(260px, 600px) 44px;
  }

  .context-panel {
    display: none;
  }

  .content {
    padding-right: clamp(35px, 7vw, 100px);
    padding-left: clamp(35px, 7vw, 100px);
  }
}

@media (max-width: 980px) {
  .home-hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .home-copy {
    max-width: 700px;
    padding-top: 20px;
  }

  .osi-container {
    width: min(100%, 620px);
    min-height: 500px;
    margin: 0 auto;
  }

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

@media (max-width: 800px) {
  :root {
    --topbar-height: 62px;
    --sidebar-width: 278px;
  }

  .mobile-only {
    display: inline-grid;
  }

  .topbar {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    gap: 8px;
    padding: 0 10px;
  }

  .brand {
    display: none;
  }

  .global-search {
    grid-column: 2;
  }

  .global-search input {
    height: 38px;
    padding-right: 13px;
  }

  .global-search > kbd {
    display: none;
  }

  .app-shell {
    display: block;
    padding-top: var(--topbar-height);
  }

  .sidebar {
    position: fixed;
    z-index: 90;
    top: var(--topbar-height);
    bottom: 0;
    left: 0;
    width: var(--sidebar-width);
    height: auto;
    box-shadow: var(--shadow);
    transform: translateX(-105%);
    transition: transform 200ms ease;
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .nav-scrim {
    position: fixed;
    z-index: 80;
    inset: var(--topbar-height) 0 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
  }

  body.nav-open .nav-scrim {
    display: block;
  }

  .content {
    padding: 38px clamp(18px, 5vw, 40px) 85px;
  }

  .article-content h2::before {
    width: 13px;
    margin-left: 0;
    margin-right: 8px;
  }

  .comparison-controls,
  .glossary-controls {
    top: calc(var(--topbar-height) + 5px);
  }
}

@media (max-width: 620px) {
  body {
    font-size: 14px;
  }

  .page-header h1,
  .home-copy h1 {
    font-size: clamp(31px, 10vw, 42px);
  }

  .page-summary,
  .hero-lede {
    font-size: 15px;
  }

  .narrated-block:not(.narrated-block--media):not(.narrated-block--code) > .audio-toggle {
    position: relative;
    top: auto;
    left: auto;
    float: left;
    margin: 0.18em 0.5em 0 0;
  }

  .callout.narrated-block > .audio-toggle {
    top: auto;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero-stat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
  }

  .quick-grid,
  .glossary-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .comparison-controls,
  .glossary-controls {
    position: static;
    grid-template-columns: 1fr;
  }

  .comparison-heading {
    flex-direction: column;
    gap: 9px;
  }

  .diagram-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .diagram-caption {
    flex-direction: column;
    gap: 4px;
  }

  .diagram-card,
  .diagram-card--large {
    min-height: 300px;
    margin-right: -5px;
    margin-left: -5px;
  }

  .page-footer-nav {
    grid-template-columns: 1fr;
  }

  .page-footer-nav a:last-child {
    text-align: left;
  }

  .cross-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .content {
    padding-right: 15px;
    padding-left: 15px;
  }

  .osi-container {
    min-height: 440px;
    margin-right: -3px;
    margin-left: -3px;
  }

  .quick-card {
    padding: 16px;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  :root { color-scheme: light; }

  body {
    color: #111;
    background: white;
    font-size: 11pt;
  }

  .topbar,
  .sidebar,
  .context-panel,
  .page-footer-nav,
  .play-all-button,
  .audio-toggle,
  .audio-progress,
  .comparison-controls,
  .glossary-controls {
    display: none !important;
  }

  .app-shell {
    display: block;
    padding: 0;
  }

  .content {
    padding: 0;
  }

  .page {
    width: 100%;
  }

  a { color: #1a7f37; }
  pre, .diagram-card, table { break-inside: avoid; }
}
