/* ============================================================
   CODLAB Amici Theme — Cinematic Animations
   ============================================================ */

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

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

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

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

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

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

@keyframes revealLine {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

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

@keyframes slowZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.08); }
}

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

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

@keyframes pulseGlow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.05); }
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(15px, -20px); }
    66% { transform: translate(-10px, 10px); }
}

/* --- Scroll Reveal --- */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in.visible {
    opacity: 1;
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

/* --- Staggered Delays --- */
.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }
.delay-600 { transition-delay: 600ms; }
.delay-700 { transition-delay: 700ms; }

/* --- Hero Cinematic --- */
.hero-bg {
    animation: slowZoom 20s ease-out forwards;
}

.hero-title {
    animation: fadeInUp 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s both;
}

.hero-subtitle {
    animation: fadeInUp 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.7s both;
}

.hero-cta {
    animation: fadeInUp 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.1s both;
}

.hero-scroll-indicator {
    animation: float 2.5s ease-in-out infinite, fadeIn 1s 2s both;
}

.hero-line {
    animation: revealLine 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.6s both;
    transform-origin: center;
}

/* --- Marquee --- */
.marquee-track {
    display: flex;
    animation: marqueeScroll 30s linear infinite;
    width: max-content;
}

.marquee-track:hover {
    animation-play-state: paused;
}

/* --- Ambient Orbs Animation --- */
.ambient-orb {
    animation: orbFloat 12s ease-in-out infinite, pulseGlow 8s ease-in-out infinite;
}

.ambient-orb:nth-child(2) {
    animation-delay: -4s;
    animation-duration: 15s, 10s;
}

.ambient-orb:nth-child(3) {
    animation-delay: -8s;
    animation-duration: 18s, 12s;
}

/* --- Image Tilt on Hover --- */
.tilt-hover {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* --- Clip Reveal for images --- */
.clip-reveal {
    clip-path: inset(0 100% 0 0);
    transition: clip-path 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.clip-reveal.visible {
    clip-path: inset(0 0 0 0);
}

/* --- Text Char Reveal --- */
.char-reveal span {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.char-reveal.visible span {
    opacity: 1;
    transform: translateY(0);
}

/* --- Feature Strips --- */
.feature-strip {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.feature-strip.visible {
    opacity: 1;
    transform: translateY(0);
}

.feature-strip .feature-number {
    transition: transform 0.4s ease, color 0.3s ease;
}

.feature-strip:hover .feature-number {
    transform: translateX(8px);
}

/* --- Bento Grid Items --- */
.bento-item {
    overflow: hidden;
    border-radius: var(--radius-md);
}

.bento-item img {
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.bento-item:hover img {
    transform: scale(1.06);
}

.bento-item .bento-overlay {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.bento-item:hover .bento-overlay {
    opacity: 1;
}

/* --- Lightbox --- */
.lightbox-enter {
    animation: fadeIn 0.3s ease-out both;
}

.lightbox-image-enter {
    animation: scaleIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

/* --- Mobile Menu --- */
.mobile-menu-enter {
    animation: fadeIn 0.25s ease-out both;
}

.mobile-menu-link {
    opacity: 0;
    animation: fadeInUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.mobile-menu-link:nth-child(1) { animation-delay: 0.05s; }
.mobile-menu-link:nth-child(2) { animation-delay: 0.1s; }
.mobile-menu-link:nth-child(3) { animation-delay: 0.15s; }
.mobile-menu-link:nth-child(4) { animation-delay: 0.2s; }
.mobile-menu-link:nth-child(5) { animation-delay: 0.25s; }
.mobile-menu-link:nth-child(6) { animation-delay: 0.3s; }
.mobile-menu-link:nth-child(7) { animation-delay: 0.35s; }

/* --- Smooth Scroll --- */
html {
    scroll-behavior: smooth;
}

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

    html { scroll-behavior: auto; }

    .fade-in-up, .fade-in, .slide-in-left, .slide-in-right, .scale-in,
    .clip-reveal, .feature-strip {
        opacity: 1;
        transform: none;
        clip-path: none;
    }

    .char-reveal span {
        opacity: 1;
        transform: none;
    }

    .marquee-track {
        animation: none;
    }

    .hero-bg {
        animation: none;
    }
}
