@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,600;0,700;0,800;0,900;1,700;1,800;1,900&family=Chakra+Petch:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg: #090705;
  --bg-soft: #0f0b08;
  --panel: rgba(12, 9, 7, .88);
  --panel-2: rgba(20, 14, 10, .82);
  --panel-solid: #100c09;
  --line: rgba(255, 255, 255, .085);
  --line-warm: rgba(255, 126, 55, .23);
  --line-strong: rgba(255, 126, 55, .42);
  --text: #fffaf5;
  --muted: #a79c94;
  --muted-2: #6f655f;
  --accent: #ff7e37;
  --accent-2: #d95b22;
  --accent-light: #ffad79;
  --accent-soft: rgba(255, 126, 55, .10);
  --green: #56e6a7;
  --warning: #f5b55a;
  --shadow: 0 24px 90px rgba(0,0,0,.55);
  --radius: 14px;
  --sidebar: 270px;
  --toc: 230px;
  --topbar: 64px;
  --display: "Barlow Condensed", sans-serif;
  --sans: "Chakra Petch", sans-serif;
  --mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 50% -15%, rgba(255,126,55,.12), transparent 34%),
    radial-gradient(circle at 92% 40%, rgba(114,52,22,.10), transparent 33%),
    linear-gradient(180deg, #0b0806 0%, #080605 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  z-index: -2;
  inset: -22%;
  background-image: url("../images/topography.png");
  background-repeat: repeat;
  background-size: 760px 760px;
  opacity: .095;
  filter: drop-shadow(0 0 5px rgba(255,110,44,.16));
  transform: rotate(-3deg) scale(1.12);
  animation: topoDrift 55s linear infinite;
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7,5,4,.80), rgba(10,7,5,.50) 48%, rgba(7,5,4,.82)),
    radial-gradient(circle at center, transparent 10%, rgba(4,3,2,.52) 84%);
  pointer-events: none;
}
body.home-page::before {
  opacity: .31;
  background-size: 880px 880px;
  filter: drop-shadow(0 0 7px rgba(255,111,47,.28));
}
body.home-page::after {
  background:
    radial-gradient(circle at 50% 32%, rgba(31,17,10,.14), rgba(5,4,3,.56) 62%, rgba(3,3,2,.86) 100%),
    linear-gradient(180deg, rgba(7,5,4,.34), rgba(7,5,4,.70));
}

@keyframes topoDrift {
  from { background-position: 0 0; }
  to { background-position: 880px 440px; }
}

::selection { background: var(--accent); color: #160802; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
code, pre, kbd { font-family: var(--mono); }

.topbar {
  position: fixed;
  z-index: 60;
  inset: 0 0 auto 0;
  height: var(--topbar);
  display: grid;
  grid-template-columns: var(--sidebar) minmax(260px, 520px) 1fr;
  align-items: center;
  gap: 26px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255,126,55,.12);
  background: rgba(8, 6, 5, .86);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}
.brand-logo {
  width: 112px;
  height: 38px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,.45));
}
.brand-separator {
  width: 1px;
  height: 18px;
  background: rgba(255,255,255,.12);
}
.brand-docs {
  font-family: var(--mono);
  color: #81746b;
  font-size: 10px;
  letter-spacing: .23em;
}

.top-search { width: 100%; }
.search-trigger {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
  color: #786f69;
  padding: 0 11px;
  border-radius: 8px;
  cursor: pointer;
  transition: .18s ease;
  font-size: 11px;
}
.search-trigger:hover {
  border-color: var(--line-warm);
  background: rgba(255,126,55,.045);
  color: #b4a59a;
}
.search-trigger kbd { margin-left: auto; }
.search-icon {
  display: inline-block;
  font-size: 20px;
  line-height: 1;
  transform: rotate(-20deg);
  color: var(--accent);
}
.search-icon.big { font-size: 26px; }

kbd {
  border: 1px solid rgba(255,255,255,.08);
  background: #0d0a08;
  color: #7b7069;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 9px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
}
.top-link {
  position: relative;
  color: #91857e;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  transition: .18s ease;
}
.top-link:hover { color: #fff8f1; }
.top-link.accent-link { color: var(--accent-light); }
.top-link.accent-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 1px;
  transform: scaleX(0);
  transform-origin: left;
  background: var(--accent);
  transition: .18s ease;
}
.top-link.accent-link:hover::after { transform: scaleX(1); }

.app-shell {
  padding-top: var(--topbar);
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--toc);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 40;
  top: var(--topbar);
  bottom: 0;
  left: 0;
  width: var(--sidebar);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,126,55,.10);
  background: rgba(8,6,5,.90);
  backdrop-filter: blur(14px);
}
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 22px 13px 16px;
}
.sidebar-scroll::-webkit-scrollbar { width: 5px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: #2b1c13; border-radius: 999px; }

.nav-group { margin-bottom: 24px; }
.nav-label {
  padding: 0 11px 8px;
  color: #665a53;
  font: 700 9px/1 var(--mono);
  letter-spacing: .17em;
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 10px;
  margin: 1px 0;
  border-radius: 7px;
  color: #8e8179;
  font: 500 11px/1.3 var(--mono);
  transition: .17s ease;
}
.nav-link:hover {
  color: #eee4dc;
  background: rgba(255,255,255,.025);
}
.nav-link.active {
  color: #fff6ef;
  background: linear-gradient(90deg, rgba(255,126,55,.11), rgba(255,126,55,.025));
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: -13px;
  width: 2px;
  height: 20px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(255,126,55,.55);
}
.nav-dot {
  width: 6px;
  height: 6px;
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 2px;
  transform: rotate(45deg);
}
.nav-link.active .nav-dot {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 10px rgba(255,126,55,.35);
}
.external-mark {
  margin-left: auto;
  color: #5d5049;
  font-size: 9px;
}

.sidebar-footer {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding: 0 18px;
}
.sidebar-footer strong {
  display: block;
  color: #c8bbb2;
  font: 700 9px/1.2 var(--mono);
}
.sidebar-footer span {
  display: block;
  color: #655a54;
  font-size: 8px;
  margin-top: 4px;
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(255,126,55,.5);
}

.content {
  grid-column: 2;
  width: min(100%, 1000px);
  margin: 0 auto;
  padding: 48px 54px 36px;
  min-height: calc(100vh - var(--topbar));
}

.toc {
  grid-column: 3;
  position: fixed;
  top: var(--topbar);
  right: 0;
  bottom: 0;
  width: var(--toc);
  border-left: 1px solid rgba(255,126,55,.07);
  background: rgba(8,6,5,.34);
}
.toc-inner {
  padding: 38px 24px;
  position: sticky;
  top: calc(var(--topbar) + 10px);
}
.eyebrow {
  color: #60544e;
  font: 700 8px/1 var(--mono);
  letter-spacing: .19em;
}
#tocLinks { margin-top: 14px; }
.toc-link {
  display: block;
  padding: 6px 0 6px 10px;
  border-left: 1px solid rgba(255,255,255,.065);
  color: #766a63;
  font: 500 9px/1.45 var(--mono);
}
.toc-link:hover {
  color: var(--accent-light);
  border-left-color: var(--accent);
}

.doc {
  font-family: var(--mono);
}
.doc-header {
  padding: 6px 0 25px;
  margin-bottom: 28px;
  border-bottom: 1px dashed rgba(255,126,55,.13);
}
.breadcrumbs {
  display: flex;
  gap: 7px;
  align-items: center;
  color: #705d54;
  font-size: 9px;
  margin-bottom: 18px;
}
.breadcrumbs span { color: var(--accent); }
.doc h1 {
  margin: 0 0 14px;
  color: #fff8f2;
  font-family: var(--mono);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -.04em;
}
.doc h1::before {
  content: "#";
  color: var(--accent);
  margin-right: 13px;
  font-weight: 500;
}
.doc .lead {
  max-width: 800px;
  margin: 0;
  color: #a1938a;
  font-size: 12px;
  line-height: 1.75;
}
.doc h2 {
  padding-top: 20px;
  margin: 26px 0 9px;
  scroll-margin-top: 94px;
  color: #fff8f2;
  font-family: var(--mono);
  font-size: 20px;
  letter-spacing: -.03em;
}
.doc h2::before {
  content: "##";
  color: var(--accent);
  margin-right: 12px;
  font-weight: 500;
}
.doc h3 {
  margin: 22px 0 7px;
  scroll-margin-top: 94px;
  color: #f2e8e1;
  font-size: 13px;
}
.doc p, .doc li {
  color: #b1a59d;
  font-size: 11px;
  line-height: 1.8;
}
.doc ul, .doc ol { padding-left: 18px; }
.doc li { margin: 4px 0; }
.doc li::marker { color: var(--accent); }
.doc strong { color: #fff5ee; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}
.meta-chip {
  padding: 5px 7px;
  border: 1px solid rgba(255,126,55,.13);
  border-radius: 5px;
  background: rgba(255,126,55,.035);
  color: #9c8273;
  font-size: 8px;
  font-weight: 700;
}

.code-wrap {
  position: relative;
  margin: 13px 0 20px;
  overflow: hidden;
  border: 1px solid rgba(255,126,55,.13);
  border-radius: 9px;
  background: rgba(7,5,4,.90);
  box-shadow: inset 0 1px rgba(255,255,255,.015);
}
.code-head {
  min-height: 35px;
  display: flex;
  align-items: center;
  padding: 0 11px;
  border-bottom: 1px solid rgba(255,126,55,.10);
  background: rgba(255,126,55,.035);
  color: #7d675c;
  font-size: 8px;
  font-weight: 700;
}
.code-dots { display: flex; gap: 4px; margin-right: 9px; }
.code-dots i {
  width: 5px;
  height: 5px;
  display: block;
  border-radius: 50%;
  background: #3c2b22;
}
.copy-btn {
  margin-left: auto;
  border: 1px solid rgba(255,126,55,.16);
  border-radius: 5px;
  background: rgba(255,126,55,.05);
  color: #9b7560;
  padding: 4px 7px;
  font-size: 8px;
  cursor: pointer;
}
.copy-btn:hover { color: var(--accent-light); }
pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  color: #e5d4c9;
  font-size: 10px;
  line-height: 1.7;
}
.inline-code {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid rgba(255,126,55,.14);
  border-radius: 4px;
  background: rgba(255,126,55,.07);
  color: var(--accent-light);
  font-size: .88em;
}

.notice {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  margin: 16px 0;
  padding: 13px;
  border: 1px solid rgba(255,126,55,.18);
  border-radius: 9px;
  background: linear-gradient(90deg, rgba(255,126,55,.055), rgba(255,126,55,.018));
}
.notice.warning {
  border-color: rgba(245,181,90,.23);
  background: rgba(245,181,90,.04);
}
.notice .n-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--accent);
  background: rgba(255,126,55,.08);
  font-weight: 800;
}
.notice.warning .n-icon {
  color: var(--warning);
  background: rgba(245,181,90,.07);
}
.notice strong { display: block; font-size: 10px; margin-bottom: 4px; }
.notice p { margin: 0; font-size: 9px; }

.steps { counter-reset: step; margin: 18px 0; }
.step {
  position: relative;
  margin-left: 13px;
  padding: 0 0 21px 38px;
  border-left: 1px solid rgba(255,126,55,.16);
}
.step:last-child { border-left-color: transparent; }
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: -13px;
  top: 0;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--accent);
  color: #170902;
  font-size: 9px;
  font-weight: 900;
}
.step h3 { margin: 0 0 4px; }
.step p { margin: 0; }

.table-wrap {
  overflow-x: auto;
  margin: 14px 0 20px;
  border: 1px solid rgba(255,126,55,.12);
  border-radius: 8px;
  background: rgba(9,6,5,.62);
}
table { width: 100%; min-width: 560px; border-collapse: collapse; }
th, td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255,126,55,.09);
  text-align: left;
  font-size: 9px;
}
th {
  color: #9b7460;
  background: rgba(255,126,55,.04);
  letter-spacing: .07em;
  text-transform: uppercase;
}
td { color: #c2b3aa; }
tr:last-child td { border-bottom: 0; }

.doc-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px dashed rgba(255,126,55,.12);
}
.doc-nav a {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #7f7068;
  font-size: 8px;
}
.doc-nav a:hover {
  color: var(--accent-light);
  border-color: var(--line-warm);
  background: rgba(255,126,55,.025);
}
.doc-nav a:last-child { text-align: right; }
.doc-nav strong {
  display: block;
  color: #ddcfc7;
  margin-top: 4px;
  font-size: 9px;
}

/* HOME */
body.home-page .sidebar,
body.home-page .toc { display: none; }
body.home-page .app-shell { display: block; }
body.home-page .content {
  width: 100%;
  max-width: none;
  padding: 0;
}
body.home-page .site-footer {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.home-hero {
  min-height: min(820px, calc(100vh - var(--topbar)));
  display: grid;
  place-items: center;
  padding: 84px 22px 70px;
  position: relative;
  overflow: hidden;
}
.home-hero::before {
  content: "";
  position: absolute;
  width: 780px;
  height: 380px;
  left: 50%;
  top: 35%;
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(255,126,55,.18), rgba(255,126,55,.03) 45%, transparent 70%);
  filter: blur(45px);
  pointer-events: none;
}
.home-hero::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 42px;
  width: min(1100px, 78vw);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(255,126,55,.28), transparent);
}
.home-hero-inner {
  position: relative;
  z-index: 2;
  width: min(100%, 920px);
  text-align: center;
}
.home-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 11px;
  border: 1px solid rgba(255,126,55,.20);
  background: rgba(8,6,5,.64);
  border-radius: 7px;
  color: #b8917a;
  font: 700 9px/1 var(--mono);
  letter-spacing: .13em;
  box-shadow: 0 8px 24px rgba(0,0,0,.26);
}
.home-kicker i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(255,126,55,.65);
}
.hero-emblem {
  display: block;
  width: min(330px, 68vw);
  max-height: 180px;
  object-fit: contain;
  margin: 26px auto 2px;
  filter: drop-shadow(0 15px 24px rgba(0,0,0,.58));
}
.home-title {
  margin: 5px 0 17px;
  font-family: var(--display);
  font-size: clamp(55px, 9vw, 118px);
  font-weight: 900;
  font-style: italic;
  line-height: .78;
  letter-spacing: -.045em;
  text-transform: uppercase;
  text-shadow: 0 5px 0 rgba(0,0,0,.32);
}
.home-title .white {
  display: inline-block;
  padding: 4px 13px 10px;
  color: white;
  background: rgba(9,7,6,.88);
  border-radius: 6px;
}
.home-title .orange {
  display: inline-block;
  padding: 4px 13px 10px;
  color: var(--accent);
  background: rgba(9,7,6,.88);
  border-radius: 6px;
}
.home-title small {
  display: block;
  margin-top: 20px;
  color: #f0e4dc;
  font-family: var(--mono);
  font-size: clamp(12px, 1.45vw, 16px);
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .34em;
  text-shadow: none;
}
.home-subtitle {
  max-width: 690px;
  margin: 22px auto 25px;
  color: #b0a39b;
  font-size: 13px;
  line-height: 1.75;
}
.home-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.primary-btn, .secondary-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border-radius: 7px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: .025em;
  text-transform: uppercase;
  transition: .18s ease;
}
.primary-btn {
  border: 1px solid #ff985f;
  background: linear-gradient(180deg, #ff8d4b, #ff742b);
  color: #190a03;
  box-shadow: 0 12px 34px rgba(255,126,55,.18);
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 16px 38px rgba(255,126,55,.28); }
.secondary-btn {
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(10,8,7,.68);
  color: #eee4dd;
}
.secondary-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(255,126,55,.28);
  background: rgba(255,126,55,.055);
}

.hero-stats {
  max-width: 720px;
  margin: 42px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.hero-stat {
  padding: 16px 14px;
  border: 1px solid rgba(255,126,55,.13);
  border-radius: 10px;
  background: rgba(7,5,4,.72);
  backdrop-filter: blur(8px);
}
.hero-stat strong {
  display: block;
  color: #fff8f2;
  font-family: var(--display);
  font-size: 23px;
  font-style: italic;
  letter-spacing: .02em;
}
.hero-stat span {
  display: block;
  margin-top: 3px;
  color: #766961;
  font: 600 8px/1.2 var(--mono);
  letter-spacing: .08em;
}

.home-main {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px 80px;
}
.home-section {
  padding: 44px 0;
}
.home-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,126,55,.10);
}
.home-section-title {
  margin: 0;
  color: #fff6ef;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: -.02em;
}
.home-section-title::before {
  content: "//";
  color: var(--accent);
  margin-right: 10px;
}
.home-section-count {
  color: #63544b;
  font: 600 8px/1 var(--mono);
  letter-spacing: .15em;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.card {
  position: relative;
  overflow: hidden;
  display: block;
  min-height: 184px;
  padding: 18px;
  border: 1px solid rgba(255,126,55,.13);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255,126,55,.035), transparent 50%),
    rgba(9,7,6,.86);
  transition: .18s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), transparent 70%);
  opacity: .65;
}
.card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -80px;
  top: -90px;
  border-radius: 50%;
  background: rgba(255,126,55,.14);
  filter: blur(55px);
  opacity: .12;
}
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,126,55,.32);
  background:
    linear-gradient(145deg, rgba(255,126,55,.06), transparent 54%),
    rgba(10,7,5,.93);
  box-shadow: 0 18px 42px rgba(0,0,0,.25);
}
.card-top {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.card-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,126,55,.22);
  border-radius: 7px;
  background: rgba(255,126,55,.065);
  color: var(--accent);
  font: 800 12px/1 var(--mono);
}
.card-arrow {
  color: #5c4c43;
  transition: .18s ease;
}
.card:hover .card-arrow {
  color: var(--accent);
  transform: translate(2px,-2px);
}
.card h3 {
  position: relative;
  z-index: 2;
  margin: 19px 0 7px;
  color: #fff8f2;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
  font-style: italic;
  text-transform: uppercase;
}
.card p {
  position: relative;
  z-index: 2;
  max-width: 95%;
  margin: 0;
  color: #958981;
  font-size: 10px;
  line-height: 1.6;
}
.card-tags {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}
.tag {
  padding: 4px 6px;
  border: 1px solid rgba(255,126,55,.11);
  border-radius: 5px;
  background: rgba(255,126,55,.025);
  color: #8e7161;
  font: 700 8px/1 var(--mono);
}

.quick-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 12px;
}
.quick-card {
  min-height: 160px;
  padding: 18px;
  border: 1px solid rgba(255,126,55,.13);
  border-radius: 10px;
  background: rgba(8,6,5,.78);
}
.quick-card strong {
  display: block;
  color: #fff7f1;
  font-family: var(--display);
  font-size: 20px;
  font-style: italic;
  text-transform: uppercase;
}
.quick-card p {
  margin: 8px 0 18px;
  color: #8e8179;
  font-size: 10px;
  line-height: 1.65;
}
.quick-card a {
  color: var(--accent-light);
  font: 700 9px/1 var(--mono);
}
.quick-card.highlight {
  background:
    linear-gradient(135deg, rgba(255,126,55,.13), rgba(7,5,4,.78) 55%),
    rgba(8,6,5,.78);
  border-color: rgba(255,126,55,.26);
}

.discord-banner {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 28px;
  border: 1px solid rgba(255,126,55,.20);
  border-radius: 12px;
  background:
    radial-gradient(circle at 90% 20%, rgba(255,126,55,.14), transparent 38%),
    rgba(9,6,5,.88);
}
.discord-banner::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -100px;
  width: 320px;
  height: 220px;
  background-image: url("../images/global-logo.png");
  background-size: contain;
  background-repeat: no-repeat;
  opacity: .035;
  transform: rotate(-6deg);
}
.discord-banner h3 {
  margin: 0 0 6px;
  color: #fff7f1;
  font-family: var(--display);
  font-size: 27px;
  font-style: italic;
  text-transform: uppercase;
}
.discord-banner p {
  margin: 0;
  color: #8f8178;
  font-size: 10px;
  line-height: 1.65;
}
.discord-banner .primary-btn { position: relative; z-index: 2; }

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 46px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,126,55,.09);
  color: #5a4f49;
  font: 600 8px/1.4 var(--mono);
}
.footer-links { display: flex; gap: 14px; }
.footer-links a:hover { color: var(--accent-light); }

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 11vh;
  background: rgba(0,0,0,.70);
  backdrop-filter: blur(10px);
}
.search-modal.open { display: flex; }
.search-box {
  width: min(680px, calc(100vw - 26px));
  overflow: hidden;
  border: 1px solid rgba(255,126,55,.18);
  border-radius: 11px;
  background: #0a0705;
  box-shadow: var(--shadow);
}
.search-input-wrap {
  height: 59px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 15px;
  border-bottom: 1px solid rgba(255,126,55,.11);
}
.search-input-wrap input {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff6ef;
  font-family: var(--mono);
  font-size: 11px;
}
.search-input-wrap input::placeholder { color: #5f534c; }
.search-results {
  max-height: 420px;
  overflow-y: auto;
  padding: 7px;
}
.search-result {
  display: block;
  padding: 11px;
  border-radius: 7px;
  color: #a3958d;
}
.search-result:hover {
  background: rgba(255,126,55,.055);
}
.search-result strong {
  display: block;
  color: #f7ece5;
  font: 600 10px/1.3 var(--mono);
}
.search-result span {
  display: block;
  margin-top: 4px;
  color: #6e6058;
  font-size: 9px;
  line-height: 1.5;
}
.search-hint {
  padding: 10px 13px;
  border-top: 1px solid rgba(255,126,55,.08);
  color: #554943;
  font-size: 8px;
}

.empty {
  padding: 28px;
  border: 1px dashed rgba(255,126,55,.13);
  border-radius: 9px;
  color: #8e8179;
  text-align: center;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}
.icon-btn span {
  display: block;
  width: 14px;
  height: 1px;
  background: #a39287;
  margin: 4px auto;
}
.mobile-only { display: none; }
.overlay { display: none; }

@media (max-width: 1120px) {
  :root { --toc: 0px; }
  .app-shell { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .toc { display: none; }
  .content { grid-column: 2; width: min(100%, 940px); }
  .topbar { grid-template-columns: var(--sidebar) minmax(220px, 1fr) auto; }
  .topbar-actions { gap: 14px; }
}

@media (max-width: 850px) {
  :root { --topbar: 60px; }
  .mobile-only { display: inline-block; }
  .topbar {
    display: flex;
    padding: 0 12px;
    gap: 10px;
  }
  .brand { margin-right: auto; }
  .brand-logo { width: 92px; height: 32px; }
  .brand-separator, .brand-docs { display: none; }
  .top-search { width: auto; }
  .search-trigger {
    width: 38px;
    padding: 0;
    justify-content: center;
  }
  .search-trigger span:not(.search-icon), .search-trigger kbd { display: none; }
  .topbar-actions .top-link:not(.accent-link) { display: none; }
  .topbar-actions { gap: 8px; }
  .topbar-actions .accent-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid rgba(255,126,55,.20);
    border-radius: 7px;
    background: rgba(255,126,55,.05);
  }
  .app-shell { display: block; }
  .sidebar {
    transform: translateX(-102%);
    transition: .22s ease;
    box-shadow: 24px 0 80px rgba(0,0,0,.48);
  }
  .sidebar.open { transform: translateX(0); }
  .overlay {
    position: fixed;
    inset: var(--topbar) 0 0;
    z-index: 35;
    background: rgba(0,0,0,.52);
    backdrop-filter: blur(4px);
  }
  .overlay.open { display: block; }
  .content { width: 100%; padding: 32px 19px 28px; }
  body.home-page .content { padding: 0; }
  .cards { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .discord-banner { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr 1fr; }
  .doc-nav { grid-template-columns: 1fr; }
  .doc-nav a:last-child { text-align: left; }
}

@media (max-width: 560px) {
  body::before { background-size: 640px 640px; }
  .topbar-actions .accent-link { font-size: 9px; }
  .home-hero {
    min-height: 720px;
    padding: 72px 14px 52px;
  }
  .hero-emblem { width: 245px; }
  .home-title { font-size: 58px; }
  .home-title .white, .home-title .orange { padding-left: 9px; padding-right: 9px; }
  .home-title small { margin-top: 15px; font-size: 10px; letter-spacing: .20em; }
  .home-subtitle { font-size: 11px; }
  .home-actions { flex-direction: column; }
  .home-actions a { width: 100%; }
  .hero-stats {
    margin-top: 28px;
    gap: 6px;
  }
  .hero-stat { padding: 12px 6px; }
  .hero-stat strong { font-size: 17px; }
  .hero-stat span { font-size: 6px; }
  .home-main { padding: 0 14px 60px; }
  .home-section { padding: 34px 0; }
  .home-section-head { align-items: flex-start; flex-direction: column; gap: 7px; }
  .content { padding: 27px 14px; }
  .doc h1 { font-size: 26px; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}


/* v1.2 — nested docs navigation + translations */
.nav-icon {
  width: 17px;
  flex: 0 0 17px;
  color: #65564e;
  font-family: var(--mono);
  font-size: 11px;
  text-align: center;
}
.nav-link:hover .nav-icon,
.nav-link.active .nav-icon { color: var(--accent); }
.external-mark { margin-left: auto; color: #594940; font-size: 9px; }

.nav-section-toggle {
  width: 100%;
  min-height: 33px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  margin-bottom: 4px;
  border: 0;
  background: transparent;
  color: #6f6159;
  cursor: pointer;
  font: 700 9px/1 var(--mono);
  letter-spacing: .17em;
  text-transform: uppercase;
}
.nav-section-toggle:hover { color: #b7a79d; }
.section-title { display: inline-flex; align-items: center; gap: 8px; }
.section-glyph { color: var(--accent); font-size: 10px; }
.nav-section-toggle .chevron { color: #5a4b43; transition: transform .18s ease; }
.nav-section-toggle.is-open .chevron { transform: rotate(180deg); }

.scripts-tree {
  position: relative;
  padding-left: 7px;
}
.scripts-tree::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: linear-gradient(180deg, rgba(255,126,55,.22), rgba(255,126,55,.03));
}
.script-tree-item {
  position: relative;
  margin: 2px 0 3px;
}
.script-parent {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 35px;
  display: grid;
  grid-template-columns: 20px minmax(0,1fr) 18px;
  align-items: center;
  gap: 6px;
  padding: 0 7px 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #8a7d75;
  cursor: pointer;
  text-align: left;
  font: 600 10px/1.25 var(--mono);
  transition: .16s ease;
}
.script-parent::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
}
.script-parent:hover { color: #e7dbd3; background: rgba(255,255,255,.022); }
.script-parent.active-parent {
  color: #fff7f1;
  background: linear-gradient(90deg, rgba(255,126,55,.09), rgba(255,126,55,.018));
}
.script-parent.active-parent::before { background: var(--accent); box-shadow: 0 0 10px rgba(255,126,55,.36); }
.script-parent-icon { color: #7b6b62; text-align: center; }
.script-parent.active-parent .script-parent-icon { color: var(--accent); }
.script-parent-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.script-parent-chevron { justify-self: end; color: #53453e; transition: transform .18s ease; }
.script-tree-item.open .script-parent-chevron { transform: rotate(180deg); color: var(--accent); }

.script-children {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  overflow: hidden;
  transition: grid-template-rows .2s ease, opacity .2s ease;
}
.script-children::before { content: ""; min-height: 0; }
.script-tree-item.open .script-children {
  grid-template-rows: 1fr;
  opacity: 1;
  padding: 2px 0 6px 18px;
}
/* grid animation fallback: children remain hidden until open */
.script-tree-item:not(.open) .sub-nav-link { display: none; }
.sub-nav-link {
  position: relative;
  min-height: 30px;
  display: grid;
  grid-template-columns: 18px minmax(0,1fr);
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border-radius: 6px;
  color: #70645d;
  font: 500 9px/1.2 var(--mono);
  transition: .15s ease;
}
.sub-nav-link::before {
  content: "";
  position: absolute;
  left: -11px;
  top: 50%;
  width: 7px;
  height: 1px;
  background: rgba(255,126,55,.16);
}
.sub-nav-link:hover { color: #d9ccc4; background: rgba(255,255,255,.02); }
.sub-nav-link.active {
  color: #fff4ec;
  background: rgba(255,126,55,.075);
}
.sub-nav-link.active::after {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  width: 4px;
  height: 4px;
  transform: translate(-50%,-50%);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 9px rgba(255,126,55,.7);
}
.sub-nav-icon { color: #5d5049; text-align: center; }
.sub-nav-link.active .sub-nav-icon { color: var(--accent); }

.language-switch { position: relative; }
.language-button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid rgba(255,126,55,.15);
  border-radius: 7px;
  background: rgba(255,126,55,.035);
  color: #b9aaa0;
  cursor: pointer;
  font: 700 9px/1 var(--mono);
}
.language-button:hover { border-color: rgba(255,126,55,.32); color: #fff7f1; }
.language-button .globe { color: var(--accent); font-size: 12px; }
.lang-caret { color: #5f5047; }
.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 90;
  width: 150px;
  display: none;
  padding: 6px;
  border: 1px solid rgba(255,126,55,.17);
  border-radius: 9px;
  background: rgba(10,7,5,.98);
  box-shadow: 0 18px 50px rgba(0,0,0,.46);
  backdrop-filter: blur(14px);
}
.language-menu.open { display: block; }
.language-menu button {
  width: 100%;
  min-height: 34px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8e8179;
  cursor: pointer;
  text-align: left;
  font: 500 10px/1 var(--sans);
}
.language-menu button:hover,
.language-menu button.active { background: rgba(255,126,55,.075); color: #fff3eb; }
.language-menu button span { color: var(--accent); font: 700 9px/1 var(--mono); }

.script-title-row {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 14px;
}
.script-title-mark {
  color: var(--accent);
  font: 500 clamp(28px,4vw,42px)/1 var(--mono);
}
.doc h1.plain-h1 {
  margin: 0;
  font-size: clamp(25px, 3.5vw, 38px);
}
.doc h1.plain-h1::before { content: none; }
.doc h1.plain-h1 em { color: #735246; font-style: normal; font-weight: 400; }

.framework-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 24px; }
.framework-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid rgba(255,126,55,.13);
  border-radius: 6px;
  background: rgba(255,126,55,.035);
  color: #c0ada2;
  font: 600 9px/1 var(--mono);
}
.framework-pill i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px rgba(255,126,55,.55); }
.language-demo {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(255,126,55,.14);
  border-radius: 8px;
  background: rgba(8,6,5,.66);
}
.language-demo > span {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 28px;
  border: 1px solid rgba(255,126,55,.18);
  border-radius: 5px;
  color: var(--accent-light);
  font: 700 9px/1 var(--mono);
}
.language-demo small { margin-left: 5px; color: #74665e; font: 500 9px/1.5 var(--mono); }
.api-empty { display: grid; place-items: center; gap: 8px; }
.empty-symbol { color: var(--accent); font-size: 24px; }
.api-empty strong { color: #8f8179; font: 600 10px/1.4 var(--mono); }

/* A more technical / game-ui feel: no Arial/Inter-like body */
body, button, input { font-family: var(--sans); }
.home-subtitle, .card p, .quick-card p, .discord-banner p { font-family: var(--sans); font-weight: 500; }

@media (max-width: 980px) {
  .topbar-actions .top-link { display: none; }
  .language-switch { margin-left: 2px; }
}
@media (max-width: 850px) {
  .language-button { min-width: 42px; padding: 0 7px; }
  .language-button .globe, .lang-caret { display: none; }
  .language-menu { right: 0; }
  .script-parent { font-size: 10px; }
}
