/* ==========================================================================
   FreeBeatHub — Main Stylesheet
   Royalty-Free Music for Every Creator
   --------------------------------------------------------------------------
   Table of Contents
   1.  Design Tokens (CSS Custom Properties) + Dark Theme
   2.  Reset & Base
   3.  Typography
   4.  Layout helpers (container, sections, grid)
   5.  Buttons
   6.  Header / Navigation
   7.  Hero
   8.  Search & Filters
   9.  Music Cards & Audio Player
   10. Category Cards
   11. Feature / Why-Us Cards
   12. Pricing
   13. Accordion / FAQ
   14. Blog
   15. Forms / Contact
   16. Footer
   17. Utilities, Badges, Notifications
   18. Animations
   19. Accessibility
   20. Responsive (media queries)
   ========================================================================== */

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
  /* Brand / accent */
  --c-primary:        #2563eb;
  --c-primary-rgb:    37, 99, 235;
  --c-primary-hover:  #1d4ed8;
  --c-primary-soft:   #eff4ff;
  --c-accent:         #7c3aed;
  --c-accent-2:       #06b6d4;

  /* Surfaces & background (LIGHT THEME default) */
  --c-bg:             #ffffff;
  --c-bg-soft:        #f5f7fb;
  --c-bg-softer:      #eef2f8;
  --c-surface:        #ffffff;
  --c-surface-alt:    #f8fafc;

  /* Text */
  --c-text:           #0f172a;
  --c-text-soft:      #475569;
  --c-text-muted:     #64748b;
  --c-text-invert:    #ffffff;

  /* Borders & lines */
  --c-border:         #e6eaf2;
  --c-border-strong:  #d4dbe8;

  /* States */
  --c-success:        #16a34a;
  --c-warning:        #d97706;
  --c-danger:         #dc2626;
  --c-star:           #f59e0b;

  /* Gradients */
  --grad-primary:     linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --grad-soft:        linear-gradient(135deg, #eff4ff 0%, #f5f0ff 100%);
  --grad-hero:        radial-gradient(1200px 600px at 80% -10%, #e8efff 0%, rgba(232,239,255,0) 60%),
                      radial-gradient(900px 500px at 0% 0%, #f3ecff 0%, rgba(243,236,255,0) 55%);

  /* Shadows (soft, premium) */
  --shadow-xs:  0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm:  0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md:  0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg:  0 18px 48px rgba(15, 23, 42, 0.12);
  --shadow-primary: 0 12px 30px rgba(37, 99, 235, 0.28);

  /* Radii */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Spacing scale */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  /* Layout */
  --container:    1200px;
  --container-lg: 1360px;
  --header-h:     72px;

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 0.15s;
  --t-med:  0.3s;
  --t-slow: 0.6s;
}

/* DARK THEME — applied via [data-theme="dark"] on <html> */
[data-theme="dark"] {
  --c-primary-soft:  #16223c;

  --c-bg:            #0b1120;
  --c-bg-soft:       #0f172a;
  --c-bg-softer:     #131c30;
  --c-surface:       #131c30;
  --c-surface-alt:   #18233b;

  --c-text:          #f1f5f9;
  --c-text-soft:     #cbd5e1;
  --c-text-muted:    #94a3b8;

  --c-border:        #243049;
  --c-border-strong: #324063;

  --grad-soft:       linear-gradient(135deg, #16223c 0%, #1d1633 100%);
  --grad-hero:       radial-gradient(1200px 600px at 80% -10%, #16223c 0%, rgba(11,17,32,0) 60%),
                     radial-gradient(900px 500px at 0% 0%, #1d1633 0%, rgba(11,17,32,0) 55%);

  --shadow-xs:  0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm:  0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md:  0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg:  0 18px 48px rgba(0, 0, 0, 0.55);
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
  overflow-x: clip; /* never allow sideways scroll; clip preserves sticky header */
}

body {
  margin: 0;
  width: 100%;
  max-width: 100%;
  font-family: var(--font-sans);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--t-med) var(--ease), color var(--t-med) var(--ease);
  overflow-x: hidden;
  overflow-wrap: break-word; /* long words/URLs wrap instead of forcing width */
}

img, svg, video { max-width: 100%; display: block; height: auto; }
img { border-radius: inherit; }

a { color: var(--c-primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--c-primary-hover); }

button { font-family: inherit; cursor: pointer; }

ul, ol { margin: 0; padding: 0; }
li { list-style: none; }

input, textarea, select, button { font-family: inherit; font-size: inherit; }

:focus-visible {
  outline: 3px solid rgba(var(--c-primary-rgb), 0.45);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ==========================================================================
   3. TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-text);
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.6rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); }
h4 { font-size: 1.2rem; }
p  { margin: 0 0 1rem; color: var(--c-text-soft); }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-primary);
  margin-bottom: var(--sp-3);
}
.text-gradient {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.lead { font-size: 1.18rem; color: var(--c-text-soft); }

/* ==========================================================================
   4. LAYOUT HELPERS
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}
.container--wide { max-width: var(--container-lg); }

.section { padding-block: var(--sp-9); }
.section--sm { padding-block: var(--sp-7); }
.section--soft { background: var(--c-bg-soft); }

.section-head { text-align: center; max-width: 720px; margin: 0 auto var(--sp-7); }
.section-head p { font-size: 1.1rem; }

.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }

.center { text-align: center; }
.mt-6 { margin-top: var(--sp-6); }
.mt-7 { margin-top: var(--sp-7); }

/* ==========================================================================
   5. BUTTONS
   ========================================================================== */
.btn {
  --btn-bg: var(--c-primary);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: 0.97rem;
  line-height: 1;
  position: relative;
  overflow: hidden;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-med), background var(--t-fast), color var(--t-fast);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); color: var(--btn-fg); }
.btn:active { transform: translateY(0); }

.btn--primary { box-shadow: var(--shadow-primary); }
.btn--primary:hover { background: var(--c-primary-hover); }

.btn--secondary {
  --btn-bg: var(--c-surface);
  --btn-fg: var(--c-text);
  border-color: var(--c-border-strong);
  box-shadow: var(--shadow-xs);
}
.btn--secondary:hover { --btn-bg: var(--c-surface-alt); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--c-text-soft);
}
.btn--ghost:hover { --btn-bg: var(--c-bg-soft); --btn-fg: var(--c-text); }

.btn--light {
  --btn-bg: rgba(255,255,255,0.16);
  --btn-fg: #fff;
  backdrop-filter: blur(6px);
  border-color: rgba(255,255,255,0.3);
}
.btn--light:hover { --btn-bg: rgba(255,255,255,0.26); }

.btn--lg { padding: 16px 30px; font-size: 1.05rem; }
.btn--sm { padding: 9px 16px; font-size: 0.85rem; }
.btn--block { display: flex; width: 100%; }
.btn--icon { padding: 11px; border-radius: var(--r-pill); }

/* Ripple effect element */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.5);
  animation: ripple 0.6s linear;
  pointer-events: none;
}
@keyframes ripple { to { transform: scale(3.5); opacity: 0; } }

/* ==========================================================================
   6. HEADER / NAVIGATION
   ========================================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--c-bg); /* fallback for browsers without color-mix */
  background: color-mix(in srgb, var(--c-bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-med), box-shadow var(--t-med), background var(--t-med);
}
.header.is-scrolled {
  border-color: var(--c-border);
  box-shadow: var(--shadow-sm);
}
.header__inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--c-text);
  flex-shrink: 0;
}
.logo:hover { color: var(--c-text); }
.logo__mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.logo__mark svg { width: 22px; height: 22px; }

.nav { display: flex; align-items: center; gap: 2px; margin-inline: auto; }
.nav__link {
  padding: 9px 14px;
  border-radius: var(--r-sm);
  color: var(--c-text-soft);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav__link:hover { color: var(--c-text); background: var(--c-bg-soft); }
.nav__link.is-active { color: var(--c-primary); background: var(--c-primary-soft); }

.header__actions { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }

/* Search in header */
.header-search {
  position: relative;
  display: flex;
  align-items: center;
}
.header-search input {
  width: 210px;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  background: var(--c-bg-soft);
  color: var(--c-text);
  transition: width var(--t-med) var(--ease), border-color var(--t-fast), background var(--t-fast);
  font-size: 0.9rem;
}
.header-search input:focus { width: 250px; background: var(--c-surface); border-color: var(--c-primary); }
.header-search svg { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--c-text-muted); pointer-events: none; }

/* Theme toggle */
.theme-toggle {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-soft);
  transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.theme-toggle:hover { color: var(--c-text); background: var(--c-bg-soft); transform: rotate(15deg); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Hamburger */
.hamburger {
  display: none;
  width: 42px; height: 42px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  place-items: center;
}
.hamburger svg { width: 22px; height: 22px; }

/* Mobile drawer */
.mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 1100;
  visibility: hidden;
  pointer-events: none;
}
.mobile-nav.is-open { visibility: visible; pointer-events: auto; }
.mobile-nav__overlay {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity var(--t-med);
}
.mobile-nav.is-open .mobile-nav__overlay { opacity: 1; }
.mobile-nav__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(360px, 86vw);
  background: var(--c-bg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform var(--t-med) var(--ease);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  overflow-y: auto;
}
.mobile-nav.is-open .mobile-nav__panel { transform: translateX(0); }
.mobile-nav__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.mobile-nav__link {
  padding: 14px 16px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--c-text);
}
.mobile-nav__link:hover, .mobile-nav__link.is-active { background: var(--c-primary-soft); color: var(--c-primary); }
.mobile-nav__search { margin-bottom: var(--sp-3); }
.mobile-nav__search input {
  width: 100%; padding: 13px 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-bg-soft);
  color: var(--c-text);
}

/* ==========================================================================
   7. HERO
   ========================================================================== */
.hero {
  position: relative;
  padding-block: clamp(var(--sp-7), 9vw, 120px);
  background: var(--grad-hero), var(--c-bg);
  overflow: hidden;
}
.hero__inner { position: relative; z-index: 2; text-align: center; max-width: 860px; margin-inline: auto; }
.hero h1 { margin-bottom: var(--sp-4); }
.hero .lead { max-width: 680px; margin: 0 auto var(--sp-6); }
.hero__cta { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

/* Animated wave background */
.hero__wave { position: absolute; left: 0; right: 0; bottom: -2px; z-index: 1; opacity: 0.7; pointer-events: none; }
.hero__wave svg { width: 100%; height: 160px; }
.wave-path { animation: waveShift 8s ease-in-out infinite alternate; }
@keyframes waveShift { from { transform: translateX(0); } to { transform: translateX(-40px); } }

/* Floating music icons */
.floaties { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.floaty {
  position: absolute;
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--c-surface);
  color: var(--c-primary);
  box-shadow: var(--shadow-md);
  animation: float 6s ease-in-out infinite;
}
.floaty svg { width: 26px; height: 26px; }
.floaty:nth-child(1) { top: 18%; left: 8%; animation-delay: 0s; }
.floaty:nth-child(2) { top: 26%; right: 9%; animation-delay: 1s; color: var(--c-accent); }
.floaty:nth-child(3) { bottom: 28%; left: 14%; animation-delay: 2s; color: var(--c-accent-2); }
.floaty:nth-child(4) { bottom: 22%; right: 13%; animation-delay: 1.5s; }
.floaty:nth-child(5) { top: 50%; left: 4%; animation-delay: 0.5s; color: var(--c-accent); }
.floaty:nth-child(6) { top: 58%; right: 5%; animation-delay: 2.5s; color: var(--c-accent-2); }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-4deg);} 50% { transform: translateY(-18px) rotate(4deg);} }

/* Hero stats */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4);
  margin-top: var(--sp-8);
  position: relative; z-index: 2;
}
.stat {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat__num { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; color: var(--c-primary); letter-spacing: -0.03em; }
.stat__label { font-size: 0.92rem; color: var(--c-text-muted); font-weight: 500; }

/* ==========================================================================
   8. SEARCH & FILTERS
   ========================================================================== */
.searchbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  padding: 8px 8px 8px 18px;
  box-shadow: var(--shadow-md);
  max-width: 640px;
  margin: 0 auto;
  min-width: 0; /* allow the bar to shrink inside flex parents on small screens */
}
.searchbar svg { width: 22px; height: 22px; color: var(--c-text-muted); flex-shrink: 0; }
.searchbar input { flex: 1; min-width: 0; border: none; background: transparent; color: var(--c-text); padding: 10px 0; outline: none; }
.searchbar input::placeholder { color: var(--c-text-muted); }

.chip-row { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: center; margin-top: var(--sp-4); }
.chip {
  padding: 7px 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-soft);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--t-fast);
}
.chip:hover { border-color: var(--c-primary); color: var(--c-primary); }
.chip.is-active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }

/* Browse layout: sidebar + grid */
.browse-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--sp-6); align-items: start; }
.browse-layout > * { min-width: 0; } /* grid items must be allowed to shrink */

.filter-panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  position: sticky;
  top: calc(var(--header-h) + 16px);
  box-shadow: var(--shadow-sm);
}
.filter-group { padding-block: var(--sp-4); border-bottom: 1px solid var(--c-border); }
.filter-group:last-child { border-bottom: none; }
.filter-group__title {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--c-text-muted); margin-bottom: var(--sp-3);
}
.filter-options { display: flex; flex-direction: column; gap: 6px; max-height: 230px; overflow-y: auto; padding-right: 4px; }
.filter-options.is-scroll { padding-right: 8px; }
.check {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.9rem; color: var(--c-text-soft);
  cursor: pointer; padding: 4px 6px; border-radius: var(--r-sm);
}
.check:hover { background: var(--c-bg-soft); }
.check input { width: 17px; height: 17px; accent-color: var(--c-primary); cursor: pointer; }

.range { width: 100%; accent-color: var(--c-primary); }
.range-vals { display: flex; justify-content: space-between; font-size: 0.82rem; color: var(--c-text-muted); margin-top: 4px; }

.filter-select {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--c-border); border-radius: var(--r-sm);
  background: var(--c-bg-soft); color: var(--c-text);
}

/* Toolbar above results */
.results-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); margin-bottom: var(--sp-5); flex-wrap: wrap;
}
.results-bar__count { color: var(--c-text-muted); font-size: 0.92rem; }
.mobile-filter-btn { display: none; }

/* ==========================================================================
   9. MUSIC CARDS & AUDIO PLAYER
   ========================================================================== */
.track-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: var(--sp-5); }

.track-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med), border-color var(--t-fast);
  display: flex; flex-direction: column;
  min-width: 0; /* allow the card to shrink inside grid/flex parents */
}
.track-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--c-border-strong); }

.track-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid; place-items: center;
  color: #fff;
  overflow: hidden;
}
.track-card__thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.35) 100%);
}
.track-card__genre-icon { width: 46px; height: 46px; opacity: 0.92; z-index: 1; transition: opacity var(--t-med), visibility var(--t-med); }
.track-card:hover .track-card__genre-icon,
.track-card.is-playing .track-card__genre-icon { opacity: 0; visibility: hidden; }
.track-play {
  position: absolute; z-index: 2;
  width: 58px; height: 58px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.92);
  color: var(--c-primary);
  display: grid; place-items: center;
  box-shadow: var(--shadow-md);
  opacity: 0; transform: scale(0.8);
  transition: opacity var(--t-med), transform var(--t-med) var(--ease);
}
.track-card:hover .track-play { opacity: 1; transform: scale(1); }
/* Touch devices have no hover, so the play button must always be visible. */
@media (hover: none) {
  .track-play { opacity: 1; transform: scale(1); }
  .track-card__genre-icon { display: none; }
}
.track-play svg { width: 26px; height: 26px; }
.track-play .icon-pause { display: none; }
.track-card.is-playing .track-play { opacity: 1; transform: scale(1); }
.track-card.is-playing .track-play .icon-play { display: none; }
.track-card.is-playing .track-play .icon-pause { display: block; }

.track-card__duration {
  position: absolute; bottom: 10px; right: 10px; z-index: 2;
  background: rgba(0,0,0,0.6); color: #fff;
  font-size: 0.75rem; font-weight: 600;
  padding: 3px 8px; border-radius: var(--r-pill);
}

/* Waveform (CSS bars) */
.waveform { display: flex; align-items: flex-end; gap: 2px; height: 36px; padding: var(--sp-3) var(--sp-4) 0; }
.waveform span {
  flex: 1; background: var(--c-border-strong); border-radius: 2px;
  transition: background var(--t-fast);
}
.track-card.is-playing .waveform span { background: var(--c-primary); animation: bar 0.9s ease-in-out infinite; }
.track-card.is-playing .waveform span:nth-child(odd) { animation-delay: 0.15s; }
.track-card.is-playing .waveform span:nth-child(3n) { animation-delay: 0.3s; }
@keyframes bar { 0%,100% { transform: scaleY(0.4);} 50% { transform: scaleY(1);} }

.track-card__body { padding: var(--sp-4); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.track-card__title { font-size: 1.05rem; font-weight: 700; color: var(--c-text); margin: 0; }
.track-card__artist { font-size: 0.85rem; color: var(--c-text-muted); margin: 0; }
.track-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.track-tag {
  font-size: 0.72rem; font-weight: 600;
  padding: 3px 9px; border-radius: var(--r-pill);
  background: var(--c-bg-soft); color: var(--c-text-soft);
}
.track-card__footer {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--c-border);
  margin-top: auto;
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--c-border);
  background: var(--c-surface); color: var(--c-text-soft);
  transition: all var(--t-fast);
}
.icon-btn:hover { color: var(--c-primary); border-color: var(--c-primary); background: var(--c-primary-soft); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.is-fav { color: var(--c-danger); border-color: var(--c-danger); background: rgba(220,38,38,0.08); }
.track-card__footer .btn { margin-left: auto; }

/* Sticky audio player bar */
.player-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 1050;
  overflow: hidden; /* fixed element must never expand the page width */
  background: var(--c-surface); /* fallback for browsers without color-mix */
  background: color-mix(in srgb, var(--c-surface) 92%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -8px 24px rgba(15,23,42,0.1);
  transform: translateY(110%);
  transition: transform var(--t-med) var(--ease);
}
.player-bar.is-active { transform: translateY(0); }
.player-bar__inner { display: flex; align-items: center; gap: var(--sp-4); padding: 12px var(--sp-5); max-width: var(--container-lg); margin-inline: auto; }
.player-bar__thumb { width: 48px; height: 48px; border-radius: var(--r-md); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.player-bar__thumb svg { width: 22px; height: 22px; }
.player-bar__info { min-width: 0; }
.player-bar__title { font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-bar__artist { font-size: 0.8rem; color: var(--c-text-muted); }
.player-bar__btn {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--c-primary); color: #fff; display: grid; place-items: center; flex-shrink: 0;
}
.player-bar__btn svg { width: 22px; height: 22px; }
.player-bar__btn .icon-pause { display: none; }
.player-bar.is-playing .player-bar__btn .icon-play { display: none; }
.player-bar.is-playing .player-bar__btn .icon-pause { display: block; }
.player-progress { flex: 1; display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.player-progress__time { font-size: 0.78rem; color: var(--c-text-muted); font-variant-numeric: tabular-nums; }
.player-track { flex: 1; height: 6px; border-radius: var(--r-pill); background: var(--c-bg-softer); position: relative; cursor: pointer; }
.player-track__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: var(--r-pill); background: var(--c-primary); }
.player-bar__close { margin-left: var(--sp-2); }

/* ==========================================================================
   10. CATEGORY CARDS
   ========================================================================== */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: var(--sp-4); }
.cat-card {
  position: relative;
  display: flex; flex-direction: column; justify-content: flex-end; gap: var(--sp-2);
  min-height: 182px;
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  /* Gradient fallback shows if the cover photo is missing. */
  background: var(--grad-primary) center / cover no-repeat;
  color: #fff;
  border: none;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
  will-change: transform;
}
/* Photo layer — inherits the per-category cover set inline on the card.
   Kept on its own layer so it can zoom on hover and be faded independently
   of the text in light mode. */
.cat-card::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image: inherit;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: scale(1.02);
  transition: transform var(--t-slow) var(--ease), filter var(--t-med) var(--ease);
}
/* Bottom shade keeps the white text readable over any photo. */
.cat-card::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,0.64) 0%, rgba(0,0,0,0.16) 55%, rgba(0,0,0,0) 100%);
  transition: background var(--t-med) var(--ease);
}
.cat-card:hover::before { transform: scale(1.1); }
.cat-card:hover::after { background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(var(--c-primary-rgb),0.28) 55%, rgba(var(--c-primary-rgb),0.06) 100%); }
.cat-card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: 0 22px 50px rgba(var(--c-primary-rgb), 0.30), var(--shadow-lg);
  color: #fff;
}
.cat-card:focus-visible { outline: 3px solid rgba(var(--c-primary-rgb), 0.55); outline-offset: 3px; }

/* Light theme: gently fade / soften the photos for a calmer, premium look.
   Fade is done purely with filters (no transparency) so the card's own
   background copy never bleeds through. */
[data-theme="light"] .cat-card::before { filter: brightness(1.12) saturate(0.72) contrast(0.92); }
[data-theme="light"] .cat-card:hover::before { filter: brightness(1.04) saturate(0.9) contrast(0.98); }

.cat-card__icon {
  width: 50px; height: 50px; border-radius: 15px;
  display: grid; place-items: center; color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.30);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
  transition: transform var(--t-med) var(--ease), background var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}
.cat-card__icon svg { width: 25px; height: 25px; }
.cat-card:hover .cat-card__icon {
  transform: translateY(-2px) scale(1.08);
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.55);
}
.cat-card__title {
  font-size: 1.15rem; font-weight: 700; color: #fff; margin: 0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.38);
  transition: transform var(--t-med) var(--ease);
}
.cat-card:hover .cat-card__title { transform: translateY(-2px); }
.cat-card__count { font-size: 0.85rem; color: rgba(255, 255, 255, 0.90); text-shadow: 0 1px 3px rgba(0,0,0,0.3); }
/* Soft light bloom for depth — brightens and drifts on hover. */
.cat-card__glow {
  position: absolute; top: -55px; right: -55px; width: 160px; height: 160px;
  border-radius: 50%; z-index: 1; opacity: 0.85;
  background: radial-gradient(circle, rgba(255,255,255,0.40), rgba(255,255,255,0) 70%);
  transition: transform var(--t-slow) var(--ease), opacity var(--t-med) var(--ease);
}
.cat-card:hover .cat-card__glow { transform: translate(-12px, 16px) scale(1.25); opacity: 1; }
/* Thin inner highlight ring that sharpens on hover for a crisp, premium edge. */
.cat-card__ring {
  content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
  transition: box-shadow var(--t-med) var(--ease);
}
.cat-card:hover .cat-card__ring { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.45); }
.cat-card > * { position: relative; z-index: 3; }
@media (prefers-reduced-motion: reduce) {
  .cat-card, .cat-card::before, .cat-card__icon, .cat-card__title, .cat-card__glow { transition: none; }
  .cat-card:hover { transform: none; }
  .cat-card:hover::before { transform: scale(1.02); }
}

/* ==========================================================================
   11. FEATURE / WHY-US CARDS
   ========================================================================== */
.feature-card {
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med);
}
.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.feature-card__icon {
  width: 54px; height: 54px; border-radius: var(--r-md);
  display: grid; place-items: center; margin-bottom: var(--sp-4);
  background: var(--c-primary-soft); color: var(--c-primary);
}
.feature-card__icon svg { width: 27px; height: 27px; }
.feature-card h3 { font-size: 1.15rem; margin-bottom: 6px; }
.feature-card p { margin: 0; font-size: 0.95rem; }

/* Steps / how it works */
.step { text-align: center; padding: var(--sp-4); }
.step__num {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center; margin: 0 auto var(--sp-4);
  background: var(--grad-primary); color: #fff; font-weight: 800; font-size: 1.3rem;
  box-shadow: var(--shadow-primary);
}

/* CTA band */
.cta-band {
  background: var(--grad-primary);
  border-radius: var(--r-xl);
  padding: clamp(var(--sp-6), 6vw, var(--sp-8));
  text-align: center;
  color: #fff;
  box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.9); max-width: 560px; margin: 0 auto var(--sp-5); }
.cta-band__cta { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }

/* ==========================================================================
   12. PRICING
   ========================================================================== */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); align-items: stretch; }
.price-card {
  display: flex; flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med);
}
.price-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.price-card.is-featured { border: 2px solid var(--c-primary); box-shadow: var(--shadow-primary); }
.price-badge {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  background: var(--grad-primary); color: #fff;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 6px 16px; border-radius: var(--r-pill);
}
.price-card__name { font-size: 1.25rem; font-weight: 800; }
.price-card__desc { color: var(--c-text-muted); font-size: 0.92rem; margin-bottom: var(--sp-4); }
.price-card__price { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.03em; }
.price-card__price span { font-size: 1rem; font-weight: 500; color: var(--c-text-muted); }
.price-list { display: flex; flex-direction: column; gap: var(--sp-3); margin: var(--sp-5) 0; flex: 1; }
.price-list li { display: flex; align-items: flex-start; gap: 10px; font-size: 0.93rem; color: var(--c-text-soft); }
.price-list svg { width: 20px; height: 20px; color: var(--c-success); flex-shrink: 0; margin-top: 1px; }
.price-list .no svg { color: var(--c-text-muted); }
.price-list .no { color: var(--c-text-muted); text-decoration: line-through; }

/* ==========================================================================
   13. ACCORDION / FAQ
   ========================================================================== */
.accordion { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--sp-3); }
.acc-item {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: box-shadow var(--t-fast), border-color var(--t-fast);
}
.acc-item.is-open { border-color: var(--c-primary); box-shadow: var(--shadow-sm); }
.acc-trigger {
  width: 100%; text-align: left;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: transparent; border: none;
  font-size: 1.02rem; font-weight: 600; color: var(--c-text);
}
.acc-trigger:hover { color: var(--c-primary); }
.acc-icon { flex-shrink: 0; width: 22px; height: 22px; color: var(--c-primary); transition: transform var(--t-med) var(--ease); }
.acc-item.is-open .acc-icon { transform: rotate(45deg); }
.acc-panel {
  max-height: 0; overflow: hidden;
  transition: max-height var(--t-med) var(--ease);
}
.acc-panel__inner { padding: 0 var(--sp-5) var(--sp-5); color: var(--c-text-soft); }

/* FAQ category tabs */
.faq-tabs { display: flex; gap: var(--sp-2); flex-wrap: wrap; justify-content: center; margin-bottom: var(--sp-6); }

/* ==========================================================================
   14. BLOG
   ========================================================================== */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--sp-5); }
.post-card {
  display: flex; flex-direction: column;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med);
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); color: var(--c-text); }
.post-card__img { aspect-ratio: 16/9; display: grid; place-items: center; color: #fff; }
.post-card__img svg { width: 56px; height: 56px; opacity: 0.9; }
.post-card__body { padding: var(--sp-5); display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card__cat { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--c-primary); }
.post-card__title { font-size: 1.18rem; font-weight: 700; color: var(--c-text); margin: 0; }
.post-card__excerpt { font-size: 0.92rem; color: var(--c-text-soft); margin: 0; }
.post-card__meta { display: flex; align-items: center; gap: var(--sp-3); margin-top: auto; padding-top: var(--sp-3); font-size: 0.82rem; color: var(--c-text-muted); }

/* Blog post article */
.article { max-width: 760px; margin: 0 auto; }
.article__header { margin-bottom: var(--sp-6); }
.article__meta { display: flex; align-items: center; gap: var(--sp-4); color: var(--c-text-muted); font-size: 0.9rem; flex-wrap: wrap; margin-top: var(--sp-3); }
.article__hero { aspect-ratio: 16/8; border-radius: var(--r-lg); display: grid; place-items: center; color: #fff; margin-bottom: var(--sp-6); }
.article__hero svg { width: 80px; height: 80px; opacity: 0.9; }
.article-body { font-size: 1.08rem; line-height: 1.8; color: var(--c-text-soft); }
.article-body h2 { margin-top: var(--sp-7); }
.article-body h3 { margin-top: var(--sp-6); }
.article-body p { margin-bottom: var(--sp-4); }
.article-body ul { margin: 0 0 var(--sp-4) var(--sp-5); }
.article-body ul li { list-style: disc; margin-bottom: 8px; }
.article-body blockquote {
  border-left: 4px solid var(--c-primary);
  padding: var(--sp-3) var(--sp-5);
  background: var(--c-bg-soft);
  border-radius: var(--r-sm);
  margin: var(--sp-5) 0; font-style: italic; color: var(--c-text);
}
.article-body img { border-radius: var(--r-md); margin: var(--sp-5) 0; }

.toc {
  background: var(--c-bg-soft);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  margin-bottom: var(--sp-6);
}
.toc h4 { margin-bottom: var(--sp-3); }
.toc a { display: block; padding: 6px 0; color: var(--c-text-soft); font-size: 0.95rem; }
.toc a:hover { color: var(--c-primary); }

.author-box {
  display: flex; gap: var(--sp-4); align-items: center;
  padding: var(--sp-5);
  background: var(--c-bg-soft);
  border-radius: var(--r-lg);
  margin: var(--sp-7) 0;
}
.author-box__avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--grad-primary); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.4rem; flex-shrink: 0; }

.share-row { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }

/* layout with TOC sidebar */
.article-layout { display: grid; grid-template-columns: 260px 1fr; gap: var(--sp-7); align-items: start; max-width: var(--container); margin-inline: auto; }
.article-layout .toc { position: sticky; top: calc(var(--header-h) + 16px); margin-bottom: 0; }

/* ==========================================================================
   15. FORMS / CONTACT
   ========================================================================== */
.form-grid { display: grid; gap: var(--sp-4); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 0.9rem; color: var(--c-text); }
.field input, .field textarea, .field select {
  padding: 13px 16px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  color: var(--c-text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb), 0.15);
}
.field textarea { resize: vertical; min-height: 140px; }
.field--error input, .field--error textarea { border-color: var(--c-danger); }
.field__err { color: var(--c-danger); font-size: 0.82rem; display: none; }
.field--error .field__err { display: block; }

.contact-layout { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: var(--sp-6); align-items: start; }
.contact-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); padding: var(--sp-6); box-shadow: var(--shadow-sm);
}
.contact-info-item { display: flex; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.contact-info-item__icon { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--c-primary-soft); color: var(--c-primary); display: grid; place-items: center; flex-shrink: 0; }
.map-embed { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--c-border); aspect-ratio: 16/10; background: var(--c-bg-soft); display: grid; place-items: center; color: var(--c-text-muted); position: relative; }
.map-embed svg { width: 48px; height: 48px; }

/* Newsletter */
.newsletter-form { display: flex; gap: var(--sp-2); max-width: 460px; flex-wrap: wrap; }
.newsletter-form input { flex: 1; min-width: 0; padding: 13px 16px; border-radius: var(--r-pill); border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text); }

/* ==========================================================================
   16. FOOTER
   ========================================================================== */
.footer { background: var(--c-bg-soft); border-top: 1px solid var(--c-border); padding-top: var(--sp-8); margin-top: var(--sp-9); }
.footer__top { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: var(--sp-6); padding-bottom: var(--sp-7); }
.footer__brand p { font-size: 0.92rem; max-width: 280px; margin-top: var(--sp-3); }
.footer__col h4 { font-size: 0.95rem; margin-bottom: var(--sp-4); }
.footer__col a { display: block; padding: 5px 0; color: var(--c-text-soft); font-size: 0.9rem; }
.footer__col a:hover { color: var(--c-primary); }
.footer__social { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); }
.footer__social a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--c-surface); border: 1px solid var(--c-border); color: var(--c-text-soft); }
.footer__social a:hover { color: var(--c-primary); border-color: var(--c-primary); transform: translateY(-3px); transition: all var(--t-fast); }
.footer__social svg { width: 18px; height: 18px; }
.footer__bottom {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-3);
  padding-block: var(--sp-5); border-top: 1px solid var(--c-border);
  font-size: 0.85rem; color: var(--c-text-muted);
}
.footer__bottom-links { display: flex; gap: var(--sp-4); flex-wrap: wrap; }

/* ==========================================================================
   17. UTILITIES, BADGES, NOTIFICATIONS, BREADCRUMB
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-pill);
  background: var(--c-primary-soft); color: var(--c-primary);
  font-size: 0.8rem; font-weight: 600;
}
.badge--success { background: rgba(22,163,74,0.12); color: var(--c-success); }

.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--c-text-muted); margin-bottom: var(--sp-4); }
.breadcrumb a { color: var(--c-text-muted); }
.breadcrumb a:hover { color: var(--c-primary); }
.breadcrumb li:not(:last-child)::after { content: "/"; margin-left: 8px; color: var(--c-border-strong); }

.page-hero { background: var(--grad-hero), var(--c-bg-soft); padding-block: var(--sp-8); text-align: center; }
.page-hero .lead { max-width: 640px; margin-inline: auto; }

/* Toast notifications */
.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-left: 4px solid var(--c-success);
  padding: 14px 18px; border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); min-width: 280px; max-width: 360px;
  transform: translateX(120%); opacity: 0;
  transition: transform var(--t-med) var(--ease), opacity var(--t-med);
}
.toast.is-show { transform: translateX(0); opacity: 1; }
.toast svg { width: 22px; height: 22px; color: var(--c-success); flex-shrink: 0; }
.toast__msg { font-size: 0.92rem; color: var(--c-text); }

/* Skeleton loading */
.skeleton { background: linear-gradient(90deg, var(--c-bg-soft) 25%, var(--c-bg-softer) 50%, var(--c-bg-soft) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r-md); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.empty-state { text-align: center; padding: var(--sp-8) var(--sp-4); color: var(--c-text-muted); }
.empty-state svg { width: 64px; height: 64px; margin: 0 auto var(--sp-4); opacity: 0.5; }

/* Skip link */
.skip-link {
  position: absolute; left: 50%; transform: translateX(-50%) translateY(-120%);
  top: 8px; z-index: 2000;
  background: var(--c-primary); color: #fff;
  padding: 10px 18px; border-radius: var(--r-pill);
  transition: transform var(--t-fast);
}
.skip-link:focus { transform: translateX(-50%) translateY(0); color: #fff; }

.hide { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   18. ANIMATIONS (scroll reveal)
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   19. ACCESSIBILITY helpers
   ========================================================================== */
[hidden] { display: none !important; }
::selection { background: rgba(var(--c-primary-rgb), 0.2); }

/* ==========================================================================
   20. RESPONSIVE
   ========================================================================== */
/* Laptop: tighten footer + header search */
@media (max-width: 1100px) {
  .footer__top { grid-template-columns: 1fr 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
  .header-search input { width: 160px; }
}

/* Laptop → tablet: collapse 2-column page layouts, move filters off-canvas */
@media (max-width: 1024px) {
  .browse-layout { grid-template-columns: 1fr; }
  .filter-panel {
    position: fixed; inset: 0; z-index: 1100;
    border-radius: 0; transform: translateX(-100%);
    transition: transform var(--t-med) var(--ease);
    overflow-y: auto; width: min(340px, 90vw); top: 0; bottom: 0; left: 0; right: auto;
    box-shadow: var(--shadow-lg);
  }
  .filter-panel.is-open { transform: translateX(0); }
  .mobile-filter-btn { display: inline-flex; }
  .article-layout { grid-template-columns: 1fr; }
  .article-layout .toc { position: static; }
}

/* Tablet: switch primary nav to the hamburger drawer */
@media (max-width: 900px) {
  .nav, .header-search { display: none; }
  .hamburger { display: grid; }
  /* Nav carried margin-inline:auto, so without it pin actions to the right
     instead of letting them bunch up next to the logo. */
  .header__actions { margin-left: auto; }
  .header__actions .download-cta { display: none; }
  .pricing-grid { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
  .contact-layout { grid-template-columns: 1fr; }
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Small tablet / large phone landscape */
@media (max-width: 768px) {
  :root { --header-h: 64px; }
  .section { padding-block: var(--sp-8); }
  .hero { padding-block: clamp(var(--sp-6), 8vw, 72px); }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__bottom { flex-direction: column; text-align: center; }
}

/* Phones: single-column everything, full-width controls, tighter gutters */
@media (max-width: 600px) {
  .container { padding-inline: var(--sp-4); }
  .section { padding-block: var(--sp-7); }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .track-grid { grid-template-columns: minmax(0, 1fr); }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-grid { grid-template-columns: 1fr; }
  .floaty { display: none; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { width: 100%; }
  .searchbar .btn { padding-inline: var(--sp-4); } /* keep "Search" from crowding */
  .results-bar__count { display: none; } /* hide "N tracks" count on mobile */
  .track-play { opacity: 1; transform: scale(1); } /* always show play on small screens */
  .track-card__genre-icon { display: none; } /* no background icon behind play on mobile */
  .player-progress__time { display: none; } /* compact mobile player; keep seek bar */
  .player-bar__inner { gap: var(--sp-3); padding-inline: var(--sp-4); }
  .footer__top { grid-template-columns: 1fr; }
  .footer__bottom-links { justify-content: center; }
  .newsletter-form { flex-direction: column; }
  .newsletter-form .btn { width: 100%; }
  /* Home: show only the first 4 cards in the featured sections on mobile. */
  #homeCategories > :nth-child(n+5),
  #featuredTracks > :nth-child(n+5) { display: none; }
}

/* Small phones */
@media (max-width: 380px) {
  .cat-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
  .searchbar { padding: 6px 6px 6px 14px; }
}
