/* StreetNet project page and documentation. */

@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/JetBrainsMono-Variable.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f5f7fa;
  --surface-2: #eaeef4;
  --border: rgba(15, 23, 42, 0.11);
  --border-muted: rgba(15, 23, 42, 0.075);
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #64748b;
  --accent: #1a73e8;
  --accent-hover: #1557b0;
  --accent-bg: rgba(26, 115, 232, 0.08);
  --accent-glow: rgba(26, 115, 232, 0.24);
  --code-bg: #f6f8fb;
  --nav-bg: rgba(255, 255, 255, 0.78);
  --hero-glow: radial-gradient(ellipse 75% 50% at 50% -10%, rgba(26, 115, 232, 0.085), transparent 72%);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 30px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 2px 6px rgba(15, 23, 42, 0.05), 0 22px 54px rgba(15, 23, 42, 0.10);
  --g0: #2a78d6; --g1: #eb6834; --g2: #1baf7a; --g3: #eda100;
  --g4: #e87ba4; --g5: #008300; --g6: #4a3aa7; --g7: #e34948;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 16px;
  --wrap: 1120px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #090d14;
    --surface: #111824;
    --surface-2: #192231;
    --border: rgba(248, 250, 252, 0.12);
    --border-muted: rgba(248, 250, 252, 0.075);
    --text: #f1f5f9;
    --text-2: #94a3b8;
    --text-3: #64748b;
    --accent: #4d9cff;
    --accent-hover: #70b0ff;
    --accent-bg: rgba(77, 156, 255, 0.12);
    --accent-glow: rgba(77, 156, 255, 0.28);
    --code-bg: #0f1520;
    --nav-bg: rgba(9, 13, 20, 0.78);
    --hero-glow: radial-gradient(ellipse 75% 50% at 50% -10%, rgba(59, 130, 246, 0.16), transparent 72%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.5);
    --g0: #3987e5; --g1: #d95926; --g2: #199e70; --g3: #c98500;
    --g4: #d55181; --g5: #0ca30c; --g6: #9085e9; --g7: #e66767;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090d14;
  --surface: #111824;
  --surface-2: #192231;
  --border: rgba(248, 250, 252, 0.12);
  --border-muted: rgba(248, 250, 252, 0.075);
  --text: #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --accent: #4d9cff;
  --accent-hover: #70b0ff;
  --accent-bg: rgba(77, 156, 255, 0.12);
  --accent-glow: rgba(77, 156, 255, 0.28);
  --code-bg: #0f1520;
  --nav-bg: rgba(9, 13, 20, 0.78);
  --hero-glow: radial-gradient(ellipse 75% 50% at 50% -10%, rgba(59, 130, 246, 0.16), transparent 72%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 4px 10px rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.5);
  --g0: #3987e5; --g1: #d95926; --g2: #199e70; --g3: #c98500;
  --g4: #d55181; --g5: #0ca30c; --g6: #9085e9; --g7: #e66767;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-optical-sizing: auto; font-size: 16.5px; line-height: 1.62;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
img, video, svg { max-width: 100%; }
a { color: var(--accent); text-decoration: none; transition: color 0.15s var(--ease); }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { color: var(--text); font-weight: 640; letter-spacing: -0.025em; line-height: 1.18; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
sub { line-height: 0; }
code {
  font-family: var(--mono); font-size: 0.85em; background: var(--surface);
  border: 1px solid var(--border-muted); border-radius: 6px; padding: 0.1em 0.4em; letter-spacing: -0.01em;
}
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 32px; }

/* ---------------------------------------------------------------- navigation */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: var(--nav-bg); border-bottom: 1px solid var(--border-muted);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; color: var(--text);
  font-weight: 680; letter-spacing: -0.024em; font-size: 17px; flex: none;
}
.brand:hover { text-decoration: none; }
.brand-logo { width: 28px; height: 28px; display: block; flex: none; border-radius: 7px; }
.links { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; }
.links a {
  color: var(--text-2); padding: 6px 11px; border-radius: 8px;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.links a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.links a.on { color: var(--text); background: var(--surface); }
.nav .end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-cta {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px;
  border-radius: 999px; background: var(--accent); color: #ffffff;
  font-size: 13.5px; font-weight: 580; letter-spacing: -0.005em;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: background 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.nav-cta:hover { background: var(--accent-hover); color: #ffffff; text-decoration: none; transform: translateY(-0.5px); }
.nav-cta svg { width: 14px; height: 14px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; min-width: 34px; padding: 0 9px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg); color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 500;
  cursor: pointer; transition: color 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.icon-btn:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.icon-btn svg { width: 16px; height: 16px; }
.menu-btn { display: none; }
.sheet { display: none; }

/* theme toggle icon visibility */
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative;
  padding: 76px 0 24px;
  background-image: var(--hero-glow);
  background-repeat: no-repeat;
}
.hero-head {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  max-width: 820px; margin: 0 auto;
}
.eyebrow-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px 5px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 13px; font-weight: 520; color: var(--text-2); letter-spacing: -0.005em;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}
.eyebrow-pill:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.eyebrow-pill .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-bg);
}
.hero-title {
  display: inline-flex; align-items: center; justify-content: center; gap: 18px;
  margin-top: 24px;
}
.hero-logo {
  width: 58px; height: 58px; display: block; flex: none;
  border-radius: 15px; box-shadow: var(--shadow);
}
.hero h1 {
  font-size: clamp(46px, 6.2vw, 68px); font-weight: 690;
  letter-spacing: -0.042em; line-height: 1.0;
}
.hero .lede {
  margin-top: 20px; max-width: 680px; font-size: clamp(18.5px, 2.2vw, 22px);
  line-height: 1.48; color: var(--text-2); letter-spacing: -0.012em; font-weight: 420;
}
.hero-meta {
  margin-top: 14px; font-size: 14.5px; color: var(--text-3);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px;
}
.hero-meta strong { color: var(--text-2); font-weight: 560; }

/* priority action bar */
.cta {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 10px; margin-top: 30px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 44px; padding: 0 18px; border-radius: 999px;
  font-size: 15px; font-weight: 560; letter-spacing: -0.008em;
  border: 1px solid var(--border); color: var(--text); background: var(--bg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.btn:hover {
  background: var(--surface); border-color: rgba(15, 23, 42, 0.22);
  text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow);
}
:root[data-theme="dark"] .btn:hover { border-color: rgba(248, 250, 252, 0.24); }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn .ext { width: 14px; height: 14px; opacity: 0.78; margin-left: -2px; }

.btn.primary {
  background: var(--text); border-color: var(--text); color: var(--bg);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.16);
}
.btn.primary:hover {
  background: var(--text); border-color: var(--text); color: var(--bg);
  opacity: 0.92; box-shadow: 0 8px 22px rgba(15, 23, 42, 0.22);
}

.btn.map-cta {
  background: linear-gradient(180deg, #257bf0 0%, #1a6de0 100%);
  border-color: #1660c7; color: #ffffff;
  box-shadow: 0 2px 8px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn.map-cta:hover {
  background: linear-gradient(180deg, #1f73e8 0%, #155fc6 100%);
  border-color: #1354b0; color: #ffffff;
  box-shadow: 0 8px 24px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn-tag {
  font-size: 12px; font-weight: 540; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border-muted);
  padding: 2px 8px; border-radius: 999px; margin-left: 2px;
}

.hero-fig { margin: 44px 0 0; }
.hero-fig .photo { border-radius: 20px; box-shadow: var(--shadow-lg); }
.hero-fig figcaption { text-align: center; margin-left: auto; margin-right: auto; }

/* metrics strip */
.metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px; margin-top: 24px;
}
.metric {
  padding: 20px 22px; border-radius: var(--radius);
  border: 1px solid var(--border-muted); background: var(--surface);
  display: flex; flex-direction: column; gap: 4px;
}
.metric .val {
  font-size: 30px; font-weight: 680; letter-spacing: -0.035em; line-height: 1.1;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.metric .lbl { font-size: 14px; font-weight: 540; color: var(--text); }
.metric .sub { font-size: 13px; color: var(--text-3); line-height: 1.4; }

/* ---------------------------------------------------------------- sections */
section.block { padding: 96px 0 0; }
.eyebrow {
  font-size: 12px; font-weight: 640; text-transform: uppercase;
  letter-spacing: 0.085em; color: var(--accent); margin-bottom: 8px;
}
.block > .wrap > h2, .sec-h h2 { font-size: clamp(28px, 3.6vw, 38px); letter-spacing: -0.032em; }
.sec-h { display: flex; flex-direction: column; max-width: 760px; }
.sec-h p { margin-top: 12px; font-size: 17.5px; color: var(--text-2); line-height: 1.58; }
.sec-body { margin-top: 34px; }
.prose { max-width: 780px; }
.prose p + p { margin-top: 14px; }
.prose p, .prose li { color: var(--text-2); }
.prose strong { color: var(--text); font-weight: 600; }

/* figures */
figure { margin: 0; }
.fig img {
  display: block; width: 100%; height: auto; border-radius: 18px;
  border: 1px solid var(--border-muted); box-shadow: var(--shadow);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.zoom { display: block; cursor: zoom-in; }
.zoom:hover img { box-shadow: var(--shadow-lg); }
.fig figcaption, .cap { margin-top: 14px; font-size: 14.5px; line-height: 1.55; color: var(--text-3); max-width: 860px; }
.photo { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.photo::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--border); pointer-events: none; }
.photo img, .photo video { display: block; width: 100%; height: auto; }
.credit { position: absolute; right: 14px; bottom: 10px; font-size: 12px; color: rgba(255, 255, 255, 0.88); text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7); }

/* videos */
.videos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.video .photo { border-radius: 16px; box-shadow: var(--shadow); }
.video video { aspect-ratio: 16 / 9; background: #090d14; }
.video h3 { font-size: 18.5px; margin-top: 18px; display: flex; align-items: center; gap: 10px; }
.video h3 span {
  font-size: 12.5px; font-weight: 560; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border-muted);
  padding: 2px 8px; border-radius: 999px; letter-spacing: 0; font-variant-numeric: tabular-nums;
}
.video p { margin-top: 7px; font-size: 15.5px; color: var(--text-2); line-height: 1.58; }
.note {
  margin-top: 24px; padding: 14px 18px; border: 1px solid var(--border-muted);
  border-radius: 12px; background: var(--surface); font-size: 14px; color: var(--text-2); line-height: 1.55;
}

/* interactive viewer spotlight banner */
.viewer-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 24px 28px; margin-bottom: 28px; border-radius: 18px;
  background: linear-gradient(135deg, #0f172a 0%, #17253d 60%, #12243f 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow-lg); color: #f8fafc;
}
.viewer-banner-info { display: flex; align-items: center; gap: 18px; min-width: 0; }
.viewer-icon {
  width: 48px; height: 48px; border-radius: 13px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(59, 130, 246, 0.22); border: 1px solid rgba(147, 197, 253, 0.35);
  color: #93c5fd;
}
.viewer-icon svg { width: 24px; height: 24px; }
.viewer-banner h3 { color: #ffffff; font-size: 19px; letter-spacing: -0.02em; }
.viewer-banner p { color: #cbd5e1; font-size: 14.5px; margin-top: 4px; line-height: 1.5; max-width: 580px; }
.viewer-banner .btn.map-cta { flex: none; }

/* facts grid */
.facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px; margin-top: 32px;
}
.fact {
  background: var(--surface); border: 1px solid var(--border-muted);
  border-radius: var(--radius); padding: 22px 24px;
}
.fact h3 { font-size: 16px; letter-spacing: -0.014em; }
.fact p { margin-top: 7px; font-size: 14.5px; color: var(--text-2); line-height: 1.58; }

/* cards (documentation links) */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card-link {
  display: flex; flex-direction: column; gap: 8px; padding: 22px;
  border: 1px solid var(--border-muted); border-radius: var(--radius);
  color: var(--text); background: var(--surface);
  transition: transform 0.18s var(--ease), border-color 0.15s var(--ease), box-shadow 0.18s var(--ease), background 0.15s var(--ease);
}
.card-link:hover {
  text-decoration: none; border-color: var(--border); background: var(--bg);
  box-shadow: var(--shadow); transform: translateY(-2px);
}
.card-link h3 { font-size: 17px; }
.card-link p { font-size: 14.5px; color: var(--text-2); line-height: 1.52; }
.card-link .go {
  margin-top: auto; padding-top: 8px; font-size: 13.5px; font-weight: 560;
  color: var(--accent); display: inline-flex; align-items: center; gap: 4px;
}

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.45; }
th, td { text-align: left; padding: 11px 15px; border-bottom: 1px solid var(--border-muted); vertical-align: top; }
th { font-weight: 600; color: var(--text); background: var(--surface); white-space: nowrap; font-size: 13px; letter-spacing: 0.01em; }
td { color: var(--text-2); }
tbody tr:hover td { background: var(--surface); }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.total td { color: var(--text); font-weight: 640; background: var(--surface); }
td .sq { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 9px; vertical-align: -1px; }
td.cls { color: var(--text); font-weight: 520; white-space: nowrap; }
td .tag {
  margin-left: 8px; font-size: 11.5px; font-weight: 500; color: var(--text-3);
  border: 1px solid var(--border); border-radius: 999px; padding: 1px 7px;
}
td code { white-space: nowrap; }
.grp-row td { background: var(--surface); color: var(--text); font-weight: 620; font-size: 13.5px; }
.grp-row:hover td { background: var(--surface); }

/* code blocks */
pre {
  position: relative; margin: 0; padding: 16px 18px;
  background: var(--code-bg); border: 1px solid var(--border-muted); border-radius: 13px;
  overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.62; color: var(--text);
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }
pre .c { color: var(--text-3); }
.copy {
  position: absolute; top: 10px; right: 10px; height: 28px; padding: 0 11px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--bg);
  color: var(--text-2); font: inherit; font-family: "Inter", sans-serif; font-size: 12.5px; font-weight: 520;
  cursor: pointer; opacity: 0; transition: opacity 0.15s var(--ease), color 0.15s var(--ease);
}
.copy:hover { color: var(--text); }
pre:hover .copy, .copy:focus-visible { opacity: 1; }
.steps { display: grid; gap: 22px; }
.step h3 { font-size: 16.5px; display: flex; align-items: center; gap: 12px; margin-bottom: 11px; }
.step-n {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 8px; background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 640;
}
details.more { margin-top: 18px; border: 1px solid var(--border-muted); border-radius: 13px; padding: 14px 18px; background: var(--surface); }
details.more summary { cursor: pointer; font-weight: 560; font-size: 15px; color: var(--text); }
details.more ul { margin: 12px 0 4px; padding-left: 20px; color: var(--text-2); font-size: 14.5px; }
details.more li + li { margin-top: 6px; }

/* layout helpers */
.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.steps, .step { min-width: 0; }
.kv {
  display: grid; grid-template-columns: max-content 1fr; gap: 12px 22px; font-size: 14.5px;
  padding: 22px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-muted);
  margin: 0;
}
.kv dt { color: var(--text-3); font-weight: 500; }
.kv dd { margin: 0; color: var(--text); }

/* citation & acknowledgments grid */
.cite-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.cite-grid pre.bib { font-size: 13px; }
.info-card {
  padding: 24px 26px; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border-muted);
}
.info-card h3 { font-size: 17px; margin-bottom: 10px; }
.info-card p { font-size: 14.5px; color: var(--text-2); line-height: 1.6; }
.info-card .kv { padding: 0; border: 0; background: none; margin-top: 12px; gap: 8px 18px; }

/* lightbox modal */
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  padding: 28px; background: rgba(9, 13, 20, 0.86);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  opacity: 0; pointer-events: none; transition: opacity 0.18s var(--ease);
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img {
  max-width: min(94vw, 1520px); max-height: 90vh; width: auto; height: auto;
  border-radius: 14px; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.12); background: var(--bg);
}
.lightbox-close {
  position: fixed; top: 18px; right: 22px; width: 40px; height: 40px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.72); color: #ffffff;
  font-size: 22px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lightbox-close:hover { background: rgba(30, 41, 59, 0.92); }

/* footer */
footer {
  margin-top: 112px; border-top: 1px solid var(--border-muted);
  padding: 44px 0 60px; color: var(--text-3); font-size: 14px;
}
.foot-inner {
  display: flex; flex-wrap: wrap; gap: 20px 40px;
  align-items: center; justify-content: space-between;
}
.foot-brand { display: flex; align-items: center; gap: 12px; }
.foot-brand img { width: 26px; height: 26px; border-radius: 6px; }
.foot-brand strong { color: var(--text); font-weight: 640; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot-links a { color: var(--text-2); font-weight: 500; }
.foot-links a:hover { color: var(--text); }
.foot-sub {
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border-muted);
  font-size: 13px; color: var(--text-3);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
}

/* ---------------------------------------------------------------- documentation pages */
.wrap.doc { max-width: 1280px; }
.doc { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding-top: 48px; }
.toc { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 104px); overflow-y: auto; font-size: 14px; }
.toc p { font-weight: 600; color: var(--text); margin-bottom: 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.toc a { display: block; padding: 5px 0 5px 12px; color: var(--text-2); border-left: 1.5px solid var(--border-muted); line-height: 1.4; }
.toc a.l3 { padding-left: 24px; font-size: 13.5px; }
.toc a:hover, .toc a.on { color: var(--text); text-decoration: none; border-left-color: var(--accent); }
.toc .pages { margin-top: 24px; }
.md { min-width: 0; max-width: 960px; }
.md h1 { font-size: 40px; letter-spacing: -0.032em; margin-bottom: 18px; }
.md h2 { font-size: 26px; letter-spacing: -0.024em; margin: 52px 0 14px; padding-top: 4px; }
.md h3 { font-size: 19px; letter-spacing: -0.014em; margin: 34px 0 10px; }
.md p, .md li { color: var(--text-2); font-size: 16px; line-height: 1.66; }
.md p { margin: 12px 0; }
.md ul { padding-left: 22px; }
.md pre { margin: 16px 0; font-size: 12.5px; line-height: 1.55; }
.md .table-wrap { margin: 18px 0; }
.md table { font-size: 13.5px; }
.md td, .md th { padding: 9px 13px; }
.md a.anchor { color: var(--text-3); margin-left: 8px; font-weight: 400; opacity: 0; }
.md h2:hover a.anchor, .md h3:hover a.anchor { opacity: 1; text-decoration: none; }
.doc-foot { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--border-muted); font-size: 14px; color: var(--text-3); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1020px) {
  .links { display: none; }
  .menu-btn { display: inline-flex; }
  .sheet.open {
    display: block; position: absolute; left: 0; right: 0; top: 64px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px 20px 18px; box-shadow: var(--shadow-lg);
  }
  .sheet a { display: block; padding: 11px 4px; color: var(--text); font-weight: 500; border-bottom: 1px solid var(--border-muted); }
  .sheet a:last-child { border-bottom: 0; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split, .pair, .cite-grid { grid-template-columns: minmax(0, 1fr); }
  .doc { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .wrap { padding: 0 18px; }
  .nav-cta span { display: none; }
  .nav-cta { padding: 0 10px; }
  .hero { padding: 48px 0 12px; }
  .hero-title { gap: 12px; }
  .hero-logo { width: 44px; height: 44px; border-radius: 12px; }
  .btn { height: 42px; padding: 0 15px; font-size: 14.5px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric { padding: 16px; }
  .metric .val { font-size: 24px; }
  .viewer-banner { flex-direction: column; align-items: flex-start; padding: 20px; }
  section.block { padding-top: 68px; }
  .videos, .facts, .cards { grid-template-columns: minmax(0, 1fr); }
  .md h1 { font-size: 32px; }
  .fig img { border-radius: 12px; }
  .copy { opacity: 1; }
  footer { margin-top: 76px; }
}
