/* ============================================================
   WURZELWERK – animations.css
   Scroll-Fades, Hover-Effekte, Micro-Interactions
   ============================================================ */

/* ------------------------------------------------------------
   1. FADE-IN ON SCROLL
   Elemente mit .fade-in starten unsichtbar und werden durch
   IntersectionObserver in main.js mit .is-visible sichtbar
   ------------------------------------------------------------ */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Verzögerung für gestaffelte Einblendungen */
.fade-in--delay       { transition-delay: 0.15s; }
.fade-in--delay-2     { transition-delay: 0.3s; }
.fade-in--delay-3     { transition-delay: 0.45s; }

/* Kein Animation für Nutzer die reduzierte Bewegung bevorzugen */
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ------------------------------------------------------------
   2. PRESS LOGOS – Farb-Swap via CSS (Fallback für JS-less)
   ------------------------------------------------------------ */
.press__item {
  position: relative;
}

/* ------------------------------------------------------------
   3. SERVICE CARDS – Glow Border on Hover
   ------------------------------------------------------------ */
.service-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius-md) + 1px);
  background: linear-gradient(135deg, var(--color-green), transparent);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
  z-index: -1;
}

.service-card {
  position: relative;
}

.service-card:hover::before {
  opacity: 0.15;
}

/* ------------------------------------------------------------
   4. REFERENCE CARDS – Subtle glow
   ------------------------------------------------------------ */
.reference-card {
  position: relative;
}

/* ------------------------------------------------------------
   5. STAT BADGE – Pulse glow
   ------------------------------------------------------------ */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 165, 93, 0); }
  50%       { box-shadow: 0 0 20px 4px rgba(59, 165, 93, 0.15); }
}

.stat-badge {
  animation: pulse-glow 3s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .stat-badge { animation: none; }
}

/* ------------------------------------------------------------
   6. HERO PORTRAIT – Glow entrance
   ------------------------------------------------------------ */
@keyframes portrait-enter {
  from {
    opacity: 0;
    transform: translateY(20px);
    filter: drop-shadow(0 0 0px rgba(59, 165, 93, 0));
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: drop-shadow(0 0 40px rgba(59, 165, 93, 0.2));
  }
}

.hero__portrait {
  animation: portrait-enter 0.9s ease 0.3s both;
}

@media (prefers-reduced-motion: reduce) {
  .hero__portrait { animation: none; }
}

/* ------------------------------------------------------------
   7. HERO CONTENT – Staggered entrance
   ------------------------------------------------------------ */
@keyframes slide-up {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero__eyebrow   { animation: slide-up 0.6s ease 0.1s both; }
.hero__headline  { animation: slide-up 0.6s ease 0.2s both; }
.hero__subheadline { animation: slide-up 0.6s ease 0.3s both; }
.hero__actions   { animation: slide-up 0.6s ease 0.4s both; }

@media (prefers-reduced-motion: reduce) {
  .hero__eyebrow,
  .hero__headline,
  .hero__subheadline,
  .hero__actions { animation: none; }
}

/* ------------------------------------------------------------
   8. COOKIE BANNER – Slide up entrance
   ------------------------------------------------------------ */
@keyframes cookie-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.cookie-banner:not([hidden]) {
  animation: cookie-slide-up 0.35s ease;
}

/* ------------------------------------------------------------
   9. FORM INPUT FOCUS – Smooth highlight
   ------------------------------------------------------------ */
.check-form__input {
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.check-form__input:focus {
  background-color: rgba(255,255,255,0.07);
}

/* ------------------------------------------------------------
   10. BUTTON LOADING SPINNER
   ------------------------------------------------------------ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.8;
}

/* ------------------------------------------------------------
   11. NAV LINK UNDERLINE ANIMATION
   ------------------------------------------------------------ */
.nav__link {
  position: relative;
  padding-bottom: 2px;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-green);
  transition: width 0.25s ease;
}

.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
}

/* ------------------------------------------------------------
   12. PROBLEM CARDS – Stagger via nth-child
   ------------------------------------------------------------ */
.problem-card:nth-child(1) { transition-delay: 0s; }
.problem-card:nth-child(2) { transition-delay: 0.1s; }
.problem-card:nth-child(3) { transition-delay: 0.2s; }
.solution-card:nth-child(1) { transition-delay: 0s; }
.solution-card:nth-child(2) { transition-delay: 0.1s; }
.solution-card:nth-child(3) { transition-delay: 0.2s; }
.service-card:nth-child(1) { transition-delay: 0s; }
.service-card:nth-child(2) { transition-delay: 0.08s; }
.service-card:nth-child(3) { transition-delay: 0.16s; }
.service-card:nth-child(4) { transition-delay: 0.24s; }
