:root {
  color-scheme: light dark;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-muted: #eeeeea;
  --text: #171714;
  --muted: #62625b;
  --border: #d5d5ce;
  --accent: #174c3c;
  --accent-soft: #dfece6;
  --code-bg: #20211f;
  --code-text: #f2f2ed;
  --warning-bg: #f5ead1;
  --warning-border: #bd7b18;
  --max-width: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111210;
    --surface: #181a17;
    --surface-muted: #22241f;
    --text: #edede7;
    --muted: #aeaea6;
    --border: #393b35;
    --accent: #89cbb4;
    --accent-soft: #1d352c;
    --code-bg: #0b0c0a;
    --code-text: #e8e8e2;
    --warning-bg: #332715;
    --warning-border: #c58b36;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: var(--accent);
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1px;
}

a:hover {
  text-decoration-thickness: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

code,
pre,
.mono,
.eyebrow,
.stat-value,
.version {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
}

code {
  padding: 0.08em 0.3em;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface-muted);
  font-size: 0.9em;
}

pre {
  position: relative;
  margin: 0;
  overflow-x: auto;
  border: 1px solid #33352f;
  border-radius: 5px;
  background: var(--code-bg);
  color: var(--code-text);
  font-size: 0.88rem;
  line-height: 1.58;
  tab-size: 4;
}

pre code {
  display: block;
  min-width: max-content;
  padding: 1.1rem 1.2rem;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

.skip-link {
  position: absolute;
  z-index: 100;
  top: -4rem;
  left: 1rem;
  padding: 0.6rem 0.8rem;
  background: var(--text);
  color: var(--bg);
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}

.nav {
  display: flex;
  width: min(calc(100% - 2rem), var(--max-width));
  min-height: 62px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand {
  flex: 0 0 auto;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

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

.nav-links a {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.nav-links a:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.nav-links a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}

main,
.footer-inner {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
}

main {
  padding: 3.75rem 0 4.5rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.75fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
  padding-bottom: 3.25rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  color: var(--text);
  font-weight: 690;
  line-height: 1.16;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(2.55rem, 7vw, 5.1rem);
}

.page-heading h1 {
  max-width: none;
  font-size: clamp(2.35rem, 6vw, 4.5rem);
}

h2 {
  margin: 0 0 1.1rem;
  font-size: clamp(1.55rem, 3vw, 2rem);
}

h3 {
  margin: 0 0 0.5rem;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1rem;
}

.lede {
  max-width: 66ch;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.2vw, 1.28rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  margin-top: 1.65rem;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.button {
  display: inline-flex;
  min-height: 42px;
  padding: 0.58rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

.button:hover {
  opacity: 0.88;
}

.button.secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.quick-facts {
  margin: 0;
  border-top: 1px solid var(--border);
}

.quick-facts > div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  gap: 0.7rem;
}

.quick-facts dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.quick-facts dd {
  margin: 0;
  font-size: 0.92rem;
}

.notice {
  padding: 1rem 1.1rem;
  border-left: 3px solid var(--warning-border);
  background: var(--warning-bg);
}

.notice strong {
  display: block;
  margin-bottom: 0.15rem;
}

.notice p:last-child {
  margin-bottom: 0;
}

.stats {
  display: grid;
  margin: 2.7rem 0 0;
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  grid-template-columns: repeat(4, 1fr);
}

.stat {
  min-width: 0;
  padding: 1.15rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.stat-value {
  display: block;
  margin-bottom: 0.25rem;
  font-size: clamp(1.3rem, 3vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.section {
  padding: 3.5rem 0;
  border-top: 1px solid var(--border);
}

.section:last-child {
  padding-bottom: 0;
}

.section-intro,
.page-heading p {
  max-width: 68ch;
  color: var(--muted);
}

.page-heading {
  padding-bottom: 3rem;
}

.page-heading .lede {
  max-width: 72ch;
}

.grid-2,
.grid-3,
.code-grid {
  display: grid;
  gap: 1.25rem;
}

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

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

.card {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

.card p,
.card li {
  color: var(--muted);
}

.card .card-kicker {
  margin-bottom: 0.4rem;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plain-list {
  padding-left: 1.2rem;
}

.plain-list li + li {
  margin-top: 0.42rem;
}

.compact-list {
  margin: 0;
  padding-left: 1.2rem;
}

.code-label {
  display: flex;
  margin-bottom: 0.55rem;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.code-label h3 {
  margin: 0;
}

.code-label a {
  font-size: 0.82rem;
}

.table-wrap {
  width: 100%;
  margin: 1.35rem 0 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 5px;
}

table {
  width: 100%;
  min-width: 610px;
  border-collapse: collapse;
  background: var(--surface);
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 0.7rem 0.82rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}

th {
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

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

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

tbody tr:hover {
  background: var(--surface-muted);
}

.best {
  color: var(--accent);
  font-weight: 750;
}

.table-note,
.source-note {
  color: var(--muted);
  font-size: 0.84rem;
}

.table-note {
  margin-top: 0.65rem;
}

.top-gap {
  margin-top: 1rem;
}

.definition-list {
  margin: 0;
}

.definition-list > div {
  display: grid;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  grid-template-columns: minmax(140px, 0.42fr) minmax(0, 1.58fr);
  gap: 1.5rem;
}

.definition-list > div:last-child {
  border-bottom: 1px solid var(--border);
}

.definition-list dt {
  font-weight: 680;
}

.definition-list dd {
  margin: 0;
  color: var(--muted);
}

.port-row {
  display: grid;
  padding: 1.45rem 0;
  border-top: 1px solid var(--border);
  grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1.25fr) auto;
  align-items: start;
  gap: 1.4rem;
}

.port-row:last-child {
  border-bottom: 1px solid var(--border);
}

.port-row h2 {
  margin: 0;
  font-size: 1.35rem;
}

.port-row p {
  margin: 0;
  color: var(--muted);
}

.status {
  display: inline-flex;
  padding: 0.22rem 0.48rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  align-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.version {
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  min-height: 92px;
  padding: 1.25rem 0;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-inner p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

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

.footer-links a {
  font-size: 0.84rem;
}

@media (max-width: 800px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .quick-facts {
    max-width: 560px;
  }

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

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

  .grid-2,
  .code-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .nav {
    padding: 0.65rem 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .nav-links {
    width: 100%;
    overflow-x: auto;
  }

  .nav-links a {
    padding: 0.38rem 0.52rem;
    white-space: nowrap;
  }

  main {
    padding-top: 2.6rem;
  }

  .hero {
    padding-bottom: 2.6rem;
  }

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

  .stat {
    padding: 0.9rem;
  }

  .section {
    padding: 2.7rem 0;
  }

  .definition-list > div,
  .port-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .port-row .status {
    justify-self: start;
  }

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

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