/* ============================================================
   Hochzeit — Animation Library
   Full of scroll-triggered, hover, and ambient animations
   ============================================================ */

/* ---- Keyframes ---- */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-40px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(50px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes scaleInBounce {
    0%   { opacity: 0; transform: scale(0.3); }
    50%  { opacity: 1; transform: scale(1.05); }
    70%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}
@keyframes slideInUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
@keyframes rotateIn {
    from { opacity: 0; transform: rotate(-10deg) scale(0.9); }
    to   { opacity: 1; transform: rotate(0) scale(1); }
}
@keyframes flipInX {
    from { opacity: 0; transform: perspective(400px) rotateX(-30deg); }
    to   { opacity: 1; transform: perspective(400px) rotateX(0); }
}
@keyframes blurIn {
    from { opacity: 0; filter: blur(12px); }
    to   { opacity: 1; filter: blur(0); }
}
@keyframes typewriter {
    from { width: 0; }
    to   { width: 100%; }
}
@keyframes blink { 50% { border-color: transparent; } }

/* Continuous / ambient */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-12px); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.08); opacity: 0.85; }
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,55,0.4); }
    50%      { box-shadow: 0 0 20px 10px rgba(212,175,55,0); }
}
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes wiggle {
    0%, 100% { transform: rotate(0); }
    25%      { transform: rotate(-3deg); }
    75%      { transform: rotate(3deg); }
}
@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    14%      { transform: scale(1.2); }
    28%      { transform: scale(1); }
    42%      { transform: scale(1.15); }
    56%      { transform: scale(1); }
}
@keyframes confetti-fall {
    0%   { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
@keyframes gradient-shift {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
@keyframes draw-line {
    from { stroke-dashoffset: 1000; }
    to   { stroke-dashoffset: 0; }
}
@keyframes wave {
    0%   { transform: translateX(0) translateY(0); }
    25%  { transform: translateX(-5px) translateY(-8px); }
    50%  { transform: translateX(0) translateY(-12px); }
    75%  { transform: translateX(5px) translateY(-8px); }
    100% { transform: translateX(0) translateY(0); }
}
@keyframes sparkle {
    0%, 100% { opacity: 0; transform: scale(0) rotate(0); }
    50%      { opacity: 1; transform: scale(1) rotate(180deg); }
}
@keyframes slideCounter {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
@keyframes ripple {
    0%   { transform: scale(0.8); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}
@keyframes tiltIn {
    from { opacity: 0; transform: perspective(600px) rotateY(-15deg) translateX(-30px); }
    to   { opacity: 1; transform: perspective(600px) rotateY(0) translateX(0); }
}
@keyframes morphBlob {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    25%      { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    50%      { border-radius: 50% 60% 30% 60% / 30% 60% 70% 40%; }
    75%      { border-radius: 60% 40% 70% 30% / 60% 40% 30% 70%; }
}

/* ---- Scroll-triggered Animation Classes ---- */
/* Elements start hidden, animate when .anim-visible is added by JS */

[data-anim] {
    opacity: 0;
    transition: opacity 0.1s;
    will-change: transform, opacity;
}

[data-anim].anim-visible {
    opacity: 1;
}

[data-anim="fade-up"].anim-visible   { animation: fadeInUp 0.8s ease both; }
[data-anim="fade-down"].anim-visible { animation: fadeInDown 0.8s ease both; }
[data-anim="fade-left"].anim-visible { animation: fadeInLeft 0.8s ease both; }
[data-anim="fade-right"].anim-visible { animation: fadeInRight 0.8s ease both; }
[data-anim="fade-in"].anim-visible   { animation: fadeIn 0.8s ease both; }
[data-anim="scale-in"].anim-visible  { animation: scaleIn 0.7s ease both; }
[data-anim="scale-bounce"].anim-visible { animation: scaleInBounce 0.8s ease both; }
[data-anim="rotate-in"].anim-visible { animation: rotateIn 0.7s ease both; }
[data-anim="flip-in"].anim-visible   { animation: flipInX 0.8s ease both; }
[data-anim="blur-in"].anim-visible   { animation: blurIn 0.7s ease both; }
[data-anim="tilt-in"].anim-visible   { animation: tiltIn 0.8s ease both; }
[data-anim="slide-up"].anim-visible  { animation: slideInUp 0.6s ease both; }

/* ---- Stagger delay classes ---- */
[data-delay="1"] { animation-delay: 0.1s !important; }
[data-delay="2"] { animation-delay: 0.2s !important; }
[data-delay="3"] { animation-delay: 0.3s !important; }
[data-delay="4"] { animation-delay: 0.4s !important; }
[data-delay="5"] { animation-delay: 0.5s !important; }
[data-delay="6"] { animation-delay: 0.6s !important; }
[data-delay="7"] { animation-delay: 0.7s !important; }
[data-delay="8"] { animation-delay: 0.8s !important; }

/* ---- Duration classes ---- */
[data-duration="fast"] { animation-duration: 0.4s !important; }
[data-duration="slow"] { animation-duration: 1.2s !important; }
[data-duration="slower"] { animation-duration: 1.8s !important; }

/* ---- Ambient Hover Animations ---- */
.hover-float:hover { animation: float 2s ease-in-out infinite; }
.hover-pulse:hover { animation: pulse 1.5s ease-in-out infinite; }
.hover-wiggle:hover { animation: wiggle 0.5s ease-in-out; }
.hover-grow { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.hover-grow:hover { transform: scale(1.05); box-shadow: 0 12px 40px rgba(0,0,0,0.12); }
.hover-lift { transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease; }
.hover-lift:hover { transform: translateY(-8px); box-shadow: 0 16px 48px rgba(0,0,0,0.15); }
.hover-tilt { transition: transform 0.3s ease; }
.hover-tilt:hover { transform: perspective(600px) rotateX(5deg) rotateY(-5deg); }
.hover-glow:hover { box-shadow: 0 0 30px rgba(212,175,55,0.3); }
.hover-shine { position: relative; overflow: hidden; }
.hover-shine::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}
.hover-shine:hover::after { left: 120%; }

/* ---- Continuous Animations ---- */
.anim-float { animation: float 3s ease-in-out infinite; }
.anim-pulse { animation: pulse 2s ease-in-out infinite; }
.anim-pulse-glow { animation: pulseGlow 2s ease-in-out infinite; }
.anim-heartbeat { animation: heartbeat 1.8s ease-in-out infinite; }
.anim-morph { animation: morphBlob 8s ease-in-out infinite; }
.anim-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 4s ease infinite;
}

/* ---- Shimmer / Skeleton Loading ---- */
.shimmer {
    background: linear-gradient(90deg, #f0ebe0 25%, #faf8f2 50%, #f0ebe0 75%);
    background-size: 400% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* ---- Parallax Helper ---- */
.parallax-layer {
    will-change: transform;
    transition: transform 0.1s linear;
}

/* ---- Text Animations ---- */
.text-reveal {
    overflow: hidden;
}
.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.text-reveal.anim-visible span {
    transform: translateY(0);
}

/* ---- Counter Animation ---- */
.counter-anim {
    display: inline-block;
    overflow: hidden;
    height: 1em;
    line-height: 1;
}
.counter-anim span {
    display: inline-block;
    animation: slideCounter 0.6s ease both;
}

/* ---- Decorative Particles ---- */
.particles-container {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, rgba(212,175,55,0.6), transparent);
    border-radius: 50%;
    animation: float 4s ease-in-out infinite;
}
.particle:nth-child(2n)  { animation-duration: 5s; animation-delay: 0.5s; }
.particle:nth-child(3n)  { animation-duration: 6s; animation-delay: 1s; width: 4px; height: 4px; }
.particle:nth-child(4n)  { animation-duration: 7s; animation-delay: 1.5s; width: 8px; height: 8px; }

/* ---- Scroll Progress Bar ---- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-light, #C4A875), var(--accent, #D4AF37));
    z-index: 9999;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(212,175,55,0.5);
}

/* ---- Magnetic Button Effect ---- */
.btn-magnetic {
    transition: transform 0.2s ease;
}

/* ---- Cursor Trail (optional fun) ---- */
.cursor-sparkle {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--accent, #D4AF37);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    opacity: 0;
    transform: scale(0);
    animation: sparkle 0.6s ease forwards;
}

/* ---- Image Reveal on Scroll ---- */
.img-reveal {
    position: relative;
    overflow: hidden;
}
.img-reveal::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-alt, #F5F0EA);
    transform-origin: right;
    transition: transform 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}
.img-reveal.anim-visible::after {
    transform: scaleX(0);
}

/* ---- Reduce motion for accessibility ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    [data-anim] { opacity: 1; transform: none; }
    .parallax-layer { transform: none !important; }
}
