:root {
  --ink: #102a43;
  --ink-soft: #334e68;
  --muted: #627d98;
  --paper: #fbfcfa;
  --surface: #ffffff;
  --surface-soft: #f2f7f6;
  --line: #d8e3e1;
  --teal: #087f78;
  --teal-dark: #05615c;
  --mint: #c9eee8;
  --amber: #d69e2e;
  --shadow: 0 20px 60px rgba(16, 42, 67, 0.1);
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 7rem; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 4%, rgba(8, 127, 120, 0.08), transparent 25rem),
    var(--paper);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal-dark); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { color: var(--teal); }
button, input { font: inherit; }

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

.skip-link {
  position: fixed;
  z-index: 100;
  left: 1rem;
  top: 1rem;
  transform: translateY(-200%);
  padding: 0.65rem 1rem;
  color: white;
  background: var(--ink);
  border-radius: 0.5rem;
}
.skip-link:focus { transform: translateY(0); }

.reading-progress {
  position: fixed;
  inset: 0 0 auto;
  z-index: 90;
  height: 4px;
  background: rgba(216, 227, 225, 0.5);
}
.reading-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), #31b8a9);
  transform: scaleX(0);
  transform-origin: left;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.35rem clamp(1.2rem, 4vw, 4rem);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.15;
}
.wordmark-mark {
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  color: white;
  background: var(--ink);
  border-radius: 0.7rem 0.7rem 0.7rem 0.15rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.wordmark strong, .wordmark small { display: block; }
.wordmark strong { font-size: 0.95rem; letter-spacing: 0.01em; }
.wordmark small { margin-top: 0.22rem; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.055em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 1rem; }
.quiet-link { color: var(--ink-soft); font-size: 0.88rem; font-weight: 650; text-decoration: none; }
.quiet-link:hover { text-decoration: underline; }
.nav-toggle {
  display: none;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  color: var(--ink);
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 700;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(17rem, 0.38fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
  max-width: 1340px;
  margin: 0 auto;
  padding: clamp(4rem, 9vw, 8.5rem) clamp(1.2rem, 4vw, 4rem) clamp(3rem, 6vw, 5.5rem);
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1.2rem;
  color: var(--teal-dark);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.eyebrow span { width: 2.3rem; height: 2px; background: var(--teal); }
.hero h1 {
  max-width: 14ch;
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(3.2rem, 7vw, 7rem);
  font-weight: 500;
  letter-spacing: -0.052em;
  line-height: 0.96;
  overflow-wrap: anywhere;
}
.hero-copy, .hero-panel { min-width: 0; }
.hero h1 em { color: var(--teal); font-weight: 500; }
.dek {
  max-width: 48rem;
  margin: 1.8rem 0 0;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.1vw, 1.7rem);
  line-height: 1.5;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.button {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.65rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 0.55rem;
  font-size: 0.88rem;
  font-weight: 750;
  text-decoration: none;
}
.button.primary { color: white; background: var(--ink); }
.button.primary:hover { color: white; background: var(--teal-dark); border-color: var(--teal-dark); }
.button.secondary { color: var(--ink); background: transparent; }
.button.secondary:hover { background: var(--surface); }
.hero-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.scope-stat { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.scope-stat:last-child { border: 0; }
.scope-stat span { color: var(--muted); font-size: 0.78rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.scope-stat strong { color: var(--ink); font-size: 0.9rem; text-align: right; }

.scope-note {
  display: flex;
  gap: 1.1rem;
  align-items: flex-start;
  max-width: 1340px;
  margin: 0 auto clamp(4rem, 7vw, 7rem);
  padding: 1.4rem clamp(1.2rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--surface-soft);
}
.scope-note p { margin: 0; color: var(--ink-soft); font-size: 0.94rem; line-height: 1.6; }
.scope-icon { flex: none; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; color: var(--teal-dark); border: 1px solid var(--teal); border-radius: 50%; font-family: var(--serif); font-weight: 700; }

.page-shell {
  display: grid;
  grid-template-columns: 16rem minmax(0, 52rem);
  gap: clamp(3rem, 7vw, 7rem);
  justify-content: center;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 clamp(1.2rem, 4vw, 4rem) 8rem;
}
.sidebar { min-width: 0; }
.sidebar-inner { position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow: auto; padding: 0.35rem 0.6rem 1.5rem 0; scrollbar-width: thin; }
.sidebar-label { margin: 0 0 0.85rem; color: var(--muted); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
.section-filter { position: relative; display: flex; align-items: center; margin-bottom: 1rem; }
.section-filter svg { position: absolute; left: 0.75rem; width: 1rem; fill: none; stroke: var(--muted); stroke-linecap: round; stroke-width: 1.8; }
.section-filter input { width: 100%; padding: 0.65rem 2.3rem 0.65rem 2.2rem; border: 1px solid var(--line); border-radius: 0.55rem; outline: 0; color: var(--ink); background: var(--surface); font-size: 0.78rem; }
.section-filter input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(8, 127, 120, 0.12); }
.section-filter kbd { position: absolute; right: 0.55rem; padding: 0.05rem 0.35rem; color: var(--muted); border: 1px solid var(--line); border-radius: 0.25rem; background: var(--paper); font-size: 0.65rem; }
.toc > div > ul { margin: 0; padding: 0; list-style: none; }
.toc ul ul { margin: 0.2rem 0 0.45rem 0.72rem; padding: 0 0 0 0.75rem; border-left: 1px solid var(--line); list-style: none; }
.toc li { margin: 0; }
.toc li[hidden] { display: none; }
.toc a { display: block; padding: 0.34rem 0.5rem; color: var(--ink-soft); border-radius: 0.35rem; font-size: 0.78rem; font-weight: 620; line-height: 1.35; text-decoration: none; }
.toc ul ul a { color: var(--muted); font-size: 0.72rem; font-weight: 520; }
.toc a:hover, .toc a.active { color: var(--teal-dark); background: var(--surface-soft); }
.sidebar-note { margin-top: 1.5rem; padding: 0.9rem; border-top: 2px solid var(--teal); background: var(--surface-soft); }
.sidebar-note > span { display: block; margin-bottom: 0.5rem; color: var(--muted); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.sidebar-note p { margin: 0.2rem 0; color: var(--ink-soft); font-size: 0.71rem; line-height: 1.35; }
.sidebar-note b { display: inline-block; min-width: 1.65rem; color: var(--teal-dark); }

.report { min-width: 0; color: #213b53; overflow-wrap: break-word; }
.report > h2:first-child { margin-top: 0; }
.report h2, .report h3, .report h4 { position: relative; color: var(--ink); }
.report h2 {
  margin: 6rem 0 1.4rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 520;
  letter-spacing: -0.026em;
  line-height: 1.15;
}
.report h3 { margin: 3.2rem 0 1rem; font-family: var(--serif); font-size: 1.55rem; font-weight: 600; line-height: 1.25; }
.report h4 { margin: 2.4rem 0 0.8rem; font-size: 1.05rem; }
.heading-anchor { margin-left: 0.45rem; color: var(--mint); font-family: var(--sans); font-size: 0.7em; font-weight: 500; text-decoration: none; opacity: 0; transition: opacity 120ms ease; }
.report h2:hover .heading-anchor, .report h3:hover .heading-anchor, .heading-anchor:focus { opacity: 1; }
.report p { margin: 0 0 1.28rem; }
.report > p:first-of-type {
  padding: 1.4rem 1.55rem;
  border-left: 4px solid var(--teal);
  color: var(--ink-soft);
  background: linear-gradient(90deg, var(--surface-soft), transparent);
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.6;
}
.report strong { color: var(--ink); }
.report em { color: #34566f; }
.report ul, .report ol { margin: 0 0 1.4rem; padding-left: 1.35rem; }
.report li { margin: 0.48rem 0; padding-left: 0.25rem; }
.report li::marker { color: var(--teal); font-weight: 750; }
.report blockquote { margin: 2rem 0; padding: 1.2rem 1.4rem; border-left: 4px solid var(--amber); background: #fffaf0; }
.report blockquote p:last-child { margin-bottom: 0; }
.report a[href^="http"]::after { content: " ↗"; font-size: 0.7em; vertical-align: 0.15em; }
.table-wrap { width: 100%; margin: 2rem 0 2.6rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 0.7rem; background: var(--surface); box-shadow: 0 8px 30px rgba(16, 42, 67, 0.05); }
.table-wrap:focus { outline: 3px solid rgba(8, 127, 120, 0.18); outline-offset: 2px; }
.report table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 0.78rem; line-height: 1.45; }
.report th { padding: 0.8rem 0.9rem; color: white; background: var(--ink); text-align: left; vertical-align: bottom; }
.report td { padding: 0.82rem 0.9rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.report tbody tr:nth-child(even) { background: #f7faf9; }
.report tbody tr:last-child td { border-bottom: 0; }
.report code { padding: 0.15em 0.35em; border: 1px solid var(--line); border-radius: 0.25rem; background: var(--surface-soft); font-size: 0.88em; overflow-wrap: anywhere; }
.report-footer { margin-top: 6rem; padding: 1.5rem; border: 1px solid var(--line); border-radius: 0.7rem; background: var(--surface-soft); }
.report-footer p { margin: 0 0 0.55rem; color: var(--muted); font-size: 0.78rem; line-height: 1.55; }
.report-footer p:last-child { margin: 0; }

.back-to-top {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--ink);
  box-shadow: 0 10px 25px rgba(16, 42, 67, 0.25);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.7rem);
  transition: 160ms ease;
}
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-panel { display: grid; grid-template-columns: 1fr 1fr; }
  .scope-stat:nth-child(odd) { border-right: 1px solid var(--line); }
  .scope-stat:nth-last-child(-n + 2) { border-bottom: 0; }
  .page-shell { display: block; max-width: 58rem; }
  .sidebar {
    position: fixed;
    inset: 4.6rem 1rem auto;
    z-index: 60;
    display: none;
    max-height: calc(100vh - 6rem);
    overflow: auto;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: var(--surface);
    box-shadow: var(--shadow);
  }
  .sidebar.open { display: block; }
  .sidebar-inner { position: static; max-height: none; padding: 0; }
  .toc a { font-size: 0.86rem; }
  .toc ul ul a { font-size: 0.8rem; }
}

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .site-header { padding: 1rem; }
  .wordmark small, .quiet-link { display: none; }
  .hero { padding: 3.5rem 1rem 2.8rem; }
  .hero h1 { font-size: clamp(3rem, 15vw, 4.7rem); }
  .dek { font-size: 1.2rem; }
  .hero-actions { align-items: stretch; flex-direction: column; }
  .button { justify-content: center; }
  .hero-panel { grid-template-columns: 1fr; }
  .scope-stat, .scope-stat:nth-child(odd), .scope-stat:nth-last-child(-n + 2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .scope-stat:last-child { border-bottom: 0; }
  .scope-note { margin-inline: 1rem; padding: 1rem; }
  .scope-icon { display: none; }
  .page-shell { padding: 0 1rem 5rem; }
  .report h2 { margin-top: 4.5rem; font-size: 2rem; }
  .report h3 { font-size: 1.4rem; }
  .report > p:first-of-type { padding: 1rem; font-size: 1.08rem; }
  .table-wrap { width: 100%; margin-left: 0; border-radius: 0.45rem; }
}

@media (max-width: 340px) {
  .site-header { gap: 0.5rem; }
  .wordmark { min-width: 0; }
  .wordmark-mark { display: none; }
  .wordmark strong { font-size: 0.8rem; line-height: 1.15; }
  .nav-toggle { flex: none; padding: 0.45rem 0.6rem; font-size: 0.78rem; }
  .hero h1 { font-size: 2.25rem; overflow-wrap: normal; hyphens: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media print {
  body { color: #000; background: #fff; font-size: 11pt; }
  .reading-progress, .site-header, .hero-actions, .sidebar, .back-to-top { display: none !important; }
  .hero { display: block; padding: 0 0 2rem; }
  .hero-panel { display: grid; margin-top: 1rem; box-shadow: none; }
  .scope-note, .page-shell { display: block; max-width: none; margin: 0; padding: 0; }
  .report h2 { break-after: avoid; margin-top: 2.5rem; }
  .report h3 { break-after: avoid; }
  .table-wrap { overflow: visible; box-shadow: none; }
  .report table { min-width: 0; font-size: 7.5pt; }
  .report a { color: #000; text-decoration: none; }
  .report a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.7em; }
}
