/* Musical Theme Base styles */
:root {
  --brand: #8B5CF6; /* Musical purple */
  --brand-dark: #7C3AED;
  --brand-light: #A78BFA;
  --accent: #F59E0B; /* Musical gold */
  --accent-dark: #D97706;
  --text: #1F2937;
  --muted: #6B7280;
  --bg: #FEFEFE;
  --surface: #F9FAFB;
  --surface-light: #F3F4F6;
  --border: #E5E7EB;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #FEFEFE 0%, #F8FAFC 100%);
  line-height: 1.6;
  position: relative;
}

/* Musical background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(16, 185, 129, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* Header & Nav */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(254, 254, 254, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 0;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.logo span {
  font-weight: 700;
  color: var(--text);
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.nav-item {
  position: relative;
}
.nav-link, .nav-button {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 10px;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
}
.nav-link:hover, .nav-button:hover {
  background: var(--surface);
  border-color: var(--border);
  transform: translateY(-1px);
}
.nav-item.active .nav-button {
  background: var(--surface);
  border-color: var(--brand);
  color: var(--brand);
}
.nav-button {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-button::after {
  content: '▼';
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}
.nav-item.active .nav-button::after {
  transform: rotate(180deg);
}
.dropdown {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  background: rgba(254, 254, 254, 0.98);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0,0,0,.1), 0 8px 16px rgba(0,0,0,.06);
  padding: 16px;
  display: none;
  width: min(880px, 90vw);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}
.dropdown.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 8px 16px;
}
.nav-item.active .dropdown { 
  display: grid; 
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown a {
  display: block;
  color: var(--text);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.dropdown a:hover { 
  background: var(--surface); 
  border-color: var(--border);
  transform: translateX(4px);
}

/* Hero */
.hero {
  padding: 60px 0 40px;
  text-align: center;
  position: relative;
}
.hero h1 { 
  margin: 0 0 16px; 
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.hero p { 
  margin: 0; 
  color: var(--muted);
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Sections */
section { padding: 40px 0; }
section h2 { 
  margin: 0 0 24px; 
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  position: relative;
  display: inline-block;
}
section h2::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  border-radius: 2px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  height: 100%;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--brand-light);
}
.card:hover img {
  transform: scale(1.05);
}
.card img { 
  width: 100%; 
  height: 200px; 
  object-fit: contain; 
  object-position: center;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 0;
  transition: transform 0.3s ease;
  display: block;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}
.card img:not([src]) {
  background: linear-gradient(45deg, var(--surface) 25%, transparent 25%), 
              linear-gradient(-45deg, var(--surface) 25%, transparent 25%), 
              linear-gradient(45deg, transparent 75%, var(--surface) 75%), 
              linear-gradient(-45deg, transparent 75%, var(--surface) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}
.card .card-body { 
  padding: 16px; 
  display: flex; 
  flex-direction: column; 
  flex-grow: 1;
  justify-content: space-between;
}
.card .card-title { 
  font-weight: 700; 
  margin: 0 0 12px; 
  font-size: 1.1rem;
  color: var(--text);
}
.card .card-links { 
  display: flex; 
  gap: 8px; 
  flex-wrap: wrap; 
  margin-top: auto;
}
.chip {
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}
.chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.chip.primary { 
  border-color: var(--brand); 
  background: linear-gradient(135deg, var(--brand-light), var(--brand)); 
  color: white; 
}
.chip.primary:hover {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
}

/* Content */
.prose p { margin: 0 0 12px; }
.prose h2 { margin-top: 31px; margin-bottom: 16px; }
.prose h3 { margin: 16px 0 8px; }
.prose ul { margin: 0 0 12px 18px; }

/* Footer */
footer {
  margin-top: 80px;
  border-top: 1px solid var(--border);
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
  position: relative;
}
footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), var(--accent), transparent);
}
footer .container { padding: 24px 16px; }
.muted { color: var(--muted); }

/* Interactive fingering */
.fingering {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}
.trumpet-container {
  position: relative;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  padding: 20px;
  overflow: hidden;
}

.trumpet-svg {
  width: 100%;
  height: auto;
  display: block;
}

.valve { 
  cursor: pointer; 
  transition: all 0.2s ease;
}

.valve:hover { 
  transform: scale(1.1); 
}

.valve:active { 
  transform: translateY(1px) scale(0.95); 
}

.valve.active circle { 
  fill: var(--brand) !important; 
  stroke: var(--brand-dark) !important; 
  stroke-width: 3 !important; 
  filter: drop-shadow(0 2px 4px rgba(139, 92, 246, 0.3));
}

.valve.active text {
  fill: white !important;
  font-weight: bold;
}

.valve circle {
  transition: all 0.2s ease;
}
.note-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 8px;
}
.note-btn {
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.note-btn:hover {
  background: var(--surface);
  border-color: var(--brand-light);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.note-btn.active { 
  outline: 2px solid var(--brand); 
  background: linear-gradient(135deg, var(--brand-light), var(--brand)); 
  color: white;
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(139, 92, 246, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
  .nav {
    flex-direction: column;
    gap: 16px;
    padding: 16px 0;
  }
  .nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  .dropdown.grid { 
    grid-template-columns: 1fr; 
    width: 100%;
    left: 0;
    right: 0;
  }
  .fingering { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
  }
  .card img {
    height: 180px;
    padding: 12px;
  }
  .card .card-links {
    flex-direction: column;
    gap: 6px;
  }
  .chip {
    text-align: center;
    padding: 6px 12px;
  }
}

/* Interactive Fingering Chart Styles */
.note-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}

.note-btn {
  padding: 12px 16px;
  border: 2px solid var(--border);
  background: white;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.note-btn:hover {
  border-color: var(--brand-light);
  background: var(--surface);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(139, 92, 246, 0.15);
}

.note-btn:active {
  transform: translateY(0);
}

.note-btn.active {
  border-color: var(--brand);
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Instrument container styles */
.trumpet-container,
.flute-container,
.instrument-container {
  background: white;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
}

/* SVG interactive elements */
.valve,
.key,
.flute-key,
.contrabassoon-key {
  cursor: pointer;
  transition: all 0.3s ease;
}

.valve:hover circle,
.key:hover circle,
.flute-key:hover,
.contrabassoon-key:hover circle {
  filter: brightness(1.1);
  stroke-width: 3;
  opacity: 0.9;
}

.valve.active circle {
  fill: var(--brand) !important;
  stroke: var(--brand-dark) !important;
}

.flute-key,
.contrabassoon-key {
  transition: fill 0.3s ease, stroke 0.3s ease, stroke-width 0.3s ease;
}


/* Blog Styles */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.blog-article {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.blog-article:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--brand-light);
}

.blog-article img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
}

.blog-article-content {
  padding: 20px;
}

.blog-article h3 {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.blog-article p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.6;
}

.blog-article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.blog-article-date {
  font-weight: 500;
}

.blog-article-category {
  background: var(--surface);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand);
}

.blog-article-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.blog-article-link:hover {
  color: var(--brand-dark);
  transform: translateX(4px);
}

.blog-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-light) 100%);
  border-radius: 16px;
  border: 2px dashed var(--border);
}

.empty-state-content h3 {
  margin: 0 0 16px;
  font-size: 1.5rem;
  color: var(--text);
}

.empty-state-content p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 1.1rem;
}

.empty-state-content ul {
  text-align: left;
  max-width: 400px;
  margin: 0 auto;
  color: var(--muted);
}

.empty-state-content li {
  margin-bottom: 8px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.category-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  padding: 24px;
  transition: all 0.3s ease;
  text-align: center;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-color: var(--brand-light);
}

.category-card h3 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.category-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Responsive adjustments for interactive charts */
@media (max-width: 768px) {
  .note-grid {
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 8px;
  }
  
  .note-btn {
    padding: 10px 12px;
    font-size: 0.9rem;
  }
  
  .trumpet-container,
  .flute-container,
  .instrument-container {
    padding: 16px;
  }
  
  .blog-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .category-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .blog-empty-state {
    padding: 40px 16px;
  }
}


