* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --panel: var(--ink-card);
  --panel-2: var(--ink-raised);
  --border: var(--line-lit);
  --hairline: var(--line);
  --text: var(--cream);
  --accent: var(--ember-lit);
}

html {
  scroll-behavior: smooth;
}

body, html {
  font-family: var(--font);
  background: var(--ink);
  color: var(--text);
  line-height: 1.6;
}

a {
  color: var(--text);
  text-decoration: none;
}

.kicker {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ember);
}

.mono {
  font-family: var(--mono);
  font-size: 0.9em;
  color: var(--accent);
}

.dochead {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 8.5rem var(--gutter) 3.5rem;
  background: radial-gradient(ellipse at 50% -40%, #d9401f2e, transparent 62%);
  border-bottom: 1px solid var(--hairline);
}

.dochead h1 {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.lede {
  max-width: 36rem;
  font-size: 1.12rem;
  color: var(--muted);
  text-wrap: pretty;
}

.dochead .lede {
  margin-bottom: 0.75rem;
}

.missing {
  padding: 0.6rem 0.9rem;
  border: 1px solid #d9401f55;
  border-radius: 0.7rem;
  background: #d9401f14;
  font-size: 0.9rem;
  color: var(--muted);
}

.docsearch {
  position: relative;
  width: min(28rem, 100%);
}

.docsearch-field {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: var(--panel);
  transition: border-color 0.18s ease-in-out;
}

.docsearch-field:focus-within {
  border-color: #d9401f80;
}

.docsearch-field svg {
  height: 0.95rem;
  width: 0.95rem;
  flex: none;
  color: var(--faint);
}

.docsearch-field input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.92rem;
}

.docsearch-field input::placeholder {
  color: var(--faint);
}

.docsearch-field input::-webkit-search-cancel-button {
  display: none;
}

.docsearch-field kbd {
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 0.3rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--faint);
}

.docsearch-out {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  max-height: 22rem;
  overflow-y: auto;
  padding: 0.3rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: var(--panel);
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.55);
}

.hit {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.5rem;
}

.hit b {
  font-size: 0.88rem;
  font-weight: 600;
}

.hit span {
  font-size: 0.78rem;
  color: var(--faint);
}

.hit.on,
.hit:hover {
  background: #d9401f26;
}

.hit.on b,
.hit:hover b {
  color: var(--accent);
}

.docsearch-none {
  padding: 0.6rem;
  font-size: 0.85rem;
  color: var(--faint);
}

.hub {
  display: flex;
  flex-direction: column;
  gap: 2.75rem;
  padding: 3.5rem var(--gutter) 6rem;
}

.hub-g {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.hub-h {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.hub-h i {
  flex: 1;
  height: 1px;
  background: var(--hairline);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 0.6rem;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: var(--panel);
  transition: border-color 0.18s ease-in-out, transform 0.18s ease-in-out;
}

.card:hover,
.card:focus-visible {
  border-color: #d9401f80;
  transform: translateY(-2px);
}

.card b {
  font-size: 0.98rem;
  font-weight: 600;
}

.card span {
  font-size: 0.85rem;
  color: var(--faint);
  text-wrap: pretty;
}

.card u {
  margin-top: 0.5rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  text-decoration: none;
}

.shell {
  display: grid;
  grid-template-columns: 12.5rem minmax(0, 1fr) 10.5rem;
  gap: 3.5rem;
  max-width: 82rem;
  margin: 0 auto;
  padding: 7rem 1.5rem 6rem;
  align-items: start;
}

.rail {
  position: sticky;
  top: 5.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rail .docsearch {
  width: 100%;
}

.rail .docsearch-field {
  padding: 0.4rem 0.6rem;
}

.rail .docsearch-field input {
  font-size: 0.82rem;
}

.tierbox {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tierbox-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.switch {
  display: flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: var(--panel);
}

.sw {
  flex: 1;
  padding: 0.35rem 0;
  border: none;
  border-radius: 0.5rem;
  background: none;
  color: var(--muted);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease-in-out, color 0.18s ease-in-out;
}

.sw:hover {
  color: var(--text);
}

.sw:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

.sw.on {
  background: #d9401f40;
  color: var(--text);
  box-shadow: inset 0 0 0 1px #d9401f80;
}

.tree {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.tree-g {
  display: flex;
  flex-direction: column;
}

.tree-g b {
  margin-bottom: 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.tree-g a {
  padding: 0.22rem 0 0.22rem 0.7rem;
  border-left: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--faint);
  transition: color 0.18s ease-in-out, border-color 0.18s ease-in-out;
}

.tree-g a:hover,
.tree-g a:focus-visible {
  color: var(--muted);
}

.tree-g a.on {
  border-left-color: var(--accent);
  color: var(--text);
  font-weight: 600;
}

.doc {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.crumb {
  display: flex;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--faint);
}

.crumb a:hover {
  color: var(--accent);
}

.doc h1 {
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
}

.doc .lede {
  font-size: 1.05rem;
}

.body {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
  margin-top: 2.5rem;
}

.sec {
  scroll-margin-top: 6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sec h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.sec p {
  max-width: 42rem;
  color: var(--muted);
  text-wrap: pretty;
}

.sec p a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.sec p strong {
  color: var(--text);
  font-weight: 600;
}

.spec {
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--panel);
  overflow: hidden;
}

.spec-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem 1.1rem;
  border-top: 1px solid var(--hairline);
}

.spec-row:first-child {
  border-top: none;
}

.spec-k {
  font-size: 0.92rem;
  color: var(--muted);
}

.spec-v {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text);
  text-align: end;
}

.spec-v.tv {
  color: var(--accent);
}

.spec .spec-cap {
  max-width: none;
  padding: 0.6rem 1.1rem;
  border-top: 1px solid var(--hairline);
  background: var(--panel-2);
  font-size: 0.78rem;
  color: var(--faint);
}

.spec .spec-cap a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 100rem;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.chip.up {
  border-color: #d9401f80;
  background: #d9401f1a;
  color: var(--accent);
}

.chip-key {
  font-size: 0.78rem;
  color: var(--faint);
}

.badgelist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.6rem;
}

.badge {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--panel);
}

.badge-icon {
  display: grid;
  place-items: center;
  height: 1.4rem;
  width: 1.4rem;
  flex: none;
}

.badge-icon svg {
  height: 1.4rem;
  width: 1.4rem;
}

.badge-text b {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
}

.badge-text span {
  display: block;
  font-size: 0.8rem;
  color: var(--faint);
  text-wrap: pretty;
}

.badge-text em {
  display: block;
  margin-top: 0.3rem;
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--border);
}

.callout {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid #d9401f55;
  border-radius: 0.75rem;
  background: #d9401f14;
  font-size: 0.9rem;
}

.callout b {
  font-weight: 600;
}

.callout span {
  color: var(--muted);
  text-wrap: pretty;
}

.media {
  margin: 1.4rem 0;
}

.media img,
.media video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--panel);
}

.media figcaption {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  color: var(--faint);
  text-wrap: pretty;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 4rem;
}

.pg {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.8rem;
  background: var(--panel);
  font-size: 0.95rem;
  font-weight: 600;
  transition: border-color 0.18s ease-in-out;
}

.pg:hover,
.pg:focus-visible {
  border-color: #d9401f80;
}

.pg span {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.pg.next {
  text-align: end;
}

.onthis {
  position: sticky;
  top: 5.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.onthis b {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.onthis-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.onthis-list a {
  font-size: 0.82rem;
  color: var(--faint);
  text-wrap: pretty;
  transition: color 0.18s ease-in-out;
}

.onthis-list a:hover,
.onthis-list a:focus-visible {
  color: var(--muted);
}

.onthis-list a.on {
  color: var(--accent);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem var(--gutter);
  border-top: 1px solid var(--hairline);
  font-size: 0.85rem;
  color: var(--faint);
}

@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 12rem minmax(0, 1fr);
    gap: 2.5rem;
  }

  .onthis {
    display: none;
  }
}

@media (max-width: 820px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
    padding-top: 5.5rem;
  }

  .rail {
    position: static;
    gap: 1.25rem;
  }

  .tree {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.25rem;
  }

  .tree-g {
    min-width: 8rem;
  }

  .body {
    gap: 2.75rem;
  }

  .spec-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .spec-v {
    text-align: start;
  }

  .pager {
    flex-direction: column;
  }

  .pg.next {
    text-align: start;
  }
}

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

  .card {
    transition: none;
  }
}
