/* ============================================================
   Sylvanas Rotation API Codex
   Aesthetic: arcane field manual — ink, parchment, ember gold
   ============================================================ */

:root {
  --ink: #08070c;
  --ink-2: #0b0a11;
  --panel: #0f0e17;
  --panel-2: #14121e;
  --panel-3: #1a1724;
  --line: rgba(233, 227, 214, 0.09);
  --line-strong: rgba(233, 227, 214, 0.16);
  --text: #e9e3d6;
  --text-soft: #c8c2b6;
  --muted: #928ca0;
  --faint: #6c6679;
  --gold: #d9a441;
  --gold-soft: #f0ca82;
  --gold-dim: rgba(217, 164, 65, 0.16);
  --violet: #a78bfa;
  --violet-dim: rgba(167, 139, 250, 0.14);
  --teal: #5fd3b4;
  --teal-dim: rgba(95, 211, 180, 0.12);
  --blue: #7aa2f7;
  --blue-dim: rgba(122, 162, 247, 0.12);
  --red: #e0716f;
  --serif: "Fraunces", "Noto Serif SC", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --topbar-h: 64px;
  --radius: 14px;
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 28px);
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 620px at 78% -8%, rgba(126, 82, 196, 0.18), transparent 62%),
    radial-gradient(760px 520px at 6% 14%, rgba(217, 164, 65, 0.075), transparent 60%),
    radial-gradient(900px 700px at 50% 110%, rgba(63, 96, 156, 0.10), transparent 65%),
    var(--ink);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(233, 227, 214, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(233, 227, 214, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 12%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 12%, transparent 78%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: rgba(217, 164, 65, 0.3); color: #fff; }

a { color: var(--gold-soft); text-decoration: none; }
a:hover { color: #ffe6b8; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--gold-soft);
  background: rgba(217, 164, 65, 0.08);
  border: 1px solid rgba(217, 164, 65, 0.12);
  border-radius: 5px;
  padding: 0.08em 0.36em;
}

/* ---------- scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  z-index: 120;
  background: linear-gradient(90deg, var(--gold), #f7dfa8, var(--violet));
  box-shadow: 0 0 12px rgba(217, 164, 65, 0.7);
  transition: width 0.08s linear;
}

/* ---------- topbar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  background: rgba(8, 7, 12, 0.78);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text);
  white-space: nowrap;
}

.brand-mark {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  filter: drop-shadow(0 0 6px rgba(167, 139, 250, 0.5));
}
.brand-mark svg { width: 22px; height: 22px; }

.topbar-search {
  position: relative;
  flex: 1;
  min-width: 0;
  max-width: 440px;
  margin-left: auto;
}
.topbar-search svg {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--muted);
}
.topbar-search input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 14px 0 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
.topbar-search input::placeholder { color: var(--faint); }
.topbar-search input:focus {
  border-color: rgba(217, 164, 65, 0.45);
  background: rgba(217, 164, 65, 0.05);
  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.08);
}

.topbar-link {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.18s;
}
.topbar-link:hover { color: var(--gold-soft); }

.menu-btn {
  display: none;
  width: 38px; height: 38px;
  padding: 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}
.menu-btn span {
  display: block;
  height: 1.5px;
  margin: 4px 0;
  background: var(--text-soft);
  border-radius: 2px;
}

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr) 220px;
  max-width: 1560px;
  margin: 0 auto;
  padding-top: var(--topbar-h);
}

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 164, 65, 0.3) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(217, 164, 65, 0.22); border-radius: 4px; }

.sidebar-inner {
  padding: 26px 22px 40px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.sidebar-brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.brand-sigil {
  position: relative;
  width: 44px; height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  margin-top: 2px;
}
.sigil-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(217, 164, 65, 0.55);
  animation: spin 26s linear infinite;
}
.sigil-ring::after {
  content: "";
  position: absolute;
  top: -2px; left: 50%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 8px var(--gold);
  transform: translateX(-50%);
}
.sigil-planet {
  position: relative;
  width: 14px; height: 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #f3e2ba 0%, #c9b6f6 24%, #8f7bd8 48%, #4a3d84 74%, #161227 100%);
  box-shadow:
    inset -3px -3px 5px rgba(0, 0, 0, 0.65),
    inset 2px 2px 4px rgba(255, 255, 255, 0.16),
    0 0 12px rgba(167, 139, 250, 0.45);
}
.sigil-planet::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 26px; height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(217, 164, 65, 0.62);
  transform: translate(-50%, -50%) rotate(-20deg);
  box-shadow: 0 0 6px rgba(217, 164, 65, 0.2);
}
@keyframes spin { to { transform: rotate(360deg); } }

.sidebar-kicker {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: var(--gold);
}
.sidebar-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: 0.005em;
  color: var(--text);
}
.sidebar-title em {
  font-style: italic;
  font-weight: 300;
  color: var(--gold-soft);
}

.search-box {
  position: relative;
  margin: 20px 0 6px;
}
.search-box svg {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--faint);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  height: 38px;
  padding: 0 40px 0 34px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.028);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.search-box input::placeholder { color: var(--faint); }
.search-box input:focus {
  border-color: rgba(217, 164, 65, 0.5);
  background: rgba(217, 164, 65, 0.05);
  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.07);
}
.search-box kbd {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  min-width: 18px;
  height: 20px;
  padding: 0 5px;
  display: grid; place-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.025);
}
.search-status {
  min-height: 15px;
  margin: 4px 0 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--gold);
}

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; }

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--text-soft);
  transition: color 0.16s, background 0.16s;
}
.nav-link::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 2px; height: 0;
  border-radius: 2px;
  transform: translateY(-50%);
  background: var(--gold);
  transition: height 0.18s, box-shadow 0.18s;
}
.nav-link:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.nav-link.active {
  color: var(--gold-soft);
  background: linear-gradient(90deg, rgba(217, 164, 65, 0.10), transparent);
}
.nav-link.active::before {
  height: 60%;
  box-shadow: 0 0 8px var(--gold);
}
.nav-num {
  width: 17px;
  flex: 0 0 17px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--faint);
  transition: color 0.16s;
}
.nav-link.active .nav-num { color: var(--gold); }
.nav-text { flex: 1; min-width: 0; }
.nav-link .nav-count {
  flex: 0 0 auto;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--faint);
  background: rgba(255, 255, 255, 0.025);
}
.nav-link.active .nav-count {
  color: rgba(240, 202, 130, 0.85);
  border-color: rgba(217, 164, 65, 0.25);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--faint);
}
.sidebar-foot p { margin: 0 0 8px; }
.sidebar-foot a { color: var(--muted); text-decoration: underline; text-decoration-color: rgba(217,164,65,.3); text-underline-offset: 3px; }
.sidebar-foot a:hover { color: var(--gold-soft); }
.foot-note { color: #5a5568; }

/* ---------- main ---------- */
.main {
  min-width: 0;
  padding: 0 52px;
  max-width: 1040px;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 86px 0 64px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero-orbit {
  position: absolute;
  top: 14px;
  right: -34px;
  width: 330px; height: 330px;
  pointer-events: none;
  opacity: 0.95;
  isolation: isolate;
}

/* deep-space haze behind the planet */
.hero-orbit::before {
  content: "";
  position: absolute;
  inset: 2%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 64% 38%, rgba(122, 162, 247, 0.2), transparent 46%),
    radial-gradient(circle at 36% 64%, rgba(167, 139, 250, 0.22), transparent 52%),
    radial-gradient(circle at 50% 50%, rgba(95, 211, 180, 0.08), transparent 64%);
  filter: blur(16px);
  z-index: 0;
}

.cosmos-stars {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0.9;
  background-image:
    radial-gradient(1.6px 1.6px at 22% 24%, rgba(255, 255, 255, 0.95), transparent 62%),
    radial-gradient(1.2px 1.2px at 71% 16%, rgba(160, 220, 255, 0.9), transparent 62%),
    radial-gradient(1px 1px at 84% 46%, rgba(233, 227, 214, 0.8), transparent 62%),
    radial-gradient(1.3px 1.3px at 56% 8%, rgba(240, 202, 130, 0.8), transparent 62%),
    radial-gradient(1px 1px at 12% 62%, rgba(167, 139, 250, 0.85), transparent 62%),
    radial-gradient(1.4px 1.4px at 92% 76%, rgba(255, 255, 255, 0.75), transparent 62%),
    radial-gradient(1px 1px at 38% 90%, rgba(122, 162, 247, 0.8), transparent 62%),
    radial-gradient(1.1px 1.1px at 66% 86%, rgba(95, 211, 180, 0.75), transparent 62%),
    radial-gradient(0.9px 0.9px at 8% 38%, rgba(255, 255, 255, 0.6), transparent 62%),
    radial-gradient(1px 1px at 82% 94%, rgba(255, 255, 255, 0.55), transparent 62%);
  animation: twinkle 7s ease-in-out infinite alternate;
}

.planet {
  position: absolute;
  left: 50%; top: 50%;
  width: 46%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.planet::before {
  content: "";
  position: absolute;
  inset: -16%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.28) 0%, rgba(122, 162, 247, 0.12) 42%, transparent 70%);
  filter: blur(10px);
  z-index: 0;
}

.planet-sphere {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  z-index: 2;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.9) 0%, rgba(224, 216, 255, 0.55) 11%, transparent 30%),
    radial-gradient(circle at 70% 74%, rgba(44, 70, 122, 0.6) 0%, transparent 56%),
    radial-gradient(circle at 36% 32%, #b4a6f2 0%, #7f6ccb 24%, #4b3f86 50%, #292246 72%, #0c0a18 100%);
  box-shadow:
    inset -16px -18px 34px rgba(0, 0, 0, 0.82),
    inset 9px 10px 24px rgba(167, 139, 250, 0.24),
    inset 0 0 0 1px rgba(233, 227, 214, 0.1),
    0 0 34px rgba(122, 162, 247, 0.18),
    0 0 86px rgba(167, 139, 250, 0.16);
}

/* cloud bands and surface texture */
.planet-sphere::before {
  content: "";
  position: absolute;
  inset: -12%;
  background:
    radial-gradient(ellipse 44% 12% at 42% 32%, rgba(240, 202, 130, 0.32), transparent 70%),
    radial-gradient(ellipse 58% 10% at 58% 52%, rgba(95, 211, 180, 0.22), transparent 72%),
    radial-gradient(ellipse 46% 9% at 38% 70%, rgba(122, 162, 247, 0.3), transparent 72%),
    repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 9px);
  filter: blur(1.4px);
  transform: rotate(-12deg);
  mix-blend-mode: screen;
  opacity: 0.9;
}

/* day/night terminator */
.planet-sphere::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(118deg, transparent 32%, rgba(6, 5, 14, 0.3) 54%, rgba(4, 3, 10, 0.9) 82%);
  box-shadow: inset 5px 0 10px rgba(122, 162, 247, 0.2);
}

.planet-ring {
  position: absolute;
  left: 50%; top: 50%;
  width: 112%; height: 112%;
  border-radius: 50%;
  border: 1.6px solid rgba(217, 164, 65, 0.5);
  box-shadow: 0 0 14px rgba(217, 164, 65, 0.18), inset 0 0 10px rgba(95, 211, 180, 0.1);
  transform: translate(-50%, -50%) rotate(-20deg) scaleY(0.3);
}
.planet-ring-back {
  z-index: 1;
  clip-path: inset(0 0 50% 0);
  opacity: 0.75;
}
.planet-ring-front {
  z-index: 3;
  clip-path: inset(50% 0 0 0);
  opacity: 0.9;
}

.moon-orbit {
  position: absolute;
  inset: 8%;
  z-index: 4;
  animation: spin 38s linear infinite;
}
.moon {
  position: absolute;
  top: 10%; left: 76%;
  width: 8%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #f6f1e4 0%, #c9c0b2 38%, #79728a 70%, #2a2638 100%);
  box-shadow: 0 0 10px rgba(233, 227, 214, 0.35), 0 0 22px rgba(122, 162, 247, 0.18);
}

.cosmos-comet {
  position: absolute;
  top: 18%; left: 4%;
  width: 34%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(95, 211, 180, 0.55), rgba(255, 255, 255, 0.8), transparent);
  transform: rotate(-24deg);
  opacity: 0.5;
  filter: blur(0.3px);
  z-index: 1;
}

@keyframes twinkle {
  from { opacity: 0.55; }
  to { opacity: 1; }
}

.eyebrow {
  position: relative;
  margin: 0 0 22px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--muted);
}
.eyebrow-rune { color: var(--gold); margin-right: 8px; }

.hero-title {
  position: relative;
  margin: 0 0 24px;
  font-family: var(--serif);
  font-size: clamp(42px, 6vw, 76px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.022em;
  color: var(--text);
}
.hero-title em {
  font-style: italic;
  font-weight: 300;
  background: linear-gradient(100deg, var(--gold-soft) 0%, #f7e5bb 45%, var(--violet) 110%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lede {
  position: relative;
  max-width: 660px;
  margin: 0 0 30px;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text-soft);
}
.hero-lede code { font-size: 0.84em; }

.hero-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 42px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: transform 0.18s, background 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.btn-primary {
  background: linear-gradient(135deg, #e3b45d, var(--gold));
  color: #16100a;
  border: 1px solid rgba(255, 226, 170, 0.35);
  box-shadow: 0 8px 24px -10px rgba(217, 164, 65, 0.65);
}
.btn-primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #f3cb82, #e2ad50);
  color: #16100a;
  box-shadow: 0 12px 30px -10px rgba(217, 164, 65, 0.8);
}
.btn-ghost {
  color: var(--text-soft);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
}
.btn-ghost:hover {
  color: var(--text);
  border-color: rgba(217, 164, 65, 0.4);
  background: rgba(217, 164, 65, 0.06);
  transform: translateY(-1px);
}

.hero-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  max-width: 720px;
}
.stat {
  background: rgba(12, 11, 18, 0.72);
  padding: 16px 18px;
}
.stat b {
  display: block;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
  color: var(--gold-soft);
  margin-bottom: 6px;
}
.stat span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.hero-hint {
  position: relative;
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.hint-key {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px;
}
.hint-sep { color: rgba(233, 227, 214, 0.18); }

/* ---------- sections ---------- */
.section {
  padding: 64px 0 18px;
  border-bottom: 1px solid var(--line);
}
.section:last-of-type { border-bottom: none; }

.section-head {
  position: relative;
  margin-bottom: 30px;
}
.section-num {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gold);
  margin-bottom: 10px;
}
.section-num::after {
  content: "";
  display: inline-block;
  width: 46px;
  height: 1px;
  margin-left: 12px;
  vertical-align: middle;
  background: linear-gradient(90deg, rgba(217, 164, 65, 0.6), transparent);
}
.section-title {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(27px, 3.2vw, 38px);
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: -0.015em;
  color: var(--text);
}
.section-title .en {
  display: block;
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.section-intro {
  max-width: 760px;
  margin: 0;
  font-size: 14.5px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--muted);
}

/* ---------- API cards ---------- */
.api-list { display: flex; flex-direction: column; gap: 18px; }

.api-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.038), rgba(255, 255, 255, 0.008) 55%, rgba(217, 164, 65, 0.015));
  padding: 22px 24px 24px;
  transition: border-color 0.22s, transform 0.22s, box-shadow 0.22s;
  scroll-margin-top: calc(var(--topbar-h) + 24px);
}
.api-card::before {
  content: "";
  position: absolute;
  left: -1px; top: 22px; bottom: 22px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.22s, box-shadow 0.22s;
}
.api-card:hover {
  border-color: rgba(217, 164, 65, 0.28);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.api-card:hover::before {
  background: var(--gold);
  box-shadow: 0 0 12px rgba(217, 164, 65, 0.55);
}

.api-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  min-width: 0;
}
.api-name {
  margin: 0;
  min-width: 0;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.api-name .dot { color: var(--gold); }
.api-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.badge-izi { color: var(--violet); background: var(--violet-dim); border-color: rgba(167, 139, 250, 0.22); }
.badge-legacy { color: var(--gold-soft); background: var(--gold-dim); border-color: rgba(217, 164, 65, 0.24); }
.badge-module { color: var(--teal); background: var(--teal-dim); border-color: rgba(95, 211, 180, 0.22); }
.badge-type { color: var(--blue); background: var(--blue-dim); border-color: rgba(122, 162, 247, 0.22); }
.badge-pattern { color: #c9c2b4; background: rgba(233, 227, 214, 0.06); border-color: rgba(233, 227, 214, 0.16); }

.api-cn {
  margin: 6px 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.sig {
  position: relative;
  display: block;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(217, 164, 65, 0.14);
  background: rgba(6, 5, 10, 0.55);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: #e8dcc2;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}
.sig::before {
  content: "SIGNATURE";
  display: block;
  margin-bottom: 7px;
  font-size: 8.5px;
  letter-spacing: 0.2em;
  color: rgba(217, 164, 65, 0.6);
}

.api-desc {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.72;
  color: var(--text-soft);
}
.api-desc code { font-size: 0.85em; }

.params {
  width: 100%;
  border-collapse: collapse;
  margin: 4px 0 16px;
  font-size: 12.5px;
}
.params th {
  text-align: left;
  padding: 7px 10px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--line-strong);
  font-weight: 500;
}
.params td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(233, 227, 214, 0.05);
  vertical-align: top;
  color: var(--text-soft);
}
.params td:first-child {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--gold-soft);
  white-space: nowrap;
}
.params td:nth-child(2) {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--violet);
  white-space: nowrap;
}

.note {
  display: flex;
  gap: 10px;
  margin: 14px 0;
  padding: 12px 14px 12px 15px;
  border-left: 2px solid rgba(217, 164, 65, 0.7);
  border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, rgba(217, 164, 65, 0.07), rgba(217, 164, 65, 0.012));
  font-size: 12.8px;
  line-height: 1.66;
  color: #d8cfbe;
}
.note strong { color: var(--gold-soft); font-weight: 600; }
.note .note-icon { color: var(--gold); flex: 0 0 auto; }

.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--faint);
  transition: color 0.18s;
}
.doc-link:hover { color: var(--gold-soft); }

/* ---------- code blocks ---------- */
.code-block {
  margin: 4px 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(233, 227, 214, 0.1);
  background: #07060b;
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 34px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid rgba(233, 227, 214, 0.07);
  background: rgba(255, 255, 255, 0.018);
}
.code-lang {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 8px;
  border-radius: 5px;
  border: 1px solid rgba(233, 227, 214, 0.12);
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}
.copy-btn:hover { color: var(--gold-soft); border-color: rgba(217, 164, 65, 0.4); background: rgba(217, 164, 65, 0.06); }
.copy-btn.copied { color: var(--teal); border-color: rgba(95, 211, 180, 0.4); background: rgba(95, 211, 180, 0.08); }
.copy-btn svg { width: 11px; height: 11px; }

.code-block pre {
  margin: 0;
  padding: 15px 16px 17px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.3px;
  line-height: 1.72;
  color: #d9d3c6;
  tab-size: 2;
  scrollbar-width: thin;
  scrollbar-color: rgba(217, 164, 65, 0.25) transparent;
}
.code-block pre::-webkit-scrollbar { height: 6px; }
.code-block pre::-webkit-scrollbar-thumb { background: rgba(217, 164, 65, 0.2); border-radius: 4px; }

.tok-com { color: #6f6a7c; font-style: italic; }
.tok-str { color: #a8c98a; }
.tok-kw { color: #c792ea; }
.tok-num { color: #f0b97a; }
.tok-fn { color: #82aaff; }
.tok-api { color: #f0ca82; }
.tok-op { color: #8f8a9b; }

/* ---------- example section ---------- */
.example-card {
  border: 1px solid rgba(217, 164, 65, 0.22);
  border-radius: var(--radius);
  background:
    radial-gradient(700px 220px at 20% 0%, rgba(217, 164, 65, 0.07), transparent 70%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.008));
  padding: 24px;
}
.example-card .code-block { margin-top: 16px; }
.example-points {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 22px;
  margin: 18px 0 4px;
  padding: 0;
}
.example-points li {
  position: relative;
  padding-left: 20px;
  font-size: 12.8px;
  line-height: 1.6;
  color: var(--muted);
}
.example-points li::before {
  content: "◆";
  position: absolute;
  left: 0; top: 1px;
  font-size: 8px;
  color: var(--gold);
}

/* ---------- rail ---------- */
.rail {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 34px 24px 30px 8px;
  border-left: 1px solid rgba(233, 227, 214, 0.05);
}
.rail-inner { position: sticky; top: 0; }
.rail-title {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--faint);
}
.rail nav { display: flex; flex-direction: column; gap: 1px; }
.rail a {
  display: block;
  padding: 6px 0 6px 11px;
  border-left: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.45;
  color: var(--faint);
  transition: color 0.16s, border-color 0.16s;
}
.rail a:hover { color: var(--text-soft); border-color: rgba(217, 164, 65, 0.4); }
.rail a.active {
  color: var(--gold-soft);
  border-left-color: var(--gold);
}
.rail-top {
  display: inline-block;
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--faint);
}
.rail-top:hover { color: var(--gold-soft); }

/* ---------- footer ---------- */
.page-footer {
  margin-top: 60px;
  padding: 40px 0 70px;
  text-align: center;
  color: var(--faint);
  font-size: 12px;
}
.footer-rule {
  width: 70px;
  height: 1px;
  margin: 0 auto 26px;
  background: linear-gradient(90deg, transparent, rgba(217, 164, 65, 0.6), transparent);
}
.footer-title {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--text-soft);
  margin: 0 0 8px;
}
.page-footer p { margin: 0 0 8px; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; margin-top: 16px; }
.footer-links a { color: var(--muted); font-size: 12px; }
.footer-links a:hover { color: var(--gold-soft); }

/* ---------- motion: page load & scroll reveal ---------- */
@keyframes rise {
  from { opacity: 0; translate: 0 16px; }
  to   { opacity: 1; translate: 0 0; }
}

.hero .eyebrow     { animation: rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.06s both; }
.hero .hero-title  { animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both; }
.hero .hero-lede   { animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.22s both; }
.hero .hero-actions{ animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.30s both; }
.hero .hero-stats  { animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.38s both; }
.hero .hero-hint   { animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.46s both; }
.hero .hero-orbit  { animation: rise 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both; }

.reveal.armed {
  opacity: 0;
  translate: 0 18px;
  transition:
    opacity 0.72s cubic-bezier(0.22, 1, 0.36, 1),
    translate 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.armed.in {
  opacity: 1;
  translate: 0 0;
}

/* ---------- search / empty ---------- */
.no-results {
  display: none;
  padding: 40px 0 60px;
  text-align: center;
  color: var(--muted);
}
.no-results.show { display: block; }
.no-results b { color: var(--gold-soft); font-weight: 500; }
.no-results p { margin: 6px 0; font-size: 13px; }

.api-card.search-hidden,
.section.search-hidden { display: none; }

mark {
  background: rgba(217, 164, 65, 0.22);
  color: var(--gold-soft);
  border-radius: 2px;
  padding: 0 1px;
}

/* ---------- drawer ---------- */
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 89;
  background: rgba(4, 3, 7, 0.7);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.25s;
}
.drawer-scrim.show { opacity: 1; }

/* ---------- responsive ---------- */
@media (max-width: 1320px) {
  .shell { grid-template-columns: 276px minmax(0, 1fr); }
  .rail { display: none; }
}

@media (max-width: 980px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    width: 300px;
    z-index: 90;
    background: #0a0910;
    transform: translateX(-102%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    border-right: 1px solid var(--line-strong);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-inner { padding-top: calc(var(--topbar-h) + 18px); }
  .menu-btn { display: block; }
  .topbar-link { display: none; }
  .topbar-search { max-width: none; }
  .main { padding: 0 26px; }
  .hero { padding-top: 56px; }
  .hero-orbit { width: 240px; height: 240px; right: -70px; opacity: 0.5; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .topbar { padding: 0 14px; gap: 12px; }
  .topbar-brand span:last-child { display: none; }
  .main { padding: 0 18px; }
  .hero { padding: 44px 0 46px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 38px; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
  .api-card { padding: 18px 16px 20px; }
  .api-name { font-size: 15px; }
  .api-badges { margin-left: 0; }
  .example-points { grid-template-columns: 1fr; }
  .section { padding-top: 48px; }
  .params { display: block; overflow-x: auto; }
  .hero-hint { display: none; }
}

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