/* ============================================================
   ViewRefine.dev — IDE Editor + Component Lab Theme
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Editor palette */
  --bg-deep:        #0d1117;
  --bg-panel:       #161b22;
  --bg-surface:     #1c2128;
  --bg-hover:       #21262d;
  --bg-active:      #30363d;
  --border:         #30363d;
  --border-light:   #3d444d;
  --text-primary:   #e6edf3;
  --text-secondary: #8b949e;
  --text-muted:     #6e7681;
  --accent:         #58a6ff;
  --accent-hover:   #79c0ff;
  --green:          #3fb950;
  --green-dim:      #238636;
  --orange:         #d29922;
  --red:            #f85149;
  --purple:         #bc8cff;
  --cyan:           #39d2c0;
  --yellow:         #e3b341;

  /* Syntax highlight tokens */
  --syn-keyword:    #ff7b72;
  --syn-string:     #a5d6ff;
  --syn-func:       #d2a8ff;
  --syn-type:       #79c0ff;
  --syn-comment:    #6e7681;
  --syn-number:     #79c0ff;
  --syn-tag:        #7ee787;
  --syn-attr:       #d2a8ff;
  --syn-punct:      #8b949e;

  /* Typography */
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --nav-height: 44px;
  --container-max: 1280px;
  --section-gap: 100px;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; display: block; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* Selection */
::selection { background: rgba(88, 166, 255, .25); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: var(--bg-active); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-light); }

/* ============================================================
   Utilities
   ============================================================ */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ============================================================
   Top Navigation — "System Header"
   ============================================================ */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-height);
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-brand {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-primary); font-weight: 700;
  white-space: nowrap;
}
.nav-brand .version {
  font-size: 11px; color: var(--green);
  background: rgba(63,185,80,.12);
  padding: 1px 6px; border-radius: 4px;
}

.nav-links {
  display: flex; align-items: center; gap: 0;
  margin-left: 24px;
  list-style: none;
}
.nav-links li a {
  display: flex; align-items: center; gap: 6px;
  padding: 0 14px; height: var(--nav-height);
  color: var(--text-secondary);
  font-size: 13px;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s, background .2s;
}
.nav-links li a:hover,
.nav-links li a.active {
  color: var(--text-primary);
  background: rgba(255,255,255,.03);
}
.nav-links li a.active {
  border-bottom-color: var(--accent);
}
.nav-links li a svg { width: 15px; height: 15px; }

.nav-terminal {
  margin-left: auto;
  display: flex; align-items: center; gap: 12px;
}
.nav-terminal .status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(63,185,80,.5);
}
.terminal-login {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: all .2s;
}
.terminal-login:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(88,166,255,.06);
}
.terminal-login svg { width: 14px; height: 14px; }

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  background: none; border: none; color: var(--text-secondary);
  cursor: pointer; padding: 8px;
}
.nav-toggle svg { width: 20px; height: 20px; }

/* ============================================================
   Hero — Split-Screen Editor View
   ============================================================ */
.hero {
  padding-top: calc(var(--nav-height) + 60px);
  padding-bottom: 80px;
}

.hero-comment {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--syn-comment);
  margin-bottom: 8px;
}

.hero-title {
  font-family: var(--font-mono);
  font-size: clamp(28px, 4.5vw, 52px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--text-primary);
}
.hero-title .strike {
  text-decoration: line-through;
  color: var(--red);
  opacity: .7;
}
.hero-title .highlight {
  color: var(--green);
}

.hero-subtitle {
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--text-secondary);
  max-width: 720px;
  margin-bottom: 40px;
  line-height: 1.7;
}

/* Editor window frame */
.editor-window {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0,0,0,.3),
    0 16px 70px rgba(0,0,0,.45);
}

.editor-titlebar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.editor-dots {
  display: flex; gap: 6px;
}
.editor-dots span {
  width: 12px; height: 12px; border-radius: 50%;
}
.editor-dots span:nth-child(1) { background: #f85149; }
.editor-dots span:nth-child(2) { background: #d29922; }
.editor-dots span:nth-child(3) { background: #3fb950; }

.editor-tabs {
  display: flex; gap: 0; margin-left: 12px;
}
.editor-tab {
  padding: 4px 14px;
  border-radius: 6px 6px 0 0;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
}
.editor-tab.active {
  background: var(--bg-panel);
  color: var(--text-primary);
}
.editor-tab .tab-lang {
  display: inline-block;
  margin-left: 6px;
  font-size: 10px;
  color: var(--syn-type);
  opacity: .7;
}

.editor-body {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  min-height: 340px;
}

/* Left panel — Visual Input */
.panel-input {
  padding: 24px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.panel-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--syn-comment);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.dropzone {
  flex: 1;
  border: 2px dashed var(--border-light);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  cursor: pointer;
  transition: all .3s;
  background: rgba(255,255,255,.01);
}
.dropzone:hover {
  border-color: var(--accent);
  background: rgba(88,166,255,.04);
}
.dropzone svg {
  width: 40px; height: 40px;
  color: var(--text-muted);
}
.dropzone p {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}
.dropzone .formats {
  font-size: 11px;
  color: var(--text-muted);
  opacity: .6;
}

/* Center — AI Processing */
.panel-process {
  width: 260px;
  padding: 24px 20px;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-right: 1px solid var(--border);
}
.process-line {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.process-line .chevron {
  color: var(--green);
  flex-shrink: 0;
}
.process-line.done { color: var(--green); }
.process-line.active { color: var(--orange); }
.cursor-blink::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: var(--accent);
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Right panel — Code Output */
.panel-output {
  padding: 0;
  position: relative;
}
.panel-output pre {
  margin: 0;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  overflow-x: auto;
  height: 100%;
}
.panel-output .line-numbers {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 40px;
  padding: 20px 8px 20px 0;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-muted);
  user-select: none;
  border-right: 1px solid var(--border);
}
.panel-output pre code {
  display: block;
  padding-left: 48px;
}

/* Syntax tokens */
.kw  { color: var(--syn-keyword); }
.fn  { color: var(--syn-func); }
.str { color: var(--syn-string); }
.ty  { color: var(--syn-type); }
.cm  { color: var(--syn-comment); }
.num { color: var(--syn-number); }
.tag { color: var(--syn-tag); }
.at  { color: var(--syn-attr); }
.pn  { color: var(--syn-punct); }

/* Hero CTA row */
.hero-cta-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  background: var(--green-dim);
  border: 1px solid var(--green);
  border-radius: 8px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.btn-primary:hover {
  background: var(--green);
  color: #fff;
  box-shadow: 0 0 20px rgba(63,185,80,.25);
}
.btn-primary svg { width: 16px; height: 16px; }

.install-cmd {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all .2s;
  user-select: all;
}
.install-cmd:hover {
  border-color: var(--border-light);
  background: var(--bg-hover);
}
.install-cmd .dollar { color: var(--green); user-select: none; }

/* ============================================================
   Section — Generic
   ============================================================ */
section {
  padding: 80px 0;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-mono);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}

.section-desc {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 640px;
  margin-bottom: 48px;
  line-height: 1.7;
}

/* ============================================================
   Tech Specs — 4 Cards
   ============================================================ */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.spec-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px;
  transition: all .3s;
  position: relative;
  overflow: hidden;
}
.spec-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  opacity: 0;
  transition: opacity .3s;
}
.spec-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0,0,0,.3);
}
.spec-card:hover::before { opacity: 1; }

.spec-card:nth-child(1)::before { background: linear-gradient(90deg, var(--accent), var(--cyan)); }
.spec-card:nth-child(2)::before { background: linear-gradient(90deg, var(--purple), var(--accent)); }
.spec-card:nth-child(3)::before { background: linear-gradient(90deg, var(--green), var(--cyan)); }
.spec-card:nth-child(4)::before { background: linear-gradient(90deg, var(--orange), var(--red)); }

.spec-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 20px;
}
.spec-card:nth-child(1) .spec-icon { background: rgba(88,166,255,.12); color: var(--accent); }
.spec-card:nth-child(2) .spec-icon { background: rgba(188,140,255,.12); color: var(--purple); }
.spec-card:nth-child(3) .spec-icon { background: rgba(63,185,80,.12); color: var(--green); }
.spec-card:nth-child(4) .spec-icon { background: rgba(210,153,34,.12); color: var(--orange); }

.spec-card h3 {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}
.spec-card .spec-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-surface);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
}
.spec-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================================
   Workflow — 3 Steps
   ============================================================ */
.workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  position: relative;
}

/* connector line */
.workflow-steps::before {
  content: '';
  position: absolute;
  top: 44px;
  left: calc(16.66% + 24px);
  right: calc(16.66% + 24px);
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.step-card {
  text-align: center;
  position: relative;
  z-index: 1;
}

.step-number {
  width: 48px; height: 48px;
  display: inline-flex;
  align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  border-radius: 50%;
  margin-bottom: 20px;
  border: 2px solid var(--border);
  background: var(--bg-panel);
  color: var(--accent);
  transition: all .3s;
}
.step-card:hover .step-number {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(88,166,255,.2);
}

.step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  margin: 0 auto 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.step-icon svg { width: 28px; height: 28px; color: var(--accent); }

.step-card h3 {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}
.step-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto;
}

/* ============================================================
   Social Proof — Lab Logs
   ============================================================ */
.proof-section {
  background: var(--bg-panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.proof-terminal {
  max-width: 800px;
  margin: 0 auto;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.proof-terminal-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.proof-terminal-bar .dots { display: flex; gap: 5px; }
.proof-terminal-bar .dots span {
  width: 10px; height: 10px; border-radius: 50%;
}
.proof-terminal-bar .dots span:nth-child(1) { background: var(--red); }
.proof-terminal-bar .dots span:nth-child(2) { background: var(--orange); }
.proof-terminal-bar .dots span:nth-child(3) { background: var(--green); }

.proof-body {
  padding: 28px 32px;
}
.proof-body .log-entry {
  margin-bottom: 28px;
}
.proof-body .log-entry:last-child { margin-bottom: 0; }
.proof-body .log-header {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.proof-body .log-header .timestamp { color: var(--cyan); }
.proof-body .log-header .level { color: var(--green); }
.proof-body blockquote {
  font-size: 16px;
  color: var(--text-primary);
  line-height: 1.7;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
  font-style: italic;
}
.proof-body .log-author {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
}

/* ============================================================
   Final CTA
   ============================================================ */
.cta-section {
  text-align: center;
  padding: 100px 24px;
}
.cta-section .cta-title {
  font-family: var(--font-mono);
  font-size: clamp(24px, 3.5vw, 40px);
  font-weight: 700;
  margin-bottom: 16px;
}
.cta-section .cta-desc {
  font-size: 17px;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 32px;
  line-height: 1.7;
}
.cta-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.btn-outline {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 14px;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  background: transparent;
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: rgba(88,166,255,.05);
}
.btn-outline svg, .btn-primary svg { width: 16px; height: 16px; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-links {
  display: flex; gap: 20px; list-style: none;
}
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text-primary); }

/* ============================================================
   Subpage: Components Library
   ============================================================ */
.page-header {
  padding-top: calc(var(--nav-height) + 40px);
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
}

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

.sidebar {
  border-right: 1px solid var(--border);
  padding: 24px 0;
  background: var(--bg-panel);
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
}
.sidebar-group { margin-bottom: 24px; }
.sidebar-group-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 0 20px;
  margin-bottom: 8px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all .15s;
}
.sidebar-link:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,.03);
}
.sidebar-link.active {
  color: var(--accent);
  background: rgba(88,166,255,.08);
  border-right: 2px solid var(--accent);
}
.sidebar-link svg { width: 14px; height: 14px; opacity: .6; }

.comp-main {
  padding: 40px;
}

.comp-demo {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}
.comp-demo-preview {
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 120px;
  border-bottom: 1px solid var(--border);
}
.comp-demo-code {
  padding: 20px;
  background: var(--bg-deep);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
}

/* Demo buttons */
.demo-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
}
.demo-btn--primary {
  background: var(--accent);
  color: #fff;
}
.demo-btn--primary:hover { background: var(--accent-hover); }
.demo-btn--secondary {
  background: var(--bg-active);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.demo-btn--secondary:hover { background: var(--bg-hover); border-color: var(--border-light); }
.demo-btn--danger {
  background: rgba(248,81,73,.15);
  color: var(--red);
  border: 1px solid rgba(248,81,73,.3);
}
.demo-btn--danger:hover { background: rgba(248,81,73,.25); }
.demo-btn--ghost {
  background: transparent;
  color: var(--text-secondary);
}
.demo-btn--ghost:hover { color: var(--text-primary); background: rgba(255,255,255,.05); }

/* Demo inputs */
.demo-input {
  padding: 10px 14px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  transition: border-color .2s;
  width: 260px;
}
.demo-input:focus { border-color: var(--accent); }
.demo-input::placeholder { color: var(--text-muted); }

/* Demo badge / tag */
.demo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}
.demo-badge--green { background: rgba(63,185,80,.15); color: var(--green); }
.demo-badge--blue  { background: rgba(88,166,255,.15); color: var(--accent); }
.demo-badge--orange { background: rgba(210,153,34,.15); color: var(--orange); }
.demo-badge--red   { background: rgba(248,81,73,.15); color: var(--red); }

/* Demo card */
.demo-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  max-width: 320px;
  width: 100%;
}
.demo-card h4 {
  font-family: var(--font-mono);
  font-size: 15px;
  margin-bottom: 6px;
}
.demo-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

/* ============================================================
   Subpage: Lab (Playground)
   ============================================================ */
.lab-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - var(--nav-height));
  margin-top: var(--nav-height);
}
.lab-panel {
  display: flex;
  flex-direction: column;
}
.lab-panel--input {
  border-right: 1px solid var(--border);
  background: var(--bg-panel);
}
.lab-panel--output {
  background: var(--bg-deep);
}
.lab-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-surface);
}
.lab-panel-header .lang-badge {
  font-size: 11px;
  color: var(--syn-type);
  background: rgba(121,192,255,.1);
  padding: 2px 8px;
  border-radius: 4px;
}
.lab-textarea {
  flex: 1;
  resize: none;
  border: none;
  outline: none;
  padding: 20px;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.7;
}
.lab-textarea::placeholder { color: var(--text-muted); }

.lab-output-code {
  flex: 1;
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  overflow: auto;
  white-space: pre;
}

.lab-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}
.lab-select {
  padding: 6px 10px;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: none;
  cursor: pointer;
}
.lab-btn {
  padding: 8px 18px;
  background: var(--green-dim);
  border: 1px solid var(--green);
  border-radius: 6px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  margin-left: auto;
}
.lab-btn:hover {
  background: var(--green);
  box-shadow: 0 0 16px rgba(63,185,80,.25);
}

/* ============================================================
   Subpage: Files (File Explorer)
   ============================================================ */
.files-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: calc(100vh - var(--nav-height));
  margin-top: var(--nav-height);
}
.files-sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  overflow-y: auto;
}
.files-tree-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 0 16px;
  margin-bottom: 12px;
}
.tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 16px 5px 24px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}
.tree-item:hover {
  background: rgba(255,255,255,.03);
  color: var(--text-primary);
}
.tree-item.active {
  background: rgba(88,166,255,.08);
  color: var(--accent);
}
.tree-item svg { width: 14px; height: 14px; flex-shrink: 0; }
.tree-item--folder svg { color: var(--accent); }
.tree-item--file svg { color: var(--text-muted); }
.tree-item--indent { padding-left: 44px; }

.files-content {
  background: var(--bg-deep);
  padding: 0;
  overflow: auto;
}
.file-viewer-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}
.file-viewer-code {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  white-space: pre;
  overflow-x: auto;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .editor-body { grid-template-columns: 1fr; }
  .panel-process { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  .panel-input { border-right: none; border-bottom: 1px solid var(--border); }
  .workflow-steps { grid-template-columns: 1fr; gap: 32px; }
  .workflow-steps::before { display: none; }
  .components-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .lab-layout { grid-template-columns: 1fr; }
  .lab-panel--input { border-right: none; border-bottom: 1px solid var(--border); min-height: 40vh; }
  .lab-panel--output { min-height: 40vh; }
  .files-layout { grid-template-columns: 1fr; }
  .files-sidebar { display: none; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: var(--nav-height); left: 0; right: 0;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
  }
  .nav-links.open li a {
    height: auto; padding: 12px 20px;
    border-bottom: none;
  }
  .hero { padding-top: calc(var(--nav-height) + 32px); padding-bottom: 48px; }
  .hero-cta-row { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in {
  opacity: 0;
  animation: fadeInUp .6s ease forwards;
}
.fade-in-d1 { animation-delay: .1s; }
.fade-in-d2 { animation-delay: .2s; }
.fade-in-d3 { animation-delay: .3s; }
.fade-in-d4 { animation-delay: .4s; }

/* Glow effect on editor window */
.editor-glow {
  position: relative;
}
.editor-glow::after {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px; bottom: -1px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(88,166,255,.15), rgba(188,140,255,.1), rgba(63,185,80,.1));
  z-index: -1;
  filter: blur(20px);
  opacity: .4;
}
