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

:root {
  --bg-primary: #06060f;
  --bg-secondary: #0c0c1d;
  --bg-tertiary: #13132b;
  --surface: rgba(255,255,255,0.04);
  --surface-hover: rgba(255,255,255,0.08);
  --surface-active: rgba(255,255,255,0.12);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);
  --text-primary: #f0f0f5;
  --text-secondary: #8888a8;
  --text-muted: #55556a;
  --accent: #6c5ce7;
  --accent-light: #a29bfe;
  --cyan: #00cec9;
  --cyan-glow: rgba(0,206,201,0.3);
  --green: #00e676;
  --green-glow: rgba(0,230,118,0.25);
  --orange: #fdcb6e;
  --red: #ff6b6b;
  --pink: #fd79a8;
  --gradient-1: linear-gradient(135deg, #6c5ce7, #00cec9);
  --gradient-2: linear-gradient(135deg, #fd79a8, #6c5ce7);
  --gradient-3: linear-gradient(135deg, #00cec9, #00e676);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px rgba(108,92,231,0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ===== NAVIGATION ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: 16px 40px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(6,6,15,0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.navbar.scrolled { padding: 10px 40px; background: rgba(6,6,15,0.95); }
.nav-brand {
  font-size: 1.3rem; font-weight: 800;
  background: var(--gradient-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}
.nav-links { display: flex; gap: 8px; list-style: none; }
.nav-links a {
  text-decoration: none; color: var(--text-secondary);
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 500;
  transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  color: var(--text-primary); background: var(--surface);
}

/* ===== HERO ===== */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; padding: 100px 40px 60px;
}
.hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(108,92,231,0.12) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(0,206,201,0.08) 0%, transparent 60%);
}
.hero-content { position: relative; z-index: 1; text-align: center; max-width: 800px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 50px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.8rem; color: var(--cyan); font-weight: 500;
  margin-bottom: 24px;
}
.hero-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}
.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 900;
  line-height: 1.1; letter-spacing: -2px; margin-bottom: 20px;
}
.hero h1 span {
  background: var(--gradient-1); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { font-size: 1.1rem; color: var(--text-secondary); max-width: 600px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; border: none; transition: var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--gradient-1); color: white;
  box-shadow: 0 4px 20px rgba(108,92,231,0.3);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(108,92,231,0.4); }
.btn-secondary {
  background: var(--surface); color: var(--text-primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-hover); border-color: var(--border-hover); }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-icon {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); background: var(--surface);
  border: 1px solid var(--border); color: var(--text-secondary);
  cursor: pointer; transition: var(--transition);
}
.btn-icon:hover { background: var(--surface-hover); color: var(--text-primary); }

/* ===== SECTIONS ===== */
.section {
  padding: 80px 40px; max-width: 1300px; margin: 0 auto;
}
.section-header { text-align: center; margin-bottom: 48px; }
.section-label {
  display: inline-block; font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--cyan); margin-bottom: 12px;
}
.section-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem); font-weight: 800;
  letter-spacing: -1px; margin-bottom: 12px;
}
.section-desc { color: var(--text-secondary); max-width: 600px; margin: 0 auto; }

/* ===== CARDS / GLASS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(10px);
  transition: var(--transition);
}
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-glow); }

/* ===== NETWORK BUILDER ===== */
.builder-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  min-height: 600px;
}
.builder-sidebar { display: flex; flex-direction: column; gap: 16px; }
.builder-canvas-wrap {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.builder-canvas-wrap canvas {
  display: block; width: 100%; height: 100%;
}

/* Controls */
.control-group { margin-bottom: 16px; }
.control-group label {
  display: block; font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-secondary); margin-bottom: 8px;
}
.control-row { display: flex; gap: 8px; align-items: center; }

input[type="number"], select {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-family: inherit; font-size: 0.85rem;
  width: 100%;
  transition: var(--transition);
  outline: none;
}
input[type="number"]:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,92,231,0.2);
}
select { cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238888a8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Layer list */
.layer-list { display: flex; flex-direction: column; gap: 8px; }
.layer-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  transition: var(--transition);
}
.layer-item:hover { border-color: var(--border-hover); }
.layer-item .layer-type {
  font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 2px 8px; border-radius: 4px;
  flex-shrink: 0;
}
.layer-item .layer-type.input { background: rgba(0,206,201,0.15); color: var(--cyan); }
.layer-item .layer-type.hidden { background: rgba(108,92,231,0.15); color: var(--accent-light); }
.layer-item .layer-type.output { background: rgba(0,230,118,0.15); color: var(--green); }
.layer-item .layer-info { flex: 1; }
.layer-item .layer-info span { color: var(--text-secondary); font-size: 0.75rem; }
.layer-item input[type="number"] { width: 60px; padding: 6px 8px; text-align: center; }
.layer-item .btn-icon { width: 28px; height: 28px; font-size: 0.75rem; }

/* ===== COMPUTATION DISPLAY ===== */
.computation-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.step-list { display: flex; flex-direction: column; gap: 12px; max-height: 500px; overflow-y: auto; padding-right: 8px; }
.step-card {
  padding: 16px; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition);
}
.step-card:hover, .step-card.active {
  border-color: var(--accent); background: rgba(108,92,231,0.05);
}
.step-card .step-num {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--accent-light); margin-bottom: 6px;
}
.step-card .step-title { font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.step-card .step-desc { font-size: 0.8rem; color: var(--text-secondary); }

.math-display {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  font-family: 'JetBrains Mono', monospace;
  overflow: auto;
}
.math-display .matrix-label {
  font-size: 0.7rem; color: var(--cyan);
  text-transform: uppercase; letter-spacing: 1px;
  margin-bottom: 8px; font-family: 'Inter', sans-serif; font-weight: 600;
}
.matrix {
  display: inline-flex; flex-direction: column; gap: 4px;
  padding: 12px; margin: 8px 4px;
  border-left: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  border-radius: 2px;
  position: relative;
}
.matrix-row { display: flex; gap: 16px; }
.matrix-row span {
  min-width: 50px; text-align: right;
  font-size: 0.8rem; color: var(--text-primary);
}
.math-op {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: var(--accent-light);
  margin: 0 8px; vertical-align: middle;
}
.math-eq { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 20px; }
.result-highlight { color: var(--green) !important; font-weight: 600; }

/* ===== ACTIVATION EXPLORER ===== */
.activation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.activation-card {
  padding: 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  cursor: pointer; transition: var(--transition);
}
.activation-card:hover, .activation-card.active {
  border-color: var(--cyan); box-shadow: 0 0 20px var(--cyan-glow);
}
.activation-card h4 { font-size: 0.95rem; margin-bottom: 4px; }
.activation-card .formula {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem; color: var(--cyan); margin-bottom: 12px;
}
.activation-card canvas { width: 100%; height: 120px; border-radius: var(--radius-sm); }

/* ===== TRAINING PLAYGROUND ===== */
.playground-layout {
  display: grid; grid-template-columns: 280px 1fr 280px; gap: 24px;
}
.playground-viz {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative; overflow: hidden;
  aspect-ratio: 1;
}
.playground-viz canvas { width: 100%; height: 100%; }
.training-stats { display: flex; flex-direction: column; gap: 12px; }
.stat-card {
  padding: 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md);
}
.stat-card .stat-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-secondary); margin-bottom: 4px;
}
.stat-card .stat-value {
  font-size: 1.4rem; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.stat-card .stat-value.green { color: var(--green); }
.stat-card .stat-value.cyan { color: var(--cyan); }
.stat-card .stat-value.orange { color: var(--orange); }
.loss-chart-wrap {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px; margin-top: auto;
}
.loss-chart-wrap canvas { width: 100%; height: 150px; }

/* Dataset selector */
.dataset-selector { display: flex; gap: 8px; margin-bottom: 16px; }
.dataset-btn {
  flex: 1; padding: 10px; text-align: center;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  font-size: 0.75rem; font-weight: 600; color: var(--text-secondary);
  transition: var(--transition);
}
.dataset-btn:hover { border-color: var(--border-hover); color: var(--text-primary); }
.dataset-btn.active { border-color: var(--cyan); color: var(--cyan); background: rgba(0,206,201,0.05); }

/* Training controls */
.training-controls { display: flex; gap: 8px; margin-top: 12px; }

/* ===== CONCEPTS GRID ===== */
.concepts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.concept-card {
  padding: 28px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: var(--transition); position: relative; overflow: hidden;
}
.concept-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient-1); opacity: 0; transition: var(--transition);
}
.concept-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.concept-card:hover::before { opacity: 1; }
.concept-card .concept-icon {
  width: 48px; height: 48px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; margin-bottom: 16px;
}
.concept-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.concept-card p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; }

/* Icon BGs */
.icon-purple { background: rgba(108,92,231,0.15); }
.icon-cyan { background: rgba(0,206,201,0.15); }
.icon-green { background: rgba(0,230,118,0.15); }
.icon-pink { background: rgba(253,121,168,0.15); }
.icon-orange { background: rgba(253,203,110,0.15); }

/* ===== TABS ===== */
.tabs { display: flex; gap: 4px; margin-bottom: 24px; }
.tab-btn {
  padding: 10px 20px; background: transparent;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-family: inherit;
  font-size: 0.85rem; font-weight: 500; cursor: pointer;
  transition: var(--transition);
}
.tab-btn:hover { color: var(--text-primary); background: var(--surface); }
.tab-btn.active {
  color: var(--text-primary); background: var(--surface);
  border-color: var(--border);
}
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ===== RANGE SLIDER ===== */
input[type="range"] {
  -webkit-appearance: none; width: 100%; height: 4px;
  background: var(--bg-secondary); border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px;
  border-radius: 50%; background: var(--accent);
  cursor: pointer; box-shadow: 0 0 10px rgba(108,92,231,0.4);
}
.range-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.range-row label { flex: 1; font-size: 0.8rem; color: var(--text-secondary); }
.range-row .range-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem; color: var(--cyan);
  min-width: 50px; text-align: right;
}

/* ===== FOOTER ===== */
.footer {
  text-align: center; padding: 40px;
  border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.8rem;
}

/* ===== TOOLTIP ===== */
.tooltip {
  position: absolute; padding: 8px 12px;
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.75rem;
  color: var(--text-primary); pointer-events: none;
  box-shadow: var(--shadow); z-index: 100;
  white-space: nowrap; opacity: 0; transition: opacity 0.2s;
}
.tooltip.show { opacity: 1; }

/* ===== ANIMATED BACKGROUND PARTICLES ===== */
#hero-canvas {
  position: absolute; inset: 0; z-index: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .builder-layout { grid-template-columns: 1fr; }
  .builder-canvas-wrap { min-height: 400px; }
  .computation-panel { grid-template-columns: 1fr; }
  .playground-layout { grid-template-columns: 1fr; }
  .playground-viz { aspect-ratio: auto; min-height: 350px; }
}
@media (max-width: 768px) {
  .navbar { padding: 12px 20px; }
  .nav-links { display: none; }
  .section { padding: 60px 20px; }
  .hero { padding: 80px 20px 40px; }
  .hero-actions { flex-direction: column; align-items: center; }
}

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 40px; }
.timeline::before {
  content: ''; position: absolute; left: 12px; top: 0; bottom: 0;
  width: 2px; background: linear-gradient(to bottom, var(--accent), var(--cyan), var(--green));
}
.timeline-item { position: relative; margin-bottom: 32px; }
.timeline-item::before {
  content: ''; position: absolute; left: -34px; top: 18px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--bg-primary);
  box-shadow: 0 0 12px rgba(108,92,231,0.5);
}
.timeline-year {
  font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
  font-weight: 700; color: var(--cyan); margin-bottom: 8px;
  letter-spacing: 1px;
}
.timeline-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  transition: var(--transition);
}
.timeline-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-glow); }
.timeline-card-header {
  display: flex; align-items: center; gap: 16px; margin-bottom: 12px;
}
.pioneer-photo {
  width: 56px; height: 56px; border-radius: var(--radius-md);
  object-fit: cover; flex-shrink: 0;
  background: var(--bg-tertiary); border: 1px solid var(--border);
}
.pioneer-name {
  font-size: 0.8rem; color: var(--text-secondary); display: block; margin-top: 2px;
}
.timeline-card h3 { font-size: 1rem; font-weight: 700; }
.timeline-card p { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 10px; }
.paper-link {
  display: inline-block; font-size: 0.78rem; color: var(--cyan);
  text-decoration: none; padding: 6px 12px;
  background: rgba(0,206,201,0.08); border: 1px solid rgba(0,206,201,0.15);
  border-radius: var(--radius-sm); transition: var(--transition);
  word-break: break-all;
}
.paper-link:hover { background: rgba(0,206,201,0.15); border-color: var(--cyan); }

/* ===== ARCHITECTURE ACCORDION ===== */
.arch-accordion { display: flex; flex-direction: column; gap: 12px; }
.arch-item { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition); }
.arch-item:hover { border-color: var(--border-hover); }
.arch-header {
  display: flex; align-items: center; gap: 16px; width: 100%;
  padding: 20px 24px; background: var(--surface); border: none;
  color: var(--text-primary); font-family: inherit; cursor: pointer;
  text-align: left; transition: var(--transition);
}
.arch-header:hover { background: var(--surface-hover); }
.arch-num {
  font-family: 'JetBrains Mono', monospace; font-size: 0.75rem;
  font-weight: 700; color: var(--accent-light); flex-shrink: 0;
  width: 32px; height: 32px; display: flex; align-items: center;
  justify-content: center; background: rgba(108,92,231,0.15);
  border-radius: var(--radius-sm);
}
.arch-header h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.arch-sub { font-size: 0.8rem; color: var(--text-secondary); }
.arch-toggle {
  margin-left: auto; font-size: 1.2rem; color: var(--text-secondary);
  transition: var(--transition); flex-shrink: 0;
}
.arch-item.open .arch-toggle { transform: rotate(45deg); }
.arch-body {
  max-height: 0; overflow: hidden; transition: max-height 0.4s ease;
}
.arch-item.open .arch-body { max-height: 1200px; }
.arch-content {
  padding: 0 24px 24px;
  font-size: 0.9rem; color: var(--text-secondary); line-height: 1.8;
}
.arch-content h4 { color: var(--text-primary); margin-bottom: 8px; font-size: 0.95rem; }
.arch-content ul, .arch-content ol { margin: 8px 0 8px 20px; }
.arch-content li { margin-bottom: 6px; }
.arch-content p { margin-bottom: 8px; }
.arch-formula {
  font-family: 'JetBrains Mono', monospace; font-size: 0.85rem;
  color: var(--cyan); padding: 12px 16px; margin: 12px 0;
  background: rgba(0,206,201,0.06); border: 1px solid rgba(0,206,201,0.12);
  border-radius: var(--radius-sm); text-align: center;
}

