:root {
  --primary-green: #009763;
  --deep-green: #376153;
  --charcoal: #3e3e3e;
  --bright-green: #00ffa7;
  --cta-green: #16a34a;
  --dark-bg: #1c2e28;
  --green-04: #04ad73;
  --green-16: #167f3d;
  --green-17: #176735;
  --gray-51: #515151;
  --gray-79: #797979;
  --gray-c0: #c0c0c0;
  --white: #ffffff;
  --font: "Urbanist", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  background: var(--dark-bg);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}

.scene {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background:
    radial-gradient(ellipse 80% 50% at 50% 100%, #243d34 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 20% 30%, rgba(0, 151, 99, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse 50% 35% at 85% 20%, rgba(0, 255, 167, 0.06) 0%, transparent 45%),
    linear-gradient(180deg, #0f1f1a 0%, var(--dark-bg) 40%, #142620 100%);
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      rgba(15, 31, 26, 0.88) 0%,
      rgba(15, 31, 26, 0.72) 28%,
      rgba(15, 31, 26, 0.35) 48%,
      transparent 62%
    ),
    linear-gradient(
      180deg,
      rgba(15, 31, 26, 0.45) 0%,
      transparent 22%,
      transparent 70%,
      rgba(15, 31, 26, 0.55) 100%
    );
}

/* ——— Forest layers (official SVGs) ——— */
.forest {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.forest-layer {
  --parallax-x: 0px;
  --parallax-y: 0px;
  position: absolute;
  left: 50%;
  bottom: 0;
  width: max(140vw, 1600px);
  height: auto;
  max-width: none;
  display: block;
  transform-origin: 50% 100%;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

.forest-layer--dark {
  /* Fondo: se mueve más */
  transform: translate3d(calc(-50% + var(--parallax-x)), var(--parallax-y), 0) scale(1.02);
  opacity: 0.95;
  filter: brightness(0.85);
}

.forest-layer--green {
  /* Frente: se mueve menos */
  width: max(130vw, 1500px);
  transform: translate3d(calc(-48% + var(--parallax-x)), var(--parallax-y), 0) scale(1.04);
  opacity: 0.92;
}

.forest-fairies {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.fairy {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bright-green);
  box-shadow:
    0 0 8px 2px rgba(0, 255, 167, 0.55),
    0 0 20px 6px rgba(0, 255, 167, 0.22);
  opacity: 0;
  pointer-events: none;
}

/* Entre el follaje: trayectoria larga → desaparece → pausa ~20s → reinicia */
.fairy--1 {
  top: 62%;
  left: 42%;
  animation: fairy-route-a 40s linear infinite;
}

.fairy--2 {
  top: 68%;
  left: 72%;
  width: 4px;
  height: 4px;
  animation: fairy-route-b 42s linear infinite;
  animation-delay: -8s;
}

.fairy--3 {
  top: 52%;
  left: 58%;
  width: 4px;
  height: 4px;
  background: #a8ffe0;
  animation: fairy-route-c 44s linear infinite;
  animation-delay: -16s;
}

.fairy--4 {
  top: 74%;
  left: 48%;
  width: 3px;
  height: 3px;
  animation: fairy-route-alt 80s linear infinite;
  animation-delay: -24s;
}

.fairy--5 {
  top: 56%;
  left: 84%;
  width: 4px;
  height: 4px;
  background: #a8ffe0;
  animation: fairy-route-b 40s linear infinite;
  animation-delay: -32s;
}

.fairy--6 {
  top: 70%;
  left: 64%;
  width: 3px;
  height: 3px;
  animation: fairy-route-alt 80s linear infinite;
  animation-delay: -48s;
}

/* ——— Atmosphere ——— */
.atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.mist {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  animation: mist-drift 28s ease-in-out infinite;
}

.mist--1 {
  width: 55vw;
  height: 30vh;
  bottom: 8%;
  left: -10%;
  background: rgba(55, 97, 83, 0.55);
}

.mist--2 {
  width: 45vw;
  height: 25vh;
  bottom: 5%;
  right: -5%;
  background: rgba(0, 151, 99, 0.25);
  animation-delay: -9s;
  animation-duration: 34s;
}

.mist--3 {
  width: 40vw;
  height: 20vh;
  bottom: 18%;
  left: 30%;
  background: rgba(28, 46, 40, 0.7);
  animation-delay: -16s;
  animation-duration: 40s;
}

.glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.glow--left {
  width: 40vw;
  height: 50vh;
  top: -10%;
  left: -15%;
  background: radial-gradient(circle, rgba(0, 151, 99, 0.2) 0%, transparent 70%);
  animation: glow-pulse 8s ease-in-out infinite;
}

.glow--right {
  width: 35vw;
  height: 40vh;
  top: 5%;
  right: -10%;
  background: radial-gradient(circle, rgba(0, 255, 167, 0.08) 0%, transparent 70%);
  animation: glow-pulse 11s ease-in-out infinite reverse;
}

.glow--floor {
  width: 70vw;
  height: 35vh;
  bottom: -10%;
  left: 15%;
  background: radial-gradient(ellipse, rgba(0, 255, 167, 0.07) 0%, transparent 65%);
  animation: glow-pulse 14s ease-in-out infinite;
}

/* ——— Brand ——— */
.brand {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 4vw, 3rem);
  animation: fade-down 1s ease-out both;
}

.logo {
  width: clamp(168px, 28vw, 280px);
  height: auto;
  flex-shrink: 0;
  display: block;
}

/* ——— Content ——— */
.content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(1.25rem, 3vh, 2rem);
  max-width: min(36rem, 92vw);
  padding: 0 clamp(1.25rem, 4vw, 3rem);
  margin: 0;
  animation: fade-up 1.1s ease-out 0.15s both;
}

.eyebrow {
  font-size: clamp(0.8rem, 1.4vw, 0.95rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bright-green);
  line-height: 1.2;
  text-shadow: 0 0 24px rgba(0, 255, 167, 0.35);
}

.message {
  font-size: clamp(1.35rem, 3.2vw, 2.35rem);
  font-weight: 800;
  line-height: 1.22;
  color: var(--white);
  text-wrap: pretty;
  max-width: 24ch;
  text-shadow: 0 2px 28px rgba(12, 24, 20, 0.85);
}

@media (min-width: 768px) {
  .message {
    max-width: 30ch;
  }
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
  padding: 1rem 1.65rem;
  background: var(--cta-green);
  color: var(--white);
  font-family: var(--font);
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0);
  animation: cta-breathe 4s ease-in-out infinite;
}

.cta:hover {
  background: var(--white);
  color: var(--dark-bg);
  transform: translateY(-2px);
  box-shadow: 0 10px 36px rgba(22, 163, 74, 0.32);
  animation: none;
}

.cta:focus-visible {
  outline: 2px solid var(--cta-green);
  outline-offset: 4px;
}

.cta:active {
  transform: translateY(0);
}

.cta-arrow {
  display: flex;
  transition: transform 0.25s ease;
}

.cta:hover .cta-arrow {
  transform: translateX(4px);
}

/* ——— Footer ——— */
.footer {
  position: relative;
  z-index: 10;
  padding: clamp(1rem, 2.5vh, 1.5rem) clamp(1.25rem, 4vw, 3rem);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-c0);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  animation: fade-up 1s ease-out 0.45s both;
}

/* ——— Keyframes ——— */
/* ~50% vuelo (~20s) + ~50% pausa invisible (~20s) */
@keyframes fairy-route-a {
  0%   { transform: translate(0, 0) scale(0.4); opacity: 0; }
  4%   { opacity: 0.95; transform: translate(1vw, -1vh) scale(1); }
  18%  { transform: translate(8vw, -5vh) scale(1.15); opacity: 1; }
  32%  { transform: translate(16vw, -2vh) scale(0.95); opacity: 0.9; }
  44%  { transform: translate(22vw, -7vh) scale(1.1); opacity: 0.85; }
  50%  { transform: translate(24vw, -8vh) scale(0.4); opacity: 0; }
  50.01%, 100% { transform: translate(0, 0) scale(0.4); opacity: 0; }
}

@keyframes fairy-route-b {
  0%   { transform: translate(0, 0) scale(0.4); opacity: 0; }
  4%   { opacity: 0.9; transform: translate(-1vw, -0.5vh) scale(1); }
  16%  { transform: translate(-7vw, -4vh) scale(1.2); opacity: 1; }
  28%  { transform: translate(-14vw, 1vh) scale(0.9); opacity: 0.85; }
  40%  { transform: translate(-20vw, -3vh) scale(1.05); opacity: 0.95; }
  50%  { transform: translate(-22vw, -5vh) scale(0.4); opacity: 0; }
  50.01%, 100% { transform: translate(0, 0) scale(0.4); opacity: 0; }
}

@keyframes fairy-route-c {
  0%   { transform: translate(0, 0) scale(0.4); opacity: 0; }
  5%   { opacity: 0.9; transform: translate(0.5vw, 1vh) scale(1); }
  15%  { transform: translate(5vw, 4vh) scale(1.1); opacity: 1; }
  28%  { transform: translate(12vw, -1vh) scale(0.85); opacity: 0.8; }
  40%  { transform: translate(6vw, -6vh) scale(1.15); opacity: 0.95; }
  50%  { transform: translate(-2vw, -8vh) scale(0.4); opacity: 0; }
  50.01%, 100% { transform: translate(0, 0) scale(0.4); opacity: 0; }
}

/* Alterna dos trayectorias, con ~20s de pausa entre cada una */
@keyframes fairy-route-alt {
  0%   { transform: translate(0, 0) scale(0.4); opacity: 0; }
  2%   { opacity: 0.95; transform: translate(1vw, -1vh) scale(1); }
  9%   { transform: translate(9vw, -4vh) scale(1.15); opacity: 1; }
  16%  { transform: translate(18vw, 1vh) scale(0.9); opacity: 0.9; }
  23%  { transform: translate(24vw, -5vh) scale(1.05); opacity: 0.85; }
  25%  { transform: translate(26vw, -6vh) scale(0.4); opacity: 0; }
  25.01%, 50% { transform: translate(0, 0) scale(0.4); opacity: 0; }

  50.01% { transform: translate(0, 0) scale(0.4); opacity: 0; }
  52%  { opacity: 0.9; transform: translate(-1vw, 0.5vh) scale(1); }
  59%  { transform: translate(-8vw, 3vh) scale(1.2); opacity: 1; }
  66%  { transform: translate(-16vw, -2vh) scale(0.85); opacity: 0.85; }
  73%  { transform: translate(-10vw, -7vh) scale(1.1); opacity: 0.95; }
  75%  { transform: translate(-4vw, -9vh) scale(0.4); opacity: 0; }
  75.01%, 100% { transform: translate(0, 0) scale(0.4); opacity: 0; }
}

@keyframes mist-drift {
  0%, 100% { transform: translateX(0) translateY(0); }
  50% { transform: translateX(4vw) translateY(-2vh); }
}

@keyframes glow-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-down {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes cta-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
  50% { box-shadow: 0 0 24px 2px rgba(22, 163, 74, 0.28); }
}

/* ——— Responsive ——— */
@media (max-width: 640px) {
  .scene::after {
    background:
      linear-gradient(
        180deg,
        rgba(15, 31, 26, 0.55) 0%,
        rgba(15, 31, 26, 0.78) 35%,
        rgba(15, 31, 26, 0.82) 70%,
        rgba(15, 31, 26, 0.9) 100%
      );
  }

  .forest-layer--dark,
  .forest-layer--green {
    width: max(220vw, 900px);
  }

  .content {
    margin: 0;
    align-items: stretch;
    text-align: left;
    padding-bottom: 1rem;
    max-width: 100%;
  }

  .message {
    max-width: none;
    font-size: clamp(1.25rem, 6.5vw, 1.6rem);
  }

  .cta {
    justify-content: center;
    width: 100%;
  }

  .logo {
    width: clamp(150px, 55vw, 220px);
  }

  .footer {
    text-align: center;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .content {
    gap: 0.75rem;
  }

  .message {
    font-size: 1.15rem;
    max-width: 40ch;
  }

  .brand {
    padding-block: 0.75rem;
  }

  .footer {
    padding-block: 0.5rem;
  }

  .logo {
    width: 160px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
