/* ══════════════════════════════════════
   RESET & BASE
   (Google Fonts loaded via <link> in HTML)
══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:   #52c4f7;
  --teal:   #2dd4bf;
  --green:  #4ade80;
  --amber:  #fbbf24;
  --red:    #f87171;
  --purple: #a78bfa;

  --gradient:      linear-gradient(135deg, #52c4f7, #2dd4bf);
  --gradient-text: linear-gradient(135deg, #52c4f7, #2dd4bf, #4ade80);

  --bg-0: #040608;
  --bg-1: #080a0f;
  --bg-2: #0d1018;
  --bg-3: #131620;
  --bg-4: #1a1e2e;
  --bg-5: #222740;
  --bg-6: #2c3250;

  --t0: #edf0fa;
  --t1: #9aa3c0;
  --t2: #545d7a;
  --t3: #333a55;

  --border:    rgba(255,255,255,0.06);
  --border-md: rgba(255,255,255,0.10);
  --border-hi: rgba(82,196,247,0.30);

  --sans: 'Sora', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;

  --r:  8px;
  --r2: 12px;
  --r3: 16px;
  --r4: 24px;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.35);
  --shadow:    0 4px 24px rgba(0,0,0,0.45);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.55);
  --glow:      0 0 40px rgba(82,196,247,0.12);
  --glow-hi:   0 0 60px rgba(82,196,247,0.22);
  --glow-btn:  0 4px 24px rgba(82,196,247,0.35);

  --nav-h: 64px;
  --max-w: 1160px;
}

html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--sans);
  background: var(--bg-1);
  color: var(--t0);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ══════════════════════════════════════
   TYPOGRAPHY
══════════════════════════════════════ */
h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 700; line-height: 1.2;  letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
h4 { font-size: 0.9rem;  font-weight: 600; }
p  { color: var(--t1); line-height: 1.75; }

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ══════════════════════════════════════
   LAYOUT UTILITIES
══════════════════════════════════════ */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 28px; }
section    { padding: 96px 0; }

.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--blue); margin-bottom: 18px;
}
.section-label::before {
  content: ''; display: inline-block;
  width: 20px; height: 2px;
  background: var(--gradient); border-radius: 1px;
}
.section-title { margin-bottom: 14px; }
.section-desc  { color: var(--t1); font-size: 1.05rem; max-width: 540px; line-height: 1.75; }

.text-center { text-align: center; }
.text-center .section-desc  { margin: 0 auto; }
.text-center .section-label { justify-content: center; }

/* ══════════════════════════════════════
   NAV
══════════════════════════════════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: var(--nav-h);
  display: flex; align-items: center;
  padding: 0 28px;
  transition: background 0.3s, border-color 0.3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(8,10,15,0.88);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border-color: var(--border);
}
.nav-inner {
  display: flex; align-items: center;
  width: 100%; max-width: var(--max-w); margin: 0 auto;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 16px; font-weight: 700;
  color: var(--t0); flex-shrink: 0;
}
.nav-logo img {
  width: 30px; height: 30px; border-radius: 8px;
  box-shadow: 0 0 16px rgba(82,196,247,0.25);
}
.nav-logo-text        { color: var(--t0); }
.nav-logo-text > span { color: var(--blue); }

.nav-links {
  display: flex; align-items: center; gap: 4px;
  list-style: none; margin: 0 auto;
}
.nav-links a {
  padding: 6px 14px; border-radius: var(--r);
  font-size: 14px; font-weight: 500; color: var(--t1);
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover    { color: var(--t0); background: rgba(255,255,255,0.06); }
.nav-links a.nav-cur  { color: var(--blue); }

.nav-actions { display: flex; align-items: center; gap: 10px; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  cursor: pointer; background: none; border: none;
  padding: 6px; margin-left: 10px; border-radius: var(--r);
  transition: background 0.15s;
}
.hamburger:hover { background: var(--bg-3); }
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--t1); border-radius: 1px;
  transition: all 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav panel */
.nav-mobile-panel {
  display: none; flex-direction: column;
  position: fixed; top: var(--nav-h); left: 0; right: 0; z-index: 999;
  background: rgba(8,10,15,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px 20px;
  gap: 2px;
}
.nav-mobile-panel.open { display: flex; }
.nav-mobile-panel a {
  display: block; padding: 11px 14px; border-radius: var(--r);
  font-size: 15px; color: var(--t1); font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
.nav-mobile-panel a:hover { color: var(--t0); background: rgba(255,255,255,0.06); }
.nav-mobile-panel a.nav-cur { color: var(--blue); }
.nav-mobile-sep {
  height: 1px; background: var(--border);
  margin: 8px 0;
}

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--r2);
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.2s;
  text-decoration: none; white-space: nowrap;
}
.btn svg { flex-shrink: 0; }

.btn-primary {
  background: var(--gradient);
  color: #050c15;
  box-shadow: var(--glow-btn);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 32px rgba(82,196,247,0.45);
  filter: brightness(1.06);
}

.btn-secondary {
  background: var(--bg-4);
  color: var(--t0);
  border: 1px solid var(--border-md);
}
.btn-secondary:hover {
  background: var(--bg-5); border-color: rgba(82,196,247,0.2);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent; color: var(--t1);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--t0); background: var(--bg-3); border-color: var(--border-md); }

.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: var(--r); }
.btn-lg { padding: 14px 30px; font-size: 16px; border-radius: var(--r3); }

/* ══════════════════════════════════════
   HERO
══════════════════════════════════════ */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding-top: var(--nav-h);
  position: relative; overflow: hidden;
  background: var(--bg-0);
}

/* Dot-grid background */
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(82,196,247,0.18) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 0%, black 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 85% 75% at 50% 0%, black 20%, transparent 100%);
  pointer-events: none;
}

.hero-glow-1 {
  position: absolute; width: 900px; height: 700px;
  top: -200px; right: -300px;
  background: radial-gradient(ellipse, rgba(82,196,247,0.07) 0%, transparent 65%);
  pointer-events: none;
}
.hero-glow-2 {
  position: absolute; width: 600px; height: 500px;
  bottom: -100px; left: -150px;
  background: radial-gradient(ellipse, rgba(45,212,191,0.05) 0%, transparent 65%);
  pointer-events: none;
}

.hero-inner {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 72px;
  align-items: center; width: 100%; max-width: var(--max-w);
  margin: 0 auto; padding: 80px 28px 100px;
  position: relative; z-index: 1;
}

.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(82,196,247,0.08);
  border: 1px solid rgba(82,196,247,0.22);
  color: var(--blue);
  padding: 5px 14px 5px 10px; border-radius: 20px;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  margin-bottom: 28px;
}
.hero-badge .live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 8px var(--green);
  animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--green); }
  50%       { opacity: 0.6; box-shadow: 0 0 4px var(--green); }
}

.hero h1    { margin-bottom: 22px; }
.hero-sub   {
  font-size: 1.1rem; color: var(--t1); line-height: 1.8;
  max-width: 500px; margin-bottom: 40px;
}
.hero-cta   { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 56px; }

.hero-meta {
  display: flex; gap: 32px; padding-top: 20px;
  border-top: 1px solid var(--border);
}
.meta-value {
  font-family: var(--mono); font-size: 1.5rem; font-weight: 700;
  color: var(--t0); line-height: 1;
}
.meta-label { font-size: 12px; color: var(--t2); margin-top: 4px; }

/* ── Terminal Widget ── */
.terminal {
  background: var(--bg-2);
  border: 1px solid var(--border-md);
  border-radius: var(--r3);
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--glow);
  font-family: var(--mono);
}
.terminal-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 13px 18px;
  background: var(--bg-3); border-bottom: 1px solid var(--border);
}
.terminal-dot           { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.td-red                 { background: #ff5f57; }
.td-yellow              { background: #febc2e; }
.td-green               { background: #28c840; }
.terminal-caption       { margin: 0 auto; font-size: 11.5px; color: var(--t2); }

/* FIX #1: white-space: pre preserves ASCII art indentation.
   max-height + overflow: auto creates a scrolling terminal feel. */
.terminal-body {
  padding: 22px 24px;
  min-height: 260px;
  max-height: 380px;
  overflow: auto;
  line-height: 1.9;
  white-space: pre;          /* Preserves leading spaces for ASCII art */
  font-size: 12.5px;
}

.t-prompt { color: var(--teal); }
.t-cmd    { color: var(--t0); }
.t-ok     { color: var(--green); }
.t-info   { color: var(--blue); }
.t-dim    { color: var(--t3); }
.t-warn   { color: var(--amber); }
.t-url    { color: var(--purple); }
.t-stage  { color: var(--amber); font-weight: 600; }
.t-cursor {
  display: inline-block; width: 8px; height: 15px;
  background: var(--blue); vertical-align: middle;
  animation: cur-blink 1s step-end infinite; margin-left: 2px;
}
@keyframes cur-blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ══════════════════════════════════════
   FEATURES
══════════════════════════════════════ */
.features      { background: var(--bg-0); }

.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  margin-top: 56px;
}
.feature-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r3); padding: 28px 26px;
  position: relative; overflow: hidden;
  transition: border-color 0.22s, transform 0.22s, box-shadow 0.22s;
}
.feature-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  opacity: 0; transition: opacity 0.22s;
}

/* FIX #2 & #6: Higher specificity (.features-grid .feature-card:hover)
   beats .anim.visible so the lift animation actually works after scroll-in. */
.features-grid .feature-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-5px);
  box-shadow: var(--glow);
}
.features-grid .feature-card:hover::after { opacity: 1; }

.fc-blue::after   { background: linear-gradient(90deg, var(--blue),   transparent); }
.fc-teal::after   { background: linear-gradient(90deg, var(--teal),   transparent); }
.fc-green::after  { background: linear-gradient(90deg, var(--green),  transparent); }
.fc-amber::after  { background: linear-gradient(90deg, var(--amber),  transparent); }
.fc-purple::after { background: linear-gradient(90deg, var(--purple), transparent); }
.fc-red::after    { background: linear-gradient(90deg, var(--red),    transparent); }

.feature-icon {
  width: 46px; height: 46px; border-radius: var(--r2);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 18px; flex-shrink: 0;
}
.fi-blue   { background: rgba(82,196,247,0.10);  border: 1px solid rgba(82,196,247,0.15); }
.fi-teal   { background: rgba(45,212,191,0.10);  border: 1px solid rgba(45,212,191,0.15); }
.fi-green  { background: rgba(74,222,128,0.10);  border: 1px solid rgba(74,222,128,0.15); }
.fi-amber  { background: rgba(251,191,36,0.10);  border: 1px solid rgba(251,191,36,0.15); }
.fi-purple { background: rgba(167,139,250,0.10); border: 1px solid rgba(167,139,250,0.15); }
.fi-red    { background: rgba(248,113,113,0.10); border: 1px solid rgba(248,113,113,0.15); }

.feature-card h3 { font-size: 1rem;   margin-bottom: 9px; }
.feature-card p  { font-size: 13.5px; color: var(--t1); line-height: 1.65; }

/* ══════════════════════════════════════
   WORKFLOW STAGES
══════════════════════════════════════ */
.workflow { position: relative; }

.stages-wrapper {
  display: flex; margin-top: 60px;
  border: 1px solid var(--border); border-radius: var(--r3);
  overflow: hidden; background: var(--bg-2);
}
.stage {
  flex: 1; padding: 32px 24px;
  border-right: 1px solid var(--border);
  position: relative; transition: background 0.2s;
  cursor: default;
}
.stage:last-child { border-right: none; }
.stage:hover      { background: var(--bg-3); }

.stage-num {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--t3); margin-bottom: 14px;
}
.stage-icon { font-size: 26px; margin-bottom: 14px; line-height: 1; }
.stage h3 {
  font-size: 14.5px; font-weight: 700;
  margin-bottom: 10px; color: var(--t0);
}
.stage p  { font-size: 12.5px; color: var(--t1); line-height: 1.6; }

.stage-accent {
  position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  opacity: 0; transition: opacity 0.2s;
}
.stage:hover .stage-accent { opacity: 1; }
.sa-blue   { background: var(--blue); }
.sa-teal   { background: var(--teal); }
.sa-green  { background: var(--green); }
.sa-amber  { background: var(--amber); }
.sa-purple { background: var(--purple); }

/* Flow connector arrow — single transform (fixed prev bug) */
.stage-arrow {
  position: absolute; right: -10px; top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 20px; height: 20px;
  background: var(--bg-2);          /* Match default stage bg, not hovered bg */
  border-top: 1px solid var(--border-md);
  border-right: 1px solid var(--border-md);
  z-index: 1;
}
.stage:last-child .stage-arrow { display: none; }

/* ══════════════════════════════════════
   RUNNERS
══════════════════════════════════════ */
.runners      { background: var(--bg-0); }

.runners-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  margin-top: 56px;
}
.runner-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r3); padding: 32px 28px;
  transition: all 0.22s; position: relative; overflow: hidden;
}

/* FIX #6: Higher specificity beats .anim.visible */
.runners-grid .runner-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-5px);
  box-shadow: var(--glow);
}

.runner-card.featured {
  border-color: rgba(82,196,247,0.22);
  background: linear-gradient(135deg, rgba(82,196,247,0.04) 0%, rgba(45,212,191,0.04) 100%);
}
.runner-card.featured::before {
  content: '默认推荐';
  position: absolute; top: 18px; right: 18px;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
  background: rgba(82,196,247,0.1); color: var(--blue);
  border: 1px solid rgba(82,196,247,0.2);
}
.runner-logo        { font-size: 36px; margin-bottom: 18px; line-height: 1; }
.runner-card h3     { margin-bottom: 10px; font-size: 1.1rem; }
.runner-card p      { font-size: 13.5px; color: var(--t1); line-height: 1.65; }
.runner-tags        { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 18px; }
.rtag {
  font-family: var(--mono); font-size: 11px;
  padding: 3px 9px; border-radius: 20px;
  background: var(--bg-4); color: var(--t2);
  border: 1px solid var(--border);
}

/* ══════════════════════════════════════
   TECH STACK GRID (FIX #10: no more inline style)
══════════════════════════════════════ */
.techstack-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 52px;
}
.techstack-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r3); padding: 24px 16px;
  text-align: center;
  transition: border-color 0.22s, transform 0.22s;
}
.techstack-card:hover { border-color: var(--border-hi); transform: translateY(-3px); }
.techstack-icon  { font-size: 32px; margin-bottom: 12px; }
.techstack-name  { font-size: 13px; font-weight: 700; color: var(--t0); margin-bottom: 4px; }
.techstack-sub   { font-size: 12px; color: var(--t2); }

/* ══════════════════════════════════════
   INSTALL / CODE BLOCK
══════════════════════════════════════ */
.code-window {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r3); overflow: hidden;
  max-width: 720px; margin-top: 40px;
  box-shadow: var(--shadow-lg), var(--glow);
}
.code-win-bar {
  display: flex; align-items: center; gap: 7px;
  padding: 13px 18px; background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}
.cwb-dots { display: flex; gap: 6px; }
.cwb-dot  { width: 11px; height: 11px; border-radius: 50%; }
.cwd-r    { background: #ff5f57; }
.cwd-y    { background: #febc2e; }
.cwd-g    { background: #28c840; }
.code-win-title {
  margin: 0 auto; font-size: 12px; font-family: var(--mono); color: var(--t2);
}
.copy-btn {
  margin-left: auto;
  background: var(--bg-4); border: 1px solid var(--border);
  border-radius: var(--r); color: var(--t2);
  font-size: 12px; font-family: var(--sans);
  padding: 4px 12px; cursor: pointer; transition: all 0.15s;
}
.copy-btn:hover { color: var(--t0); border-color: var(--border-md); background: var(--bg-5); }

.code-win-body {
  padding: 28px; font-family: var(--mono); font-size: 13.5px;
  line-height: 2.1; overflow-x: auto;
}
.cc { color: var(--t3); }
.ck { color: var(--blue); }
.cs { color: var(--green); }
.cp { color: var(--teal); }

/* ══════════════════════════════════════
   CTA SECTION
══════════════════════════════════════ */
.cta-section {
  text-align: center; padding: 120px 0; background: var(--bg-0);
  position: relative; overflow: hidden;
}
.cta-glow {
  position: absolute; width: 700px; height: 500px;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(ellipse, rgba(82,196,247,0.07) 0%, transparent 65%);
  pointer-events: none;
}
.cta-section h2 { margin-bottom: 18px; }
.cta-section p  { font-size: 1.05rem; margin-bottom: 44px; }
.cta-actions    { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.cta-note {
  margin-top: 22px; font-size: 13px; color: var(--t3);
  font-family: var(--mono);
}

/* ══════════════════════════════════════
   FOOTER
══════════════════════════════════════ */
footer {
  background: var(--bg-0);
  border-top: 1px solid var(--border);
  padding: 64px 0 40px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 56px; margin-bottom: 56px;
}

.footer-brand .footer-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 16px; font-weight: 700;
  color: var(--t0); margin-bottom: 14px;
}
.footer-brand .footer-logo img { width: 28px; height: 28px; border-radius: 7px; }
.footer-desc { font-size: 13.5px; color: var(--t2); line-height: 1.75; max-width: 270px; }
.footer-social { display: flex; gap: 10px; margin-top: 20px; }
.social-btn {
  width: 36px; height: 36px; border-radius: var(--r);
  background: var(--bg-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--t2); font-size: 16px; transition: all 0.15s;
}
.social-btn:hover { color: var(--blue); border-color: var(--border-hi); background: var(--bg-4); }

.footer-col h4 {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--t2); margin-bottom: 18px;
}
.footer-col ul    { list-style: none; display: flex; flex-direction: column; gap: 11px; }
.footer-col a     { font-size: 13.5px; color: var(--t2); transition: color 0.15s; }
.footer-col a:hover { color: var(--blue); }

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 28px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--t3);
}
.footer-bottom a       { color: var(--t2); transition: color 0.15s; }
.footer-bottom a:hover { color: var(--blue); }

/* ══════════════════════════════════════
   DOCS PAGE
══════════════════════════════════════ */
.docs-page { background: var(--bg-1); min-height: 100vh; }

.docs-layout {
  display: grid; grid-template-columns: 240px 1fr;
  min-height: calc(100vh - var(--nav-h));
  padding-top: var(--nav-h);
}

.docs-sidebar {
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h)); overflow-y: auto;
  background: var(--bg-0); border-right: 1px solid var(--border);
  padding: 28px 12px; flex-shrink: 0;
}
.ds-section { margin-bottom: 28px; }
.ds-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.13em; color: var(--t3);
  padding: 0 10px; margin-bottom: 8px; display: block;
}
.ds-link {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: var(--r);
  font-size: 13px; color: var(--t2);
  transition: all 0.15s; margin-bottom: 2px;
}
.ds-link:hover  { color: var(--t1); background: var(--bg-3); }
.ds-link.active { color: var(--blue); background: rgba(82,196,247,0.08); }
.ds-link-icon   { font-size: 13px; width: 16px; text-align: center; }
.ds-sub         { padding-left: 26px; }
.ds-sub .ds-link { font-size: 12.5px; }

.docs-content {
  max-width: 820px; padding: 56px 64px 80px;
}
.docs-content h1 { margin-bottom: 10px; font-size: 2.2rem; }
.doc-lead {
  font-size: 1.05rem; color: var(--t1); line-height: 1.8; margin-bottom: 48px;
  padding-bottom: 32px; border-bottom: 1px solid var(--border);
}
.doc-section { margin-bottom: 56px; }
.doc-section h2 {
  font-size: 1.4rem; margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px; color: var(--t0);
}
.doc-h2-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--bg-4); border: 1px solid var(--border-md);
  font-family: var(--mono); font-size: 12px; color: var(--blue);
  font-weight: 700; flex-shrink: 0;
}
.doc-section h3  { font-size: 1rem; font-weight: 600; color: var(--t0); margin: 24px 0 10px; }
.doc-section p   { color: var(--t1); line-height: 1.8; margin-bottom: 14px; }
.doc-section ul  { color: var(--t1); padding-left: 20px; margin-bottom: 14px; }
.doc-section li  { margin-bottom: 6px; line-height: 1.7; }
.doc-section a   { color: var(--blue); }
.doc-section a:hover { text-decoration: underline; }

.inline-code {
  font-family: var(--mono); font-size: 0.85em;
  background: var(--bg-4); padding: 2px 7px; border-radius: 5px;
  color: var(--blue); border: 1px solid var(--border);
}

.doc-code {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--r2); overflow: hidden; margin: 18px 0;
}
.doc-code-bar {
  padding: 9px 16px; background: var(--bg-3); border-bottom: 1px solid var(--border);
  font-family: var(--mono); font-size: 12px; color: var(--t2);
  display: flex; align-items: center; justify-content: space-between;
}
.doc-code pre {
  padding: 20px 22px; font-family: var(--mono); font-size: 13px;
  line-height: 1.85; overflow-x: auto; color: var(--t0);
}
.doc-code pre .cc { color: var(--t3); }
.doc-code pre .ck { color: var(--blue); }
.doc-code pre .cs { color: var(--green); }

.doc-callout {
  padding: 16px 20px; border-radius: var(--r2); margin: 20px 0;
  border-left: 3px solid; font-size: 14px;
}
.callout-info { background: rgba(82,196,247,0.06);  border-color: var(--blue);  color: var(--t1); }
.callout-warn { background: rgba(251,191,36,0.06);  border-color: var(--amber); color: var(--t1); }
.callout-tip  { background: rgba(74,222,128,0.06);  border-color: var(--green); color: var(--t1); }

.doc-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 18px 0; }
.doc-table th {
  text-align: left; padding: 10px 14px;
  background: var(--bg-3); color: var(--t1); font-weight: 600;
  border-bottom: 1px solid var(--border-md);
}
.doc-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  color: var(--t1); vertical-align: top;
}
.doc-table tr:last-child td { border-bottom: none; }
.doc-table td code { font-family: var(--mono); font-size: 12px; color: var(--blue); }

.stage-steps   { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; }
.stage-step {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 16px 20px; background: var(--bg-2);
  border: 1px solid var(--border); border-radius: var(--r2);
  transition: border-color 0.15s;
}
.stage-step:hover { border-color: var(--border-md); }
.ss-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-4); border: 1px solid var(--border-md);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--blue); flex-shrink: 0;
}
.ss-body h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.ss-body p  { font-size: 13px; color: var(--t1); line-height: 1.6; margin: 0; }

/* ══════════════════════════════════════
   SCROLL ANIMATIONS
══════════════════════════════════════ */
.anim {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}
.anim.visible { opacity: 1; transform: translateY(0); }
.anim-d1 { transition-delay: 0.08s; }
.anim-d2 { transition-delay: 0.16s; }
.anim-d3 { transition-delay: 0.24s; }
.anim-d4 { transition-delay: 0.32s; }
.anim-d5 { transition-delay: 0.40s; }
.anim-d6 { transition-delay: 0.48s; }

/* ══════════════════════════════════════
   CUSTOM SCROLLBAR
══════════════════════════════════════ */
::-webkit-scrollbar       { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-5); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-6); }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 1100px) {
  .hero-inner { grid-template-columns: 1fr; gap: 52px; }
  .hero-inner > :last-child { display: none; } /* hide terminal */
  .features-grid    { grid-template-columns: repeat(2, 1fr); }
  .philosophy-pillars { grid-template-columns: 1fr; }
  .footer-grid      { grid-template-columns: 1fr 1fr; gap: 40px; }
  .stages-wrapper { flex-direction: column; }
  .stage          { border-right: none; border-bottom: 1px solid var(--border); }
  .stage:last-child { border-bottom: none; }
  .stage-arrow    { display: none; }
  .techstack-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  section         { padding: 64px 0; }
  .nav-links      { display: none; }
  .hamburger      { display: flex; }
  .features-grid  { grid-template-columns: 1fr; }
  .runners-grid   { grid-template-columns: 1fr; }
  .docs-layout    { grid-template-columns: 1fr; }
  .docs-sidebar   { display: none; }
  .docs-content   { padding: 32px 24px 60px; }
  .footer-grid    { grid-template-columns: 1fr; gap: 32px; }
  .hero-meta      { gap: 20px; flex-wrap: wrap; }
  .cta-section    { padding: 80px 0; }
  .footer-bottom  { flex-direction: column; gap: 12px; text-align: center; }
  .techstack-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .container { padding: 0 18px; }
  .hero-cta   { flex-direction: column; }
  .btn-lg     { width: 100%; justify-content: center; }
  .techstack-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ══════════════════════════════════════
   PHILOSOPHY
══════════════════════════════════════ */
.philosophy {
  padding: 100px 0;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
}

.philosophy-quote {
  margin: 48px auto 56px;
  max-width: 720px;
  text-align: center;
  padding: 32px 40px;
  background: var(--bg-2);
  border: 1px solid var(--border-md);
  border-left: 3px solid var(--teal);
  border-radius: var(--r3);
}
.philosophy-quote blockquote {
  font-size: 1.15rem;
  color: var(--t0);
  font-weight: 500;
  line-height: 1.7;
  letter-spacing: 0.01em;
}
.philosophy-quote cite {
  display: block;
  margin-top: 14px;
  font-size: 0.82rem;
  color: var(--t2);
  font-style: normal;
  font-family: var(--mono);
}

.philosophy-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.pillar-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: 32px 28px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pillar-card:hover {
  border-color: var(--border-hi);
  box-shadow: var(--glow);
}
.pillar-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}
.pillar-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--t0);
  margin-bottom: 10px;
}
.pillar-card p {
  font-size: 0.875rem;
  color: var(--t1);
  line-height: 1.75;
}

.philosophy-link {
  text-align: center;
}
.philosophy-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: transparent;
  border: 1px solid var(--border-hi);
  border-radius: var(--r2);
  color: var(--teal);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, box-shadow 0.2s;
}
.philosophy-link-btn:hover {
  background: rgba(45, 212, 191, 0.08);
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.15);
  text-decoration: none;
}

/* ══════════════════════════════════════
   ACCESSIBILITY: prefers-reduced-motion
   FIX #5: Elements remain visible if user
   has motion reduction enabled or JS fails.
══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .anim, .anim.visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .hero-badge .live-dot { animation: none; }
  .t-cursor             { animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
