/* ==========================================================================
   Harmonia Viva — Folha de Estilos
   Design System Moderno, Dark Theme, Glassmorphism & Visão Computacional
   ========================================================================== */

:root {
  --bg-dark: #090a10;
  --bg-surface: #12131e;
  --bg-card: rgba(26, 28, 44, 0.7);
  --bg-card-hover: rgba(36, 39, 61, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(138, 92, 246, 0.5);

  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-faint: #6b7280;

  --accent-purple: #8b5cf6;
  --accent-violet: #6366f1;
  --accent-cyan: #06b6d4;
  --accent-pink: #ec4899;
  --accent-amber: #f59e0b;

  --gradient-brand: linear-gradient(135deg, #a855f7 0%, #6366f1 50%, #06b6d4 100%);
  --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 100%);
  --glow-brand: 0 0 35px rgba(139, 92, 246, 0.35);

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

  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset Básico */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Utilitários & Gradientes */
.gradient-text {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Barra de Navegação
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(9, 10, 16, 0.75);
  border-bottom: 1px solid var(--border-subtle);
  transition: var(--transition-normal);
}

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

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

.brand-icon {
  width: 28px;
  height: 28px;
  color: var(--accent-purple);
  filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.6));
}

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

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition-normal);
}

.nav-links a:hover {
  color: #ffffff;
}

.btn-nav {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: var(--radius-full);
  color: #c4b5fd;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: var(--transition-normal);
}

.btn-nav:hover {
  background: var(--accent-purple);
  color: #fff;
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.4);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  position: relative;
  padding: 150px 24px 70px;
  text-align: center;
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 480px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.28) 0%, rgba(99, 102, 241, 0.15) 45%, rgba(6, 182, 212, 0) 70%);
  filter: blur(75px);
  pointer-events: none;
  z-index: 0;
}

.hero-container {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  z-index: 1;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: #c4b5fd;
  margin-bottom: 24px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulseAnim 2s infinite;
}

@keyframes pulseAnim {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.hero-title {
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.12;
  margin-bottom: 24px;
  color: #ffffff;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 36px;
  font-weight: 400;
}

.hero-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-normal);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--gradient-brand);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(139, 92, 246, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Card Visualizador de Som */
.visualizer-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  margin-top: 10px;
}

.visualizer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 0 8px;
  font-size: 0.85rem;
}

.visualizer-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}

.status-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.btn-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition-normal);
}

.btn-chip:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

#soundCanvas {
  width: 100%;
  height: 130px;
  background: #0d0e17;
  border-radius: var(--radius-md);
  display: block;
}

/* ==========================================================================
   Seções Gerais & Títulos
   ========================================================================== */
.section {
  padding: 90px 0;
  position: relative;
}

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

.section-header.text-center {
  text-align: center;
}

.section-tag {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(2rem, 3.5vw, 2.7rem);
  color: #ffffff;
  margin-bottom: 14px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 660px;
}

.section-header.text-center .section-desc {
  margin: 0 auto;
}

/* ==========================================================================
   Grid de Gêneros Musicais
   ========================================================================== */
.genres-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.genre-card {
  position: relative;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  overflow: hidden;
}

.genre-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-brand);
  opacity: 0;
  transition: var(--transition-normal);
}

.genre-card:hover {
  transform: translateY(-6px);
  background: var(--bg-card-hover);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

.genre-card:hover::before {
  opacity: 1;
}

.genre-icon {
  font-size: 2.2rem;
  margin-bottom: 16px;
}

.genre-period {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-purple);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.genre-name {
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 12px;
}

.genre-info {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 18px;
  flex-grow: 1;
}

.genre-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--text-faint);
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.genre-meta strong {
  color: #d1d5db;
}

.btn-play-genre {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-md);
  color: #e0e7ff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
}

.btn-play-genre:hover, .btn-play-genre.playing {
  background: var(--accent-purple);
  color: #ffffff;
  border-color: var(--accent-purple);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.4);
}

/* ==========================================================================
   Seção: Sintetizador & Câmera Interativa (Side-by-Side)
   ========================================================================== */
.synth-section {
  background: linear-gradient(180deg, rgba(9, 10, 16, 0.9) 0%, rgba(18, 19, 30, 0.96) 50%, rgba(9, 10, 16, 0.9) 100%);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.synth-interactive-wrapper {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.camera-panel, .synth-panel {
  background: #11131f;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-xl);
  padding: 26px 22px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title-wrap h3 {
  font-size: 1.15rem;
  color: #fff;
}

.camera-icon-pulse, .synth-icon {
  font-size: 1.35rem;
}

/* Viewport da Câmera */
.camera-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #090a12;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(139, 92, 246, 0.25);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}

#webcam {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Espelho natural */
  display: block;
}

#hand-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* Placeholder quando a câmera está desligada */
.camera-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(22, 24, 38, 0.96) 0%, rgba(9, 10, 18, 0.98) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  z-index: 20;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.camera-placeholder.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.placeholder-icon-big {
  font-size: 3.2rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 14px rgba(139, 92, 246, 0.6));
  animation: floatHand 3s ease-in-out infinite;
}

@keyframes floatHand {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.camera-placeholder h4 {
  font-size: 1.25rem;
  color: #fff;
  margin-bottom: 8px;
}

.camera-placeholder p {
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 320px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.btn-pulse {
  animation: pulseGlow 2.5s infinite;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.7); }
  70% { box-shadow: 0 0 0 14px rgba(139, 92, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

/* Zonas de Teclas Virtuais no Rodapé da Câmera */
.air-keys-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36%;
  display: flex;
  z-index: 15;
  pointer-events: none;
  border-top: 2px dashed rgba(6, 182, 212, 0.5);
  background: linear-gradient(180deg, rgba(6, 182, 212, 0.06) 0%, rgba(139, 92, 246, 0.2) 100%);
  transition: opacity 0.3s;
}

.air-keys-overlay.hidden {
  opacity: 0;
}

.air-col {
  flex: 1;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  transition: background 0.12s, box-shadow 0.12s;
}

.air-col:last-child {
  border-right: none;
}

.air-col span {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 6px;
  border-radius: 4px;
}

.air-col.active {
  background: rgba(6, 182, 212, 0.38);
  box-shadow: inset 0 0 16px rgba(6, 182, 212, 0.7);
}

.air-col.active span {
  color: #fff;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}

/* Controles da Câmera */
.camera-controls {
  margin-top: 14px;
}

.camera-btns-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.btn-camera-action {
  flex: 1;
  min-width: 100px;
  padding: 8px 12px;
  background: var(--gradient-brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-normal);
}

.btn-camera-action:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.btn-camera-action.secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.btn-camera-action.secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-camera-action.active-danger {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4);
}

.camera-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: var(--text-faint);
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

#fps-display {
  color: var(--accent-cyan);
  font-family: monospace;
}

.status-badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 600;
}

.status-badge.status-off {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.status-active {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.status-tracking {
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.4);
  animation: pulseTracking 1.5s infinite;
}

@keyframes pulseTracking {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

.badge-accent {
  font-size: 0.74rem;
  color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

/* Controles do Sintetizador */
.synth-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

.control-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.control-label span {
  color: var(--accent-cyan);
}

.waveform-selector {
  display: flex;
  gap: 5px;
  background: rgba(0, 0, 0, 0.3);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.wave-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 7px 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-normal);
}

.wave-btn:hover {
  color: #fff;
}

.wave-btn.active {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.synth-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  margin: 6px 0;
}

.synth-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  cursor: pointer;
  transition: var(--transition-normal);
}

/* Teclado do Piano */
.piano-wrapper {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  padding: 6px 0 16px;
}

.piano-keys {
  position: relative;
  display: flex;
  height: 195px;
  background: #0d0f17;
  padding: 10px;
  border-radius: var(--radius-md);
  box-shadow: inset 0 4px 15px rgba(0, 0, 0, 0.8), 0 4px 20px rgba(0, 0, 0, 0.4);
}

.key {
  position: relative;
  cursor: pointer;
  user-select: none;
  border-radius: 0 0 8px 8px;
  transition: background 0.08s, transform 0.08s, box-shadow 0.08s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 12px;
}

.white-key {
  width: 50px;
  height: 172px;
  background: linear-gradient(180deg, #f9fafb 0%, #e5e7eb 92%, #d1d5db 100%);
  border: 1px solid #9ca3af;
  border-top: none;
  margin: 0 1.5px;
  z-index: 1;
  box-shadow: inset 0 -4px 6px rgba(0, 0, 0, 0.15), 0 3px 6px rgba(0, 0, 0, 0.3);
}

.white-key .note-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1f2937;
}

.white-key .key-hint {
  font-size: 0.68rem;
  font-weight: 600;
  color: #6b7280;
  margin-top: 2px;
  padding: 1px 5px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 4px;
}

.white-key:active, .white-key.active {
  background: linear-gradient(180deg, #c4b5fd 0%, #a78bfa 100%);
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.7);
  transform: translateY(3px);
}

.white-key.camera-triggered {
  background: linear-gradient(180deg, #67e8f9 0%, #06b6d4 100%) !important;
  box-shadow: 0 0 22px rgba(6, 182, 212, 0.9) !important;
  transform: translateY(3px);
}

.black-key {
  position: absolute;
  width: 32px;
  height: 110px;
  background: linear-gradient(180deg, #27272a 0%, #09090b 90%, #000 100%);
  border: 1px solid #3f3f46;
  border-top: none;
  z-index: 2;
  box-shadow: inset 0 -2px 3px rgba(255, 255, 255, 0.1), 0 4px 8px rgba(0, 0, 0, 0.6);
}

.black-key .note-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #e4e4e7;
}

.black-key .key-hint {
  font-size: 0.64rem;
  font-weight: 600;
  color: #a1a1aa;
  margin-top: 2px;
  padding: 1px 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.black-key:active, .black-key.active {
  background: linear-gradient(180deg, #6366f1 0%, #4338ca 100%);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.8);
  transform: translateY(3px);
}

.black-key.camera-triggered {
  background: linear-gradient(180deg, #a855f7 0%, #7c3aed 100%) !important;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.9) !important;
  transform: translateY(3px);
}

.synth-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

.active-note-display {
  color: var(--text-muted);
}

.active-note-display strong {
  color: #fff;
  font-size: 1.05rem;
}

.active-note-display span {
  color: var(--accent-cyan);
}

.finger-status-display {
  color: var(--text-faint);
  font-size: 0.8rem;
}

.badge-source {
  color: var(--accent-cyan);
  font-weight: 600;
}

/* ==========================================================================
   Linha do Tempo
   ========================================================================== */
.timeline {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding: 20px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 2px;
  background: linear-gradient(180deg, rgba(139, 92, 246, 0.8) 0%, rgba(6, 182, 212, 0.8) 100%);
}

.timeline-item {
  position: relative;
  padding-left: 56px;
  margin-bottom: 42px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 13px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 3px solid var(--accent-purple);
  box-shadow: 0 0 12px var(--accent-purple);
  transition: var(--transition-normal);
}

.timeline-item:hover .timeline-dot {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px var(--accent-cyan);
  transform: scale(1.2);
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  transition: var(--transition-normal);
}

.timeline-content:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateX(4px);
}

.timeline-year {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.timeline-content h4 {
  font-size: 1.25rem;
  color: #fff;
  margin-bottom: 8px;
}

.timeline-content p {
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   Ciência e Curiosidades
   ========================================================================== */
.facts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.fact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
}

.fact-card:hover {
  transform: translateY(-5px);
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
}

.fact-number {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 16px;
}

.fact-title {
  font-size: 1.28rem;
  color: #fff;
  margin-bottom: 12px;
}

.fact-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 22px;
  flex-grow: 1;
}

.btn-sound-mini {
  align-self: flex-start;
  padding: 8px 16px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-full);
  color: #67e8f9;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-normal);
}

.btn-sound-mini:hover {
  background: var(--accent-cyan);
  color: #042f2e;
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.5);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  padding: 80px 0 40px;
  border-top: 1px solid var(--border-subtle);
  background: #06070a;
}

.footer-content {
  text-align: center;
}

.quote-block {
  max-width: 600px;
  margin: 0 auto 40px;
}

.quote-text {
  font-family: 'Outfit', sans-serif;
  font-size: 1.6rem;
  font-style: italic;
  color: #ffffff;
  margin-bottom: 8px;
}

.quote-author {
  font-size: 0.95rem;
  color: var(--accent-purple);
  font-weight: 600;
}

.footer-divider {
  width: 80px;
  height: 2px;
  background: var(--gradient-brand);
  margin: 0 auto 30px;
  border-radius: 2px;
}

.footer-bottom {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-credit {
  font-size: 0.78rem;
  color: var(--text-faint);
  margin-top: 6px;
}

/* ==========================================================================
   Responsividade
   ========================================================================== */
@media (max-width: 1024px) {
  .synth-interactive-wrapper {
    grid-template-columns: 1fr;
  }

  .camera-viewport {
    max-height: 380px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero {
    padding: 130px 20px 60px;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

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

  .piano-keys {
    height: 180px;
  }

  .white-key {
    width: 42px;
    height: 158px;
  }

  .black-key {
    width: 26px;
    height: 100px;
  }

  /* Reposicionamento das teclas pretas em tela menor */
  .black-key[data-note="C#4"] { left: 34px !important; }
  .black-key[data-note="D#4"] { left: 80px !important; }
  .black-key[data-note="F#4"] { left: 172px !important; }
  .black-key[data-note="G#4"] { left: 218px !important; }
  .black-key[data-note="A#4"] { left: 264px !important; }

  .synth-footer {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}
