:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #21262d;
  --bg-highlight: #30363d;
  --text-main: #f0f6fc;
  --text-muted: #8b949e;
  --text-dim: #6e7681;
  --border-color: #30363d;
  --accent-cyan: #58a6ff;
  --accent-amber: #f2cc60;
  --accent-green: #3fb950;
  --accent-red: #ff7b72;
  --accent-purple: #bc8cff;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --container-max: 1160px;
}

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

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

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  text-decoration: underline;
  color: #79c0ff;
}

code, pre {
  font-family: var(--font-mono);
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 20px;
  background: var(--accent-cyan);
  color: #000;
  padding: 8px 16px;
  font-weight: 700;
  z-index: 1000;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 10px;
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-main);
}

.brand-badge:hover {
  text-decoration: none;
}

.brand-tag {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--accent-amber);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.site-nav {
  display: flex;
  gap: 18px;
}

.site-nav a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--text-main);
  text-decoration: none;
}

.nav-cta {
  display: flex;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
}

.btn-primary {
  background: #238636;
  color: #fff;
}

.btn-primary:hover {
  background: #2ea043;
  text-decoration: none;
  color: #fff;
}

.btn-outline {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-highlight);
  border-color: var(--text-dim);
  text-decoration: none;
  color: var(--text-main);
}

/* Hero Section */
.hero {
  padding: 64px 24px 48px;
  max-width: var(--container-max);
  margin: 0 auto;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(188, 140, 255, 0.1);
  border: 1px solid rgba(188, 140, 255, 0.3);
  color: var(--accent-purple);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: 2.75rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 820px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 40px;
}

.hero-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 8px;
}

.stat-val {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  line-height: 1.1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.stat-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Callout Alert */
.callout-box {
  background: rgba(242, 204, 96, 0.08);
  border: 1px solid rgba(242, 204, 96, 0.3);
  border-left: 4px solid var(--accent-amber);
  padding: 20px;
  border-radius: 6px;
  margin: 36px 0;
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-amber);
  margin-bottom: 10px;
}

.callout-box p {
  color: #c9d1d9;
  font-size: 0.94rem;
  margin-bottom: 10px;
}

.callout-box p:last-child {
  margin-bottom: 0;
}

/* Section Common */
.section {
  padding: 48px 24px;
  max-width: var(--container-max);
  margin: 0 auto;
  border-top: 1px solid var(--border-color);
}

.section-header {
  margin-bottom: 32px;
}

.section-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.section-title {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.section-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 800px;
  margin-top: 8px;
}

/* Grid Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-cyan);
}

.card-icon {
  font-size: 1.75rem;
  margin-bottom: 14px;
}

.card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-main);
}

.card p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.card-meta {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* DSP Pipeline Stepper */
.pipeline-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 24px 0;
}

.pipeline-step {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 16px;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 16px 20px;
  border-radius: 8px;
}

.step-num {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--accent-cyan);
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
}

.step-content h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.step-content p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.step-filter {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: 4px;
  color: var(--accent-amber);
}

/* Terminal Showcase */
.terminal-window {
  background: #090d13;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin: 24px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.terminal-header {
  background: #161b22;
  border-bottom: 1px solid var(--border-color);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.terminal-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-dim);
}

.terminal-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: #e6edf3;
  overflow-x: auto;
  line-height: 1.5;
}

.terminal-prompt {
  color: var(--accent-green);
  user-select: none;
}

.terminal-comment {
  color: var(--text-dim);
}

/* Media Showcase */
.media-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin: 24px 0;
}

.media-container img {
  width: 100%;
  height: auto;
  display: block;
}

.media-caption {
  padding: 12px 18px;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
}

/* Audio Player Box */
.audio-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.audio-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 8px;
}

.audio-box h4 {
  font-size: 0.96rem;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.audio-box p {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.audio-box audio {
  width: 100%;
  outline: none;
  border-radius: 4px;
}

/* Comparison Table */
.table-responsive {
  overflow-x: auto;
  margin: 24px 0;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.comparison-table th {
  background: var(--bg-card);
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-color);
  font-weight: 600;
  color: var(--text-main);
}

.comparison-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
}

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

.comparison-table .highlight-col {
  color: var(--accent-green);
  font-weight: 600;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 48px 24px 32px;
  background: #090d13;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-container {
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 40px;
}

.footer-brand h4 {
  color: var(--text-main);
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.footer-col h5 {
  color: var(--text-main);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 8px;
}

.footer-bottom {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Responsive */
@media (max-width: 860px) {
  .site-nav {
    display: none;
  }
  .hero h1 {
    font-size: 2.1rem;
  }
  .pipeline-step {
    grid-template-columns: 38px 1fr;
  }
  .step-filter {
    grid-column: 2 / 3;
    justify-self: start;
  }
  .footer-container {
    grid-template-columns: 1fr;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Multimedia & Interactive Lab Suite Styles
   ========================================================================== */

/* A/B Audio Crossfader Laboratory */
.audio-lab {
  background: #0d131a;
  border: 1px solid #30363d;
  border-radius: 12px;
  padding: 28px;
  margin: 32px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.lab-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

.playback-bar {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-play {
  background: var(--accent-green);
  color: #fff;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}

.btn-play:hover {
  transform: scale(1.05);
  background: #2ea043;
}

.time-display {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-muted);
}

.crossfader-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-card);
  padding: 16px 20px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.crossfader-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.label-raw {
  color: var(--accent-red);
}

.label-restored {
  color: var(--accent-green);
}

.crossfader-slider {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #161b22;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}

.crossfader-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-amber);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 0 10px rgba(242, 204, 96, 0.5);
}

.crossfader-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-amber);
  cursor: pointer;
  border: 2px solid #fff;
}

/* Canvas Audio Spectrogram */
.visualizer-canvas {
  width: 100%;
  height: 140px;
  background: #05080c;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  display: block;
}

/* Presentation Slide Deck Engine */
.deck-container {
  background: #111620;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px;
  margin: 32px 0;
  position: relative;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.deck-slide {
  display: none;
}

.deck-slide.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.slide-number {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.deck-slide h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-main);
}

.slide-body {
  font-size: 1.05rem;
  color: #c9d1d9;
  line-height: 1.7;
  max-width: 820px;
}

.slide-teleprompter {
  margin-top: 20px;
  background: rgba(88, 166, 255, 0.08);
  border-left: 3px solid var(--accent-cyan);
  padding: 14px 18px;
  border-radius: 4px;
  font-size: 0.92rem;
  font-style: italic;
  color: #8b949e;
}

.deck-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  margin-top: 28px;
}

.deck-dots {
  display: flex;
  gap: 8px;
}

.deck-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
}

.deck-dot.active {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

/* Video Master Player with Chapter Jump Buttons */
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #000;
  margin-bottom: 20px;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.chapter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.btn-chapter {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: background 0.2s, border-color 0.2s;
}

.btn-chapter:hover {
  background: var(--bg-highlight);
  border-color: var(--accent-cyan);
}

/* Diagnostic Epistemic Simulator Quiz */
.quiz-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 24px;
  margin: 24px 0;
}

.quiz-question {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-main);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.quiz-option-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 12px 16px;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.2s, border-color 0.2s;
}

.quiz-option-btn:hover {
  background: var(--bg-highlight);
  border-color: var(--accent-cyan);
}

.quiz-result {
  display: none;
  padding: 20px;
  border-radius: 6px;
  margin-top: 16px;
}

.quiz-result.slop {
  display: block;
  background: rgba(255, 123, 114, 0.1);
  border: 1px solid var(--accent-red);
  color: #ff7b72;
}

.quiz-result.solution {
  display: block;
  background: rgba(63, 185, 80, 0.1);
  border: 1px solid var(--accent-green);
  color: #3fb950;
}
