:root {
  --white: #ffffff;
  --soft: #f6f7f6;
  --ink: #17201d;
  --muted: #5f6965;
  --line: #d9dfdc;
  --accent: #137333;
  --accent-dark: #0f5d2a;
  --accent-soft: #edf7f1;
  --red: #b3261e;
  --red-soft: #fff2f0;
  --blue: #355d9b;
  --code: #18211e;
  --max-width: 1100px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

section[id] {
  scroll-margin-top: 24px;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

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

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

:focus-visible {
  outline: 3px solid #9cbfb8;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 8px 12px;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-160%);
}

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

.content-shell,
.nav-shell {
  width: min(calc(100% - 40px), var(--max-width));
  margin-inline: auto;
}

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.nav-shell {
  display: grid;
  grid-template-columns: auto 1fr auto;
  min-height: 62px;
  align-items: center;
  gap: 28px;
}

.wordmark {
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.site-nav {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.site-nav a,
.header-link,
.footer-inner a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover,
.header-link:hover,
.footer-inner a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.header-link {
  color: var(--ink);
}

.hero {
  padding: 52px 0 36px;
  text-align: center;
}

.hero-copy {
  max-width: 860px;
}

.venue-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  padding: 7px 11px 7px 10px;
  color: var(--red);
  background: var(--red-soft);
  border-left: 4px solid var(--red);
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.2;
  text-decoration: none;
}

.venue-name {
  font-weight: 750;
}

.venue-status {
  padding-left: 9px;
  color: #70413d;
  border-left: 1px solid #e2b8b3;
  font-weight: 600;
}

.venue-badge:hover {
  background: #ffe9e6;
  text-decoration: underline;
  text-underline-offset: 4px;
}

h1 {
  margin: 0;
  font-size: 52px;
  font-weight: 700;
  line-height: 1.08;
}

.hero-lead {
  max-width: 780px;
  margin: 12px auto 0;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
}

.hero-summary {
  max-width: 720px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.hero-authors {
  margin: 12px auto 0;
  font-size: 14px;
  font-weight: 600;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  color: var(--white);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.button-secondary {
  color: var(--ink);
  background: var(--white);
  border-color: var(--ink);
}

.button-secondary:hover {
  color: var(--white);
  background: var(--ink);
  border-color: var(--ink);
}

.hero-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 320px));
  justify-content: center;
  gap: 16px;
  margin-top: 32px;
}

.highlight-item {
  display: flex;
  min-width: 0;
  min-height: 116px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 16px;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 6px;
  text-align: center;
}

.highlight-value,
.highlight-label {
  display: block;
  max-width: 100%;
  overflow-wrap: break-word;
}

.highlight-value {
  color: var(--ink);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.highlight-label {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}

.hero-figure {
  width: min(calc(100% - 40px), var(--max-width));
  margin: 42px auto 0;
}

.figure-link {
  display: block;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.figure-link img {
  background: var(--white);
}

.figure-link:hover {
  cursor: zoom-in;
}

.hero-figure img,
.wide-figure img {
  width: 100%;
}

.section {
  padding: 64px 0;
}

.section-results {
  background: #f5faf7;
  border-block: 1px solid #d5e5db;
}

.section-use {
  background: #f4f8f6;
  border-block: 1px solid #d5e1dc;
}

.section-heading {
  max-width: 780px;
  margin: 0 auto 34px;
  text-align: center;
}

.section-heading h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
}

.section-heading > p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.wide-figure {
  margin: 0;
}

.wide-figure figcaption {
  max-width: 900px;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}

.method-summary {
  max-width: 940px;
  margin: 36px auto 0;
  padding: 24px 0;
  border-block: 1px solid var(--line);
}

.method-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.method-summary p + p {
  margin-top: 16px;
}

.method-summary strong,
.method-summary code {
  color: var(--ink);
  font-size: inherit;
}

.method-summary strong {
  font-weight: 700;
}

.method-summary code {
  white-space: normal;
}

.method-summary .reinforce-word {
  color: var(--accent);
}

.method-summary .preserve-word {
  color: #606965;
}

.method-summary .reduce-word {
  color: var(--blue);
}

.method-summary .reflect-word {
  color: var(--red);
}

.tabs {
  border-top: 1px solid var(--line);
}

.tab-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}

.tab-list button {
  padding: 12px 14px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.tab-list button:hover {
  color: var(--ink);
}

.tab-list button[aria-selected="true"] {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
}

.tab-panel {
  padding-top: 28px;
}

.tab-panel[hidden] {
  display: none;
}

.result-intro {
  max-width: 850px;
  margin-bottom: 18px;
}

.result-intro h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.result-intro p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.result-legend {
  margin: -5px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.legend-positive,
.legend-negative {
  font-weight: 700;
}

.legend-positive {
  color: var(--accent);
}

.legend-negative {
  color: var(--red);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--white);
  border: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 11px 13px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

thead th {
  color: var(--muted);
  background: var(--soft);
  font-size: 14px;
  font-weight: 600;
}

th:first-child,
td:first-child {
  text-align: left;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

.highlight-row {
  background: #eaf4ee;
  font-weight: 700;
}

.positive,
.best {
  color: var(--accent);
  font-weight: 700;
}

.negative {
  color: var(--red);
  font-weight: 700;
}

.text-link {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  text-underline-offset: 4px;
}

.result-note {
  max-width: 900px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.two-column-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
}

.two-column-results > div {
  min-width: 0;
}

.two-column-results .result-intro {
  min-height: 78px;
}

.compact-table table {
  min-width: 430px;
}

.figure-stack {
  display: grid;
  gap: 44px;
}

.usage-layout {
  display: grid;
  grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr);
  gap: 40px;
  align-items: start;
}

.usage-overview h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.4;
}

.usage-list {
  display: grid;
  gap: 18px;
  padding: 0;
  margin: 20px 0 0;
  list-style: none;
}

.usage-list li {
  padding-left: 14px;
  border-left: 3px solid #a8cdb6;
}

.usage-list strong,
.usage-list span {
  display: block;
}

.usage-list strong {
  font-size: 16px;
  font-weight: 700;
}

.usage-list span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.code-shell {
  overflow: hidden;
  color: #f1f1f1;
  background: var(--code);
  border-radius: 4px;
}

.code-header {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 0 16px;
  color: #c7c7c7;
  border-bottom: 1px solid #414141;
  font-size: 14px;
  font-weight: 600;
}

.copy-button {
  padding: 4px 8px;
  color: #efefef;
  background: transparent;
  border: 1px solid #666;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
}

.copy-button:hover {
  background: #303134;
  border-color: #aaa;
}

pre {
  margin: 0;
  overflow: auto;
  padding: 20px;
  font-size: 14px;
  line-height: 1.65;
  tab-size: 2;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.section-citation .section-heading {
  margin-bottom: 24px;
}

.citation-shell {
  max-width: 820px;
  margin-inline: auto;
}

.citation-shell pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.usage-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.usage-footer p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.site-footer {
  padding: 28px 0;
  background: var(--white);
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  color: var(--muted);
  font-size: 14px;
}

.footer-inner > div strong,
.footer-inner > div span {
  display: inline;
}

.footer-inner > div strong {
  color: var(--ink);
}

.footer-inner > div span::before {
  content: " · ";
}

.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

@media (max-width: 900px) {
  .tab-list {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .tab-list button {
    grid-column: span 2;
    width: 100%;
    min-width: 0;
  }

  .tab-list button:nth-last-child(-n + 2) {
    grid-column: span 3;
  }

  .two-column-results,
  .usage-layout {
    grid-template-columns: 1fr;
  }

  .two-column-results .result-intro {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .hero-highlights {
    grid-template-columns: minmax(0, 320px);
    gap: 12px;
  }
}

@media (max-width: 320px) {
  .highlight-item {
    min-height: 136px;
  }
}

@media (max-width: 760px) {
  .content-shell,
  .nav-shell {
    width: min(calc(100% - 28px), var(--max-width));
  }

  .nav-shell {
    grid-template-columns: 1fr auto;
    min-height: 0;
    gap: 8px 16px;
    padding: 12px 0;
  }

  .wordmark {
    grid-column: 1;
    grid-row: 1;
  }

  .header-link {
    grid-column: 2;
    grid-row: 1;
  }

  .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    gap: 10px 18px;
  }

  .hero {
    padding: 40px 0 28px;
  }

  h1 {
    font-size: 40px;
  }

  .hero-lead {
    font-size: 20px;
  }

  .hero-summary {
    font-size: 16px;
  }

  .hero-authors {
    font-size: 14px;
  }

  .hero-figure {
    width: calc(100% - 28px);
    margin-top: 28px;
  }

  .section {
    padding: 48px 0;
  }

  .section-heading {
    margin-bottom: 28px;
  }

  .section-heading h2 {
    font-size: 26px;
  }

  .section-heading > p {
    font-size: 16px;
  }

  .method-summary {
    margin-top: 30px;
    padding: 20px 0;
  }

  .tab-list button {
    padding-inline: 8px;
  }

  .compact-table table {
    min-width: 100%;
    font-size: 14px;
  }

  .compact-table th,
  .compact-table td {
    padding-inline: 6px;
  }

  .usage-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .tab-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab-list button,
  .tab-list button:nth-last-child(-n + 2) {
    grid-column: auto;
  }

  .tab-list button:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 340px) {
  h1 {
    font-size: 36px;
  }

  .hero-lead {
    font-size: 18px;
  }

  .button {
    padding-inline: 10px;
  }

  .site-nav {
    gap-inline: 14px;
  }
}

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