/* ═══════════════════════════════════════════════════════════
   animations.css — Hero animations, hover effects, particles,
                    keyframes, tilt cards, cursor glow
   ═══════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════
   HERO SECTION
   ══════════════════════════════════════════════════ */
.hero {
  min-height: 85vh;
  background: var(--forest);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 80% at 70% 50%, rgba(122, 158, 126, 0.12) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 20% 80%, rgba(196, 149, 106, 0.08) 0%, transparent 60%);
}

/* Advanced Animated SVG Reef / Plants */
.hero-reef {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.8;
}

.grow-plant {
  animation: swayPlant 14s ease-in-out infinite alternate;
}

.grow-plant.left-plant {
  animation-delay: -4s;
  transform-origin: 100px 800px;
}

.grow-plant.right-plant {
  animation-delay: -1s;
  transform-origin: 1340px 800px;
}

.plant-stem {
  stroke-dasharray: 2000;
  stroke-dashoffset: 2000;
  animation: growStem 3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.leaf-anim {
  transform-origin: var(--origin);
  animation: growLeaf 2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  opacity: 0;
  transform: scale(0) rotate(-15deg);
  animation-delay: var(--delay);
}

.rain-leaf {
  opacity: 0;
  animation: fallLeaf linear infinite;
  transform-origin: center;
  transition: filter 0.4s ease, transform 0.4s ease;
}

.rain-leaf.water-active {
  filter: url(#waterRipple) drop-shadow(0 4px 12px rgba(122, 158, 126, 0.4));
}

/* ── Hero Content Layout ── */
.hero-grain {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.6;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 100px 40px 80px;
  max-width: 1240px;
  margin: 0 auto;
  width: 100%;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(122, 158, 126, 0.15);
  border: 1px solid rgba(122, 158, 126, 0.25);
  border-radius: 40px;
  padding: 8px 18px;
  margin-bottom: 16px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mint);
  letter-spacing: 0.04em;
  animation: fadeUp 0.6s ease both;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5.5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.03em;
  color: var(--linen);
  margin-bottom: 20px;
  animation: fadeUp 0.6s ease 0.1s both;
}

.hero-title-accent { color: var(--sage); }
.hero-title-gold { color: var(--gold); font-style: italic; }

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(242, 237, 228, 0.6);
  line-height: 1.7;
  max-width: 520px;
  margin-bottom: 24px;
  animation: fadeUp 0.6s ease 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeUp 0.6s ease 0.3s both;
}

/* ── Hero Stats ── */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(122, 158, 126, 0.15);
  margin-top: 50px;
  animation: fadeUp 0.6s ease 0.5s both;
  position: relative;
  z-index: 2;
}

.hero-stat {
  padding: 14px;
  border-right: 1px solid rgba(122, 158, 126, 0.1);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.hero-stat:last-child { border-right: none; }

.hero-stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--mint);
  letter-spacing: -0.03em;
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.8rem;
  color: rgba(184, 212, 184, 0.5);
  margin-top: 6px;
}

/* Hatched divider inside card */
.card-hatch {
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--sage) 0, var(--sage) 6px, transparent 6px, transparent 12px);
  margin: 0 -28px;
  position: relative;
  z-index: 0;
}

/* ── Glow Orb ── */
.glow-orb {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(184, 212, 184, 0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: top 1.2s cubic-bezier(0.25, 1, 0.5, 1), left 1.2s cubic-bezier(0.25, 1, 0.5, 1);
  filter: blur(40px);
  z-index: 1;
}

/* ── Custom Cursor Glow ── */
#cursor-glow {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(122, 158, 126, 0.08), transparent 50%);
  border-radius: 50%;
  position: fixed;
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
  top: 0;
  left: 0;
}

/* ══════════════════════════════════════════════════
   SHOP PAGE ANIMATIONS
   ══════════════════════════════════════════════════ */
.shop-header {
  background: var(--linen);
  padding: 80px 0 60px;
}

.shop-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.filter-btn {
  padding: 7px 18px;
  border-radius: 20px;
  border: 1.5px solid var(--sand);
  background: white;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--stone);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
}

.filter-btn:hover,
.filter-btn.active {
  border-color: var(--moss);
  background: var(--moss);
  color: white;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 40px;
}

.product-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--sand);
  transition: var(--transition);
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
}

.product-image {
  height: 220px;
  background: linear-gradient(135deg, var(--sage) 0%, var(--moss) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}

.product-image-bg {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: radial-gradient(circle, white 1px, transparent 1px);
  background-size: 20px 20px;
}

.product-eco-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(26, 51, 32, 0.85);
  backdrop-filter: blur(8px);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--mint);
  border: 1px solid rgba(122, 158, 126, 0.3);
}

.product-body { padding: 22px; }

.product-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--forest);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.product-desc {
  font-size: 0.82rem;
  color: var(--stone);
  line-height: 1.5;
  margin-bottom: 16px;
}

.product-pricing {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.product-price {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--forest);
}

.product-coins {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: #8A6D20;
  font-weight: 600;
  background: rgba(201, 168, 76, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
}

/* ══════════════════════════════════════════════════
   PREMIUM 3D TILT & HOVER EFFECTS
   ══════════════════════════════════════════════════ */
.tilt-card {
  transition: transform 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.15s ease;
  transform-style: preserve-3d;
  will-change: transform, box-shadow;
  position: relative;
  overflow: hidden;
}

.tilt-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle 400px at var(--mouse-x, 0) var(--mouse-y, 0), rgba(255, 255, 255, 0.25), transparent 40%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 10;
  mix-blend-mode: overlay;
}

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

/* ── Particle System ── */
.particles-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  bottom: 0;
  animation: floatParticle var(--duration, 2s) ease-out forwards;
  transform: translateX(var(--drift, 0px)) scale(var(--scale, 1));
  font-size: 1rem;
  line-height: 1;
}

/* ══════════════════════════════════════════════════
   KEYFRAMES
   ══════════════════════════════════════════════════ */
@keyframes growStem {
  to { stroke-dashoffset: 0; }
}

@keyframes growLeaf {
  0%   { opacity: 0; transform: scale(0) rotate(-15deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes swayPlant {
  0%   { transform: rotate(-2deg); }
  100% { transform: rotate(2deg); }
}

@keyframes fallLeaf {
  0%   { transform: translateY(-50px) translateX(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.5; }
  85%  { opacity: 0.5; }
  100% { transform: translateY(850px) translateX(var(--sway)) rotate(var(--rot)); opacity: 0; }
}

@keyframes scrollLeft {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes floatParticle {
  0%   { transform: translateY(0) translateX(0) scale(var(--scale, 1)); opacity: 1; }
  100% { transform: translateY(-120px) translateX(var(--drift, 0px)) scale(var(--scale, 1)); opacity: 0; }
}

/* ── Animation Utility Classes ── */
.animate-fadeUp { animation: fadeUp 0.6s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero-content { padding: 140px 20px 60px; }
  .hero-stats { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero-title { margin-bottom: 20px; }
  .display-xl { font-size: 2.2rem; }
}
