/* ============================================
   WildVoices — Main Stylesheet
   Forest Nature Theme | Clean White
   ============================================ */

/* ---------- CSS Variables ---------- */
:root {
  --forest-dark:   #1a2e1a;
  --forest-mid:    #2d4a2d;
  --forest-light:  #4a7c4a;
  --leaf-green:    #6aab6a;
  --cream:         #f7f3ec;
  --cream-dark:    #ede8de;
  --bark:          #8B6F47;
  --amber:         #D4A843;
  --amber-light:   #f0c96a;
  --white:         #ffffff;
  --text-dark:     #1c1c1c;
  --text-mid:      #4a4a4a;
  --text-light:    #7a7a7a;
  --shadow-soft:   0 4px 24px rgba(26,46,26,0.10);
  --shadow-hover:  0 12px 40px rgba(26,46,26,0.20);
  --radius:        16px;
  --radius-sm:     10px;
  --transition:    0.28s cubic-bezier(0.4,0,0.2,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--cream);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--leaf-green); border-radius: 10px; }

/* ============================================
   PARTICLES
   ============================================ */
.particles {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.particle {
  position: absolute;
  opacity: 0;
  font-size: 18px;
  animation: floatParticle linear infinite;
  pointer-events: none;
  user-select: none;
}
@keyframes floatParticle {
  0%   { transform: translateY(110vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(26,46,26,0.08);
  box-shadow: 0 2px 16px rgba(26,46,26,0.06);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-icon { font-size: 24px; }
.logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--forest-dark);
  letter-spacing: -0.02em;
}
.nav-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  flex: 1;
  padding-bottom: 2px;
}
.nav-filters::-webkit-scrollbar { height: 3px; }
.filter-btn {
  background: transparent;
  border: 1.5px solid var(--cream-dark);
  color: var(--text-mid);
  border-radius: 40px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}
.filter-btn:hover {
  border-color: var(--leaf-green);
  color: var(--forest-mid);
  background: rgba(106,171,106,0.08);
}
.filter-btn.active {
  background: var(--forest-dark);
  border-color: var(--forest-dark);
  color: var(--white);
}
.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--forest-dark);
  margin-left: auto;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px 60px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(74,124,74,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 20% 100%, rgba(212,168,67,0.10) 0%, transparent 60%);
  z-index: 0;
}
.hero-content { position: relative; z-index: 1; max-width: 760px; }
.hero-eyebrow {
  display: inline-block;
  background: rgba(26,46,26,0.08);
  border: 1px solid rgba(26,46,26,0.12);
  border-radius: 40px;
  padding: 6px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--forest-mid);
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}
.hero-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  color: var(--forest-dark);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.hero-title span { color: var(--leaf-green); }
.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-mid);
  max-width: 520px;
  margin: 0 auto 40px;
  font-weight: 300;
  line-height: 1.7;
}
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}
.stat { text-align: center; }
.stat-number {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--forest-dark);
  line-height: 1;
}
.stat-label {
  font-size: 0.78rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}
.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--cream-dark);
}
.hero-scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-light);
  letter-spacing: 0.06em;
  z-index: 1;
}
.scroll-arrow {
  animation: bounce 1.6s ease-in-out infinite;
  font-size: 1.1rem;
  color: var(--leaf-green);
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ============================================
   SEARCH SECTION
   ============================================ */
.search-section {
  position: relative;
  z-index: 2;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 24px 28px;
}
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--white);
  border: 2px solid var(--cream-dark);
  border-radius: 50px;
  padding: 0 20px;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
}
.search-wrap:focus-within {
  border-color: var(--leaf-green);
  box-shadow: 0 4px 24px rgba(106,171,106,0.18);
}
.search-icon { font-size: 1.1rem; color: var(--text-light); flex-shrink: 0; }
.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 14px 12px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-dark);
}
.search-input::placeholder { color: var(--text-light); }
.search-clear {
  background: none;
  border: none;
  font-size: 0.9rem;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: none;
  transition: var(--transition);
  line-height: 1;
}
.search-clear:hover { color: var(--text-dark); background: var(--cream-dark); }
.search-clear.visible { display: flex; align-items: center; justify-content: center; }
.results-count {
  text-align: center;
  margin-top: 10px;
  font-size: 0.82rem;
  color: var(--text-light);
}

/* ============================================
   NOW PLAYING BAR
   ============================================ */
.now-playing {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  z-index: 200;
  background: var(--forest-dark);
  transform: translateY(100%);
  transition: transform 0.36s cubic-bezier(0.4,0,0.2,1);
}
.now-playing.visible { transform: translateY(0); }
.now-playing-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.np-wave {
  display: flex;
  align-items: center;
  gap: 3px;
}
.np-wave span {
  display: block;
  width: 3px;
  background: var(--amber);
  border-radius: 3px;
  animation: wave 0.8s ease-in-out infinite;
}
.np-wave span:nth-child(1) { height: 8px;  animation-delay: 0s; }
.np-wave span:nth-child(2) { height: 16px; animation-delay: 0.1s; }
.np-wave span:nth-child(3) { height: 22px; animation-delay: 0.2s; }
.np-wave span:nth-child(4) { height: 16px; animation-delay: 0.3s; }
.np-wave span:nth-child(5) { height: 8px;  animation-delay: 0.4s; }
@keyframes wave {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}
.np-text {
  flex: 1;
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 500;
}
.np-stop {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--white);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Inter', sans-serif;
}
.np-stop:hover { background: rgba(255,255,255,0.22); }

/* ============================================
   CREATURE GRID
   ============================================ */
.grid-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 120px;
}
.creature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

/* ============================================
   CREATURE CARD
   ============================================ */
.creature-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  border: 2px solid transparent;
  animation: cardIn 0.4s ease both;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.creature-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-hover);
  border-color: rgba(106,171,106,0.3);
}
.creature-card.playing {
  border-color: var(--amber);
  box-shadow: 0 8px 32px rgba(212,168,67,0.3);
  transform: translateY(-4px) scale(1.02);
}
.card-image-wrap {
  position: relative;
  width: 100%;
  padding-top: 75%;
  overflow: hidden;
  background: var(--cream-dark);
}
.card-image-wrap img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.creature-card:hover .card-image-wrap img {
  transform: scale(1.08);
}
.card-image-wrap .img-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: linear-gradient(135deg, var(--cream) 0%, var(--cream-dark) 100%);
}
.card-play-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 36px; height: 36px;
  background: var(--forest-dark);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  transform: scale(0.8);
}
.creature-card:hover .card-play-badge,
.creature-card.playing .card-play-badge {
  opacity: 1;
  transform: scale(1);
}
.creature-card.playing .card-play-badge { background: var(--amber); }
.card-category-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(26,46,26,0.75);
  backdrop-filter: blur(6px);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.card-body {
  padding: 14px 16px 16px;
}
.card-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--forest-dark);
  margin-bottom: 4px;
  line-height: 1.3;
}
.card-sciname {
  font-size: 0.72rem;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 8px;
  line-height: 1.4;
}
.card-habitat {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--forest-light);
  font-weight: 500;
}
.card-sound-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 10px;
  height: 20px;
}
.card-sound-bar span {
  display: block;
  width: 3px;
  background: var(--cream-dark);
  border-radius: 3px;
  height: 8px;
  transition: height 0.2s ease, background 0.2s ease;
}
.creature-card.playing .card-sound-bar span {
  background: var(--amber);
  animation: wave 0.8s ease-in-out infinite;
}
.creature-card.playing .card-sound-bar span:nth-child(1) { animation-delay: 0s; }
.creature-card.playing .card-sound-bar span:nth-child(2) { height: 14px; animation-delay: 0.1s; }
.creature-card.playing .card-sound-bar span:nth-child(3) { height: 18px; animation-delay: 0.2s; }
.creature-card.playing .card-sound-bar span:nth-child(4) { height: 14px; animation-delay: 0.3s; }
.creature-card.playing .card-sound-bar span:nth-child(5) { animation-delay: 0.4s; }

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-light);
}
.empty-icon { font-size: 4rem; display: block; margin-bottom: 16px; }
.empty-state p { font-size: 1.1rem; }

/* ============================================
   RIPPLE OVERLAY
   ============================================ */
.ripple-overlay {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
}
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: rippleAnim 0.8s ease-out forwards;
  background: radial-gradient(circle, rgba(212,168,67,0.3) 0%, transparent 70%);
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--forest-dark);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 48px 24px;
}
.footer-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  color: var(--white);
  margin-bottom: 12px;
}
.footer-tagline {
  font-size: 0.95rem;
  margin-bottom: 10px;
  color: rgba(255,255,255,0.6);
}
.footer-note {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .nav-filters {
    display: none;
    position: absolute;
    top: 68px;
    left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--cream-dark);
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }
  .nav-filters.open { display: flex; }
  .hamburger { display: block; }
  .creature-grid {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 14px;
  }
  .hero-stats { gap: 20px; }
  .stat-number { font-size: 1.5rem; }
}
@media (max-width: 480px) {
  .creature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .header-inner { padding: 0 16px; }
  .grid-section { padding: 0 12px 100px; }
}
