:root {
  color-scheme: light;
  --emerald-deep: #064e3b;
  --emerald: #059669;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Poppins", sans-serif;
  background: linear-gradient(135deg, #f7f0e5 0%, #fdf9f1 100%);
  overflow-x: hidden;
}

.font-hero {
  font-family: "Caveat", cursive;
}

.hero-background {
  background-image: url("img/bg-hero.jpg");
  background-size: cover;
  background-position: center;
}

@media (max-width: 640px) {
  .hero-background {
    background-position: 70% center;
  }
}

/* ---------------------------------- */
/* Botones hero (brillo al pasar)     */
/* ---------------------------------- */
.hero-button {
  position: relative;
  overflow: hidden;
}

.hero-button::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 20%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 80%
  );
  transform: translateX(-120%);
  transition: transform 0.7s ease;
}

.hero-button:hover::after,
.hero-button:focus-visible::after {
  transform: translateX(120%);
}

/* ---------------------------------- */
/* Tarjetas de personajes             */
/* ---------------------------------- */
.illustration-card {
  position: relative;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.illustration-card:hover,
.illustration-card:focus-visible {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 18px 35px rgba(16, 55, 33, 0.13);
}

.illustration-card:focus-visible {
  outline: 3px solid var(--emerald);
  outline-offset: 3px;
}

.illustration-card:active {
  transform: scale(0.97);
}

.speech {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 5;
  max-width: 92%;
  background: #ffffff;
  color: #065f46;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: 1rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
  animation: pop-in 0.3s ease;
  pointer-events: none;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes wobble {
  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(-7deg) scale(1.08);
  }
  75% {
    transform: rotate(7deg) scale(1.08);
  }
}

.wobble {
  animation: wobble 0.55s ease;
}

/* ---------------------------------- */
/* Flotado suave para decoración      */
/* ---------------------------------- */
@keyframes floaty {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.float-hero {
  animation: floaty 5s ease-in-out infinite;
}

/* ---------------------------------- */
/* Hojas flotantes en el hero         */
/* ---------------------------------- */
.leaf {
  position: absolute;
  top: -8%;
  opacity: 0;
  animation: leaf-fall linear infinite;
  will-change: transform;
  pointer-events: none;
  user-select: none;
}

@keyframes leaf-fall {
  0% {
    transform: translateY(-6vh) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 0.9;
  }
  85% {
    opacity: 0.7;
  }
  100% {
    transform: translateY(112vh) rotate(340deg);
    opacity: 0;
  }
}

/* ---------------------------------- */
/* Countdown                          */
/* ---------------------------------- */
.countdown-box {
  min-width: 4rem;
  border-radius: 1rem;
  border: 1px solid rgba(6, 78, 59, 0.12);
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  padding: 0.5rem 0.25rem 0.4rem;
  text-align: center;
}

.countdown-value {
  display: block;
  font-size: clamp(1.5rem, 6vw, 2.25rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--emerald-deep);
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-top: 0.15rem;
}

.countdown-sep {
  font-size: clamp(1.25rem, 5vw, 1.75rem);
  font-weight: 700;
  color: rgba(6, 78, 59, 0.45);
  padding-bottom: 1.6rem;
}

.countdown-done {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 9999px;
  border: 1px solid rgba(6, 78, 59, 0.15);
  background: rgba(255, 255, 255, 0.75);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 0.6rem 1.4rem;
  font-weight: 600;
  color: var(--emerald-deep);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

@media (max-width: 380px) {
  .countdown-box {
    min-width: 3.1rem;
    padding: 0.4rem 0.1rem 0.3rem;
  }

  .countdown-label {
    font-size: 0.55rem;
  }

  .countdown-sep {
    padding-bottom: 1.3rem;
  }
}

/* ---------------------------------- */
/* Marquee decorativo                 */
/* ---------------------------------- */
.marquee {
  overflow: hidden;
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 24s linear infinite;
}

.marquee:hover .marquee-track {
  animation-play-state: paused;
}

.marquee-group {
  display: inline-flex;
  gap: 3rem;
  padding-right: 3rem;
  white-space: nowrap;
  font-size: 1.4rem;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ---------------------------------- */
/* Aparición al hacer scroll          */
/* ---------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.7s ease,
    transform 0.7s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------------------------------- */
/* Confeti                            */
/* ---------------------------------- */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;
}

/* ---------------------------------- */
/* Movimiento fluido + accesibilidad  */
/* ---------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .float-hero,
  .marquee-track,
  .leaf,
  .countdown-box {
    animation: none !important;
  }

  .illustration-card:hover,
  .illustration-card:focus-visible {
    transform: none;
  }
}
