:root {
  --bg: #06141b;
  --bg-deep: #030c11;
  --panel: #0a2028;
  --panel-2: #0d2a33;
  --panel-3: #123842;
  --line: #20505a;
  --line-bright: #2f7480;
  --text: #e9fbf7;
  --muted: #9abdbd;
  --aqua: #52edc5;
  --aqua-2: #83f7dc;
  --cyan: #68dbe8;
  --warning: #ffd98b;
  --danger: #ff9b9b;
  --shadow: rgba(0, 0, 0, 0.35);
  --display: "Bahnschrift SemiCondensed", "Bahnschrift", "Aptos Display", sans-serif;
  --body: "Segoe UI Variable Text", "Segoe UI", Tahoma, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", Consolas, monospace;
  --max: 1440px;
  --radius: 3px;
  --focus: 3px;
  --speed: 190ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg-deep); }
body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 76% 8%, rgba(65, 225, 196, 0.12), transparent 27rem),
    linear-gradient(rgba(50, 118, 127, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(50, 118, 127, 0.07) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 36px 36px, 36px 36px, auto;
  font: 1rem/1.65 var(--body);
  text-rendering: optimizeLegibility;
}

button, input, select { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button, input, select, a { border-radius: var(--radius); }
a { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: var(--focus) solid var(--aqua-2);
  outline-offset: 3px;
}
h1, h2, h3, p, dl, dd, ul, ol, pre { margin: 0; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; text-wrap: balance; }
p, li { text-wrap: pretty; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--aqua-2);
  color: var(--bg-deep);
  background: var(--aqua-2);
  font-weight: 750;
  transform: translateY(-150%);
  transition: transform var(--speed) var(--ease);
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: minmax(250px, auto) 1fr auto;
  align-items: stretch;
  min-height: 76px;
  border-bottom: 1px solid var(--line-bright);
  background: rgba(4, 18, 24, 0.94);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 24px;
  border-right: 1px solid var(--line);
  text-decoration: none;
}
.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--aqua);
  background: linear-gradient(135deg, rgba(82, 237, 197, 0.2), transparent);
  color: var(--aqua-2);
  font: 800 0.82rem/1 var(--mono);
  clip-path: polygon(0 0, 83% 0, 100% 17%, 100% 100%, 17% 100%, 0 83%);
}
.brand-mark i { position: absolute; right: 5px; bottom: 5px; width: 6px; height: 6px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.brand-copy { display: grid; min-width: 0; }
.brand-copy strong { overflow: hidden; font: 700 1rem/1.2 var(--display); letter-spacing: 0.03em; text-overflow: ellipsis; white-space: nowrap; }
.brand-copy small { color: var(--muted); font: 0.66rem/1.4 var(--mono); letter-spacing: 0.12em; }
.primary-nav { display: flex; align-items: stretch; justify-content: center; }
.primary-nav a {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0 18px;
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 700;
  text-decoration: none;
  transition: color var(--speed) var(--ease), background-color var(--speed) var(--ease);
}
.primary-nav a:hover { color: var(--text); background: var(--panel); }
.language-switch { display: flex; align-items: center; gap: 5px; padding: 12px 20px; border-left: 1px solid var(--line); }
.language-switch > span { margin-right: 6px; color: var(--muted); font: 0.68rem/1 var(--mono); text-transform: uppercase; }
.language-switch button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line-bright);
  color: var(--muted);
  background: transparent;
  font: 700 0.75rem/1 var(--mono);
  transition: color var(--speed) var(--ease), border-color var(--speed) var(--ease), background-color var(--speed) var(--ease);
}
.language-switch button:hover { border-color: var(--aqua); color: var(--text); }
.language-switch button[aria-pressed="true"] { border-color: var(--aqua); color: var(--bg-deep); background: var(--aqua); }

main, .site-footer { width: min(100%, var(--max)); margin-inline: auto; }
main { padding: 28px 32px 80px; }
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  min-height: 490px;
  overflow: hidden;
  border: 1px solid var(--line-bright);
  background:
    linear-gradient(112deg, rgba(9, 35, 43, 0.98) 0 57%, rgba(10, 48, 55, 0.8) 57% 100%),
    var(--panel);
  box-shadow: 0 28px 70px var(--shadow);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 0 64%, rgba(82, 237, 197, 0.12) 64% 64.3%, transparent 64.3% 100%);
}
.hero-copy { position: relative; z-index: 1; align-self: end; max-width: 850px; padding: 62px; }
.eyebrow { color: var(--aqua); font: 700 0.72rem/1.4 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; }
.hero h1 { max-width: 860px; margin-top: 18px; font-size: clamp(3.1rem, 7vw, 6.9rem); letter-spacing: -0.045em; }
.hero-lede { max-width: 65ch; margin-top: 24px; color: #c0dada; font-size: clamp(1.05rem, 2vw, 1.3rem); }
.author-line { margin-top: 36px; color: var(--muted); font-size: 0.9rem; }
.author-line strong { color: var(--text); font-family: var(--mono); }
.author-alias { color: var(--aqua); }
.hero-metrics { position: relative; z-index: 1; display: grid; align-self: stretch; border-left: 1px solid var(--line); background: rgba(3, 14, 18, 0.35); }
.hero-metrics div { display: grid; align-content: center; padding: 28px 36px; border-bottom: 1px solid var(--line); }
.hero-metrics div:last-child { border-bottom: 0; }
.hero-metrics dt { color: var(--aqua-2); font: 700 clamp(2.5rem, 4vw, 4.5rem)/1 var(--mono); }
.hero-metrics dd { margin-top: 8px; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.hero-signal { position: absolute; z-index: 2; right: 0; bottom: 0; left: 0; display: flex; gap: 32px; padding: 10px 18px; border-top: 1px solid var(--line); color: #74aaa9; background: rgba(3, 13, 18, 0.84); font: 0.64rem/1.4 var(--mono); letter-spacing: 0.12em; }

.control-deck {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 270px) auto;
  align-items: end;
  gap: 14px;
  margin: -1px 24px 0;
  padding: 18px;
  border: 1px solid var(--line-bright);
  background: #081b22;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}
.search-field, .filter-field { display: grid; min-width: 0; gap: 7px; }
.search-field label, .filter-field label { color: var(--muted); font: 700 0.68rem/1.3 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.input-shell { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; min-height: 48px; border: 1px solid var(--line-bright); background: var(--bg-deep); }
.input-shell > span { padding-left: 16px; color: var(--aqua); font: 700 1rem/1 var(--mono); }
.input-shell input { min-width: 0; height: 46px; border: 0; outline: 0; padding: 0 12px; background: transparent; }
.input-shell:focus-within { border-color: var(--aqua); box-shadow: 0 0 0 1px var(--aqua); }
.input-shell kbd { margin-right: 9px; padding: 5px 8px; border: 1px solid var(--line); color: var(--muted); background: var(--panel); font: 0.65rem/1 var(--mono); }
.filter-field select { width: 100%; min-width: 0; min-height: 48px; padding: 0 38px 0 13px; border: 1px solid var(--line-bright); background: var(--bg-deep); }
.result-status { min-width: 100px; padding-bottom: 12px; color: var(--aqua); font: 0.72rem/1.3 var(--mono); text-align: right; }

.content-section { scroll-margin-top: 100px; margin-top: 88px; }
.section-heading { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 26px; align-items: end; margin-bottom: 28px; padding-bottom: 22px; border-bottom: 1px solid var(--line-bright); }
.section-heading > div:first-child { display: flex; align-items: baseline; gap: 14px; }
.section-number { color: var(--aqua); font: 700 2.25rem/1 var(--mono); }
.section-heading > div:last-child { display: flex; justify-content: space-between; align-items: end; gap: 28px; }
.section-heading h2 { font-size: clamp(2rem, 4vw, 3.7rem); letter-spacing: -0.025em; }
.section-heading > div:last-child p { max-width: 58ch; color: var(--muted); }

.route-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line-bright); border-left: 1px solid var(--line-bright); }
.route-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
  min-height: 280px;
  padding: 24px;
  overflow: hidden;
  border: 0;
  border-right: 1px solid var(--line-bright);
  border-bottom: 1px solid var(--line-bright);
  background: rgba(9, 31, 39, 0.88);
  color: var(--text);
  text-align: left;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.route-card::after { content: ""; position: absolute; right: -24px; bottom: -24px; width: 72px; height: 72px; border: 1px solid var(--line); transform: rotate(45deg); }
.route-card:hover { z-index: 2; background: var(--panel-3); transform: translateY(-4px); box-shadow: 0 18px 34px var(--shadow); }
.route-card:hover::after { border-color: var(--aqua); }
.route-code { color: var(--aqua); font: 700 0.72rem/1 var(--mono); letter-spacing: 0.09em; }
.route-card h3 { align-self: end; font-size: 1.55rem; }
.route-card p { color: var(--muted); font-size: 0.88rem; }
.route-action { display: flex; align-items: center; justify-content: space-between; color: var(--cyan); font: 700 0.7rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }
.route-action b { font-size: 1.15rem; }

.chapter-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.chapter-card { display: grid; align-content: start; min-height: 330px; padding: 26px; border: 1px solid var(--line); background: rgba(9, 30, 37, 0.9); transition: border-color var(--speed) var(--ease), background-color var(--speed) var(--ease); }
.chapter-card:hover { border-color: var(--line-bright); background: var(--panel); }
.chapter-index { color: var(--aqua); font: 700 0.7rem/1 var(--mono); letter-spacing: 0.1em; }
.chapter-card h3 { margin-top: 20px; font-size: 1.65rem; }
.chapter-summary { margin-top: 12px; color: #bfd9d7; }
.chapter-card ul { display: grid; gap: 10px; margin-top: 22px; padding: 0; list-style: none; }
.chapter-card li { position: relative; padding-left: 18px; color: var(--muted); font-size: 0.88rem; }
.chapter-card li::before { content: ""; position: absolute; top: 0.67em; left: 0; width: 7px; height: 1px; background: var(--aqua); }

.installer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.npm-install-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, 0.9fr); gap: 24px; align-items: center; margin-bottom: 14px; padding: 28px; border: 1px solid #8d7cf4; background: linear-gradient(120deg, rgba(86, 68, 156, 0.28), rgba(13, 42, 51, 0.94) 52%, rgba(198, 121, 182, 0.18)); }
.npm-install-card h3 { margin-top: 18px; font-size: clamp(1.75rem, 3vw, 2.8rem); }
.npm-install-card > div > p { margin-top: 10px; color: #c7d8dc; }
.npm-command-wrap { position: relative; padding: 18px 116px 18px 18px; border: 1px solid rgba(245, 199, 110, 0.58); background: rgba(3, 12, 17, 0.78); }
.npm-command-wrap code { color: #f8dda4; font: 700 0.87rem/1.5 var(--mono); overflow-wrap: anywhere; }
.npm-command-wrap .copy-button { top: 8px; right: 8px; bottom: auto; border-color: #f5c76e; background: #f5c76e; color: #1d1522; }
.npm-command-wrap .copy-button:hover { color: #f5c76e; background: transparent; }
.npm-install-note { grid-column: 1 / -1; margin: 0; color: #b5c7cc; font-size: 0.88rem; }
.installer-card { position: relative; display: grid; grid-template-rows: auto auto 1fr auto; min-height: 355px; padding: 27px; border: 1px solid var(--line-bright); background: linear-gradient(145deg, var(--panel), #07181e); }
.target-label { justify-self: start; padding: 5px 9px; border: 1px solid var(--aqua); color: var(--aqua); font: 700 0.66rem/1 var(--mono); letter-spacing: 0.09em; text-transform: uppercase; }
.installer-card h3 { margin-top: 24px; font-size: 1.8rem; }
.installer-card > p { margin-top: 10px; color: var(--muted); }
.command-block { position: relative; align-self: end; margin-top: 24px; padding: 16px 14px 58px; overflow: auto; border: 1px solid var(--line); background: var(--bg-deep); }
.command-block code { color: #bceee4; font: 0.76rem/1.6 var(--mono); overflow-wrap: anywhere; white-space: pre-wrap; }
.copy-button { position: absolute; right: 8px; bottom: 8px; min-width: 94px; min-height: 44px; padding: 8px 13px; border: 1px solid var(--aqua); color: var(--bg-deep); background: var(--aqua); font: 700 0.72rem/1 var(--mono); transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease); }
.copy-button:hover { color: var(--aqua-2); background: transparent; }
.offline-note { margin-top: 16px; padding: 17px 20px; border-left: 3px solid var(--warning); color: #d5e8e4; background: rgba(255, 217, 139, 0.06); font-size: 0.88rem; }

.empty-state { margin-top: 40px; padding: 70px 28px; border: 1px dashed var(--line-bright); color: var(--muted); text-align: center; }
.empty-state span { display: block; margin-bottom: 12px; color: var(--aqua); font: 2rem/1 var(--mono); }
.site-footer { display: flex; justify-content: space-between; gap: 24px; padding: 26px 32px 42px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.78rem; }
.noscript-message { margin: 20px; padding: 18px; border: 1px solid var(--danger); color: var(--danger); background: var(--panel); }

.route-dialog { width: min(960px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: auto; border: 1px solid var(--aqua); color: var(--text); background: var(--panel); box-shadow: 0 34px 100px rgba(0, 0, 0, 0.72); }
.route-dialog::backdrop { background: rgba(0, 8, 12, 0.82); backdrop-filter: blur(7px); }
.route-detail { padding: 34px; }
.dialog-header { display: grid; grid-template-columns: 1fr auto; gap: 18px; padding-bottom: 26px; border-bottom: 1px solid var(--line-bright); }
.dialog-header h2 { margin-top: 12px; font-size: clamp(2.2rem, 5vw, 4.4rem); }
.dialog-close { width: 48px; height: 48px; border: 1px solid var(--line-bright); color: var(--text); background: var(--bg-deep); font: 1.3rem/1 var(--mono); }
.dialog-close:hover { border-color: var(--aqua); color: var(--aqua); }
.route-what { max-width: 75ch; margin-top: 26px; color: #cbe4df; font-size: 1.08rem; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 30px; }
.detail-section { padding: 21px; border: 1px solid var(--line); background: #081a21; }
.detail-section h3 { color: var(--aqua); font: 700 0.75rem/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.detail-section ol, .detail-section ul { display: grid; gap: 10px; margin-top: 16px; padding-left: 20px; }
.detail-section li { color: var(--muted); font-size: 0.9rem; }
.detail-examples { grid-column: 1 / -1; }
.prompt-row { position: relative; margin-top: 12px; padding: 17px 118px 17px 16px; border: 1px solid var(--line); background: var(--bg-deep); }
.prompt-row code { color: #c9f3e9; font: 0.8rem/1.6 var(--mono); white-space: pre-wrap; }
.prompt-row .copy-button { top: 8px; bottom: auto; }

@media (max-width: 1120px) {
  .site-header { grid-template-columns: minmax(250px, 1fr) auto; }
  .primary-nav { grid-column: 1 / -1; grid-row: 2; border-top: 1px solid var(--line); }
  .language-switch { border-left: 0; }
  .hero { grid-template-columns: 1fr minmax(230px, 0.35fr); }
  .hero-copy { padding: 48px; }
  .route-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chapter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  main { padding: 18px 16px 58px; }
  .site-header { position: relative; grid-template-columns: 1fr auto; }
  .brand { padding: 10px 14px; border-right: 0; }
  .brand-copy strong { font-size: 0.9rem; }
  .language-switch { padding: 8px 10px; }
  .language-switch > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .primary-nav { overflow-x: auto; justify-content: stretch; }
  .primary-nav a { flex: 1 0 auto; padding: 0 13px; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-copy { padding: 44px 25px 60px; }
  .hero h1 { font-size: clamp(2.9rem, 14vw, 5rem); }
  .hero-metrics { grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 0; }
  .hero-metrics div { padding: 22px 14px 46px; border-right: 1px solid var(--line); border-bottom: 0; }
  .hero-metrics div:last-child { border-right: 0; }
  .hero-metrics dt { font-size: 2.1rem; }
  .hero-signal { gap: 16px; overflow: hidden; white-space: nowrap; }
  .control-deck { grid-template-columns: 1fr; margin-inline: 8px; }
  .result-status { padding-bottom: 0; text-align: left; }
  .section-heading { grid-template-columns: 1fr; gap: 14px; }
  .section-heading > div:last-child { display: grid; gap: 12px; }
  .route-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .route-card { min-height: 250px; padding: 20px; }
  .chapter-grid, .installer-grid { grid-template-columns: 1fr; }
  .npm-install-card { grid-template-columns: 1fr; }
  .chapter-card { min-height: 0; }
  .site-footer { flex-direction: column; padding-inline: 16px; }
  .route-detail { padding: 23px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-examples { grid-column: auto; }
}

@media (max-width: 430px) {
  .brand-mark { width: 42px; height: 42px; }
  .brand-copy small { display: none; }
  .language-switch button { min-width: 42px; }
  .hero-metrics { grid-template-columns: 1fr; }
  .hero-metrics div { grid-template-columns: auto 1fr; gap: 12px; align-items: baseline; padding: 15px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .hero-metrics div:last-child { border-bottom: 0; padding-bottom: 46px; }
  .hero-metrics dd { margin-top: 0; }
  .input-shell kbd { display: none; }
  .route-grid { grid-template-columns: 1fr; }
  .route-card { min-height: 220px; }
  .prompt-row { padding-right: 16px; padding-bottom: 66px; }
  .prompt-row .copy-button { top: auto; bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
