:root {
  --bg: #14171a;
  --ink: #ece7dc;
  --muted: #a9a297;
  --rule: #3b4248;
  --rule-strong: #626b73;
  --accent: #d8c27a;
  --accent-hover: #f0df9b;
  --accent-ink: #14171a;
  --accent-soft: rgba(216, 194, 122, 0.12);
  --selection: #32383d;
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--bg);
  font-family: 'Courier Prime', 'Courier New', 'Nimbus Mono PS', monospace;
  font-size: 17px;
}

body {
  margin: 0;
}

::selection {
  background: var(--selection);
}

.page-shell {
  width: min(76ch, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(28px, 7vw, 72px) 0 32px;
}

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

.site-header {
  padding-top: 18px;
  margin-bottom: 34px;
}

.panel {
  padding-top: 18px;
  margin-bottom: 28px;
}

.eyebrow,
caption,
.stats span,
footer {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 18px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.35rem, 8vw, 5rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.08em;
  text-transform: lowercase;
}

h2 {
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

p,
li,
pre {
  line-height: 1.55;
}

.lede,
.panel p {
  max-width: 68ch;
}

.lede {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.panel p {
  margin-bottom: 12px;
}

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

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 24px;
}

.stats div {
  min-width: 0;
}

.stats strong,
.stats span {
  display: block;
}

.stats strong {
  margin-bottom: 3px;
  font-size: 1.08rem;
  font-weight: 700;
}

.stats span {
  font-size: 0.86rem;
}

.link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.link-grid > a:not(.button-link),
.release-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.link-grid > a:not(.button-link):hover,
.link-grid > a:not(.button-link):focus,
.release-link:hover,
.release-link:focus {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: var(--accent-ink);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.muted-label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

a:hover,
a:focus {
  color: var(--accent-hover);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-panel {
  padding-top: 14px;
  margin-bottom: 24px;
}

.action-panel .section-heading {
  margin-bottom: 8px;
}

.action-panel .button-link {
  min-height: 36px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

.link-groups {
  display: grid;
  gap: 14px;
}

.link-group {
  display: grid;
  grid-template-columns: 10ch 1fr;
  gap: 10px 16px;
  align-items: start;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
}

.link-group-label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  line-height: 34px;
  text-transform: uppercase;
}

.button-link,
.compact-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.button-link {
  min-height: 42px;
  padding: 10px 14px;
}

.compact-link {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 0.84rem;
  text-transform: lowercase;
}

.button-link--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.button-link--secondary,
.compact-link {
  background: var(--accent-soft);
}

.button-link:hover,
.button-link:focus,
.compact-link:hover,
.compact-link:focus {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  color: var(--accent-ink);
}

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

.release-pin {
  display: grid;
  grid-template-columns: 10ch 10ch 1fr auto;
  gap: 8px 18px;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}

.release-label,
.release-pin > span:not(.release-actions),
.release-row span:nth-child(2) {
  color: var(--muted);
}

.release-label {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.release-pin strong {
  font-size: 1.08rem;
}

.release-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.release-rows {
  margin-top: 12px;
  border-top: 1px solid var(--rule);
}

.release-row {
  display: grid;
  grid-template-columns: 10ch 1fr auto;
  gap: 8px 18px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}

.release-row > span:first-child {
  font-weight: 700;
}

.release-link {
  white-space: nowrap;
}

.release-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}

.release-meta li {
  display: grid;
  gap: 2px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}

.release-meta span {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.release-notes-body h3,
.release-notes-body h4 {
  margin: 18px 0 8px;
}

.release-notes-body ul {
  padding-left: 22px;
}

code {
  color: var(--ink);
  font-family: inherit;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.download-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.download-list li {
  display: grid;
  grid-template-columns: minmax(18ch, 28ch) 1fr auto auto;
  gap: 8px 14px;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}

.download-list span {
  color: var(--muted);
}

.schema-list li {
  grid-template-columns: minmax(18ch, 30ch) 1fr auto auto;
}

.schema-shell {
  width: min(1120px, calc(100% - 40px));
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.schema-shell h1,
.schema-definition h2 {
  letter-spacing: 0;
  text-transform: none;
}

.schema-shell h1 {
  max-width: 22ch;
  font-size: clamp(2.45rem, 6vw, 4.4rem);
  line-height: 1.02;
}

.schema-shell code,
.schema-shell pre {
  font-family: 'Courier Prime', 'Courier New', 'Nimbus Mono PS', monospace;
}

.schema-toc {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 16px;
  margin-top: 12px;
}

.schema-toc a {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 9px 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
}

.schema-toc a:hover,
.schema-toc a:focus {
  border-color: var(--accent);
}

.schema-toc span {
  color: var(--ink);
  font-weight: 700;
}

.schema-toc code,
.schema-title-symbol,
.schema-symbol {
  color: var(--muted);
  font-weight: 400;
}

.schema-title-symbol {
  display: inline-block;
  margin: -6px 0 18px;
  font-size: 1rem;
}

.schema-symbol,
.schema-toc code {
  font-size: 0.84rem;
}

.schema-definition {
  padding-top: 24px;
  margin-bottom: 34px;
}

.schema-definition .section-heading {
  margin-bottom: 14px;
}

.schema-definition .section-heading > div {
  min-width: 0;
}

.schema-definition h2 {
  margin-bottom: 4px;
  font-size: 1.45rem;
  line-height: 1.18;
}

.schema-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.86rem;
}

.schema-summary span {
  padding: 3px 8px;
  border: 1px solid var(--rule);
  border-radius: 999px;
}

.schema-table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  border-top: 1px solid var(--rule);
}

.schema-table th,
.schema-table td {
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.schema-table thead th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.schema-table tbody th {
  width: 28%;
}

.schema-table tbody td:nth-child(2) {
  width: 22%;
}

.schema-table tbody td:nth-child(3) {
  width: 10%;
}

.schema-table tbody td:last-child {
  padding-right: 0;
  color: var(--muted);
  line-height: 1.45;
}

.schema-requirement {
  display: inline-block;
  padding: 2px 7px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.2;
}

.schema-requirement.is-required {
  border-color: var(--accent);
  color: var(--ink);
}

.schema-muted {
  color: var(--muted);
}

pre {
  overflow-x: auto;
  margin: 0;
  padding: 13px 0 0;
  border-top: 1px solid var(--rule);
  color: var(--ink);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-top: 16px;
  font-size: 0.86rem;
}

@media (max-width: 760px) {
  html {
    font-size: 16px;
  }

  .page-shell {
    width: min(100% - 24px, 76ch);
  }

  .schema-shell {
    width: min(100% - 24px, 1120px);
  }

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

  .section-heading,
  footer {
    display: block;
  }

  .release-link,
  footer a {
    display: inline-block;
    margin-top: 8px;
  }

  .release-actions {
    flex-wrap: wrap;
    white-space: normal;
  }
}

@media (max-width: 560px) {
  .release-pin,
  .release-row,
  .link-group,
  .release-meta,
  .download-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .schema-table,
  .schema-table thead,
  .schema-table tbody,
  .schema-table tr,
  .schema-table th,
  .schema-table td {
    display: block;
  }

  .schema-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .schema-table tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
  }

  .schema-table th,
  .schema-table td,
  .schema-table tbody th,
  .schema-table tbody td:nth-child(2),
  .schema-table tbody td:nth-child(3) {
    width: auto;
    padding: 3px 0;
    border-bottom: 0;
  }

  .schema-table td::before {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .schema-table td:nth-child(2)::before {
    content: 'Type';
  }

  .schema-table td:nth-child(3)::before {
    content: 'Use';
  }

  .schema-table td:nth-child(4)::before {
    content: 'Notes';
  }
}

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