/*
  ========================================================================
  PEACE WORLD - HOME PAGE SPECIFIC STYLING (home.css)
  ========================================================================
*/

.hero-section {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: radial-gradient(circle at top right, rgba(114, 125, 83, 0.08), transparent),
              radial-gradient(circle at bottom left, rgba(66, 124, 115, 0.05), transparent);
}

.hero-leaf-graphic {
  position: absolute;
  opacity: 0.1;
  pointer-events: none;
}

.hero-leaf-1 {
  top: 10%;
  right: 5%;
  width: 140px;
  animation: floatLeaf 8s ease-in-out infinite alternate;
}

.hero-leaf-2 {
  bottom: 15%;
  left: 5%;
  width: 100px;
  animation: floatLeaf 6s ease-in-out infinite alternate-reverse;
}

@keyframes floatLeaf {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(15px) rotate(10deg); }
}

/* Floating logo sitting above the Literary Pledge quote */
.pledge-logo-img {
  display: block;
  /* Grows from 84px on phones up to 120px on larger screens */
  width: clamp(84px, 10vw, 120px);
  height: auto;
  width: 20rem;
  margin: 0 auto;
  filter: drop-shadow(0 10px 18px rgba(44, 80, 74, 0.18));
  animation: floatLogo 6s ease-in-out infinite;
  will-change: transform;
}

/* Floating logo sitting above the Literary Pledge quote */
.pledge-logo-img2 {
  display: block;
  /* Grows from 84px on phones up to 120px on larger screens */
  width: clamp(84px, 10vw, 120px);
  height: auto;
  width: 20rem;
  margin: 0 auto;
  filter: drop-shadow(0 10px 18px rgba(44, 80, 74, 0.18));
  will-change: transform;
}

.pledge-logo-img3 {
  display: block;
  /* Grows from 84px on phones up to 120px on larger screens */
  width: clamp(60px, 10vw, 60px);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 10px 18px rgba(44, 80, 74, 0.18));
  will-change: transform;
}

/* Slow, gentle up-and-down drift */
@keyframes floatLogo {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-14px); }
}

html.dark .pledge-logo-img {
  filter: drop-shadow(0 10px 18px rgba(111, 179, 166, 0.15));
}

/* Landing category block hover elements */
.category-card {
  border: 1px solid var(--color-sand-dark);
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.4s ease,
    box-shadow 0.4s ease,
    background-color 0.4s ease;
  will-change: transform;
  /* Staggered entrance (cardRise below). Uses `backwards` — NOT `forwards` —
     so a filling keyframe never overrides the :hover transform afterwards. */
  animation: cardRise 0.65s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

/* One-by-one staggered reveal as the grid loads */
.category-card:nth-child(1) { animation-delay: 0.05s; }
.category-card:nth-child(2) { animation-delay: 0.12s; }
.category-card:nth-child(3) { animation-delay: 0.19s; }
.category-card:nth-child(4) { animation-delay: 0.26s; }
.category-card:nth-child(5) { animation-delay: 0.33s; }
.category-card:nth-child(6) { animation-delay: 0.40s; }
.category-card:nth-child(7) { animation-delay: 0.47s; }

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

.category-card:hover {
  transform: translateY(-10px);
  border-color: var(--color-teal);
  box-shadow:
    0 24px 48px -14px rgba(66, 124, 115, 0.22),
    0 8px 16px -8px rgba(66, 124, 115, 0.12);
}

/* Image container inside each category card — slow cinematic zoom on hover */
.category-card-img {
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.category-card:hover .category-card-img {
  transform: scale(1.08);
}

/* Floating emoji badge half-overlapping the image edge */
.category-card-badge {
  box-shadow: 0 10px 24px -8px rgba(15, 23, 42, 0.28);
}

/* Diagonal light "sheen" that sweeps across the card once on hover */
.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 10;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 65%
  );
  transform: translateX(-130%);
  transition: transform 0.9s ease;
  pointer-events: none;
}

.category-card:hover::after {
  transform: translateX(130%);
}

/* Dark-mode tuning (home.css loads after dark-mode.css, so these
   dark-scoped rules win the cascade at equal/greater specificity). */
html.dark .category-card:hover {
  box-shadow:
    0 24px 48px -14px rgba(111, 179, 166, 0.16),
    0 8px 16px -8px rgba(111, 179, 166, 0.08);
}

html.dark .category-card::after {
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 65%
  );
}

/* Motion-sensitive users get the cards without the theatrics */
@media (prefers-reduced-motion: reduce) {
  .category-card {
    animation: none;
  }
  .pledge-logo-img {
    animation: none;
  }
  .category-card:hover {
    transform: none;
  }
  .category-card:hover .category-card-img {
    transform: none;
  }
  .category-card::after {
    display: none;
  }
}
