/* ============================================
   BLACKMOOR DISTILLERY - Animations
   Keyframes & Animation Classes
   ============================================ */

/* ============================================
   Utility: Disable Transitions
   Used to prevent visual glitches when content changes
   ============================================ */
.no-transitions,
.no-transitions *,
.no-transitions *::before,
.no-transitions *::after {
    transition: none !important;
    animation: none !important;
}

/* ============================================
   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(-30px);
    }
    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.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideReveal {
    from {
        clip-path: inset(0 100% 0 0);
    }
    to {
        clip-path: inset(0 0 0 0);
    }
}

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

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

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

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px var(--color-gold), 0 0 10px var(--color-gold);
    }
    50% {
        box-shadow: 0 0 20px var(--color-gold), 0 0 40px var(--color-gold);
    }
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 5px var(--color-gold), 0 0 10px var(--color-gold);
    }
    50% {
        text-shadow: 0 0 20px var(--color-gold), 0 0 30px var(--color-gold);
    }
}

@keyframes borderPulse {
    0%, 100% {
        border-color: var(--color-gold);
    }
    50% {
        border-color: var(--color-gold-light);
    }
}

/* ============================================
   Animation Utility Classes
   ============================================ */

/* Fade Animations */
.anim-fade-in {
    animation: fadeIn var(--transition-slow) ease forwards;
}

.anim-fade-in-up {
    animation: fadeInUp var(--transition-slow) ease forwards;
}

.anim-fade-in-down {
    animation: fadeInDown var(--transition-slow) ease forwards;
}

.anim-fade-in-left {
    animation: fadeInLeft var(--transition-slow) ease forwards;
}

.anim-fade-in-right {
    animation: fadeInRight var(--transition-slow) ease forwards;
}

/* Scale Animation */
.anim-scale-in {
    animation: scaleIn var(--transition-slow) ease forwards;
}

/* Continuous Animations */
.anim-float {
    animation: float 3s ease-in-out infinite;
}

.anim-rotate {
    animation: rotate 20s linear infinite;
}

.anim-glow {
    animation: glow 2s ease-in-out infinite;
}

.anim-text-glow {
    animation: textGlow 2s ease-in-out infinite;
}

/* ============================================
   Scroll-Triggered Animation Classes
   (Applied via JavaScript)
   ============================================ */

/* Initial state for scroll animations */
[data-animate] {
    opacity: 0;
}

[data-animate="fade-up"] {
    transform: translateY(40px);
}

[data-animate="fade-down"] {
    transform: translateY(-40px);
}

[data-animate="fade-left"] {
    transform: translateX(-40px);
}

[data-animate="fade-right"] {
    transform: translateX(40px);
}

[data-animate="scale"] {
    transform: scale(0.9);
}

[data-animate="reveal"] {
    clip-path: inset(0 100% 0 0);
}

/* Animated state - Modern minimal approach */
[data-animate] {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

[data-animate].animate-visible {
    opacity: 1;
    transform: translate(0) scale(1) !important;
}

/* Staggered children animations */
[data-animate-stagger] > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

[data-animate-stagger] > *.animate-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero initial state */
.hero__ornament-top,
.hero__subtitle,
.hero__title,
.hero__tagline,
.hero__cta,
.hero__scroll-indicator {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.hero__ornament-top.animate-visible,
.hero__subtitle.animate-visible,
.hero__title.animate-visible,
.hero__tagline.animate-visible,
.hero__cta.animate-visible,
.hero__scroll-indicator.animate-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Text Animation Classes
   ============================================ */

/* Split text container */
.split-text {
    display: inline-block;
    overflow: hidden;
}

.split-text .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.split-text.animated .char {
    opacity: 1;
    transform: translateY(0);
}

/* Character delay */
.split-text .char:nth-child(1) { transition-delay: 0.02s; }
.split-text .char:nth-child(2) { transition-delay: 0.04s; }
.split-text .char:nth-child(3) { transition-delay: 0.06s; }
.split-text .char:nth-child(4) { transition-delay: 0.08s; }
.split-text .char:nth-child(5) { transition-delay: 0.1s; }
.split-text .char:nth-child(6) { transition-delay: 0.12s; }
.split-text .char:nth-child(7) { transition-delay: 0.14s; }
.split-text .char:nth-child(8) { transition-delay: 0.16s; }
.split-text .char:nth-child(9) { transition-delay: 0.18s; }
.split-text .char:nth-child(10) { transition-delay: 0.2s; }
.split-text .char:nth-child(11) { transition-delay: 0.22s; }
.split-text .char:nth-child(12) { transition-delay: 0.24s; }
.split-text .char:nth-child(13) { transition-delay: 0.26s; }
.split-text .char:nth-child(14) { transition-delay: 0.28s; }
.split-text .char:nth-child(15) { transition-delay: 0.3s; }

/* ============================================
   Hover Effects
   ============================================ */

.hover-lift {
    transition: transform var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.hover-scale {
    transition: transform var(--transition-base);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: var(--shadow-gold);
}

/* ============================================
   Image Reveal Effect
   ============================================ */

.image-reveal {
    position: relative;
    overflow: hidden;
}

.image-reveal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-gold);
    transform: translateX(-101%);
    z-index: 1;
}

.image-reveal.animate::before {
    animation: imageRevealMask 1.2s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.image-reveal img {
    transform: scale(1.2);
    opacity: 0;
}

.image-reveal.animate img {
    animation: imageRevealContent 0.8s cubic-bezier(0.77, 0, 0.175, 1) 0.4s forwards;
}

@keyframes imageRevealMask {
    0% { transform: translateX(-101%); }
    50% { transform: translateX(0); }
    100% { transform: translateX(101%); }
}

@keyframes imageRevealContent {
    0% { transform: scale(1.2); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ============================================
   Parallax Base Styles
   ============================================ */

.parallax-container {
    overflow: hidden;
    position: relative;
}

.parallax-layer {
    will-change: transform;
}

/* ============================================
   Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    [data-animate] {
        opacity: 1;
        transform: none;
        clip-path: none;
    }
}
