:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --card: #fff;
  --inset: #f5f5f4;
  --line: #e9e9e9;
  --heading: #0b0b0b;
  --text: #4b4b4b;
  --muted: #6b6b6b;
  --faint: #737373;
  --brand: oklch(0.565 0.15 45);
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    15px/1.6 Inter,
    ui-sans-serif,
    system-ui,
    sans-serif;
}
a {
  color: inherit;
}
.skip-link {
  position: fixed;
  z-index: 10;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-radius: 0.4rem;
  background: var(--heading);
  color: var(--bg);
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: translateY(0);
}
.site-shell {
  width: min(100%, 1512px);
  min-height: 100vh;
  margin-inline: auto;
  border-inline: 1px solid var(--line);
}
.site-header {
  min-height: 67px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 0 2rem;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--heading);
  font-weight: 600;
  text-decoration: none;
}
.brand img {
  width: 22px;
  height: 22px;
}
nav {
  display: flex;
  gap: 1.75rem;
}
nav a {
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
}
nav a:hover,
nav a:focus-visible {
  color: var(--heading);
}
.content {
  width: min(100% - 2.5rem, 1024px);
  margin-inline: auto;
  padding-block: 4rem;
}
.hero {
  max-width: 760px;
}
.hero h1 {
  margin: 0.8rem 0 1rem;
  color: var(--heading);
  font-size: clamp(2.4rem, 7vw, 4rem);
  line-height: 1;
  letter-spacing: -0.055em;
}
.hero p:not(.eyebrow) {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--muted);
}
.eyebrow {
  margin: 0;
  color: var(--brand);
  font:
    600 0.72rem/1.2 ui-monospace,
    monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.json-link,
.back-link {
  display: inline-flex;
  margin-top: 1.25rem;
  color: var(--heading);
  font-weight: 600;
  text-underline-offset: 0.25rem;
}
.catalog-section {
  margin-top: 3.25rem;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}
.section-heading h2,
.detail h2,
.two-column h2 {
  margin: 0;
  color: var(--heading);
  font-size: 1.1rem;
}
.section-heading span {
  color: var(--faint);
  font:
    0.75rem ui-monospace,
    monospace;
}
.rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 0;
  padding: 0.8rem 0 0;
  list-style: none;
}
.rule-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--card);
  text-decoration: none;
}
.rule-card:hover,
.rule-card:focus-visible {
  background: var(--inset);
  outline: 2px solid transparent;
}
.rule-card strong {
  color: var(--heading);
  font:
    600 0.83rem/1.4 ui-monospace,
    monospace;
  overflow-wrap: anywhere;
}
.rule-card > span {
  display: -webkit-box;
  margin-top: 0.5rem;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.rule-card small {
  margin-top: auto;
  padding-top: 0.8rem;
  color: var(--faint);
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.rule-hero {
  margin-top: 2.25rem;
}
.rule-hero h1 code {
  font: inherit;
  overflow-wrap: anywhere;
}
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  margin: 2.5rem 0 0;
}
.facts > div {
  padding: 1rem;
  border-radius: 0.5rem;
  background: var(--inset);
}
.facts dt {
  color: var(--muted);
  font-size: 0.72rem;
}
.facts dd {
  margin: 0.35rem 0 0;
  color: var(--heading);
  font:
    600 0.82rem ui-monospace,
    monospace;
}
.two-column {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 3rem;
  margin-top: 2.8rem;
  padding-top: 2.8rem;
  border-top: 1px solid var(--line);
}
.tags,
.requirements {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--inset);
  font:
    0.72rem ui-monospace,
    monospace;
}
.requirements {
  display: grid;
}
.requirements li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--card);
}
.requirements span,
.two-column section > p {
  color: var(--muted);
  font-size: 0.82rem;
}
.detail {
  margin-top: 2.8rem;
  padding-top: 2.8rem;
  border-top: 1px solid var(--line);
}
.detail p,
.detail li {
  color: var(--muted);
}
.detail small {
  color: var(--faint);
  font:
    0.72rem ui-monospace,
    monospace;
}
footer {
  width: min(100% - 2.5rem, 1024px);
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.78rem;
}
footer a {
  color: var(--text);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #08090a;
    --card: #0d0d0e;
    --inset: #0c0d0e;
    --line: #181a1d;
    --heading: #fff;
    --text: #c8c8c8;
    --muted: #85898d;
    --faint: #7a7d7f;
    --brand: oklch(0.8 0.115 45);
  }
}

@media (max-width: 700px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem 1.25rem;
  }
  .content {
    padding-block: 2.8rem;
  }
  .rule-grid,
  .facts,
  .two-column {
    grid-template-columns: 1fr;
  }
  .two-column {
    gap: 2rem;
  }
}

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