:root {
  color-scheme: dark;
  --ink: #eaf4f5;
  --muted: #9eb2bb;
  --line: #294553;
  --panel: rgba(13, 38, 51, 0.82);
  --teal: #55d3bd;
  --blue: #79b8ff;
  --amber: #f2bf68;
  --bg: #06141f;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 4%, rgba(28, 166, 161, .14), transparent 28rem),
    radial-gradient(circle at 5% 80%, rgba(66, 133, 212, .10), transparent 30rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a { color: var(--teal); text-underline-offset: .2em; }
a:hover { color: #8be6d6; }
a:focus-visible { outline: 3px solid var(--amber); outline-offset: 4px; border-radius: 3px; }

.skip-link { position: fixed; left: 18px; top: -80px; z-index: 10; padding: 10px 14px; color: #06141f; background: var(--amber); font-weight: 800; }
.skip-link:focus { top: 12px; }

.wrap { width: min(1120px, calc(100% - 36px)); margin: 0 auto; }

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
}

.brand { color: var(--ink); font-weight: 820; letter-spacing: .08em; text-decoration: none; }
.links { display: flex; gap: 22px; flex-wrap: wrap; }
.links a { color: var(--muted); text-decoration: none; font-size: .94rem; }

.hero { padding: 76px 0 58px; display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero > *, .grid > *, .boundary > * { min-width: 0; }
.eyebrow { color: var(--teal); font-size: .78rem; font-weight: 780; letter-spacing: .16em; text-transform: uppercase; }
h1 { max-width: 760px; margin: 12px 0 22px; font-size: clamp(2.8rem, 6vw, 5.6rem); line-height: .98; letter-spacing: -.055em; }
.lead { color: #c6d6da; font-size: clamp(1.12rem, 2vw, 1.34rem); max-width: 670px; }
.lead-defs { margin: 18px 0 0; max-width: 670px; color: #94a9ae; font-size: 0.95rem; line-height: 1.55; border-left: 2px solid #24373c; padding-left: 16px; }
.lead-defs dt { color: #c6d6da; font-weight: 600; letter-spacing: 0.01em; }
.lead-defs dd { margin: 2px 0 12px; }
.lead-defs dd:last-child { margin-bottom: 0; }
.lead-close { margin-top: 18px; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.hero-actions { margin: 26px 0 30px; }
.button { display: inline-flex; align-items: center; min-height: 46px; padding: 0 18px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 700; background: rgba(14, 39, 52, .72); }
.button.primary { color: #061a1b; background: var(--teal); border-color: var(--teal); }
.hero-card, .card, pre { border: 1px solid var(--line); border-radius: 15px; background: var(--panel); box-shadow: 0 22px 65px rgba(0, 0, 0, .22); }
.hero-card { padding: 22px; overflow: hidden; }
.hero-card img { display: block; width: 100%; height: auto; border-radius: 9px; }

section { padding: 62px 0; }
h2 { margin: 0 0 16px; font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -.035em; }
.section-lead { max-width: 760px; color: var(--muted); font-size: 1.08rem; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 30px; }
.card { padding: 22px; }
.card .number { color: var(--teal); font-weight: 820; font-size: .78rem; letter-spacing: .12em; }
.card h3 { margin: 8px 0; font-size: 1.12rem; }
.card p { color: var(--muted); margin: 0; font-size: .94rem; }

.terminal { margin-top: 28px; overflow: auto; }
pre { margin: 0; padding: 24px; color: #dcebed; font: 500 .92rem/1.75 ui-monospace, SFMono-Regular, Consolas, monospace; }
.ok { color: var(--teal); }
.unknown { color: var(--amber); }

.boundary { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 28px; }
.boundary ul { margin: 10px 0 0; padding-left: 20px; color: var(--muted); }
.status { border-left: 3px solid var(--amber); padding: 3px 0 3px 18px; color: #d6e2e5; max-width: 850px; }
.release-coordinate { max-width: 850px; color: var(--muted); }

.ref-hero { padding: 54px 0 10px; }
.ref-hero h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); margin-bottom: 18px; }
.ref-hero .status { margin-top: 20px; }
.ref-table, .ref-list { margin-top: 26px; }
.ref-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
th { color: var(--teal); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; }
td { color: var(--muted); }
td code, .ref-help code, .section-lead code, .lead code, li code, p code { color: #dcebed; background: rgba(9, 30, 41, .8); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font: 500 .86em/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.ref-item { border: 1px solid var(--line); border-radius: 15px; background: var(--panel); padding: 20px 22px; margin-bottom: 14px; overflow-x: auto; }
.ref-item h3 { margin: 0 0 8px; font-size: 1.05rem; }
.ref-item h3 code { background: none; border: none; padding: 0; color: var(--ink); font-size: 1em; }
.ref-tag { color: var(--amber); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.ref-help, .ref-none, .ref-source { color: var(--muted); font-size: .93rem; margin: 0 0 12px; }
.ref-source { font-size: .84rem; }
.ref-signature { padding: 14px 16px; margin: 0 0 12px; font-size: .84rem; border-radius: 10px; overflow-x: auto; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.guide-card { border: 1px solid var(--line); border-radius: 15px; background: var(--panel); padding: 22px; }
.guide-card h2 { font-size: 1.35rem; margin-bottom: 10px; }
.guide-card ul { margin: 0; padding-left: 20px; }
.guide-card li { margin: 8px 0; color: var(--muted); }
.links a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--teal); text-underline-offset: .42em; }

.doc-shell { display: grid; grid-template-columns: minmax(220px, 285px) minmax(0, 1fr); gap: clamp(34px, 6vw, 78px); align-items: start; padding-top: 44px; }
.doc-sidebar { position: sticky; top: 18px; max-height: calc(100vh - 36px); overflow: auto; padding: 18px 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(8, 28, 39, .92); scrollbar-color: var(--line) transparent; }
.doc-sidebar section { padding: 0; }
.doc-sidebar section + section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.doc-sidebar h2 { margin: 0 0 9px; color: var(--teal); font-size: .7rem; letter-spacing: .13em; text-transform: uppercase; }
.doc-sidebar ul { margin: 0; padding: 0; list-style: none; }
.doc-sidebar li { margin: 6px 0; line-height: 1.35; }
.doc-sidebar a { display: block; padding: 4px 7px; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: .81rem; }
.doc-sidebar a:hover { color: var(--ink); background: rgba(85, 211, 189, .08); }
.doc-sidebar a[aria-current="page"] { color: var(--ink); background: rgba(85, 211, 189, .13); box-shadow: inset 2px 0 0 var(--teal); }
.doc-sidebar .toc-depth-3 a { padding-left: 17px; font-size: .76rem; }

.doc-content { min-width: 0; max-width: 820px; }
.doc-coordinate { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 12px; color: var(--teal); font-size: .74rem; font-weight: 760; letter-spacing: .1em; text-transform: uppercase; }
.doc-coordinate a { color: var(--muted); letter-spacing: normal; text-transform: none; }
.doc-boundary { margin: 0 0 38px; padding: 13px 16px; border-left: 3px solid var(--amber); color: var(--muted); background: rgba(242, 191, 104, .055); font-size: .88rem; }
.doc-content h1 { max-width: none; margin: 0 0 20px; font-size: clamp(2.35rem, 5vw, 4rem); line-height: 1.04; letter-spacing: -.045em; }
.doc-content h2 { margin: 54px 0 14px; padding-top: 8px; font-size: clamp(1.65rem, 3vw, 2.25rem); }
.doc-content h3 { margin: 36px 0 12px; font-size: 1.35rem; }
.doc-content h4 { margin: 28px 0 10px; font-size: 1.08rem; }
.doc-content h5, .doc-content h6 { margin: 24px 0 8px; color: var(--teal); font-size: .94rem; letter-spacing: .03em; }
.doc-content p, .doc-content li { color: #bdcdd1; }
.doc-content p { margin: 13px 0; }
.doc-content ul, .doc-content ol { padding-left: 25px; }
.doc-content li { margin: 7px 0; }
.doc-content blockquote { margin: 22px 0; padding: 3px 20px; border-left: 3px solid var(--teal); background: rgba(85, 211, 189, .055); }
.doc-content blockquote p { color: #d5e3e5; }
.doc-content hr { height: 1px; margin: 44px 0; border: 0; background: var(--line); }
.doc-content pre { margin: 20px 0; overflow: auto; box-shadow: none; }
.doc-content .doc-table { margin: 22px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; }
.doc-content .doc-table table { min-width: 560px; }
.doc-content .doc-table tr:last-child td { border-bottom: 0; }
.doc-content .doc-image { padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.doc-content .doc-image img, .doc-content p > img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.math, .math-block { color: #dcebed; font-family: "Cambria Math", "STIX Two Math", ui-monospace, Consolas, monospace; }
.math { white-space: nowrap; }
.math-block { margin: 22px 0; padding: 16px 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: rgba(9, 30, 41, .8); text-align: center; }
.heading-anchor { margin-left: 9px; color: transparent; text-decoration: none; font-size: .65em; }
.doc-content h1:hover .heading-anchor, .doc-content h2:hover .heading-anchor, .doc-content h3:hover .heading-anchor, .heading-anchor:focus { color: var(--muted); }
.orientation-link { text-decoration-style: dotted; text-underline-offset: .18em; }
.orientation-link::after { content: " ?"; color: var(--teal); font-size: .7em; font-weight: 800; vertical-align: super; }
.orientation-preview { position: fixed; z-index: 100; width: min(420px, calc(100vw - 24px)); padding: 16px 18px; border: 1px solid var(--teal); border-radius: 13px; background: #081c27; box-shadow: 0 18px 50px rgba(0, 0, 0, .42); color: var(--ink); pointer-events: none; }
.orientation-preview[hidden] { display: none; }
.orientation-preview-eyebrow { display: block; margin-bottom: 7px; color: var(--teal); font-size: .66rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.orientation-preview-title { display: block; margin-bottom: 8px; color: var(--ink); font-size: 1.02rem; }
.orientation-preview-body { margin: 0; color: #c8d7da; font-size: .86rem; line-height: 1.5; }
.orientation-preview-hint { display: block; margin-top: 9px; color: var(--muted); font-size: .72rem; }

footer { border-top: 1px solid var(--line); margin-top: 54px; padding: 28px 0 44px; color: var(--muted); font-size: .9rem; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .grid { grid-template-columns: 1fr 1fr; }
  .doc-shell { grid-template-columns: 1fr; }
  .doc-sidebar { position: static; max-height: 420px; }
}

@media (max-width: 620px) {
  nav { align-items: flex-start; flex-wrap: wrap; }
  .links { width: 100%; justify-content: flex-start; gap: 14px; }
  .grid, .boundary, .guide-grid { grid-template-columns: 1fr; }
  h1 { font-size: 3.1rem; }
  .eyebrow { font-size: .7rem; overflow-wrap: anywhere; }
  .actions { display: grid; grid-template-columns: 1fr; }
  .button { width: 100%; justify-content: center; }
  .doc-sidebar { max-height: 280px; }
  .doc-coordinate { align-items: flex-start; flex-direction: column; gap: 5px; }
  .orientation-preview { right: 12px !important; bottom: 12px; left: 12px !important; top: auto !important; width: auto; }
}

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