/* ============================================================
   WebHarmonium — Global Design System
   Brand: Modern, clean, educational music platform
   ============================================================ */

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

/* ── CSS Variables ── */
:root {
  /* Color Palette */
  --primary:       #0F172A;
  --secondary:     #1E293B;
  --accent-gold:   #D4AF37;
  --accent-gold-light: #F0D060;
  --accent-gold-dark:  #A88A20;
  --accent-cream:  #F8F5EE;
  --cta:           #22C55E;
  --cta-hover:     #16A34A;
  --text-primary:  #F1F5F9;
  --text-secondary:#94A3B8;
  --text-dark:     #0F172A;
  --border:        rgba(212,175,55,0.18);
  --glass-bg:      rgba(30,41,59,0.72);
  --glass-border:  rgba(212,175,55,0.22);
  --shadow-gold:   0 0 32px rgba(212,175,55,0.15);
  --shadow-deep:   0 20px 60px rgba(0,0,0,0.5);
  --radius-sm:     8px;
  --radius-md:     14px;
  --radius-lg:     24px;
  --radius-xl:     36px;

  /* Typography */
  --font-heading:  'Poppins', 'Montserrat', sans-serif;
  --font-body:     'Inter', 'Open Sans', sans-serif;

  /* Transitions */
  --transition:    all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  background-color: var(--primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

main, #mainContent {
  flex: 1 0 auto;
}

/* ── Loader ── */
#app-loader {
  position: fixed;
  inset: 0;
  background: var(--primary);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s;
}
.loader-spinner {
  width: 48px; height: 48px;
  border: 4px solid var(--surface, #1E293B);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* ── Typography Scale ── */
h1, .h1 {
  font-family: var(--font-heading);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h2, .h2 {
  font-family: var(--font-heading);
  font-size: clamp(28px, 3.5vw, 38px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}
h3, .h3 {
  font-family: var(--font-heading);
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 600;
  line-height: 1.3;
}
h4, .h4 {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
}
p, .body-text {
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.7;
  color: var(--text-secondary);
}
.lead {
  font-size: clamp(17px, 2vw, 20px);
  line-height: 1.6;
  color: var(--text-primary);
  opacity: 0.85;
}

/* ── Gold Gradient Text ── */
.text-gold {
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-cta { color: var(--cta); }
.text-cream { color: var(--accent-cream); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--secondary); }
::-webkit-scrollbar-thumb { background: var(--accent-gold-dark); border-radius: 4px; }

/* ── Background Patterns ── */
.bg-noise {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
}

/* ── Glassmorphism ── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}
.glass-dark {
  background: rgba(15,23,42,0.85);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-cta {
  background: var(--cta);
  color: #fff;
  box-shadow: 0 4px 20px rgba(34,197,94,0.35);
}
.btn-cta:hover {
  background: var(--cta-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(34,197,94,0.45);
}
.btn-gold {
  background: linear-gradient(135deg, var(--accent-gold), #B8943F);
  color: var(--primary);
  box-shadow: 0 4px 20px rgba(212,175,55,0.3);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(212,175,55,0.45);
}
.btn-outline {
  background: transparent;
  color: var(--accent-gold);
  border: 1.5px solid var(--accent-gold);
}
.btn-outline:hover {
  background: rgba(212,175,55,0.1);
  transform: translateY(-2px);
}
.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-lg { padding: 16px 40px; font-size: 17px; }

/* ── Navigation ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 clamp(16px, 4vw, 48px);
  background: rgba(15,23,42,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.navbar .logo {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-gold), #B8943F);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.navbar nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: var(--accent-gold);
  background: rgba(212,175,55,0.08);
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
}
.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Hero Section ── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px clamp(16px, 4vw, 48px) 60px;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(212,175,55,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 80%, rgba(34,197,94,0.05) 0%, transparent 50%),
    linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
  z-index: 0;
}
.hero-content { position: relative; z-index: 2; max-width: 820px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  background: rgba(212,175,55,0.12);
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-gold);
  margin-bottom: 24px;
  letter-spacing: 0.04em;
}
.hero h1 { margin-bottom: 20px; }
.hero .lead { margin-bottom: 36px; max-width: 580px; margin-left: auto; margin-right: auto; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  animation: float 2.5s ease-in-out infinite;
  z-index: 2;
}
.scroll-indicator .arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--accent-gold);
  border-bottom: 2px solid var(--accent-gold);
  transform: rotate(45deg);
  opacity: 0.7;
}
@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ── Sections ── */
.section {
  padding: clamp(60px, 8vw, 100px) clamp(16px, 5vw, 64px);
  max-width: 1280px;
  margin: 0 auto;
  scroll-margin-top: 80px;
}
.section-header {
  text-align: center;
  margin-bottom: clamp(40px, 5vw, 64px);
}
.section-header .label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 12px;
}
.section-header p {
  max-width: 560px;
  margin: 16px auto 0;
}
.section-divider {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-gold), transparent);
  margin: 14px auto 0;
  border-radius: 2px;
}

/* ── Cards ── */
.card {
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: var(--transition);
}
.card:hover {
  border-color: rgba(212,175,55,0.4);
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold);
}
.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(212,175,55,0.2), rgba(212,175,55,0.05));
  border: 1px solid rgba(212,175,55,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 18px;
}
.card h4 { margin-bottom: 10px; }

/* ── Grid Layouts ── */
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 28px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }

/* ── ─────────────────────────────────────
   VIRTUAL HARMONIUM STYLES
   ───────────────────────────────────── ── */

.harmonium-section {
  padding: 40px clamp(16px, 4vw, 48px) 80px;
  position: relative;
}

.harmonium-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  background: linear-gradient(180deg, #1a1008 0%, #0d0904 100%);
  border: 2px solid #5a3e1b;
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow:
    0 0 0 1px rgba(212,175,55,0.1),
    0 4px 12px rgba(0,0,0,0.6),
    0 32px 80px rgba(0,0,0,0.7),
    inset 0 1px 0 rgba(255,255,255,0.05);
  position: relative;
  overflow: hidden;
}

/* Wood grain texture overlay */
.harmonium-wrapper::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    88deg,
    transparent 0px,
    transparent 8px,
    rgba(255,255,255,0.012) 8px,
    rgba(255,255,255,0.012) 9px
  );
  pointer-events: none;
  border-radius: inherit;
}

/* Bellows animation strip */
.bellows {
  height: 20px;
  background: repeating-linear-gradient(
    90deg,
    #1a0e05 0px,
    #1a0e05 6px,
    #2d1a08 6px,
    #2d1a08 8px,
    #1a0e05 8px,
    #1a0e05 14px,
    #0d0902 14px,
    #0d0902 16px
  );
  border: 1px solid #5a3e1b;
  border-radius: 4px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.1s ease;
}
.bellows::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(212,175,55,0.08) 50%, transparent 100%);
  animation: bellowsGlow 3s ease-in-out infinite;
}
@keyframes bellowsGlow {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

/* Harmonium top panel with controls */
.harmonium-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 0 8px;
  flex-wrap: wrap;
  gap: 12px;
}
.harmonium-brand {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.05em;
}
.stops-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stop-knob {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.stop-knob .knob {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #C8A02A, #7A5E1A);
  border: 2px solid #A8841F;
  box-shadow: 0 3px 8px rgba(0,0,0,0.6), inset 0 1px 2px rgba(255,255,255,0.2);
  transition: var(--transition);
  position: relative;
}
.stop-knob .knob::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(0deg);
  width: 3px;
  height: 10px;
  background: var(--primary);
  border-radius: 2px;
  transform-origin: center bottom;
}
.stop-knob.active .knob { box-shadow: 0 3px 8px rgba(0,0,0,0.6), 0 0 14px rgba(212,175,55,0.6), inset 0 1px 2px rgba(255,255,255,0.2); }
.stop-knob label { font-size: 9px; color: var(--accent-gold); font-weight: 600; letter-spacing: 0.05em; text-align: center; cursor: pointer; }

.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
}
.volume-control label { font-size: 11px; color: var(--text-secondary); }
.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 90px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-gold) var(--val, 80%), rgba(255,255,255,0.1) var(--val, 80%));
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-gold);
  border: 2px solid var(--primary);
  box-shadow: 0 0 6px rgba(212,175,55,0.5);
  cursor: pointer;
}

/* ── Octave Selector ── */
.octave-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 0 8px;
  justify-content: center;
}
.octave-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(212,175,55,0.1);
  border: 1px solid var(--accent-gold-dark);
  color: var(--accent-gold);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-weight: 700;
}
.octave-btn:hover { background: rgba(212,175,55,0.25); }
.octave-display {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-gold);
  min-width: 70px;
  text-align: center;
}

/* ── Keyboard Container ── */
.keyboard-container {
  overflow-x: auto;
  padding: 8px 4px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-gold-dark) transparent;
}
.keyboard {
  display: flex;
  position: relative;
  height: 200px;
  width: max-content;
  margin: 0 auto;
}

/* White Keys */
.key {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.05s ease, box-shadow 0.05s ease;
}
.key.white {
  width: 48px;
  height: 200px;
  background: linear-gradient(180deg, #F5F0E8 0%, #E8E0CC 100%);
  border: 1px solid #C8B89A;
  border-top: none;
  border-radius: 0 0 6px 6px;
  margin-right: 2px;
  box-shadow:
    inset 0 -3px 4px rgba(0,0,0,0.15),
    0 4px 8px rgba(0,0,0,0.4);
  z-index: 1;
}
.key.white:hover {
  background: linear-gradient(180deg, #FFF8E8 0%, #F0E8D4 100%);
}
.key.white.active {
  background: linear-gradient(180deg, #FFE080 0%, #D4AF37 100%);
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.2),
    0 0 16px rgba(212,175,55,0.5);
  transform: translateY(2px);
}

/* Black Keys */
.key.black {
  width: 32px;
  height: 124px;
  background: linear-gradient(180deg, #2a2218 0%, #0d0902 100%);
  border: 1px solid #5a4a2a;
  border-top: none;
  border-radius: 0 0 5px 5px;
  position: absolute;
  top: 0;
  z-index: 2;
  margin-left: -16px;
  box-shadow:
    inset -2px 0 3px rgba(255,255,255,0.06),
    inset 2px 0 3px rgba(0,0,0,0.5),
    0 6px 10px rgba(0,0,0,0.7);
}
.key.black:hover {
  background: linear-gradient(180deg, #3d321e 0%, #1a1205 100%);
}
.key.black.active {
  background: linear-gradient(180deg, #8B6914 0%, #5A4010 100%);
  box-shadow: 0 0 14px rgba(212,175,55,0.5), inset 0 2px 4px rgba(0,0,0,0.4);
  transform: translateY(2px);
}

/* ── Highlighted Keys (Raag / Scale / Note pages) ── */
.key.white.highlighted {
  background: linear-gradient(180deg, #FFF0B3 0%, #D4AF37 80%, #B8943F 100%);
  box-shadow:
    inset 0 -3px 4px rgba(0,0,0,0.15),
    0 0 18px rgba(212,175,55,0.6),
    0 0 40px rgba(212,175,55,0.25);
  border-color: var(--accent-gold);
  animation: keyPulse 2.8s ease-in-out infinite;
}
.key.black.highlighted {
  background: linear-gradient(180deg, #7A5E1A 0%, #D4AF37 100%);
  box-shadow:
    0 0 18px rgba(212,175,55,0.7),
    inset -2px 0 3px rgba(255,255,255,0.15);
  border-color: var(--accent-gold);
  animation: keyPulse 2.8s ease-in-out infinite;
}
@keyframes keyPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(212,175,55,0.5), 0 0 30px rgba(212,175,55,0.2); }
  50%       { box-shadow: 0 0 28px rgba(212,175,55,0.9), 0 0 50px rgba(212,175,55,0.4); }
}
/* Active takes priority over highlighted */
.key.white.highlighted.active {
  background: linear-gradient(180deg, #FFE080 0%, #D4AF37 100%);
  animation: none;
}
.key.black.highlighted.active {
  background: linear-gradient(180deg, #B8943F 0%, #7A5E1A 100%);
  animation: none;
}

/* Key labels */
.key-label {
  font-family: var(--font-heading);
  font-weight: 700;
  pointer-events: none;
  line-height: 1;
}
.key.white .key-label {
  font-size: 11px;
  color: #5a3e1b;
}
.key.black .key-label {
  font-size: 8px;
  color: rgba(212,175,55,0.7);
}
.key-shortcut {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 600;
  color: rgba(100,80,40,0.5);
  pointer-events: none;
  white-space: nowrap;
}
.key.black .key-shortcut { color: rgba(255,255,255,0.2); top: 6px; }

/* ── Keyboard Footer & Recording ── */
.harmonium-footer {
  margin-top: 20px;
  padding: 14px 18px;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(212,175,55,0.08);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* Recording panel */
.recording-panel {
  display: flex;
  align-items: center;
  gap: 10px;
}
.recording-panel-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* Record button — premium ring effect */
.rec-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #e74c3c;
  background: rgba(231,76,60,0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: #e74c3c;
  font-size: 13px;
  flex-shrink: 0;
}
.rec-btn:hover {
  background: rgba(231,76,60,0.18);
  transform: scale(1.08);
}
.rec-btn.recording {
  background: #e74c3c;
  color: white;
  border-color: #c0392b;
  animation: pulse-rec 1.2s ease-in-out infinite;
}
.rec-btn.recording::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(231,76,60,0.4);
  animation: rec-ring 1.4s ease-out infinite;
}
@keyframes pulse-rec {
  0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0.5); }
  50% { box-shadow: 0 0 0 8px rgba(231,76,60,0); }
}
@keyframes rec-ring {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.7); opacity: 0; }
}

/* Animated waveform (shows while recording) */
.rec-waveform {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 22px;
}
.rec-waveform.active { display: flex; }
.rec-waveform span {
  width: 3px;
  background: #e74c3c;
  border-radius: 2px;
  animation: wavePulse 1.1s ease-in-out infinite;
}
.rec-waveform span:nth-child(1) { height: 6px;  animation-delay: 0s; }
.rec-waveform span:nth-child(2) { height: 14px; animation-delay: 0.15s; }
.rec-waveform span:nth-child(3) { height: 20px; animation-delay: 0.3s; }
.rec-waveform span:nth-child(4) { height: 10px; animation-delay: 0.45s; }
.rec-waveform span:nth-child(5) { height: 16px; animation-delay: 0.6s; }

.rec-timer {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-gold);
  min-width: 46px;
  letter-spacing: 0.04em;
}
.rec-timer.active { color: #e74c3c; }

/* Playback controls */
.rec-playback {
  display: none;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  animation: fadeIn 0.3s ease;
}
.rec-playback.visible { display: flex; }
.play-btn, .download-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-heading);
  cursor: pointer;
  border: 1px solid;
  transition: var(--transition);
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.play-btn { color: var(--cta); border-color: rgba(34,197,94,0.4); }
.play-btn:hover { background: rgba(34,197,94,0.12); transform: scale(1.04); }
.download-btn { color: var(--accent-gold); border-color: rgba(212,175,55,0.3); }
.download-btn:hover { background: rgba(212,175,55,0.1); transform: scale(1.04); }

/* ── Social Share Buttons ── */
.social-share-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0;
  padding: 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.social-share-bar .share-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-right: 4px;
  flex-shrink: 0;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: white;
  transition: var(--transition);
  border: none;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.share-btn:hover { transform: translateY(-2px); filter: brightness(1.12); }
.share-btn:active { transform: translateY(0); }
.share-btn.btn-wa  { background: #25D366; box-shadow: 0 3px 12px rgba(37,211,102,0.3); }
.share-btn.btn-fb  { background: #1877F2; box-shadow: 0 3px 12px rgba(24,119,242,0.3); }
.share-btn.btn-tw  { background: #1DA1F2; box-shadow: 0 3px 12px rgba(29,161,242,0.3); }
.share-btn.btn-copy {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--text-primary);
  box-shadow: none;
}
.share-btn.btn-copy:hover { background: rgba(255,255,255,0.1); filter: none; }

.keyboard-hint {
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.kbd {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  font-size: 10px;
  font-family: monospace;
  color: var(--accent-cream);
}

/* ── Notes Visualizer ── */
.notes-visualizer {
  height: 40px;
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-sm);
  margin: 12px 0 0;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
  overflow: hidden;
}
.note-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: linear-gradient(135deg, var(--accent-gold), #8B6914);
  color: var(--primary);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-heading);
  animation: noteIn 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
@keyframes noteIn {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ── Features Section ── */
.features-section { background: var(--secondary); }
.feature-card {
  text-align: center;
  padding: 36px 24px;
}
.feature-card .icon {
  font-size: 36px;
  margin-bottom: 16px;
  display: block;
}

/* ── Raag / Notes Preview Cards ── */
.raag-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(212,175,55,0.08);
  border: 1px solid rgba(212,175,55,0.18);
  border-radius: 999px;
  font-size: 13px;
  color: var(--accent-cream);
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
}
.raag-chip:hover {
  background: rgba(212,175,55,0.18);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
  transform: translateY(-2px);
}

/* ── Stats Banner ── */
.stats-banner {
  display: flex;
  justify-content: center;
  gap: clamp(24px, 5vw, 64px);
  flex-wrap: wrap;
  padding: 48px clamp(16px, 4vw, 48px);
  background: var(--secondary);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stat-item { text-align: center; }
.stat-value {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label { font-size: 13px; color: var(--text-secondary); }

/* ── Articles Grid ── */
.article-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--secondary);
  border: 1px solid var(--border);
  transition: var(--transition);
  text-decoration: none;
}
.article-card:hover {
  transform: translateY(-4px);
  border-color: rgba(212,175,55,0.4);
  box-shadow: var(--shadow-gold);
}
.article-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: rgba(212,175,55,0.12);
  color: var(--accent-gold);
  margin-bottom: 10px;
}
.article-card-body { padding: 24px; flex: 1; }
.article-card h4 { color: var(--text-primary); margin-bottom: 8px; font-size: 16px; }
.article-card p { font-size: 13px; line-height: 1.6; }
.article-card-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Page Header (inner pages) ── */
.page-header {
  padding: 120px clamp(16px, 5vw, 64px) 60px;
  text-align: center;
  background: linear-gradient(180deg, var(--secondary) 0%, var(--primary) 100%);
  border-bottom: 1px solid var(--border);
}

/* ── Footer ── */
footer {
  background: var(--secondary);
  border-top: 1px solid var(--border);
  padding: 56px clamp(16px, 5vw, 64px) 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto 40px;
}
.footer-brand p {
  font-size: 14px;
  line-height: 1.8;
  margin: 12px 0 20px;
  max-width: 280px;
}
.footer-col h5 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 14px;
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
}
.footer-links a:hover { color: var(--accent-gold); transform: translateX(4px); }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Practice Mode Banner ── */
.practice-mode-bar {
  background: linear-gradient(90deg, rgba(34,197,94,0.15) 0%, rgba(34,197,94,0.05) 100%);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 14px;
}
.practice-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cta);
  animation: pulse-rec 1.5s ease infinite;
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.anim-fade-up { animation: fadeInUp 0.6s ease forwards; }
.anim-fade-up-1 { animation: fadeInUp 0.6s 0.1s ease both; }
.anim-fade-up-2 { animation: fadeInUp 0.6s 0.2s ease both; }
.anim-fade-up-3 { animation: fadeInUp 0.6s 0.3s ease both; }

/* ── Mobile Nav Drawer ── */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.mobile-nav.open { opacity: 1; pointer-events: all; }
.mobile-nav-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 85vw);
  height: 100%;
  background: var(--secondary);
  border-left: 1px solid var(--border);
  padding: 80px 24px 24px;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-nav.open .mobile-nav-panel { transform: translateX(0); }
.mobile-nav a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.2s ease;
}
.mobile-nav a:hover { color: var(--accent-gold); }

/* ── Contact Form ── */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-gold);
  margin-bottom: 7px;
  letter-spacing: 0.03em;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-gold);
  background: rgba(212,175,55,0.04);
}
.form-group textarea { min-height: 130px; resize: vertical; }

/* ── Policy Pages ── */
.policy-content { max-width: 800px; margin: 0 auto; }
.policy-content h2 { margin: 36px 0 16px; }
.policy-content h3 { margin: 24px 0 10px; color: var(--accent-gold); }
.policy-content p, .policy-content li { color: var(--text-secondary); line-height: 1.8; }
.policy-content ul, .policy-content ol { padding-left: 20px; margin: 12px 0; }
.policy-content li { margin-bottom: 8px; }

/* ── Responsive Breakpoints ── */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .navbar nav { display: none; }
  .nav-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .harmonium-wrapper { padding: 16px; }
  .key.white { width: 38px; height: 160px; }
  .key.black { width: 26px; height: 98px; }
  .harmonium-controls { flex-direction: column; align-items: flex-start; }
  .stops-group { flex-wrap: wrap; }
  .stats-banner { gap: 28px; }
  .stat-value { font-size: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: center; }
  .btn-lg { width: 100%; justify-content: center; }
  .key.white { width: 32px; height: 140px; margin-right: 1px; }
  .key.black { width: 22px; height: 86px; margin-left: -11px; }
  .key-label { font-size: 9px; }
  .key.black .key-label { font-size: 7px; }
}

/* ── Utility Helpers ── */
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.text-center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; clip: rect(0,0,0,0); overflow: hidden; }

/* ── AI Music Assistant ── */
.ai-section {
  padding: 80px clamp(16px, 5vw, 64px);
  background: var(--primary);
  border-top: 1px solid var(--border);
}
.ai-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
}
.ai-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  backdrop-filter: blur(8px);
}
.key-config-card.needs-config {
  border-color: rgba(239,68,68,0.25);
}
.key-config-card.configured {
  border-color: rgba(34,197,94,0.25);
}
.key-config-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}
.key-config-card h3 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  margin: 0;
}
.key-config-card .status-indicator {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(212,175,55,0.08);
}
.key-config-card.needs-config .status-indicator {
  color: #F87171;
  background: rgba(239,68,68,0.12);
}
.key-config-card.configured .status-indicator {
  color: var(--cta);
  background: rgba(34,197,94,0.12);
}
.key-input-row, .key-status-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.key-input-row input {
  flex: 1;
}
.key-status-row .masked-key {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
}
.key-status-row code {
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.input-card.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* AI Results View states */
.results-card {
  min-height: 380px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.results-empty-state, .results-loading-state, .results-error-state {
  text-align: center;
  padding: 40px 20px;
}
.results-empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  animation: pulse-rec 2s ease infinite;
}
.results-error-state .error-icon {
  font-size: 40px;
  margin-bottom: 14px;
}
.results-loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.musical-waves {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 48px;
  margin-bottom: 24px;
}
.musical-waves span {
  width: 4px;
  background: var(--accent-gold);
  border-radius: 2px;
  animation: wavePulse 1.2s ease-in-out infinite;
}
.musical-waves span:nth-child(1) { height: 16px; animation-delay: -1.0s; }
.musical-waves span:nth-child(2) { height: 32px; animation-delay: -0.8s; }
.musical-waves span:nth-child(3) { height: 48px; animation-delay: -0.6s; }
.musical-waves span:nth-child(4) { height: 24px; animation-delay: -0.4s; }
.musical-waves span:nth-child(5) { height: 38px; animation-delay: -0.2s; }

@keyframes wavePulse {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

/* Success notes structure */
.results-success-view {
  animation: fadeIn 0.4s ease;
}
.results-success-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 20px;
}
.notation-toggle-pill {
  display: flex;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: 999px;
}
.toggle-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: var(--transition);
}
.toggle-pill-btn.active {
  background: var(--accent-gold);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(212,175,55,0.25);
}

.result-lines-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}
.result-line-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 14px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.result-line-row:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(212,175,55,0.22);
}
.play-line-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(212,175,55,0.1);
  border: 1px solid rgba(212,175,55,0.3);
  color: var(--accent-gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.play-line-btn:hover {
  background: var(--accent-gold);
  color: var(--primary);
  transform: scale(1.05);
}
.play-line-btn.playing {
  background: var(--cta);
  border-color: var(--cta);
  color: var(--primary);
  animation: pulse-rec 1.2s ease infinite;
}
.line-content {
  flex: 1;
}
.notes-line-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--font-heading);
}
.notes-line-container .note-item {
  background: rgba(212,175,55,0.07);
  border: 1px solid rgba(212,175,55,0.18);
  color: var(--accent-gold);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
}
.lyrics-line-text {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.4;
}
.results-success-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  font-size: 12px;
  color: var(--text-secondary);
}

@media (max-width: 900px) {
  .ai-grid {
    grid-template-columns: 1fr;
  }
}

