/*
 * Main styles for ES Grower Club landing page
 *
 * The design uses a natural color palette inspired by growth and caring for
 * plants. Animations are subtle and organic to keep the focus on the core
 * message: the transition from the Telegram chat to the new Discord home.
 */

/* CSS reset to normalize margins and paddings across browsers */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  color: #2e3a23; /* dark earthy tone for text */
  background-color: #f6f9f3; /* very light green background to evoke freshness */
}

/* Root variables for easier theming */
:root {
  --color-background-start: #f0f8ec; /* soft greenish-white */
  --color-background-end: #e8f2e1;   /* slightly darker green */
  --color-primary: #6ba260;          /* medium green for buttons and highlights */
  --color-primary-dark: #547f4a;     /* darker green for hover states */
  --color-accent: #a6754f;           /* earthy accent (brownish) */
  --color-text: #2e3a23;             /* dark earthy tone for general text */
  --color-highlight: #4e8a38;        /* highlight color for headings */
}

/* HERO SECTION STYLES */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2rem 1rem;
  background: linear-gradient(150deg, var(--color-background-start) 0%, var(--color-background-end) 100%);
  position: relative;
  overflow: hidden;
}

/* Animated logo container */
.logo-animation {
  position: relative;
  width: 200px;
  height: 200px;
  margin-bottom: 1.5rem;
}

/* Base styles for both logos */
.logo-animation img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* We prevent pointer events to allow clicks through the logos */
  pointer-events: none;
}

/* Telegram logo animation: fades out and shrinks */
.telegram-logo {
  animation: fadeOutScale 8s infinite alternate ease-in-out;
}

/* Discord logo animation: fades in and grows */
.discord-logo {
  animation: fadeInScale 8s infinite alternate ease-in-out;
}

@keyframes fadeOutScale {
  0% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
  40% {
    opacity: 0;
    transform: scale(0.5) rotate(15deg);
  }
  100% {
    opacity: 0;
    transform: scale(0.5) rotate(15deg);
  }
}

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

/* HEADING STYLES */
h1 {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.4;
  max-width: 700px;
  margin-bottom: 2rem;
  color: var(--color-text);
}

@media (min-width: 500px) {
  h1 {
    font-size: 2.3rem;
  }
}

@media (min-width: 800px) {
  h1 {
    font-size: 2.7rem;
  }
}

.highlight {
  color: var(--color-highlight);
  font-weight: 700;
}

/* CTA BUTTON */
.cta-button {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-primary);
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.cta-button:hover,
.cta-button:focus {
  background-color: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.cta-button:active {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* Pulse animation used when the sprout is clicked */
@keyframes cta-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(107, 162, 96, 0.6);
    transform: translateY(-2px) scale(1);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(107, 162, 96, 0);
    transform: translateY(-2px) scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(107, 162, 96, 0);
    transform: translateY(-2px) scale(1);
  }
}

.cta-button.pulse {
  animation: cta-pulse 1.2s ease-out;
}

/* SPRUCE/ SPROUT ELEMENT */
/* Sprout container */
.sprout {
  margin-top: 2.5rem;
  width: 72px;
  height: 72px;
  position: relative;
  cursor: pointer;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Stem element */
.sprout .stem {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 4px;
  height: 40px;
  background-color: var(--color-primary-dark);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: height 0.35s ease;
}

/* Leaf elements */
.sprout .leaf {
  position: absolute;
  bottom: 32px;
  width: 28px;
  height: 18px;
  background-color: var(--color-primary);
  border-radius: 50% 50% 40% 40%;
  transform-origin: bottom center;
  transition: transform 0.4s ease;
}
.sprout .leaf.left {
  left: 50%;
  transform: translateX(-90%) rotate(-20deg);
}
.sprout .leaf.right {
  left: 50%;
  transform: translateX(-10%) rotate(20deg);
}

/* Hover effects to simulate the sprout unfurling */
.sprout:hover .stem {
  height: 45px;
}
.sprout:hover .leaf.left {
  transform: translateX(-100%) rotate(-35deg) scale(1.15);
}
.sprout:hover .leaf.right {
  transform: translateX(0%) rotate(35deg) scale(1.15);
}

/* Adjustments for smaller screens */
@media (max-width: 480px) {
  .logo-animation {
    width: 150px;
    height: 150px;
  }
  h1 {
    font-size: 1.6rem;
  }
  .cta-button {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
  }
  .sprout {
    margin-top: 2rem;
    width: 60px;
    height: 60px;
  }
  .sprout .stem {
    height: 35px;
  }
  .sprout:hover .stem {
    height: 40px;
  }
  .sprout .leaf {
    width: 22px;
    height: 14px;
  }
}