:root {
  --paper: #fbf3df;
  --paper-2: #fffaf0;
  --ink: #10233f;
  --muted: #5c6573;
  --line: #203452;
  --cobalt: #2454d6;
  --orange: #f05a28;
  --green: #b8e63e;
  --cream: #f4e5c4;
  --white: #ffffff;
  --danger: #a43620;
  --ok: #2f6b36;
  --max: 1180px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
}

body.nav-open {
  overflow: hidden;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

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

a:hover {
  color: #173da4;
}

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

.skip-link {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  z-index: 20;
  padding: 0.5rem 0.75rem;
  color: var(--paper-2);
  background: var(--ink);
  transform: translateY(-160%);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 2px solid var(--line);
  background: rgba(251, 243, 223, 0.96);
}

.topbar,
.footer-inner,
.section-inner,
.article-shell {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 2px solid var(--ink);
  background: var(--green);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.brand span:last-child {
  line-height: 1.1;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 2px solid var(--ink);
  background: var(--paper-2);
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 20px;
  height: 2px;
  margin: auto;
  background: currentColor;
  content: "";
}

.nav-toggle span::before {
  transform: translateY(-7px);
}

.nav-toggle span::after {
  transform: translateY(5px);
}

.site-nav {
  justify-self: end;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 0.55rem 0.75rem;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  background: var(--green);
}

.hero {
  border-bottom: 2px solid var(--line);
  background: var(--paper-2);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 3rem;
  align-items: center;
  padding: 4.4rem 0 3.6rem;
}

.eyebrow,
.label,
.reading-time,
.source-label,
.chip,
.breadcrumb,
.meta-line {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.16rem 0.45rem;
  border: 1px solid var(--ink);
  background: var(--green);
}

h1,
h2,
h3 {
  margin: 0 0 0.75rem;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 6vw, 5.3rem);
  font-weight: 720;
}

h2 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3vw, 3rem);
}

h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1rem;
}

.lead {
  max-width: 68ch;
  font-family: var(--serif);
  font-size: clamp(1.18rem, 2vw, 1.45rem);
  line-height: 1.45;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.35rem;
}

.button,
button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.62rem 0.9rem;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--green);
  font: 700 0.95rem/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  background: var(--paper-2);
}

.button:hover {
  color: var(--ink);
  background: var(--orange);
}

.visual-frame {
  border: 2px solid var(--line);
  background: var(--paper);
}

.section {
  padding: 3.2rem 0;
  border-bottom: 1px solid rgba(16, 35, 63, 0.3);
}

.section-title {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(260px, 0.6fr);
  gap: 1.5rem;
  align-items: end;
  margin-bottom: 1.5rem;
}

.grid {
  display: grid;
  gap: 1rem;
}

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

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

.card,
.source-card,
.notice,
.callout,
.filter-panel {
  border: 2px solid var(--line);
  background: var(--paper-2);
}

.card,
.source-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
}

.card img {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
}

.card a {
  color: var(--ink);
  font-weight: 700;
  text-decoration-color: var(--orange);
}

.card .meta-line,
.article-meta .meta-line {
  color: var(--muted);
}

.chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0.18rem 0.48rem;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink);
  font-weight: 700;
}

.chip.strong {
  background: var(--green);
}

.chip.warning {
  background: #ffd8bf;
}

.chip.limited {
  background: #dfe8ff;
}

.notice,
.callout,
.filter-panel {
  padding: 1rem;
}

.notice {
  border-color: var(--orange);
}

.article-shell {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(220px, 320px);
  gap: 3rem;
  align-items: start;
  padding: 2rem 0 3.5rem;
}

.article-main {
  min-width: 0;
}

.article-main h1 {
  font-size: clamp(2.3rem, 5vw, 4.5rem);
}

.article-main h2 {
  margin-top: 2.2rem;
  padding-top: 1rem;
  border-top: 2px solid var(--line);
}

.article-main h3 {
  margin-top: 1.5rem;
}

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

.article-main li {
  margin-bottom: 0.55rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.3rem;
}

.breadcrumb {
  margin-bottom: 1rem;
  color: var(--muted);
}

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

.sidebar {
  position: sticky;
  top: 96px;
}

.toc {
  padding: 1rem;
  border: 2px solid var(--line);
  background: var(--paper-2);
}

.toc h2 {
  font: 700 1rem/1.2 var(--sans);
}

.toc ul {
  margin: 0;
  padding-left: 1rem;
}

.toc a {
  color: var(--ink);
}

.footnote {
  padding-left: 1rem;
  border-left: 4px solid var(--orange);
  color: var(--muted);
  font-size: 0.95rem;
}

.source-list {
  display: grid;
  gap: 0.75rem;
}

.source-card {
  gap: 0.45rem;
}

.source-label {
  color: var(--muted);
}

.matrix {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2rem 0;
  background: var(--paper-2);
}

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

.matrix th {
  background: var(--cream);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.filter-btn {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  font: 700 0.9rem/1 var(--sans);
  cursor: pointer;
}

.filter-btn[aria-pressed="true"] {
  background: var(--green);
}

.evidence-item[hidden] {
  display: none;
}

form {
  display: grid;
  gap: 0.75rem;
}

label {
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.72rem;
  border: 2px solid var(--line);
  background: var(--paper-2);
  color: var(--ink);
  font: inherit;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.form-note,
.form-status {
  color: var(--muted);
  font-size: 0.94rem;
}

.form-status {
  min-height: 1.5rem;
  font-weight: 700;
}

.cookie-banner {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 30;
  display: none;
  width: min(520px, calc(100% - 32px));
  padding: 1rem;
  border: 2px solid var(--line);
  background: var(--paper-2);
  box-shadow: 8px 8px 0 var(--line);
}

.cookie-banner.is-visible {
  display: block;
}

.site-footer {
  padding: 2.4rem 0;
  color: var(--paper-2);
  background: var(--ink);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.9fr);
  gap: 2rem;
}

.site-footer a {
  color: var(--paper-2);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 880px) {
  .topbar {
    grid-template-columns: auto auto;
  }

  .nav-toggle {
    display: block;
    justify-self: end;
  }

  .site-nav {
    position: fixed;
    inset: 76px 0 auto 0;
    display: none;
    border-bottom: 2px solid var(--line);
    background: var(--paper-2);
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    display: grid;
    width: min(var(--max), calc(100% - 32px));
    margin: 0 auto;
    padding: 1rem 0;
  }

  .hero-grid,
  .section-title,
  .article-shell,
  .footer-inner,
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    padding: 2.8rem 0;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .topbar,
  .footer-inner,
  .section-inner,
  .article-shell {
    width: min(var(--max), calc(100% - 22px));
  }

  .button-row {
    display: grid;
  }

  .button,
  button.button {
    width: 100%;
  }

  .matrix {
    display: block;
    overflow-x: auto;
  }
}

@media print {
  .site-header,
  .site-footer,
  .cookie-banner,
  .button-row,
  .copy-link,
  .nav-toggle {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
    font-size: 12pt;
  }

  a {
    color: #000;
  }

  .article-shell,
  .section-inner {
    width: 100%;
  }

  .article-shell {
    display: block;
  }
}
