/* ============================================
   ANIMATIONS.CSS - Transitions, Keyframes
   ============================================ */

/* ---------- Fade In Animations ---------- */
@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);
    }
}

/* ---------- Scale Animations ---------- */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* ---------- Slide Animations ---------- */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(100%);
    }
}

/* ---------- Typing Animation ---------- */
@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* ---------- Floating Animation ---------- */
@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* ---------- Glow Animation ---------- */
@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 20px var(--color-accent-glow);
    }

    50% {
        box-shadow: 0 0 40px var(--color-accent-glow), 0 0 60px var(--color-accent-glow);
    }
}

/* ---------- Animation Utility Classes ---------- */
.animate-fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.animate-fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.animate-fade-in-down {
    opacity: 0;
    animation: fadeInDown 0.6s ease forwards;
}

.animate-fade-in-left {
    opacity: 0;
    animation: fadeInLeft 0.6s ease forwards;
}

.animate-fade-in-right {
    opacity: 0;
    animation: fadeInRight 0.6s ease forwards;
}

.animate-scale-in {
    opacity: 0;
    animation: scaleIn 0.4s ease forwards;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

/* ---------- Animation Delays ---------- */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-400 {
    animation-delay: 400ms;
}

.delay-500 {
    animation-delay: 500ms;
}

.delay-600 {
    animation-delay: 600ms;
}

.delay-700 {
    animation-delay: 700ms;
}

.delay-800 {
    animation-delay: 800ms;
}

/* ---------- Scroll Reveal Classes ---------- */
/* Elements with this class start hidden and are revealed by JS */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* ---------- Hero Specific Animations ---------- */
.hero__tagline {
    animation: fadeInDown 0.6s ease forwards;
}

.hero__title {
    animation: fadeInUp 0.6s ease 0.1s forwards;
    opacity: 0;
}

.hero__subtitle {
    animation: fadeInUp 0.6s ease 0.2s forwards;
    opacity: 0;
}

.hero__cta {
    animation: fadeInUp 0.6s ease 0.3s forwards;
    opacity: 0;
}

.hero__visual {
    animation: fadeInRight 0.8s ease 0.4s forwards;
    opacity: 0;
}

/* ---------- Underline Animation ---------- */
.animated-underline {
    position: relative;
    display: inline-block;
}

.animated-underline::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hover));
    border-radius: var(--radius-full);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s ease;
}

.animated-underline:hover::after,
.animated-underline.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Hero title highlight underline - always visible with animation */
.hero__title-highlight::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hover));
    border-radius: var(--radius-full);
    animation: underlineGrow 0.8s ease 0.5s forwards;
    transform: scaleX(0);
    transform-origin: left;
}

@keyframes underlineGrow {
    to {
        transform: scaleX(1);
    }
}

/* ---------- Button Hover Effects ---------- */
.btn--primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
    border-radius: inherit;
}

.btn--primary:hover::before {
    opacity: 1;
}

/* ---------- Card Stagger Animation ---------- */
.stagger-item:nth-child(1) {
    animation-delay: 0ms;
}

.stagger-item:nth-child(2) {
    animation-delay: 100ms;
}

.stagger-item:nth-child(3) {
    animation-delay: 200ms;
}

.stagger-item:nth-child(4) {
    animation-delay: 300ms;
}

.stagger-item:nth-child(5) {
    animation-delay: 400ms;
}

.stagger-item:nth-child(6) {
    animation-delay: 500ms;
}

/* ---------- Loading State ---------- */
.skeleton {
    background: linear-gradient(90deg,
            var(--color-bg-tertiary) 25%,
            var(--color-bg-secondary) 50%,
            var(--color-bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ---------- Focus Animation ---------- */
@keyframes focusRing {
    0% {
        box-shadow: 0 0 0 0 var(--color-accent-glow);
    }

    50% {
        box-shadow: 0 0 0 4px var(--color-accent-glow);
    }

    100% {
        box-shadow: 0 0 0 2px var(--color-accent-glow);
    }
}

:focus-visible {
    animation: focusRing 0.3s ease forwards;
}

/* ---------- Smooth page transitions ---------- */
.page-transition-enter {
    opacity: 0;
}

.page-transition-enter-active {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.page-transition-exit {
    opacity: 1;
}

.page-transition-exit-active {
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ---------- Ambient Background Animation ---------- */
@keyframes ambientDrift {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.25;
    }

    25% {
        transform: translate(10px, -12px) scale(1.05);
        opacity: 0.28;
    }

    50% {
        transform: translate(-8px, 10px) scale(0.98);
        opacity: 0.22;
    }

    75% {
        transform: translate(-12px, -8px) scale(1.03);
        opacity: 0.27;
    }

    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.25;
    }
}