/* Self-hosted Latin subsets of the prototype’s variable fonts */
@font-face {
  font-family: "Inter Variable";
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono Variable";
  src: url("/assets/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
}

/* Base and article typography */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img {
  max-width: 100%;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}
.icon {
  flex: none;
  display: block;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
:focus-visible {
  outline: 2px solid var(--focus, #3b82f6);
  outline-offset: 2px;
}
mark {
  background: var(--mark-bg, #fde68a);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
kbd {
  font: 500 11px/1 var(--font-mono, ui-monospace, monospace);
}

/* ---- Prose structure ---- */
.prose {
  color: var(--p-text);
  font-size: var(--p-size, 16px);
  line-height: var(--p-leading, 1.7);
}
.prose::after {
  content: "";
  display: table;
  clear: both;
}
.prose > :first-child,
.prose article > :first-child {
  margin-top: 0;
}
.prose p,
.prose ul,
.prose ol,
.prose .table-wrap,
.prose .callout,
.prose figure {
  margin: 0 0 var(--p-gap, 1.15em);
}
.prose h2,
.prose h3,
.prose h4 {
  position: relative;
  color: var(--p-heading);
  clear: both;
  scroll-margin-top: var(--p-scroll-offset, 96px);
}
.prose h2 {
  font-size: var(--p-h2, 1.5em);
  line-height: 1.3;
  margin: var(--p-h2-top, 2.2em) 0 0.6em;
}
.prose h3 {
  font-size: var(--p-h3, 1.2em);
  line-height: 1.35;
  margin: 1.9em 0 0.5em;
}
.prose h2 + h3 {
  margin-top: 1em;
}
.prose .h-anchor {
  position: absolute;
  left: -1.1em;
  width: 1em;
  text-decoration: none;
  color: var(--p-muted);
  opacity: 0;
  font-weight: 400;
  transition: opacity 0.15s;
}
.prose h2:hover .h-anchor,
.prose h3:hover .h-anchor,
.prose .h-anchor:focus-visible {
  opacity: 1;
}
.prose a:not(.h-anchor) {
  color: var(--p-link);
  text-decoration: underline;
  text-decoration-color: var(--p-link-line, currentColor);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.prose a:not(.h-anchor):hover {
  text-decoration-color: currentColor;
}
.prose strong {
  color: var(--p-strong, inherit);
  font-weight: 600;
}
.prose ul,
.prose ol {
  padding-left: 1.35em;
}
.prose li {
  margin: 0.35em 0;
  padding-left: 0.2em;
}
.prose li::marker {
  color: var(--p-muted);
}
.prose ol li::marker {
  font-variant-numeric: tabular-nums;
}

/* Rank portraits float beside their section */
.prose .md-rank {
  float: right;
  width: 96px;
  height: auto;
  margin: 0 0 1em 1.75em;
  shape-outside: circle(48% at 50% 48%);
}
.prose figure img {
  display: block;
  /* Natural size: many game images are 60px sprites that blur when stretched. */
  width: auto;
  max-width: 100%;
  border-radius: var(--p-radius, 8px);
}
.prose figure figcaption {
  font-size: 0.82em;
  color: var(--p-muted);
  margin-top: 0.6em;
}

/* Tables */
.prose .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.prose th {
  text-align: left;
  font-weight: 600;
  color: var(--p-heading);
  white-space: nowrap;
}
.prose th,
.prose td {
  padding: 10px 14px;
  vertical-align: middle;
}
.prose td.col-thumb,
.prose th.col-thumb {
  width: 1%;
  padding-right: 0;
}
.prose .md-thumb {
  display: block;
  width: 40px;
  height: 40px;
  max-width: none;
  object-fit: contain;
}

/* Callouts */
.prose .callout {
  position: relative;
}
.prose .callout > p:last-child {
  margin-bottom: 0;
}
.prose .callout-title {
  font-weight: 600;
  margin: 0 0 0.25em;
}

@media (max-width: 640px) {
  .prose .md-rank {
    width: 68px;
    margin-left: 1.1em;
  }
  .prose .h-anchor {
    display: none;
  }
  .prose th,
  .prose td {
    padding: 10px 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* Variant A light and variant E dark, shade 2 */
:root {
  color-scheme: light;
  --button-text: #fff;
  --font: "Inter Variable", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono Variable", ui-monospace, monospace;
  --bg: #ffffff;
  --bg-subtle: #f6f8fa;
  --bg-hover: #f0f3f6;
  --border: #e4e8ec;
  --border-strong: #d3d9e0;
  --text: #0e1621;
  --text-2: #3b4654;
  --muted: #5f6b7a;
  --accent: #225277;
  --accent-hover: #183d59;
  --accent-text: #225277;
  --accent-soft: #ebf2f8;
  --accent-line: #c5d8e8;
  --focus: #2f6fa3;
  --mark-bg: #fdeeb4;
  --header-h: 64px;
  --c-note-bg: #eef5fb;
  --c-note-bd: #cfe0ef;
  --c-note-fg: #1d4f78;
  --c-tip-bg: #edf8f2;
  --c-tip-bd: #c9e9d6;
  --c-tip-fg: #1c6440;
  --c-imp-bg: #f3f0fc;
  --c-imp-bd: #ddd5f5;
  --c-imp-fg: #5232a8;
  --c-warn-bg: #fdf6e7;
  --c-warn-bd: #f2dfb0;
  --c-warn-fg: #7f4f05;
  --c-caution-bg: #fdf0ef;
  --c-caution-bd: #f4cfcb;
  --c-caution-fg: #9b2a1f;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --button-text: #06131f;
  --bg: #121922;
  --bg-subtle: #18202a;
  --bg-hover: #1e2733;
  --border: #27313d;
  --border-strong: #343f4d;
  --text: #e7edf3;
  --text-2: #b4c0cc;
  --muted: #8f9cab;
  --accent: #7db8e5;
  --accent-hover: #a5cff0;
  --accent-text: #8ec2ea;
  --accent-soft: rgba(125, 184, 229, 0.1);
  --accent-line: rgba(125, 184, 229, 0.35);
  --focus: #7db8e5;
  --mark-bg: rgba(250, 204, 21, 0.28);
  --c-note-bg: rgba(125, 184, 229, 0.08);
  --c-note-bd: rgba(125, 184, 229, 0.22);
  --c-note-fg: #9ccbef;
  --c-tip-bg: rgba(74, 197, 128, 0.08);
  --c-tip-bd: rgba(74, 197, 128, 0.22);
  --c-tip-fg: #7fd8a6;
  --c-imp-bg: rgba(160, 135, 245, 0.09);
  --c-imp-bd: rgba(160, 135, 245, 0.25);
  --c-imp-fg: #bfaefa;
  --c-warn-bg: rgba(240, 180, 60, 0.08);
  --c-warn-bd: rgba(240, 180, 60, 0.24);
  --c-warn-fg: #f2c36b;
  --c-caution-bg: rgba(240, 100, 90, 0.08);
  --c-caution-bd: rgba(240, 100, 90, 0.25);
  --c-caution-fg: #f4998f;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
}
::selection {
  background: var(--accent-soft);
}

.a-skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 50;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--button-text);
  border-radius: 6px;
  text-decoration: none;
}
.a-skip:focus {
  top: 12px;
}

/* Header */
.a-top {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
}
.a-top-inner {
  height: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.a-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex: none;
}
.a-brand img {
  display: block;
}
.a-brand-name {
  font-weight: 650;
  font-size: 15.5px;
  letter-spacing: -0.01em;
}
.a-brand-tag {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--accent-text);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  padding: 1px 7px;
  border-radius: 999px;
}
.a-top .a-brand {
  width: 248px;
}
.a-search {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: 440px;
  display: flex;
  align-items: center;
  height: 38px;
  padding: 0 10px 0 12px;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  border-radius: 9px;
  color: var(--muted);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.a-search:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--bg);
}
.a-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
}
.a-search input::placeholder {
  color: var(--muted);
}
.a-search input::-webkit-search-cancel-button {
  display: none;
}
.a-kbd {
  padding: 4px 6px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
}
.a-top-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.a-top-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-2);
}
.a-top-link:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.a-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-2);
}
.a-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.a-burger {
  display: none;
  margin-left: -8px;
}

/* Shell */
.a-shell {
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  background: linear-gradient(var(--border), var(--border)) 271px 0 / 1px 100% no-repeat;
}
.a-side {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 28px 20px 96px 24px;
  scrollbar-width: thin;
}
.a-side-head {
  display: none;
}
.a-nav-home {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  margin: 0 -10px 18px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 550;
  color: var(--text-2);
  text-decoration: none;
}
.a-nav-home:hover {
  background: var(--bg-hover);
  color: var(--text);
}
.a-nav-home[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-text);
}
.a-nav-group + .a-nav-group {
  margin-top: 22px;
}
.a-nav-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.005em;
}
.a-nav-label .icon {
  color: var(--muted);
}
.a-nav-group ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 7px;
  border-left: 0;
}
.a-nav-group li a {
  display: block;
  position: relative;
  padding: 5px 10px 5px 16px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  border-left: 1px solid var(--border);
  line-height: 1.45;
}
.a-nav-group li a:hover {
  color: var(--text);
  border-left-color: var(--border-strong);
}
.a-nav-group li a[aria-current="page"] {
  color: var(--accent-text);
  font-weight: 550;
  border-left: 2px solid var(--accent);
  padding-left: 15px;
}
.a-scrim {
  display: none;
}

.a-main {
  min-width: 0;
  padding: 48px 56px 120px;
}

/* Home */
.a-home {
  max-width: 1040px;
}
.a-eyebrow {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-text);
  letter-spacing: 0.01em;
}
.a-hero h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.12;
  letter-spacing: -0.028em;
  font-weight: 700;
  max-width: 640px;
  text-wrap: balance;
}
.a-hero-lede {
  margin: 16px 0 28px;
  font-size: 17.5px;
  line-height: 1.6;
  color: var(--text-2);
  max-width: 600px;
}
.a-hero-search {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 640px;
  height: 56px;
  padding: 0 7px 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg);
  color: var(--muted);
  box-shadow:
    0 1px 2px rgba(16, 24, 40, 0.05),
    0 4px 16px -8px rgba(16, 24, 40, 0.1);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.a-hero-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.a-hero-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: none;
  background: none;
  font-size: 16.5px;
  color: var(--text);
}
.a-hero-search input::placeholder {
  color: var(--muted);
}
.a-btn-primary {
  height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--button-text);
  font-weight: 600;
  font-size: 14.5px;
}
.a-btn-primary:hover {
  background: var(--accent-hover);
}
.a-hero-try {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}
.a-hero-try span {
  margin-right: 2px;
}
.a-hero-try a {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text-2);
  text-decoration: none;
  background: var(--bg);
}
.a-hero-try a:hover {
  border-color: var(--accent-line);
  color: var(--accent-text);
}

.a-section-title {
  margin: 0 0 18px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.a-topics {
  margin-top: 64px;
}
.a-topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.a-topic {
  padding: 24px 24px 22px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.a-topic:nth-child(3n) {
  border-right: 0;
}
.a-topic:nth-child(3n + 1):nth-last-child(-n + 3),
.a-topic:nth-child(3n + 1):nth-last-child(-n + 3) ~ .a-topic {
  border-bottom: 0;
}
.a-topic-head {
  display: flex;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 14px;
}
.a-topic-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid var(--accent-line);
}
.a-topic-title {
  display: block;
  font-weight: 650;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.a-topic-head:hover .a-topic-title {
  color: var(--accent-text);
}
.a-topic-desc {
  display: block;
  margin-top: 3px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}
.a-topic ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 52px;
}
.a-topic li a {
  display: block;
  padding: 3px 0;
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
}
.a-topic li a:hover {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.a-topic-more {
  margin: 6px 0 0 52px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--accent-text);
  text-decoration: none;
}
.a-topic-more:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.a-recent {
  margin-top: 56px;
}
.a-recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}
.a-recent-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px 190px;
  align-items: center;
  gap: 16px;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  font-size: 14.5px;
}
.a-recent-list a:hover {
  background: var(--bg-subtle);
}
.a-recent-title {
  font-weight: 550;
}
.a-recent-cat {
  color: var(--muted);
}
.a-recent-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13.5px;
  justify-self: end;
}

/* Article */
.a-article {
  display: grid;
  grid-template-columns: minmax(0, 728px) 220px;
  gap: 72px;
  justify-content: start;
}
.a-preview {
  max-width: 1132px;
  margin-inline: auto;
}
.a-preview .a-article:not(:has(.a-toc)) {
  grid-template-columns: minmax(0, 728px);
  justify-content: center;
}
.a-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  font-size: 13.5px;
  color: var(--muted);
}
.a-crumbs a {
  color: var(--muted);
  text-decoration: none;
}
.a-crumbs a:hover {
  color: var(--text);
}
.a-crumbs .icon {
  opacity: 0.6;
}
.a-crumbs [aria-current="page"] {
  color: var(--text-2);
  font-weight: 500;
}
.a-title {
  margin: 0;
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: -0.026em;
  font-weight: 700;
  text-wrap: balance;
}
.a-lede {
  margin: 12px 0 0;
  font-size: 18px;
  line-height: 1.55;
  color: var(--text-2);
}
.a-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 22px 0 36px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--muted);
}
.a-meta strong {
  color: var(--text-2);
  font-weight: 600;
}
.a-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.a-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--border-strong);
  margin: 0 4px;
}

.a-prose {
  --p-text: var(--text-2);
  --p-heading: var(--text);
  --p-muted: var(--muted);
  --p-link: var(--accent-text);
  --p-link-line: var(--accent-line);
  --p-strong: var(--text);
  --p-size: 16px;
  --p-leading: 1.75;
  --p-h2: 24px;
  --p-h3: 18px;
  --p-scroll-offset: 88px;
}
.a-prose h2 {
  font-weight: 650;
  letter-spacing: -0.018em;
  margin-top: 52px;
}
.a-prose h3 {
  font-weight: 620;
  letter-spacing: -0.01em;
}
.a-prose .table-wrap {
  border: 1px solid var(--border);
  border-radius: 10px;
}
.a-prose table {
  font-size: 14px;
}
.a-prose thead th {
  background: var(--bg-subtle);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.a-prose td {
  border-top: 1px solid var(--border);
  color: var(--text-2);
}
.a-prose tbody tr:first-child td {
  border-top: 0;
}
.a-prose td:first-child:not(.col-thumb),
.a-prose .has-thumbs td:nth-child(2) {
  color: var(--text);
  font-weight: 500;
}
.a-prose td img {
  float: none;
  display: inline-block;
  vertical-align: middle;
  margin: 0 0 0 6px;
  object-fit: contain;

  width: 36px;
  height: 36px;
  border-radius: 6px;
}
.a-prose [data-callout] {
  padding: 14px 18px 14px 16px;
  border: 1px solid var(--c-bd);
  background: var(--c-bg);
  border-radius: 10px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.65;
}
.a-prose .callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--c-fg);
  font-size: 14px;
  margin-bottom: 4px;
}
.a-prose .callout-title::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  background: currentColor;
  mask: var(--c-icon) center / contain no-repeat;
}
.a-prose :is([data-callout="WARNING"], [data-callout="CAUTION"]) {
  --c-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 20h20L12 3ZM12 10v4M12 17h.01'/%3E%3C/svg%3E");
}
.a-prose [data-callout="NOTE"] {
  --c-bg: var(--c-note-bg);
  --c-bd: var(--c-note-bd);
  --c-fg: var(--c-note-fg);
  --c-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5M12 8h.01'/%3E%3C/svg%3E");
}
.a-prose [data-callout="TIP"] {
  --c-bg: var(--c-tip-bg);
  --c-bd: var(--c-tip-bd);
  --c-fg: var(--c-tip-fg);
  --c-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 21h4M12 3a6 6 0 0 0-4 10.5c.7.7 1 1.8 1 2.5h6c0-1 .3-1.8 1-2.5A6 6 0 0 0 12 3Z'/%3E%3C/svg%3E");
}
.a-prose [data-callout="IMPORTANT"] {
  --c-bg: var(--c-imp-bg);
  --c-bd: var(--c-imp-bd);
  --c-fg: var(--c-imp-fg);
  --c-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 4 6v6c0 5 3.5 8 8 9 4.5-1 8-4 8-9V6l-8-3Z'/%3E%3C/svg%3E");
}
.a-prose [data-callout="WARNING"] {
  --c-bg: var(--c-warn-bg);
  --c-bd: var(--c-warn-bd);
  --c-fg: var(--c-warn-fg);
}
.a-prose [data-callout="CAUTION"] {
  --c-bg: var(--c-caution-bg);
  --c-bd: var(--c-caution-bd);
  --c-fg: var(--c-caution-fg);
}
.a-prose figure img {
  border: 1px solid var(--border);
}
/* Rank portraits inside a table sit before the rank name, like the prototype's thumbnail
   column. Absolute positioning keeps wrapped names aligned instead of flowing under the image. */
.a-prose td:has(> .md-rank) {
  position: relative;
  padding-left: 62px;
}
.a-prose td > .md-rank {
  position: absolute;
  top: 50%;
  left: 14px;
  translate: 0 -50%;
  float: none;
  width: 36px;
  height: 36px;
  margin: 0;
  border-radius: 0;
  shape-outside: none;
}

.a-article-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--muted);
}
.a-article-foot a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}
.a-article-foot a:hover {
  color: var(--accent-text);
}
.a-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}
.a-pager a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.a-pager a:hover {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.a-pager a > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.a-pager strong {
  font-weight: 600;
  font-size: 15.5px;
  color: var(--accent-text);
}
.a-pager-next {
  text-align: right;
  align-items: flex-end;
  grid-column: 2;
}

.a-toc {
  position: sticky;
  top: calc(var(--header-h) + 48px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 96px);
  overflow-y: auto;
  font-size: 13.5px;
}
.a-toc-label {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
}
.a-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.a-toc li a {
  display: block;
  padding: 4px 0;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.45;
  transition: color 0.15s;
}
.a-toc li:not(.d2) a {
  padding-left: 14px;
}
.a-toc li a:hover {
  color: var(--text);
}
.a-toc li a.is-active {
  color: var(--accent-text);
  font-weight: 550;
}
.a-toc-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  width: 100%;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}
.a-toc-top:hover {
  color: var(--text);
}
.a-toc-mobile {
  display: none;
}

/* Search */
.a-results {
  max-width: 760px;
}
.a-results .a-title {
  font-size: 30px;
}
.a-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 8px;
}
.a-filter button {
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
}
.a-filter button span {
  color: var(--muted);
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}
.a-filter button:hover {
  border-color: var(--border-strong);
}
.a-filter button.is-on {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.a-filter button.is-on span {
  color: inherit;
  opacity: 0.7;
}
.a-hit-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.a-hit-list li {
  border-bottom: 1px solid var(--border);
}
.a-hit-list a {
  display: block;
  padding: 20px 0;
  text-decoration: none;
  color: inherit;
}
.a-hit-path {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--muted);
}
.a-hit-title {
  display: block;
  margin: 4px 0 6px;
  font-size: 17px;
  font-weight: 620;
  color: var(--accent-text);
  letter-spacing: -0.01em;
}
.a-hit-sep {
  color: var(--muted);
  font-weight: 400;
}
.a-hit-list a:hover .a-hit-title {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.a-hit-snippet {
  display: block;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-2);
}
.a-empty {
  margin-top: 24px;
  color: var(--text-2);
}

.a-footer {
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 24px 96px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
  color: var(--muted);
}
.a-footer div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-2);
}

/* Responsive */
@media (max-width: 1240px) {
  .a-article {
    grid-template-columns: minmax(0, 760px);
  }
  .a-toc {
    display: none;
  }
  .a-toc-mobile {
    display: block;
    margin: -12px 0 32px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-subtle);
    font-size: 14px;
  }
  .a-toc-mobile summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
  }
  .a-toc-mobile summary::-webkit-details-marker {
    display: none;
  }
  .a-toc-mobile[open] summary .icon {
    transform: rotate(180deg);
  }
  .a-toc-mobile ul {
    list-style: none;
    margin: 0;
    padding: 4px 14px 12px;
    border-top: 1px solid var(--border);
  }
  .a-toc-mobile li a {
    display: block;
    padding: 6px 0;
    color: var(--text-2);
    text-decoration: none;
  }
  .a-toc-mobile li:not(.d2) a {
    padding-left: 14px;
    color: var(--muted);
  }
}
@media (max-width: 1100px) {
  .a-topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .a-topic:nth-child(3n) {
    border-right: 1px solid var(--border);
  }
  .a-topic:nth-child(2n) {
    border-right: 0;
  }
  .a-topic:nth-child(n) {
    border-bottom: 1px solid var(--border);
  }
  .a-topic:nth-child(2n + 1):nth-last-child(-n + 2),
  .a-topic:nth-child(2n + 1):nth-last-child(-n + 2) ~ .a-topic {
    border-bottom: 0;
  }
}
@media (max-width: 960px) {
  .a-shell {
    grid-template-columns: minmax(0, 1fr);
    background: none;
  }

  .a-top .a-brand {
    width: auto;
  }
  .a-side {
    position: fixed;
    z-index: 60;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 86vw);
    height: 100dvh;
    background: var(--bg);
    padding-top: 0;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.2);
    visibility: hidden;
  }
  .a-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    margin: 0 -8px 8px 0;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 1;
  }
  .nav-open .a-side {
    transform: none;
    visibility: visible;
  }
  .a-scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(8, 12, 18, 0.45);
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
  }
  .nav-open .a-scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .a-main {
    padding: 36px 32px 120px;
  }
}
@media (max-width: 640px) {
  :root {
    --header-h: 56px;
  }
  .a-top-inner {
    padding: 0 16px;
    gap: 10px;
  }
  .a-top-link,
  .a-kbd {
    display: none;
  }
  .a-brand-tag {
    display: none;
  }
  .a-top .a-brand-name {
    display: none;
  }
  .a-search {
    height: 36px;
    max-width: none;
  }
  .a-main {
    padding: 28px 20px 112px;
  }
  .a-hero h1 {
    font-size: 30px;
  }
  .a-hero-lede {
    font-size: 16px;
    margin-bottom: 22px;
  }
  .a-hero-search {
    height: 52px;
    padding-left: 14px;
  }
  .a-hero-search .a-btn-primary {
    display: none;
  }
  .a-topics {
    margin-top: 44px;
  }
  .a-topic-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .a-topic,
  .a-topic:nth-child(n) {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 20px;
  }
  .a-topic:last-child {
    border-bottom: 0;
  }
  .a-recent-list a {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
  }
  .a-recent-cat {
    grid-row: 2;
    font-size: 13px;
  }
  .a-recent-meta {
    grid-row: 1 / span 2;
    grid-column: 2;
  }
  .a-title {
    font-size: 29px;
  }
  .a-meta > span.a-dot {
    display: none;
  }
  .a-meta {
    gap: 8px 12px;
  }
  .a-lede {
    font-size: 16.5px;
  }
  .a-prose {
    --p-size: 16px;
    --p-h2: 21px;
    --p-h3: 17px;
  }
  .a-prose h2 {
    margin-top: 40px;
  }
  .a-pager {
    grid-template-columns: 1fr;
  }
  .a-pager-next {
    grid-column: 1;
  }
  .a-results .a-title {
    font-size: 24px;
  }
  .a-footer {
    padding: 24px 20px 96px;
  }
}

/* Sections and status pages */
.a-nav-label a {
  text-decoration: none;
}
.a-nav-label a:hover,
.a-nav-label a[aria-current="page"] {
  color: var(--accent-text);
}
.a-content {
  min-width: 0;
}
.a-title,
.a-nav-label a,
.a-prose {
  overflow-wrap: anywhere;
}
.a-section-list {
  margin-top: 28px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.a-error-link {
  color: var(--accent-text);
}

/* Rendered Markdown */
.prose [data-callout] {
  margin: 0 0 var(--p-gap, 1.15em);
}
.prose [data-callout] > :last-child {
  margin-bottom: 0;
}
.prose [data-callout] > .callout-title {
  color: var(--c-fg);
  font-weight: 600;
}
.prose :is(h5, h6) {
  clear: both;
  color: var(--p-heading);
  scroll-margin-top: var(--p-scroll-offset, 96px);
}
.prose img {
  height: auto;
}
.a-prose pre {
  overflow-x: auto;
  padding: 14px;
  border-radius: 8px;
  background: var(--bg-subtle);
}
.a-prose code {
  font-family: var(--font-mono);
}

.a-prose blockquote {
  margin: 0 0 1.15em;
  padding-left: 1em;
  border-left: 3px solid var(--border-strong);
}
.a-prose .table-wrap:focus-visible {
  outline-offset: 1px;
}
#a-main {
  scroll-margin-top: calc(var(--header-h) + 12px);
}
#top {
  scroll-margin-top: 0;
}

/* Search palette */
.a-palette {
  width: min(560px, calc(100% - 32px));
  max-height: min(65dvh, 560px);
  margin: 13vh auto auto;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 20px 64px #0005;
}
.a-palette::backdrop {
  background: rgb(5 8 12 / 55%);
  backdrop-filter: blur(2px);
}
.a-palette:focus-within {
  border-color: var(--accent-line);
}
.a-palette-form {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.a-palette-form input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  padding: 8px;
  font-size: 16px;
  color: var(--text);
}
.a-palette-form input::placeholder {
  color: var(--muted);
}
.a-palette-form input:focus-visible {
  /* The open palette is the focus context; the caret marks the field, as in the header search. */
  outline: none;
}
.a-palette-form input::-webkit-search-cancel-button {
  display: none;
}
.a-palette-hint {
  margin: 0;
  padding: 12px 16px;
  color: var(--muted);
  font-size: 13.5px;
}
.a-palette-results {
  padding: 0 6px 6px;
  margin: 0;
  list-style: none;
}
.a-palette-results:empty {
  display: none;
}
.a-palette-results a {
  display: block;
  padding: 10px 12px;
  margin: 4px 0;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.a-palette-results a:hover,
.a-palette-results a:focus-visible {
  background: var(--bg-hover);
}
.a-palette-results .a-hit-path {
  margin-bottom: 2px;
}
.a-palette-results .a-hit-snippet {
  margin-top: 2px;
}
.a-search-trigger {
  border: 0;
  padding: 2px 0;
  background: none;
  color: var(--muted);
}
.a-search-trigger:hover {
  color: var(--accent-text);
}
.a-search-trigger-icon {
  display: none;
}
[data-js-control] {
  display: none;
}
[data-js] .a-theme,
[data-js] .a-search-trigger {
  display: inline-grid;
}
[data-theme="dark"] .theme-moon,
[data-theme="light"] .theme-sun {
  display: none;
}

@media (max-width: 960px) {
  [data-js] .a-burger {
    display: inline-grid;
  }
  .nav-open {
    overflow: hidden;
  }
  .a-side {
    overscroll-behavior: contain;
  }
}
@media (max-width: 640px) {
  [data-js] .a-search > .icon {
    display: none;
  }
  .a-search-trigger {
    order: -1;
    min-width: 24px;
    min-height: 24px;
    place-items: center;
    padding: 0;
    /* Keep the 24px hit area but align the 16px glyph with the prototype's search icon. */
    margin: 0 -4px;
  }
  .a-search-trigger-icon {
    display: block;
  }
  .a-palette-form {
    gap: 6px;
  }
}

.a-mobile-play {
  display: none;
}
[data-js] .a-filter {
  display: flex;
}
@media (max-width: 640px) {
  .a-mobile-play {
    display: inline;
    color: var(--accent-text);
    font-weight: 550;
    text-decoration: none;
  }
  .a-mobile-play:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
  .a-prose td:has(> .md-rank) {
    padding-left: 57px;
  }
  .a-prose td > .md-rank {
    left: 11px;
  }
}

@media (max-width: 640px) {
  .a-filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-block: 3px;
  }
  .a-filter button {
    flex: none;
    white-space: nowrap;
  }
}
