/**
 * animations.css
 * Holzwerk Wagner — Schreinerei Demo-Website
 * Zweck: Keyframe-Animationen, Transitions, Scroll-Reveal-Klassen
 * ----------------------------------------------------------------- */

/* ================================================================
   SCROLL REVEAL — Basis
================================================================ */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.reveal.from-left  { transform: translateX(-50px); }
.reveal.from-right { transform: translateX(50px); }
.reveal.from-bottom { transform: translateY(60px); }
.reveal.scale-in   { transform: scale(0.93) translateY(20px); }
.reveal.fade-only  { transform: none; }

.reveal.visible {
  opacity: 1;
  transform: none;
}

/* Gestaffelte Verzögerungen */
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.delay-5 { transition-delay: 0.5s; }
.delay-6 { transition-delay: 0.6s; }

/* ================================================================
   GRADIENT ANIMATIONS
================================================================ */
@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

@keyframes heroGrad {
  0%, 100% { background-position: 0% 0%; }
  50%       { background-position: 100% 100%; }
}

/* ================================================================
   FLOATING / PULSING
================================================================ */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 135, 58, 0.5); }
  70%       { box-shadow: 0 0 0 12px rgba(200, 135, 58, 0); }
}

@keyframes pulseRing {
  0%   { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ================================================================
   SCROLL INDICATOR
================================================================ */
@keyframes scrollBounce {
  0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 1; }
  50%       { transform: rotate(45deg) translate(5px, 5px); opacity: 0.5; }
}

/* ================================================================
   WORD ROTATION
================================================================ */
.word-rotate-container {
  display: inline-block;
  position: relative;
  overflow: hidden;
  height: 1.15em;
  vertical-align: bottom;
}

.word-rotate-track {
  display: flex;
  flex-direction: column;
  transition: transform 0.65s cubic-bezier(0.23, 1, 0.32, 1);
}

.word-item {
  height: 1.15em;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .word-rotate-container {
    display: block;
    height: 1.15em;
  }
  .word-item {
    justify-content: center;
  }
}

/* ================================================================
   COUNTER
================================================================ */
.counter-value {
  display: inline-block;
  transition: transform 0.3s var(--ease-spring);
}

/* ================================================================
   ORB ANIMATIONS (Kontakt-Section)
================================================================ */
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(25px, -20px) scale(1.06); }
  66%       { transform: translate(-15px, 25px) scale(0.94); }
}

@keyframes orbFloat2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(-20px, 15px) scale(0.95); }
  66%       { transform: translate(20px, -25px) scale(1.05); }
}

/* ================================================================
   TIMELINE LINIE
================================================================ */
.timeline-track {
  position: relative;
  overflow: hidden;
}

.timeline-track::before {
  content: '';
  position: absolute;
  top: 32px;
  left: calc(100% / 8);
  right: calc(100% / 8);
  height: 2px;
  background: var(--border);
  z-index: 0;
}

@media (max-width: 768px) {
  .timeline-track::before {
    top: 0;
    bottom: 0;
    left: 31px;
    right: auto;
    width: 2px;
    height: auto;
  }
}

.timeline-progress {
  position: absolute;
  top: 32px;
  left: calc(100% / 8);
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  z-index: 1;
  transition: width 1.6s var(--ease-out);
  right: calc(100% / 8);
}

.timeline-progress.animate { width: calc(100% - 100% / 4); }

@media (max-width: 768px) {
  .timeline-progress {
    top: 0;
    bottom: 0;
    left: 31px;
    right: auto;
    width: 2px;
    height: 0;
    transition: height 1.6s var(--ease-out);
  }
  .timeline-progress.animate {
    height: 100%;
    width: 2px;
  }
}

/* ================================================================
   FAQ ACCORDION
================================================================ */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s var(--ease-out), padding 0.3s ease;
}

.faq-answer.open {
  max-height: 400px;
}

.faq-chevron {
  transition: transform 0.35s var(--ease-out);
  flex-shrink: 0;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

/* ================================================================
   STAR RATING
================================================================ */
.star {
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.3s ease, transform 0.3s var(--ease-spring);
  color: var(--accent2);
}

.star.visible {
  opacity: 1;
  transform: scale(1);
}

/* ================================================================
   CARD HOVER
================================================================ */
.card-hover {
  transition: transform 0.3s var(--ease-out),
              box-shadow 0.3s var(--ease-out),
              border-color 0.3s ease;
}

.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* ================================================================
   NAV LINK UNDERLINE
================================================================ */
.nav-link-underline {
  position: relative;
}

.nav-link-underline::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s var(--ease-out);
  border-radius: 2px;
}

.nav-link-underline:hover::after,
.nav-link-underline.active::after {
  width: 100%;
}

/* ================================================================
   WOOD GRAIN (pseudo-element helper)
================================================================ */
.wood-grain {
  position: relative;
}

.wood-grain::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    92deg,
    transparent 0px,
    transparent 8px,
    rgba(200,135,58,0.025) 8px,
    rgba(200,135,58,0.025) 10px
  );
  pointer-events: none;
  z-index: 0;
}

/* ================================================================
   BUTTON GRADIENT ANIMATION
================================================================ */
.btn-animated-grad {
  background: linear-gradient(135deg, var(--accent), var(--accent2), var(--accent));
  background-size: 200% 200%;
  animation: gradShift 3s ease infinite;
}

/* ================================================================
   GLOW EFFECT
================================================================ */
.accent-glow {
  position: relative;
}

.accent-glow::before {
  content: '';
  position: absolute;
  inset: -30px;
  background: radial-gradient(ellipse, rgba(200,135,58,0.15) 0%, transparent 70%);
  filter: blur(30px);
  z-index: -1;
  pointer-events: none;
}
