/* ============================
   Layout & Structure
   ============================ */

/* Navigation */
#main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.3s ease;
}

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

.nav-title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--surface-1);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Progress bar */
.progress-bar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  z-index: 999;
  width: 0%;
  transition: width 0.1s linear;
}

/* Sections */
.section {
  min-height: 100vh;
  padding: var(--section-padding) 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

.hero-section {
  max-width: 100%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
  padding: 0 24px;
}

.hero-subtitle {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 40px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 40px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

.hero-cta {
  display: inline-block;
  padding: 14px 36px;
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 700;
  font-size: 15px;
  border-radius: 50px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  box-shadow: 0 0 30px var(--accent-glow);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 50px var(--accent-glow);
}

/* Section headers */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
}

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

/* Canvas containers */
.canvas-container {
  position: relative;
  background: var(--surface-1);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.04);
  overflow: hidden;
  margin-bottom: 40px;
}

.canvas-container canvas {
  display: block;
  width: 100%;
  height: 480px;
  cursor: crosshair;
}

.canvas-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--surface-3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-primary);
  max-width: 280px;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.canvas-tooltip.visible {
  opacity: 1;
}

.canvas-controls {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-top: 1px solid rgba(255,255,255,0.04);
  flex-wrap: wrap;
}

.ctrl-btn {
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-main);
  color: var(--text-secondary);
  background: var(--surface-1);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ctrl-btn:hover {
  color: var(--text-primary);
  background: var(--surface-2);
}

.ctrl-btn.active {
  color: var(--accent);
  background: var(--accent-dim);
  border-color: rgba(110, 231, 183, 0.2);
}

/* Info cards grid */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.info-card {
  background: var(--surface-1);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: transform 0.3s var(--ease-out), border-color 0.3s ease;
}

.info-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.08);
}

.info-card h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.info-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

.info-card ul {
  list-style: none;
  padding: 0;
}

.info-card ul li {
  color: var(--text-secondary);
  font-size: 14px;
  padding: 5px 0;
  padding-left: 18px;
  position: relative;
  line-height: 1.6;
}

.info-card ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
}

.info-card.highlight-card {
  border-color: rgba(110, 231, 183, 0.15);
  background: linear-gradient(135deg, var(--surface-1), rgba(110, 231, 183, 0.03));
}

/* Organelle detail panel */
.organelle-detail {
  position: absolute;
  bottom: 60px;
  right: 16px;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(15px);
  border: 1px solid var(--surface-3);
  border-radius: var(--radius-md);
  padding: 20px;
  max-width: 320px;
  font-size: 13px;
  color: var(--text-secondary);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s var(--ease-out);
  pointer-events: none;
}

.organelle-detail.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.organelle-detail h4 {
  font-size: 16px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* Equation display */
.equation-display {
  display: flex;
  gap: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.equation {
  flex: 1;
  min-width: 280px;
  background: var(--surface-1);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  text-align: center;
}

.eq-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 10px;
}

.eq-formula {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.8;
}

/* Quiz */
.quiz-container {
  max-width: 680px;
  margin: 0 auto;
}

.quiz-progress {
  background: var(--surface-1);
  border-radius: 20px;
  height: 6px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--cyan));
  border-radius: 20px;
  transition: width 0.4s var(--ease-out);
  width: 5%;
}

#quiz-counter {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.quiz-question {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 32px;
  min-height: 60px;
  line-height: 1.5;
}

.quiz-options {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.quiz-option {
  padding: 16px 20px;
  background: var(--surface-1);
  border: 2px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: var(--font-main);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.quiz-option:hover:not(.disabled) {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.quiz-option.correct {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.quiz-option.incorrect {
  border-color: var(--rose);
  background: var(--rose-dim);
}

.quiz-option.disabled {
  cursor: default;
  opacity: 0.6;
}

.quiz-feedback {
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  min-height: 20px;
  margin-bottom: 16px;
  line-height: 1.6;
}

.quiz-next-btn {
  display: block;
  margin: 0 auto;
  padding: 12px 32px;
  background: var(--accent);
  color: var(--bg-primary);
  font-weight: 600;
  font-size: 14px;
  font-family: var(--font-main);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quiz-next-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

/* Quiz results */
.quiz-results {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

.results-card {
  background: var(--surface-1);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  border: 1px solid rgba(255,255,255,0.04);
}

.results-card h3 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 32px;
}

.score-circle {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 24px;
}

.score-circle svg {
  width: 100%;
  height: 100%;
}

#score-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
}

#score-message {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 32px;
  line-height: 1.6;
}

/* Footer */
.footer {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(10, 14, 26, 0.98);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .section {
    padding: 60px 16px;
  }

  .canvas-container canvas {
    height: 360px;
  }

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

  .hero-stats {
    gap: 20px;
  }

  .equation-display {
    flex-direction: column;
  }
}
