/* ===========================================================
   TYPESWITCH — Premium Landing Page
   Design direction: Editorial dark, warm undertones, restrained
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ── */
:root {
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Reference Blueprint Palette */
  --ink-navy: #0A1B32;
  --navy-panel: #0F2846;
  --navy-panel-2: #0C2038;
  --navy-line: #2F5686;
  --diazo-cyan: #8FC5EA;
  --linen: #F1ECE0;
  --linen-card: #FBF8F0;
  --graphite: #182233;
  --graphite-soft: #4B5768;
  --chalk: #EDE8DC;
  --chalk-soft: #B9C6D6;
  --amber: #FF7A33;
  --amber-dark: #E4631F;
  --diff-add: #3E8F76;
  --diff-remove: #B4483A;
  --hairline-dark: rgba(143, 197, 234, 0.18);
  --hairline-light: rgba(24, 34, 51, 0.14);

  /* Theme Defaults (mapped to Dark Blueprint theme) */
  --surface-0: var(--ink-navy);
  --surface-1: var(--navy-panel-2);
  --surface-2: var(--navy-panel);
  --surface-3: #113660;
  --border: var(--navy-line);
  --border-subtle: var(--hairline-dark);

  --text-primary: var(--chalk);
  --text-secondary: var(--chalk-soft);
  --text-tertiary: var(--diazo-cyan);

  --accent: var(--amber);
  --accent-muted: rgba(255, 122, 51, 0.12);
  --accent-hover: var(--amber-dark);

  --green: var(--diff-add);
  --green-muted: rgba(62, 143, 118, 0.1);
  --red-muted: rgba(180, 72, 58, 0.1);
  --red-text: var(--diff-remove);

  --radius: 8px;
  --radius-lg: 12px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--surface-0);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--surface-0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--font-mono); font-size: 0.88em; }
img, svg { display: block; max-width: 100%; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 32px; }

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

/* ── Typography ── */
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; line-height: 1.15; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-family: var(--font-body); font-weight: 600; font-size: 0.9rem;
  padding: 12px 24px; border-radius: 6px; border: none;
  cursor: pointer; white-space: nowrap;
  transition: all 0.2s var(--ease-smooth);
}
.btn-accent {
  background: var(--accent); color: var(--surface-0);
}
.btn-accent:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 24px rgba(212, 168, 83, 0.25);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  border-color: var(--text-tertiary);
  background: var(--surface-2);
}
.btn-full { width: 100%; }

/* ===================== NAVIGATION ===================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10, 27, 50, 0.8);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-brand {
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
  color: var(--text-primary); display: flex; align-items: center; gap: 8px;
  letter-spacing: 0.02em;
}
.nav-brand svg { color: var(--accent); }
.nav-brand em { font-style: normal; font-weight: 400; color: var(--text-secondary); }
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-size: 0.85rem; color: var(--text-secondary);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-primary); }
.nav-cta .btn { padding: 8px 18px; font-size: 0.83rem; }

@media (max-width: 768px) { .nav-links { display: none; } }

/* ===================== HERO ===================== */
.hero {
  padding: 160px 0 120px;
  position: relative;
  overflow: hidden;
  background: var(--ink-navy);
  color: var(--chalk);
}

/* Blueprint grid background */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--hairline-dark) 1px, transparent 1px),
    linear-gradient(90deg, var(--hairline-dark) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 40%, transparent 90%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 40%, transparent 90%);
  pointer-events: none;
  z-index: 0;
}

.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero-content {
  display: flex;
  flex-direction: column;
}
.hero-diagram {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--border-subtle);
  background: rgba(10, 25, 47, 0.3);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: inset 0 0 24px rgba(255, 122, 51, 0.02);
}
.schematic-svg {
  width: 100%;
  height: auto;
  max-width: 480px;
}

@media (max-width: 990px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    gap: 56px;
  }
  .hero-diagram {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
  }
}

.hero-eyebrow {
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--accent); letter-spacing: 0.06em;
  text-transform: uppercase; margin-bottom: 24px;
  display: flex; align-items: center; gap: 10px;
}
.hero-eyebrow::before {
  content: '';
  width: 24px; height: 1px;
  background: var(--accent);
}

.hero h1 {
  font-size: clamp(2.8rem, 5.5vw, 4.2rem);
  font-weight: 700; max-width: 14ch;
  margin-bottom: 24px;
}
.hero h1 span { color: var(--text-secondary); }

.hero-desc {
  font-size: 1.15rem; color: var(--text-secondary);
  max-width: 540px; margin-bottom: 40px;
  line-height: 1.7;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 64px; }

/* Proof strip */
.hero-proof {
  display: flex; gap: 40px; flex-wrap: wrap;
  padding-top: 40px; border-top: 1px solid var(--border-subtle);
}
.proof-item {
  font-size: 0.85rem; color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px;
}
.proof-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
}

/* ===================== SECTION UTILITY ===================== */
.section {
  padding: 120px 0;
}

.section-dark {
  background: var(--ink-navy);
  color: var(--chalk);
  border-top: 1px solid var(--hairline-dark);
  
  --surface-0: var(--ink-navy);
  --surface-1: var(--navy-panel-2);
  --surface-2: var(--navy-panel);
  --surface-3: #113660;
  --border: var(--navy-line);
  --border-subtle: var(--hairline-dark);
  --text-primary: var(--chalk);
  --text-secondary: var(--chalk-soft);
  --text-tertiary: var(--diazo-cyan);
  --accent: var(--amber);
  --accent-muted: rgba(255, 122, 51, 0.12);
  --accent-hover: var(--amber-dark);
}

.section-light {
  background: var(--linen);
  color: var(--graphite);
  border-top: 1px solid var(--hairline-light);
  
  --surface-0: var(--linen);
  --surface-1: var(--linen-card);
  --surface-2: var(--chalk);
  --surface-3: var(--chalk-soft);
  --border: var(--hairline-light);
  --border-subtle: rgba(24, 34, 51, 0.08);
  --text-primary: var(--graphite);
  --text-secondary: var(--graphite-soft);
  --text-tertiary: var(--graphite-soft);
  --accent: var(--amber-dark);
  --accent-muted: rgba(228, 99, 31, 0.12);
  --accent-hover: var(--amber);
}

.section-label {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--accent); letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 16px;
}

.section-heading {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600; margin-bottom: 16px;
  max-width: 20ch;
  color: var(--text-primary);
}

.section-desc {
  color: var(--text-secondary); font-size: 1rem;
  max-width: 520px; margin-bottom: 48px;
}

/* Terminal switcher tabs */
.terminal-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  margin-bottom: 24px;
}
.terminal-tab {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 8px 16px;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}
.terminal-tab.active {
  background: var(--accent);
  color: var(--surface-0);
}
.terminal-tab:hover:not(.active) { color: var(--text-primary); }

/* ===================== TERMINAL ===================== */
.terminal {
  max-width: 780px; margin: 0 auto;
  background: var(--navy-panel-2);
  border: 1px solid var(--navy-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.03),
    0 20px 60px rgba(0, 0, 0, 0.5);
}
.terminal-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  background: var(--navy-panel);
  border-bottom: 1px solid var(--navy-line);
}
.terminal-dots { display: flex; gap: 6px; }
.terminal-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--navy-panel-2);
}
.terminal-dots span:nth-child(1) { background: #FF5F57; }
.terminal-dots span:nth-child(2) { background: #FFBD2E; }
.terminal-dots span:nth-child(3) { background: #28C840; }

.terminal-title {
  flex: 1; text-align: center;
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--chalk-soft); letter-spacing: 0.02em;
}
.terminal-restart {
  color: var(--chalk-soft); cursor: pointer;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; transition: all 0.2s;
  background: none; border: none;
}
.terminal-restart:hover { color: var(--chalk); background: var(--navy-panel-2); }

.terminal-body {
  padding: 20px 22px; min-height: 360px; max-height: 400px;
  overflow-y: auto; font-family: var(--font-mono);
  font-size: 0.82rem; line-height: 1.8; color: var(--chalk);
}
.terminal-body::-webkit-scrollbar { width: 6px; }
.terminal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.t-line { white-space: pre-wrap; word-break: break-word; }
.t-prompt { color: var(--accent); }
.t-green { color: var(--green); }
.t-dim { color: var(--text-tertiary); }
.t-cyan { color: #67E8F9; }
.t-white { color: var(--text-primary); }

#t-cursor::after {
  content: '▋';
  animation: cursorBlink 1.1s step-start infinite;
  color: var(--accent);
}
@keyframes cursorBlink { 50% { opacity: 0; } }

/* ===================== TOOLS SECTION ===================== */
.tools-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.tool-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  transition: border-color 0.3s var(--ease-smooth);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}
.tool-card:hover { border-color: var(--text-tertiary); }

.tool-card.roadmap-card {
  border-style: dashed;
}

.tool-info {
  display: flex;
  flex-direction: column;
}

.tool-badge {
  font-family: var(--font-mono); font-size: 0.7rem;
  color: var(--accent); letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 20px;
  padding: 4px 10px;
  background: var(--accent-muted);
  border-radius: 4px;
  display: inline-block;
  align-self: flex-start;
}
.tool-card h3 {
  font-size: 1.6rem; font-weight: 600; margin-bottom: 16px;
  font-family: var(--font-display);
}
.tool-card p {
  color: var(--text-secondary); font-size: 0.98rem; line-height: 1.65;
  margin-bottom: 0;
  max-width: 48ch;
}
.tool-card code {
  word-break: break-all;
  white-space: pre-wrap;
}
.tool-features { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.tool-features li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.9rem; color: var(--text-secondary);
}
.tool-features li svg { color: var(--green); flex-shrink: 0; margin-top: 3px; }

@media (max-width: 900px) {
  .tool-card {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 36px 30px;
  }
}

/* ===================== CODE COMPARISON ===================== */
.comp-tabs {
  display: flex; gap: 4px; margin-bottom: 24px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 6px; padding: 4px;
  display: inline-flex;
}
.comp-tab-btn {
  font-family: var(--font-mono); font-size: 0.8rem;
  padding: 8px 16px; border-radius: 4px;
  background: transparent; border: none;
  color: var(--text-secondary); cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}
.comp-tab-btn.active {
  background: var(--surface-3);
  color: var(--text-primary);
}
.comp-tab-btn:hover:not(.active) { color: var(--text-primary); }

.comp-panel { display: none; }
.comp-panel.active { display: grid; grid-template-columns: 1fr 1fr; gap: 0; animation: compFade 0.3s var(--ease); }

.comp-block {
  background: var(--surface-1);
  border: 1px solid var(--border);
  overflow: hidden;
}
.comp-block:first-child { border-radius: var(--radius) 0 0 var(--radius); border-right: none; }
.comp-block:last-child { border-radius: 0 var(--radius) var(--radius) 0; }

.comp-block-header {
  font-family: var(--font-mono); font-size: 0.72rem;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-tertiary);
  background: var(--surface-2);
  letter-spacing: 0.02em;
}
.comp-block.after .comp-block-header {
  color: var(--green);
  background: var(--green-muted);
}

.comp-block pre {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  overflow-x: auto;
  color: var(--text-secondary);
}

@keyframes compFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .comp-panel.active { grid-template-columns: 1fr; }
  .comp-block:first-child { border-radius: var(--radius) var(--radius) 0 0; border-right: 1px solid var(--border); border-bottom: none; }
  .comp-block:last-child { border-radius: 0 0 var(--radius) var(--radius); }
}

/* ===================== PROCESS STEPS ===================== */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.step {
  padding: 36px 28px;
  border-right: 1px solid var(--border);
  position: relative;
  transition: background 0.3s var(--ease-smooth);
}
.step:last-child { border-right: none; }
.step:hover { background: var(--surface-1); }

.step-num {
  font-family: var(--font-display); font-size: 2.2rem;
  font-weight: 700; color: var(--border);
  margin-bottom: 20px;
  transition: color 0.3s var(--ease-smooth);
}
.step:hover .step-num { color: var(--accent); }

.step h3 {
  font-size: 1rem; font-weight: 600; margin-bottom: 8px;
}
.step p {
  font-size: 0.85rem; color: var(--text-secondary); line-height: 1.55;
}

@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } .step:nth-child(2) { border-right: none; } .step:nth-child(1), .step:nth-child(2) { border-bottom: 1px solid var(--border); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } .step { border-right: none; border-bottom: 1px solid var(--border); } .step:last-child { border-bottom: none; } }

/* ===================== PRICING ===================== */
/* Package selector tabs */
.pkg-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  margin-bottom: 32px;
  max-width: 100%;
  overflow-x: auto;
  white-space: nowrap;
  /* Hide scrollbar for clean aesthetic */
  scrollbar-width: none; /* Firefox */
}
.pkg-tabs::-webkit-scrollbar {
  display: none; /* Safari and Chrome */
}
.pkg-tab {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 8px 16px;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}
.pkg-tab.active {
  background: var(--accent);
  color: var(--surface-0);
}
.pkg-tab:hover:not(.active) { color: var(--text-primary); }

.pricing-grid {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.pricing-grid.active {
  display: grid;
  animation: compFade 0.3s var(--ease);
}
.price-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  display: flex; flex-direction: column;
  transition: border-color 0.3s var(--ease-smooth);
}
.price-card:hover { border-color: var(--text-tertiary); }
.price-card.highlight {
  border-color: var(--accent);
  position: relative;
}
.price-card.highlight::before {
  content: 'POPULAR';
  position: absolute; top: -11px; left: 32px;
  background: var(--accent); color: var(--surface-0);
  font-family: var(--font-mono); font-size: 0.65rem;
  font-weight: 700; letter-spacing: 0.06em;
  padding: 3px 10px; border-radius: 4px;
}

.price-tier {
  font-family: var(--font-mono); font-size: 0.78rem;
  color: var(--text-tertiary); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 16px;
}
.price-amount {
  font-family: var(--font-display); font-size: 3rem;
  font-weight: 700; margin-bottom: 4px;
}
.price-note {
  font-size: 0.85rem; color: var(--text-tertiary);
  margin-bottom: 28px; padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.price-list { list-style: none; margin-bottom: 32px; flex: 1; }
.price-list li {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 0.88rem; color: var(--text-secondary); padding: 7px 0;
}
.price-list li svg { color: var(--green); flex-shrink: 0; margin-top: 2px; }
.price-list strong { color: var(--text-primary); font-weight: 600; }

@media (max-width: 900px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 0 auto;
  }
}

/* ===================== FAQ ===================== */
.faq-list { max-width: 720px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  width: 100%; padding: 24px 0; display: flex;
  justify-content: space-between; align-items: center;
  background: none; border: none; cursor: pointer;
  text-align: left; gap: 16px;
  font-family: var(--font-body); font-size: 1rem;
  font-weight: 500; color: var(--text-primary);
  transition: color 0.2s;
}
.faq-q:hover { color: var(--accent); }
.faq-q svg {
  flex-shrink: 0; color: var(--text-tertiary);
  transition: transform 0.25s var(--ease);
}
.faq-item.open .faq-q svg { transform: rotate(45deg); }

.faq-a {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s var(--ease);
}
.faq-a p {
  padding: 0 0 24px; color: var(--text-secondary);
  font-size: 0.93rem; line-height: 1.7; max-width: 60ch;
}
.faq-a code { color: var(--accent); }

/* ===================== FOOTER ===================== */
.site-footer {
  padding: 64px 0 40px;
  border-top: 1px solid var(--border-subtle);
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr;
  gap: 40px; margin-bottom: 48px;
}
.footer-brand { font-size: 0.9rem; color: var(--text-secondary); margin-top: 12px; max-width: 36ch; }
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.footer-col h4 {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--text-tertiary); text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 16px;
}
.footer-col a {
  display: block; font-size: 0.88rem;
  color: var(--text-secondary); padding: 4px 0;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--text-primary); }

.footer-bottom {
  display: flex; justify-content: space-between;
  align-items: center; padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78rem; color: var(--text-tertiary);
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; }
}

/* ===================== SANDBOX ===================== */
.sandbox {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 
    0 0 0 1px rgba(255,255,255,0.03),
    0 20px 60px rgba(0, 0, 0, 0.4);
}
.sandbox-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.sandbox-dots { display: flex; gap: 6px; }
.sandbox-dots span {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border);
}
.sandbox-title {
  font-family: var(--font-mono); font-size: 0.72rem;
  color: var(--text-tertiary); letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sandbox-btn {
  display: inline-flex; align-items: center; gap: 6px;
}

.sandbox-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  height: 480px;
}
.sandbox-sidebar {
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  display: flex; flex-direction: column; gap: 4px;
}
.sidebar-title {
  font-family: var(--font-mono); font-size: 0.65rem;
  color: var(--text-tertiary); text-transform: uppercase;
  letter-spacing: 0.08em; padding: 0 20px 8px;
}
.sidebar-file {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px; font-size: 0.85rem;
  color: var(--text-secondary); cursor: pointer;
  transition: all 0.2s var(--ease-smooth);
}
.sidebar-file svg { color: var(--text-tertiary); opacity: 0.6; }
.sidebar-file:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}
.sidebar-file.active {
  background: var(--surface-3);
  color: var(--text-primary);
  font-weight: 500;
  border-left: 2px solid var(--accent);
  padding-left: 18px;
}

.sandbox-editors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-0);
}
.editor-pane {
  display: flex; flex-direction: column;
  height: 100%;
  position: relative;
}
.editor-pane.before {
  border-right: 1px solid var(--border);
}
.pane-header {
  font-family: var(--font-mono); font-size: 0.68rem;
  padding: 10px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: var(--text-tertiary);
}
.pane-body {
  flex: 1; padding: 20px; overflow: auto;
  position: relative;
}
.pane-body pre {
  margin: 0;
  font-family: var(--font-mono); font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* scan line sweep */
.scan-line {
  position: absolute; left: 0; right: 0; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 8px var(--accent);
  opacity: 0;
  pointer-events: none;
}
@keyframes sweep {
  0% { top: 0; opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
.scan-line.animating {
  animation: sweep 1.8s var(--ease-smooth) infinite;
}

/* Loader Overlay */
.loader-overlay {
  position: absolute; inset: 0;
  background: rgba(10, 27, 50, 0.95);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.3s var(--ease-smooth);
  z-index: 10;
}
.loader-overlay.hidden {
  opacity: 0; pointer-events: none;
}
.loader-status {
  font-family: var(--font-mono); font-size: 0.85rem;
  color: var(--accent);
  display: flex; align-items: center; gap: 10px;
}
.loader-status::before {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
.loader-status.idle::before {
  display: none;
}
.loader-status.idle {
  color: var(--text-secondary);
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .sandbox-layout { grid-template-columns: 1fr; height: auto; }
  .sandbox-sidebar { flex-direction: row; overflow-x: auto; padding: 10px; border-right: none; border-bottom: 1px solid var(--border); }
  .sidebar-title { display: none; }
  .sidebar-file { padding: 8px 16px; border-left: none !important; border-bottom: 2px solid transparent; }
  .sidebar-file.active { border-bottom-color: var(--accent); background: none; }
  .sandbox-editors { grid-template-columns: 1fr; height: 350px; }
  .editor-pane.before { border-right: none; border-bottom: 1px solid var(--border); }
}

/* ===================== SCROLL ANIMATION ===================== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger children */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0s; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 0.24s; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 0.32s; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 0.40s; }
