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

/* ═══════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════ */
:root {
  --bg-primary: #060a14;
  --bg-secondary: #0d1321;
  --bg-tertiary: #131b2e;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-hover: rgba(255, 255, 255, 0.06);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-hover: rgba(255, 255, 255, 0.15);

  --text-primary: #e8edf5;
  --text-secondary: #8892b0;
  --text-muted: #4a5568;

  --accent-green: #00ff88;
  --accent-green-dim: rgba(0, 255, 136, 0.15);
  --accent-cyan: #00d4ff;
  --accent-cyan-dim: rgba(0, 212, 255, 0.15);
  --accent-purple: #a78bfa;
  --accent-purple-dim: rgba(167, 139, 250, 0.15);
  --danger: #ff3366;
  --danger-dim: rgba(255, 51, 102, 0.15);
  --warning: #ffaa00;
  --warning-dim: rgba(255, 170, 0, 0.15);

  --gradient-main: linear-gradient(135deg, #00ff88, #00d4ff);
  --gradient-alt: linear-gradient(135deg, #a78bfa, #00d4ff);
  --gradient-danger: linear-gradient(135deg, #ff3366, #ff6b6b);
  --gradient-bg: linear-gradient(180deg, #060a14 0%, #0d1321 50%, #060a14 100%);

  --glow-green: 0 0 40px rgba(0, 255, 136, 0.2), 0 0 80px rgba(0, 255, 136, 0.05);
  --glow-cyan: 0 0 40px rgba(0, 212, 255, 0.2), 0 0 80px rgba(0, 212, 255, 0.05);
  --glow-danger: 0 0 40px rgba(255, 51, 102, 0.25);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

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

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.75;
  overflow-x: hidden;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 800px 600px at 20% 10%, rgba(0, 255, 136, 0.04), transparent),
    radial-gradient(ellipse 600px 500px at 80% 80%, rgba(0, 212, 255, 0.03), transparent),
    radial-gradient(ellipse 500px 400px at 50% 50%, rgba(167, 139, 250, 0.02), transparent);
  pointer-events: none;
  z-index: 0;
}

::selection {
  background: rgba(0, 255, 136, 0.3);
  color: #fff;
}

a { color: var(--accent-cyan); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-green); }

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

/* ═══════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════ */
#main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: rgba(6, 10, 20, 0.8);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border-glass);
  transition: background var(--transition-base);
}

.nav-brand {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-links a {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-glass-hover);
}

/* ═══════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════ */
.gradient-text {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════
   HERO SECTION
   ═══════════════════════════════════════ */
.hero-section {
  position: relative;
  z-index: 1;
  padding: 7rem 2rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
}

.hero-content {
  text-align: center;
  margin-bottom: 4rem;
}

.hero-badge {
  display: inline-block;
  padding: 0.35rem 1.1rem;
  border-radius: var(--radius-full);
  background: var(--accent-green-dim);
  border: 1px solid rgba(0, 255, 136, 0.2);
  color: var(--accent-green);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  animation: badge-pulse 3s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.15); }
  50% { box-shadow: 0 0 20px 4px rgba(0, 255, 136, 0.08); }
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.04em;
  margin-bottom: 1.25rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.8;
}

/* Theory Cards */
.theory-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.theory-card {
  position: relative;
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
  transition: all var(--transition-base);
  overflow: hidden;
}

.theory-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-danger);
  opacity: 0.7;
}

.theory-card.highlight::before {
  background: var(--gradient-main);
  height: 3px;
  opacity: 1;
}

.theory-card:hover {
  border-color: var(--border-glass-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.theory-card.highlight {
  border-color: rgba(0, 255, 136, 0.15);
  box-shadow: var(--glow-green);
}

.theory-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.theory-card .card-icon {
  font-size: 1.4rem;
}

.theory-card .math-block {
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  margin: 1rem 0;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  overflow-x: auto;
}

.theory-card .card-note {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-glass);
}

.theory-card .card-note strong {
  color: var(--danger);
}

.theory-card.highlight .card-note strong {
  color: var(--accent-green);
}

/* ε-δ Visualization */
.viz-container {
  margin-bottom: 2rem;
}

.viz-container h2 {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.5rem;
}

.canvas-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.canvas-container canvas {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.3);
  max-width: 100%;
  height: auto;
}

.viz-controls {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════
   SIMULATION SECTION
   ═══════════════════════════════════════ */
.simulation-section {
  position: relative;
  z-index: 1;
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.simulation-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  margin-bottom: 2rem;
  align-items: start;
}

.canvas-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  background: #000;
}

.canvas-wrapper canvas {
  display: block;
  width: 100%;
  height: auto;
}

.canvas-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  transition: opacity var(--transition-base);
  pointer-events: none;
}

.canvas-overlay.hidden {
  opacity: 0;
}

.overlay-text {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-glass);
}

/* Controls Panel */
.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
}

.controls-panel h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.75rem;
}

/* Mode Toggle */
.toggle-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-btn .mode-icon {
  font-size: 1.3rem;
}

.mode-btn:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass-hover);
}

.mode-btn.active {
  border-color: rgba(0, 255, 136, 0.3);
  background: var(--accent-green-dim);
  color: var(--accent-green);
  box-shadow: 0 0 20px rgba(0, 255, 136, 0.1);
}

.mode-btn.active.danger {
  border-color: rgba(255, 51, 102, 0.3);
  background: var(--danger-dim);
  color: var(--danger);
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.1);
}

/* Control Group */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.control-group label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.control-group label span {
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* Custom Slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  cursor: pointer;
  transition: background var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
  cursor: pointer;
  transition: all var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.6);
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
  cursor: pointer;
}

/* Info Row */
.info-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  flex-direction: row;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
}

.info-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.info-value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-green);
}

/* Buttons */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-main);
  color: #000;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0, 255, 136, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px rgba(0, 255, 136, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 0.95rem;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glass-hover);
  color: var(--text-primary);
}

.btn-outline.active {
  background: var(--accent-cyan-dim);
  border-color: rgba(0, 212, 255, 0.3);
  color: var(--accent-cyan);
}

.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.btn-ghost:hover {
  color: var(--text-secondary);
  background: var(--bg-glass);
}

.btn-danger-outline {
  background: transparent;
  border: 1px solid rgba(255, 51, 102, 0.3);
  color: var(--danger);
}

.btn-danger-outline:hover {
  background: var(--danger-dim);
}

/* Stats Panel */
.stats-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1.25rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
  transition: all var(--transition-base);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-item.hit .stat-value { color: var(--accent-green); }
.stat-item.miss .stat-value { color: var(--danger); }
.stat-item.rate .stat-value { color: var(--accent-cyan); }

.stat-item.hit { border-color: rgba(0, 255, 136, 0.1); }
.stat-item.miss { border-color: rgba(255, 51, 102, 0.1); }
.stat-item.rate { border-color: rgba(0, 212, 255, 0.1); }

/* ═══════════════════════════════════════
   PROOF SECTION
   ═══════════════════════════════════════ */
.proof-section {
  position: relative;
  z-index: 1;
  padding: 5rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}

.proof-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.proof-step {
  padding: 1.75rem 2rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-left: 3px solid var(--accent-cyan);
  backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.proof-step.visible {
  opacity: 1;
  transform: translateY(0);
}

.proof-step.step-highlight {
  border-left-color: var(--accent-green);
  box-shadow: var(--glow-green);
}

.proof-step .step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.proof-step.step-highlight .step-number {
  background: var(--accent-green-dim);
  color: var(--accent-green);
}

.proof-step h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.proof-step p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.8;
}

.proof-step .math-block {
  background: rgba(0, 0, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  overflow-x: auto;
  text-align: center;
}

/* Key Result Box */
.key-result {
  padding: 1.75rem 2rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(0, 255, 136, 0.08), rgba(0, 212, 255, 0.05));
  border: 1px solid rgba(0, 255, 136, 0.2);
  text-align: center;
  margin: 2rem 0;
}

.key-result h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-green);
  margin-bottom: 0.75rem;
}

.key-result .math-block {
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 0.75rem 0;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  border: 1px solid rgba(0, 255, 136, 0.1);
  color: var(--accent-green);
}

/* Calculator */
.calculator {
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
}

.calculator h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calc-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.calc-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.calc-input-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.calc-input-group input {
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
  transition: all var(--transition-fast);
}

.calc-input-group input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.calc-result {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(0, 255, 136, 0.06);
  border: 1px solid rgba(0, 255, 136, 0.15);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.calc-result-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-green);
}

/* ═══════════════════════════════════════
   ANALYSIS SECTION
   ═══════════════════════════════════════ */
.analysis-section {
  position: relative;
  z-index: 1;
  padding: 5rem 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.chart-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 3rem;
}

.chart-wrapper canvas {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.25);
  max-width: 100%;
  height: auto;
}

/* Analysis Table */
.analysis-table-wrapper {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  background: var(--bg-card);
}

.analysis-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.analysis-table thead {
  background: rgba(0, 0, 0, 0.3);
}

.analysis-table th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
}

.analysis-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.analysis-table tr:last-child td {
  border-bottom: none;
}

.analysis-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.status-safe {
  color: var(--accent-green);
  font-weight: 700;
}

.status-danger {
  color: var(--danger);
  font-weight: 700;
}

/* ═══════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════ */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer p + p {
  margin-top: 0.3rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

/* ═══════════════════════════════════════
   TUNNELING ALERT
   ═══════════════════════════════════════ */
.tunnel-alert {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-full);
  background: rgba(255, 51, 102, 0.9);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: var(--glow-danger);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.tunnel-alert.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════
   CONNECTION LINE (between sections)
   ═══════════════════════════════════════ */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
  position: relative;
  z-index: 1;
}

.section-divider::before {
  content: '';
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--accent-cyan), transparent);
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 900px) {
  .simulation-layout {
    grid-template-columns: 1fr;
  }

  .theory-cards {
    grid-template-columns: 1fr;
  }

  .stats-panel {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-title {
    font-size: 2rem;
  }

  .calc-inputs {
    grid-template-columns: 1fr;
  }

  .info-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  #main-nav {
    padding: 0 1rem;
  }

  .nav-links a {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
  }

  .hero-section,
  .simulation-section,
  .proof-section,
  .analysis-section {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .stats-panel {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .stat-value {
    font-size: 1.5rem;
  }
}

/* ═══════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════ */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: slide-up 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* KaTeX overrides */
.katex-display {
  margin: 0.5rem 0 !important;
}

.katex { font-size: 1.05em !important; }
