:root {
  color-scheme: light;
  --ink: #17201b;
  --muted: #56635a;
  --line: #d9e2dc;
  --paper: #ffffff;
  --wash: #f4f8f5;
  --leaf: #16734a;
  --leaf-dark: #0c5033;
  --sky: #1176a6;
  --berry: #7f3d91;
  --sun: #e9b949;
  --danger: #a53838;
  --shadow: 0 12px 32px rgba(24, 52, 37, 0.1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; }

.container {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(217, 226, 220, 0.9);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.reading-progress {
  position: fixed;
  z-index: 19;
  top: 64px;
  left: 0;
  width: 100%;
  height: 3px;
  overflow: hidden;
  background: rgba(217, 226, 220, 0.7);
  pointer-events: none;
}
.reading-progress[hidden] { display: none; }
.reading-progress span {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--leaf);
  transform: scaleX(0);
  transform-origin: left center;
  will-change: transform;
}

.header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand img { width: 38px; height: 38px; border-radius: 6px; }
.desktop-nav { display: flex; align-items: center; gap: 20px; }
.desktop-nav a, .mobile-nav a { color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; }
.desktop-nav a:hover, .mobile-nav a:hover { color: var(--leaf); }

.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-size: 22px;
}

.mobile-nav { display: none; padding: 0 16px 16px; }
.mobile-nav[data-open] { display: grid; gap: 12px; }

.hero {
  min-height: min(500px, 62vh);
  display: flex;
  align-items: end;
  background-color: #17201b;
  background-position: center;
  background-size: cover;
  color: white;
  position: relative;
}

.hero::before {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(10, 22, 15, 0.64);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding-block: 86px 72px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--leaf);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow { color: #c6f2d8; }

h1, h2, h3 { line-height: 1.18; letter-spacing: 0; }
h1 { max-width: 760px; margin: 0; font-size: clamp(38px, 7vw, 72px); }
h2 { margin: 0 0 16px; font-size: clamp(27px, 4vw, 40px); }
h3 { margin: 0 0 8px; font-size: 20px; }

.hero-lead { max-width: 660px; margin: 18px 0 0; color: #f0f5f1; font-size: 18px; }
.hero-actions, .page-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 10px 16px;
  background: var(--leaf);
  color: white;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button:hover { background: var(--leaf-dark); }
.button-secondary { border-color: rgba(255,255,255,0.65); background: rgba(12, 30, 20, 0.45); }
.button-light { border-color: var(--line); background: var(--paper); color: var(--ink); }
.button-light:hover { background: var(--wash); }

.trust-strip { border-bottom: 1px solid var(--line); background: var(--wash); }
.trust-grid { min-height: 74px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; gap: 22px; }
.trust-item { font-size: 14px; color: var(--muted); }
.trust-item strong { display: block; color: var(--ink); font-size: 15px; }

.section { padding-block: 70px; background: var(--paper); }
.codes-section { padding-top: 48px; }
.section-tinted { background: var(--wash); }
.section-heading { max-width: 720px; margin-bottom: 28px; }
.section-heading p { margin: 0; color: var(--muted); }

.codes-list { display: grid; gap: 12px; }
.code-row {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(220px, 2fr) auto;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--leaf);
  border-radius: 6px;
  padding: 18px;
  background: var(--paper);
}

.code-value { color: var(--leaf-dark); font: 800 17px ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.code-reward { color: var(--ink); font-weight: 700; }
.code-note { margin-top: 3px; color: var(--muted); font-size: 13px; }
.code-evidence { margin-top: 6px; color: var(--sky); font-size: 12px; font-weight: 700; }
.status-badge {
  width: fit-content;
  display: inline-flex;
  margin-top: 6px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #e2f4e9;
  color: var(--leaf-dark);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}
.status-expired { background: #f7e5e5; color: var(--danger); }
.code-row-expired { border-left-color: var(--danger); }

.notice {
  margin-top: 18px;
  border-left: 4px solid var(--sun);
  padding: 12px 16px;
  background: #fff9e7;
  color: #4c421f;
  font-size: 14px;
}

.citable-answer { background: #eef7f1; }
.citable-answer .container { border-left: 4px solid var(--leaf); padding-block: 18px; padding-left: 22px; }
.citable-summary { max-width: 860px; margin: 8px 0 14px; color: #21382a; font-size: clamp(18px, 2.2vw, 23px); font-weight: 750; line-height: 1.45; }
.citable-sources { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.citable-sources a { color: var(--sky); font-size: 13px; font-weight: 800; }
.citable-limitation { max-width: 860px; margin: 14px 0 0; color: var(--muted); font-size: 13px; }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 6px;
  padding: 22px;
  background: var(--wash);
}
.empty-state p { margin: 0; color: var(--muted); }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-card { border: 1px solid var(--line); border-radius: 6px; padding: 22px; background: var(--paper); }
.feature-card p { margin: 0 0 16px; color: var(--muted); }
.feature-card a { color: var(--leaf); font-weight: 800; text-decoration: none; }

.split { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 46px; }
.split img { width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; object-fit: cover; box-shadow: var(--shadow); }
.plain-list { padding-left: 22px; }
.plain-list li + li { margin-top: 10px; }

.ad-band { border-block: 1px solid var(--line); padding-block: 24px; background: #f8faf9; text-align: center; }
.native-ad {
  min-height: 180px;
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  background: var(--wash);
  overflow: hidden;
}
.native-ad [id^="container-"]:empty { min-height: 120px; display: grid; place-items: center; }
.native-ad [id^="container-"]:empty::before { content: "Sponsored placement may be hidden by browser privacy settings."; max-width: 340px; color: #6b776f; font-size: 12px; text-align: center; }
.ad-label { display: block; margin-bottom: 6px; color: #6b776f; font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.ad-placeholder { min-height: 90px; display: grid; place-items: center; color: #7a857d; font-size: 12px; }

.page-hero { padding-block: 70px 46px; border-bottom: 1px solid var(--line); background: var(--wash); }
.page-hero h1 { color: var(--ink); font-size: clamp(34px, 6vw, 58px); }
.page-hero .eyebrow { color: var(--leaf); }
.page-hero p { max-width: 760px; color: var(--muted); font-size: 18px; }
.breadcrumb { margin-bottom: 22px; color: var(--muted); font-size: 13px; }
.breadcrumb a { color: var(--leaf); }

.article-layout { display: grid; grid-template-columns: minmax(0, 760px) 260px; gap: 64px; align-items: start; }
.article-layout > article { min-width: 0; }
.article-toc { margin-bottom: 24px; border: 1px solid var(--line); border-left: 4px solid var(--leaf); border-radius: 6px; padding: 18px 20px; background: var(--wash); }
.article-toc strong { display: block; margin-bottom: 8px; }
.article-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; }
.article-toc li { break-inside: avoid; margin-block: 4px; color: var(--muted); }
.article-toc a { color: var(--leaf-dark); font-size: 14px; font-weight: 700; text-underline-offset: 3px; }
.article-toc a[aria-current="location"] { color: var(--ink); text-decoration-thickness: 2px; }
.article-section { padding-block: 28px; border-bottom: 1px solid var(--line); }
.article-section[id] { scroll-margin-top: 88px; }
.article-section:first-child { padding-top: 0; }
.article-section p { color: #34423a; }
.mutation-calculator {
  margin-bottom: 8px;
  border: 1px solid #b8d8c6;
  border-radius: 8px;
  padding: 24px;
  background: linear-gradient(145deg, #f4fbf6, #eef7f4);
}
.calculator-grid { display: grid; grid-template-columns: 1fr .72fr 1.1fr; gap: 14px; margin-top: 20px; }
.calculator-grid label { color: var(--ink); font-size: 13px; font-weight: 800; }
.calculator-grid input,
.calculator-grid select {
  width: 100%;
  min-height: 46px;
  display: block;
  margin-top: 7px;
  border: 1px solid #b8c7bd;
  border-radius: 6px;
  padding: 9px 11px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}
.calculator-grid input:focus,
.calculator-grid select:focus { outline: 3px solid rgba(22, 115, 74, .18); border-color: var(--leaf); }
.calculator-result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  border-left: 4px solid var(--leaf);
  padding: 14px 16px;
  background: var(--paper);
}
.calculator-result span { color: var(--muted); font-size: 13px; font-weight: 800; }
.calculator-result output { color: var(--leaf-dark); font-size: clamp(24px, 4vw, 34px); font-weight: 900; }
.calculator-note { margin-bottom: 0; color: var(--muted) !important; font-size: 12px; }
.data-table-wrap { max-width: 100%; margin-top: 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 7px; }
.data-table { width: 100%; min-width: 680px; border-collapse: collapse; background: var(--paper); font-size: 14px; }
.data-table caption { padding: 12px 14px; background: var(--wash); color: var(--muted); font-size: 12px; text-align: left; }
.data-table th,
.data-table td { border-top: 1px solid var(--line); padding: 12px 14px; text-align: left; vertical-align: top; }
.data-table thead th { border-top: 0; background: #edf5f0; color: var(--ink); font-size: 12px; text-transform: uppercase; }
.data-table tbody th { color: var(--ink); white-space: nowrap; }
.confidence { display: inline-flex; width: fit-content; margin-right: 4px; border-radius: 999px; padding: 2px 7px; font-size: 11px; font-weight: 900; }
.confidence-strong { background: #e2f4e9; color: var(--leaf-dark); }
.confidence-caution { background: #fff1c9; color: #6d5512; }
.confidence-limited { background: #e7eef7; color: #315b7c; }
.steps { padding: 0; list-style: none; counter-reset: steps; }
.steps li { position: relative; min-height: 42px; padding-left: 52px; }
.steps li + li { margin-top: 18px; }
.steps li::before {
  position: absolute;
  left: 0;
  top: -4px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--leaf);
  color: white;
  content: counter(steps);
  counter-increment: steps;
  font-weight: 800;
}

.aside-panel { position: sticky; top: 88px; border-left: 3px solid var(--sky); padding-left: 18px; }
.aside-panel p { color: var(--muted); font-size: 14px; }
.aside-next { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.aside-next span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.aside-next a { color: var(--leaf-dark); font-size: 14px; font-weight: 800; text-underline-offset: 3px; }

.faq-list { border-top: 1px solid var(--line); }
.faq-item { padding-block: 18px; border-bottom: 1px solid var(--line); }
.faq-item h3 { font-size: 17px; }
.faq-item p { margin: 0; color: var(--muted); }

.sources { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sources a { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; color: var(--sky); font-size: 14px; font-weight: 700; text-decoration: none; }
.sources a:hover { border-color: #a8c7b4; background: var(--wash); }
.source-kind { flex: none; border-radius: 999px; padding: 2px 7px; background: #e7f0f7; color: #315b7c; font-size: 10px; font-weight: 900; letter-spacing: .03em; text-transform: uppercase; }
.dataset-license { max-width: 760px; margin: 18px 0 0; color: var(--muted); font-size: 12px; }
.dataset-license a { color: var(--sky); font-weight: 800; }

.site-footer { padding-block: 40px; background: #15241b; color: #dbe8df; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 32px; }
.footer-grid p { max-width: 640px; color: #b8c9bd; font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; align-content: start; gap: 10px 18px; }
.footer-links a { color: white; font-size: 14px; }
.footer-bottom { margin-top: 28px; padding-top: 20px; border-top: 1px solid #31473a; color: #9fb2a5; font-size: 12px; }

@media (max-width: 820px) {
  .desktop-nav { display: none; }
  .menu-button { display: inline-grid; place-items: center; }
  .trust-grid { grid-template-columns: 1fr; padding-block: 18px; gap: 12px; }
  .feature-grid, .split, .article-layout, .footer-grid { grid-template-columns: 1fr; }
  .article-layout { gap: 36px; }
  .aside-panel { position: static; }
}

@media (max-width: 620px) {
  .container { width: min(100% - 24px, 1120px); }
  .hero { min-height: 520px; }
  .hero-content { padding-block: 64px 44px; }
  .code-row { grid-template-columns: 1fr; gap: 10px; }
  .code-row .button { width: 100%; }
  .section { padding-block: 50px; }
  .native-ad { min-height: 250px; }
  .article-toc ol { columns: 1; }
  .mutation-calculator { padding: 18px; }
  .calculator-grid { grid-template-columns: 1fr; }
  .calculator-result { align-items: flex-start; flex-direction: column; }
  .sources { grid-template-columns: 1fr; }
}
