/* ============================================================
   LA FIAMMA — Animations Stylesheet
   ============================================================ */

/* Keyframe Definitions */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(30px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.06); opacity: 0.8; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-14px) rotate(1deg); }
  66%       { transform: translateY(-7px) rotate(-1deg); }
}

@keyframes orbitalFloat {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(5px, -10px) rotate(2deg); }
  50%  { transform: translate(0, -18px) rotate(0deg); }
  75%  { transform: translate(-5px, -8px) rotate(-2deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes ripple {
  0%   { transform: scale(0); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}

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

@keyframes flicker {
  0%, 95%, 100% { opacity: 1; }
  96%            { opacity: 0.85; }
  97%            { opacity: 0.95; }
  98%            { opacity: 0.8; }
}

@keyframes particleRise {
  0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0.6; }
  50%  { opacity: 0.4; }
  100% { transform: translateY(-80vh) translateX(var(--dx, 20px)) scale(0); opacity: 0; }
}

@keyframes borderGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,76,10,0); }
  50%       { box-shadow: 0 0 20px 4px rgba(232,76,10,0.3); }
}

@keyframes numberCount {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes drawLine {
  from { stroke-dashoffset: 1000; }
  to   { stroke-dashoffset: 0; }
}

@keyframes typewriter {
  from { width: 0; }
  to   { width: 100%; }
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Utility animation classes */
.anim-fade-in         { animation: fadeIn 0.6s ease forwards; }
.anim-fade-in-up      { animation: fadeInUp 0.7s ease forwards; }
.anim-fade-in-down    { animation: fadeInDown 0.6s ease forwards; }
.anim-fade-in-left    { animation: fadeInLeft 0.7s ease forwards; }
.anim-fade-in-right   { animation: fadeInRight 0.7s ease forwards; }
.anim-scale-in        { animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.anim-float           { animation: float 5s ease-in-out infinite; }
.anim-pulse           { animation: pulse 2s ease-in-out infinite; }
.anim-bounce          { animation: bounce 1.5s ease-in-out infinite; }
.anim-spin            { animation: spin 1s linear infinite; }

/* Shimmer loading skeleton */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--c-card) 25%,
    var(--c-elevated) 50%,
    var(--c-card) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}

/* Gradient animated bg */
.gradient-animated {
  background: linear-gradient(
    270deg,
    var(--c-primary),
    var(--c-gold),
    var(--c-primary-h),
    var(--c-gold-light)
  );
  background-size: 400% 400%;
  animation: gradientFlow 6s ease infinite;
}

/* Ripple button effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}
.btn-ripple::after {
  content: '';
  position: absolute;
  width: 100px; height: 100px;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  top: var(--y, 50%);
  left: var(--x, 50%);
  transform: translate(-50%, -50%) scale(0);
  animation: none;
}
.btn-ripple.rippling::after {
  animation: ripple 0.6s ease forwards;
}

/* Particle container */
.particles,
.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  bottom: -10px;
  width: 4px; height: 4px;
  background: var(--c-primary);
  border-radius: 50%;
  animation: particleRise var(--dur, 4s) var(--delay, 0s) ease-in infinite;
  --dx: 0px;
}
.particle:nth-child(2n)   { background: var(--c-gold); width: 3px; height: 3px; }
.particle:nth-child(3n)   { background: rgba(232,76,10,0.5); width: 5px; height: 5px; }
.particle:nth-child(4n)   { background: rgba(201,168,64,0.6); }

/* Hover glow effect */
.hover-glow {
  transition: box-shadow var(--tr-base);
}
.hover-glow:hover {
  box-shadow: 0 0 30px var(--c-primary-glow);
}

/* Text highlight animation */
.text-highlight {
  position: relative;
  display: inline-block;
}
.text-highlight::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-gold));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.text-highlight:hover::after { transform: scaleX(1); }

/* Entrance animation for sections */
.section-enter {
  opacity: 0;
  transform: translateY(60px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.section-enter.entered {
  opacity: 1;
  transform: translateY(0);
}

/* Number flip animation */
.number-flip {
  overflow: hidden;
  display: inline-block;
}
.number-flip-inner {
  display: inline-block;
  animation: numberCount 0.6s ease forwards;
}

/* Stagger children animation — generisch über CSS-Variable --i (JS setzt Index),
   Transition statt Animation: kein 8-Kinder-Limit, kein fill-mode-Konflikt mit Filtern */
.stagger-children > * {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--i, 0) * 70ms);
  /* CSS-Fallback wie bei .reveal (main.css): ohne JS werden Kinder nach 2,5s
     sichtbar, damit Galerie-/Kontakt-/Features-/Team-Grids nicht dauerhaft
     verborgen bleiben. Keyframes revealFallback in main.css definiert. */
  animation: revealFallback 0.9s 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.stagger-children.revealed > * {
  opacity: 1;
  transform: none;
  animation: none;
}

/* Magnetic hover (JS applied) */
.magnetic {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Underline draw */
.underline-draw {
  background: linear-gradient(to right, var(--c-primary), var(--c-gold));
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 0.5s ease;
  padding-bottom: 2px;
}
.underline-draw:hover { background-size: 100% 2px; }

/* Fire glow pulse */
.fire-pulse {
  animation: borderGlow 2s ease-in-out infinite;
}

/* Cart badge bounce */
@keyframes cartBounce {
  0%, 100% { transform: scale(1); }
  30%       { transform: scale(1.4); }
  60%       { transform: scale(0.9); }
}
.cart-bounce { animation: cartBounce 0.4s ease; }

/* Smooth parallax wrapper */
.parallax-container {
  overflow: hidden;
  position: relative;
}
.parallax-img {
  will-change: transform;
  transition: transform 0s linear;
}

/* Image reveal sweep */
.img-reveal {
  position: relative;
  overflow: hidden;
}
.img-reveal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--c-primary);
  z-index: 2;
  transform: translateX(-101%);
  transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
}
.img-reveal::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--c-bg);
  z-index: 1;
  transform: translateX(-101%);
  transition: transform 0.6s 0.15s cubic-bezier(0.77, 0, 0.175, 1);
}
.img-reveal.revealing::before { transform: translateX(0); }
.img-reveal.revealing::after  { transform: translateX(0); }
.img-reveal.revealed::before  { transform: translateX(101%); }
.img-reveal.revealed::after   { transform: translateX(101%); }

/* Intro overlay for page load */
@keyframes introSlide {
  0%   { transform: translateY(0); }
  100% { transform: translateY(-100%); }
}

/* ============================================================
   V6 — Scroll-Erlebnis-Bausteine
   ============================================================ */

/* Brand-Marquee (Laufband zwischen Sektionen) */
.marquee {
  overflow: hidden;
  display: flex;
  white-space: nowrap;
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface);
  padding: 18px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 48px;
  padding-right: 48px;
  flex-shrink: 0;
  animation: marqueeScroll 30s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marqueeScroll {
  to { transform: translateX(-100%); }
}
.marquee-track span {
  font-family: var(--f-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--c-gray-300);
  letter-spacing: 0.02em;
}
.marquee-track .marquee-dot {
  color: var(--c-gold);
  font-size: 14px;
}
.marquee-track .marquee-deal {
  color: var(--c-primary);
  font-style: italic;
}

/* 3D-Tilt für Karten (Klasse wird per JS vergeben) */
.tilt {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* Scroll-getriebene Effekte — nur Browser mit animation-timeline */
@supports (animation-timeline: view()) {
  @keyframes parallaxDrift {
    from { transform: translateY(5%) scale(1.12); }
    to   { transform: translateY(-5%) scale(1.12); }
  }
  .gallery-item img,
  .team-img-wrap img,
  .gallery-page-item img {
    animation: parallaxDrift linear both;
    animation-timeline: view();
    animation-range: entry 0% exit 100%;
  }

  @keyframes heroFadeAway {
    to { opacity: 0.15; transform: translateY(60px) scale(0.97); }
  }
  .hero-content {
    animation: heroFadeAway linear both;
    animation-timeline: scroll();
    animation-range: 0vh 90vh;
  }

  @keyframes pageHeroGrow {
    from { opacity: 0.4; letter-spacing: 0.04em; }
    to   { opacity: 1; letter-spacing: 0; }
  }
}

/* Bild-Sweep-Reveal wird jetzt per JS verdrahtet (.img-reveal) —
   Basisklassen existieren weiter oben in dieser Datei */

@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
  .hero-content, .gallery-item img, .team-img-wrap img, .gallery-page-item img {
    animation: none !important;
  }
}

