:root {
  color-scheme: light;

  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: Iowan Old Style, "Palatino Linotype", Palatino, Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --bg: #f6f9fa;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-muted: #edf3f5;
  --surface-strong: #dce8eb;
  --text: #14272f;
  --text-muted: #47606a;
  --text-faint: #647982;
  --border: #d2dfe3;
  --border-strong: #aebfc6;
  --primary: #0b4a6f;
  --primary-hover: #073b59;
  --primary-contrast: #ffffff;
  --secondary: #0f766e;
  --secondary-tint: #e2f4f1;
  --accent: #b45309;
  --accent-tint: #fff3df;
  --link: #075f96;
  --focus: #bd4f0b;
  --danger: #b4233f;
  --scrim: rgb(8 28 37 / 0.58);
  --topbar: rgb(246 249 250 / 0.88);
  --code: #e8f0f2;
  --hero: linear-gradient(135deg, #083f62 0%, #0b5871 52%, #0f766e 100%);
  --hero-text: #f5fbfc;
  --hero-muted: #c5e2e5;

  --radius-sm: 0.45rem;
  --radius-md: 0.8rem;
  --radius-lg: 1.2rem;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(8 42 55 / 0.08), 0 2px 6px rgb(8 42 55 / 0.05);
  --shadow-md: 0 12px 30px -18px rgb(8 42 55 / 0.34);
  --shadow-lg: 0 28px 70px -28px rgb(1 17 24 / 0.48);
  --speed: 160ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #07171f;
  --surface: #0d222c;
  --surface-raised: #112b36;
  --surface-muted: #153541;
  --surface-strong: #1d4552;
  --text: #e8f1f4;
  --text-muted: #b3c7cf;
  --text-faint: #8ea7b1;
  --border: #244551;
  --border-strong: #3b606d;
  --primary: #7fc9e9;
  --primary-hover: #a1daf1;
  --primary-contrast: #061720;
  --secondary: #66d0c5;
  --secondary-tint: #103b39;
  --accent: #f6b65c;
  --accent-tint: #3b2a11;
  --link: #80c9ed;
  --focus: #ffbd68;
  --danger: #ff8ca0;
  --scrim: rgb(0 7 11 / 0.76);
  --topbar: rgb(7 23 31 / 0.88);
  --code: #173642;
  --hero: linear-gradient(135deg, #082e45 0%, #0a4356 52%, #0b5c57 100%);
  --hero-text: #f2fafb;
  --hero-muted: #bddce0;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.35);
  --shadow-md: 0 14px 32px -18px rgb(0 0 0 / 0.72);
  --shadow-lg: 0 28px 70px -24px rgb(0 0 0 / 0.84);
}

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

* {
  margin: 0;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: var(--link);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 0.12em;
}

h1,
h2,
h3,
h4 {
  color: var(--text);
  font-weight: 720;
  line-height: 1.16;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 6vw, 4.8rem);
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

h3 {
  font-size: 1.18rem;
}

p,
li {
  text-wrap: pretty;
}

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

code {
  border-radius: 0.3rem;
  background: var(--code);
  padding: 0.12em 0.34em;
  font-size: 0.9em;
}

kbd {
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 0.35rem;
  background: var(--surface);
  padding: 0.05rem 0.34rem;
  color: var(--text-muted);
  font-size: 0.7rem;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

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

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  clip-path: inset(50%) !important;
}

.skip-link {
  position: fixed;
  z-index: 300;
  top: 0.5rem;
  left: 0.5rem;
  translate: 0 -150%;
  border-radius: var(--radius-sm);
  background: var(--focus);
  padding: 0.65rem 1rem;
  color: #111820;
  font-weight: 750;
  transition: translate var(--speed) var(--ease);
}

.skip-link:focus {
  translate: 0;
}

.topbar {
  position: sticky;
  z-index: 80;
  top: 0;
  min-height: 4rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-bottom: 1px solid var(--border);
  background: var(--topbar);
  padding: 0.55rem clamp(0.8rem, 2.4vw, 2rem);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--text);
  font-weight: 780;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand img {
  width: 2rem;
  height: 2rem;
  flex: none;
}

.brand span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-chip {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  padding: 0.22rem 0.56rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.38rem;
}

.icon-button,
.search-button {
  min-width: 2.65rem;
  min-height: 2.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  text-decoration: none;
}

.icon-button:hover,
.search-button:hover {
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--text);
  text-decoration: none;
}

.github-button {
  flex: none;
}

.github-button svg {
  width: 1.2rem;
  height: 1.2rem;
}

.theme-toggle span {
  font-size: 1.25rem;
  line-height: 1;
}

.theme-dark,
:root[data-theme="dark"] .theme-light {
  display: none;
}

:root[data-theme="dark"] .theme-dark {
  display: inline;
}

.search-button {
  gap: 0.52rem;
  border-color: var(--border);
  background: var(--surface);
  padding: 0 0.62rem;
}

.search-button > span:first-child {
  font-size: 1.35rem;
}

.search-label {
  font-size: 0.83rem;
}

.nav-toggle {
  display: inline-flex;
  flex: none;
}

.nav-toggle .hb {
  position: relative;
  width: 1.18rem;
  height: 0.9rem;
  display: block;
  transition: transform var(--speed) var(--ease);
}

.nav-toggle:active .hb {
  transform: scale(0.88);
}

.nav-toggle .hb span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--speed) var(--ease), opacity var(--speed) var(--ease);
}

.nav-toggle .hb-top {
  top: 0;
}

.nav-toggle .hb-middle {
  top: 0.39rem;
}

.nav-toggle .hb-bottom {
  bottom: 0;
}

@media (max-width: 63.9375rem) {
  body.nav-open .nav-toggle .hb-top {
    transform: translateY(0.39rem) rotate(45deg);
  }

  body.nav-open .nav-toggle .hb-middle {
    opacity: 0;
    transform: translateX(-0.35rem);
  }

  body.nav-open .nav-toggle .hb-bottom {
    transform: translateY(-0.39rem) rotate(-45deg);
  }
}

@media (min-width: 64rem) {
  :root:not(.rail-collapsed) .nav-toggle .hb-top {
    transform: translateY(0.39rem) rotate(45deg);
  }

  :root:not(.rail-collapsed) .nav-toggle .hb-middle {
    opacity: 0;
    transform: translateX(-0.35rem);
  }

  :root:not(.rail-collapsed) .nav-toggle .hb-bottom {
    transform: translateY(-0.39rem) rotate(-45deg);
  }
}

.layout {
  min-width: 0;
  flex: 1 0 auto;
  display: grid;
  grid-template-columns: 16.5rem minmax(0, 1fr);
}

@media (min-width: 64rem) {
  .layout {
    transition: grid-template-columns var(--speed) var(--ease);
  }

  .sidebar {
    width: 16.5rem;
    transition: translate var(--speed) var(--ease), visibility 0s;
  }

  :root.rail-collapsed .layout {
    grid-template-columns: 0 minmax(0, 1fr);
  }

  :root.rail-collapsed .sidebar {
    translate: -102% 0;
    visibility: hidden;
    transition: translate var(--speed) var(--ease), visibility 0s var(--speed);
  }
}

.sidebar {
  position: sticky;
  top: 4rem;
  height: calc(100dvh - 4rem);
  align-self: start;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--surface-muted);
  padding: 1.45rem 1rem;
  scrollbar-width: thin;
}

.sidebar-label {
  margin: 0 0.55rem 0.75rem;
  color: var(--text-faint);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.sidebar > a {
  display: block;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.65rem;
  color: var(--text-muted);
  font-size: 0.91rem;
  font-weight: 610;
  text-decoration: none;
}

.sidebar > a:hover {
  background: var(--surface);
  color: var(--text);
}

.sidebar > a[aria-current="page"] {
  background: var(--secondary-tint);
  color: var(--secondary);
  font-weight: 760;
}

.sidebar-note {
  margin-top: 1.35rem;
  border-top: 1px solid var(--border);
  padding: 1rem 0.65rem 0;
  color: var(--text-faint);
  font-size: 0.78rem;
  line-height: 1.52;
}

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

.nav-scrim {
  position: fixed;
  z-index: 65;
  inset: 4rem 0 0;
  display: none;
  background: var(--scrim);
}

.content {
  min-width: 0;
  width: 100%;
  max-width: 93rem;
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 5rem) clamp(1rem, 5vw, 5rem) 6rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 52rem) minmax(11rem, 14rem);
  justify-content: center;
  gap: clamp(2.5rem, 5vw, 5.5rem);
}

.content:not(:has(.content-grid)) {
  max-width: 70rem;
}

.page-head {
  max-width: 56rem;
  margin-bottom: clamp(2rem, 5vw, 3.6rem);
}

.page-head h1 {
  max-width: 16ch;
}

.page-head > p {
  max-width: 48rem;
  margin-top: 1.15rem;
  color: var(--text-muted);
  font-family: var(--font-serif);
  font-size: clamp(1.16rem, 2.2vw, 1.48rem);
  line-height: 1.48;
}

.eyebrow {
  display: block;
  margin-bottom: 0.78rem;
  color: var(--secondary);
  font-size: 0.75rem;
  font-weight: 820;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.article-meta {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  color: var(--text-faint);
  font-size: 0.84rem;
}

.proposal-note {
  margin: 0 0 2.5rem;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--border));
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--accent-tint);
  padding: 1rem 1.15rem;
  color: var(--text-muted);
}

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

.proposal-note-home {
  margin-top: -1rem;
  padding: clamp(1.1rem, 3vw, 1.5rem);
}

.proposal-note-home > span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 820;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.proposal-note-home > strong {
  display: block;
  font-size: 1.08rem;
}

.proposal-note-home p {
  margin-top: 0.3rem;
}

.home-actions {
  margin: 1.25rem 0 3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.button {
  min-height: 2.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0.6rem 0.92rem;
  color: var(--text);
  font-size: 0.87rem;
  font-weight: 720;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
}

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

.button-primary:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
  color: var(--primary-contrast);
}

.prose {
  max-width: 50rem;
  font-size: 1.015rem;
}

.prose > * + * {
  margin-top: 1.15rem;
}

.prose h2 {
  margin-top: 3.4rem;
  scroll-margin-top: 5.5rem;
}

.prose h3 {
  margin-top: 2.3rem;
  scroll-margin-top: 5.5rem;
}

.prose h4 {
  margin-top: 1.7rem;
}

.prose ul,
.prose ol {
  padding-left: 1.35rem;
}

.prose li + li {
  margin-top: 0.36rem;
}

.prose li > ul,
.prose li > ol {
  margin-top: 0.36rem;
}

.task-mark {
  color: var(--secondary);
  font-weight: 800;
}

.prose blockquote {
  border-left: 4px solid var(--secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--secondary-tint);
  padding: 1rem 1.15rem;
  color: var(--text-muted);
}

.prose blockquote > * + * {
  margin-top: 0.7rem;
}

.prose hr {
  margin-block: 3rem;
  border: 0;
  border-top: 1px solid var(--border);
}

.codeblock {
  position: relative;
  max-width: 100%;
}

.copy-button {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  min-height: 2rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0.3rem 0.55rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.copy-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.prose pre {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--code);
  padding: 1rem;
  font-size: 0.84rem;
  line-height: 1.6;
  tab-size: 2;
}

.prose pre code {
  border-radius: 0;
  background: none;
  padding: 0;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.prose table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.prose th,
.prose td {
  border-bottom: 1px solid var(--border);
  padding: 0.68rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: var(--surface-muted);
  color: var(--text);
  font-size: 0.76rem;
  letter-spacing: 0.025em;
}

.prose tr:last-child td {
  border-bottom: 0;
}

.figure {
  margin-block: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.figure img {
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius-lg) - 0.35rem);
}

.figure figcaption {
  margin-top: 0.7rem;
  color: var(--text-faint);
  font-size: 0.8rem;
  text-align: center;
}

.figure-zoom {
  display: block;
  border-radius: var(--radius-md);
  cursor: zoom-in;
}

.figure-zoom:hover {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.toc {
  position: sticky;
  top: 6rem;
  max-height: calc(100dvh - 8rem);
  align-self: start;
  overflow-y: auto;
  padding-left: 0.2rem;
  font-size: 0.8rem;
}

.toc-title {
  margin-bottom: 0.65rem;
  color: var(--text-faint);
  font-size: 0.67rem;
  font-weight: 820;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.toc a {
  display: block;
  border-left: 2px solid var(--border);
  padding: 0.28rem 0 0.28rem 0.7rem;
  color: var(--text-faint);
  text-decoration: none;
}

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

.toc-l3 {
  padding-left: 1.35rem !important;
  font-size: 0.94em;
}

.section-head {
  max-width: 48rem;
  margin: 4.8rem 0 1.5rem;
}

.section-head p {
  margin-top: 0.6rem;
  color: var(--text-muted);
}

.infographic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.4vw, 1.6rem);
}

.infographic {
  min-width: 0;
}

.infographic-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.infographic-card .figure-zoom {
  border-radius: 0;
  background: #fff;
}

.infographic img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.infographic figcaption {
  display: grid;
  gap: 0.3rem;
  padding: 0.9rem 1rem 1.05rem;
}

.infographic figcaption strong {
  line-height: 1.3;
}

.infographic figcaption span {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.52;
}

.infographic figcaption .asset-status {
  width: fit-content;
  margin-top: 0.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-muted);
  padding: 0.12rem 0.42rem;
  color: var(--text-faint);
  font-size: 0.64rem;
  font-weight: 720;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.source-note {
  max-width: 50rem;
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  color: var(--text-faint);
  font-size: 0.77rem;
}

.empty-state {
  max-width: 38rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 1.25rem;
}

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

.footer {
  min-height: 7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-top: 1px solid var(--border);
  background: var(--surface-muted);
  padding: 1.4rem clamp(1rem, 4vw, 3rem);
  color: var(--text-faint);
  font-size: 0.76rem;
}

.footer > div {
  max-width: 58rem;
  display: grid;
  gap: 0.25rem;
}

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

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  white-space: nowrap;
}

dialog {
  color: var(--text);
}

dialog::backdrop {
  background: var(--scrim);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.search-dialog {
  width: min(44rem, calc(100vw - 1.5rem));
  max-height: min(44rem, calc(100dvh - 1.5rem));
  inset: 0;
  margin: auto;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  padding: 0;
  box-shadow: var(--shadow-lg);
}

.dialog-panel {
  max-height: inherit;
  display: flex;
  flex-direction: column;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1rem 0.85rem 1.15rem;
}

.dialog-head h2 {
  font-size: 1rem;
}

.dialog-head p {
  margin-top: 0.12rem;
  color: var(--text-faint);
  font-size: 0.75rem;
}

.search-field {
  display: block;
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 1rem;
}

.search-field input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0.72rem 0.8rem;
  color: var(--text);
  outline: none;
}

.search-field input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent);
}

.search-status {
  min-height: 1.8rem;
  padding: 0.45rem 1rem 0;
  color: var(--text-faint);
  font-size: 0.73rem;
}

.search-results {
  min-height: 11rem;
  overflow-y: auto;
  padding: 0.4rem 0.7rem 0.8rem;
}

.search-result {
  display: block;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.62rem 0.7rem;
  color: var(--text);
  text-decoration: none;
}

.search-result:hover,
.search-result.selected {
  border-color: var(--border);
  background: var(--surface-muted);
  text-decoration: none;
}

.search-result-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 720;
}

.search-result-kind {
  flex: none;
  color: var(--text-faint);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-result p {
  margin-top: 0.18rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.search-empty {
  padding: 2rem 1rem;
  color: var(--text-faint);
  text-align: center;
}

.dialog-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  border-top: 1px solid var(--border);
  padding: 0.6rem 1rem;
  color: var(--text-faint);
  font-size: 0.68rem;
}

.lightbox {
  width: min(96vw, 90rem);
  height: min(94dvh, 62rem);
  inset: 0;
  margin: auto;
  overflow: hidden;
  border: 0;
  background: transparent;
  padding: 3.5rem 1rem 1rem;
}

.lightbox[open] {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  gap: 0.75rem;
}

.lightbox img {
  min-width: 0;
  max-width: 100%;
  max-height: 100%;
  align-self: center;
  border-radius: var(--radius-md);
  background: #fff;
  object-fit: contain;
  box-shadow: var(--shadow-lg);
}

.lightbox p {
  max-width: 70ch;
  color: #fff;
  font-size: 0.8rem;
  text-align: center;
  text-shadow: 0 1px 4px #000;
}

.lightbox-close {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  border-color: rgb(255 255 255 / 0.4);
  background: rgb(4 18 24 / 0.82);
  color: #fff;
  font-size: 1.35rem;
}

@media (max-width: 74rem) {
  .content-grid {
    grid-template-columns: minmax(0, 52rem);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 63.9375rem) {
  .layout {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 70;
    top: 4rem;
    bottom: 0;
    left: 0;
    width: min(19rem, 86vw);
    height: auto;
    translate: -102% 0;
    border-right-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
    transition: translate var(--speed) var(--ease);
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .sidebar {
    translate: 0;
  }

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

  .content {
    max-width: 62rem;
  }

  .footer {
    align-items: flex-start;
  }
}

@media (max-width: 42rem) {
  .topbar {
    gap: 0.4rem;
  }

  .brand span {
    max-width: 9.8rem;
  }

  .status-chip,
  .search-label,
  .search-button kbd {
    display: none;
  }

  .search-button {
    min-width: 2.65rem;
    padding: 0;
  }

  .content {
    padding-inline: 1rem;
  }

  .page-head h1 {
    font-size: clamp(2.15rem, 13vw, 3.4rem);
  }

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

  .footer {
    flex-direction: column;
    gap: 1rem;
  }
}

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

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

@media print {
  .topbar,
  .sidebar,
  .toc,
  .nav-scrim,
  .footer,
  dialog,
  .home-actions,
  .source-note {
    display: none !important;
  }

  body,
  .layout,
  .content {
    display: block;
    background: #fff;
    color: #111;
  }

  .content {
    max-width: none;
    padding: 0;
  }

  .page-head h1 {
    font-size: 2.4rem;
  }

  .infographic-card,
  .figure,
  .table-wrap {
    break-inside: avoid;
    box-shadow: none;
  }

  a {
    color: inherit;
  }
}
