/* ============================================
   Auto Pilgrim — Animations
   GPU-composited, no layout-triggering props
   ============================================ */

/* ============================================
   Loading Screen
   ============================================ */
#loader {
    position: fixed;
    inset: 0;
    background: #080808;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 28px;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loader-icon {
    position: relative;
    width: 80px;
    height: 80px;
}

.loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: #c9a84c;
    border-right-color: rgba(201, 168, 76, 0.3);
    animation: loaderSpin 1s linear infinite;
}

.loader-ring-inner {
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    border: 1px solid transparent;
    border-bottom-color: #a68a3e;
    border-left-color: rgba(166, 138, 62, 0.3);
    animation: loaderSpin 0.7s linear infinite reverse;
}

.loader-symbol {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #c9a84c;
    filter: drop-shadow(0 0 10px rgba(201, 168, 76, 0.8));
    animation: loaderPulse 1.4s ease-in-out infinite;
}

@keyframes loaderSpin { to { transform: rotate(360deg); } }
@keyframes loaderPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.88); }
}

.loader-wordmark {
    font-family: 'Inter', sans-serif;
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: #e8e6e3;
    animation: loaderFadeIn 0.6s ease both;
}

.loader-wordmark span {
    background: linear-gradient(135deg, #d4b85c, #c9a84c, #a68a3e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loader-bar-wrap {
    width: 160px;
    height: 2px;
    background: rgba(201, 168, 76, 0.12);
    border-radius: 2px;
    overflow: hidden;
}

.loader-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #c9a84c, #d4b85c);
    border-radius: 2px;
    animation: loaderBar 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    box-shadow: 0 0 8px rgba(201, 168, 76, 0.6);
}

@keyframes loaderBar {
    0% { width: 0%; }
    60% { width: 80%; }
    100% { width: 100%; }
}

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

/* ============================================
   Page System
   ============================================ */
.page { will-change: opacity, transform; }
.page.active { animation: pageEnterAnim 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }
.page.page-exit { animation: pageExitAnim 0.25s ease forwards; pointer-events: none; }
.page.page-enter { animation: pageEnterAnim 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }

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

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

/* ============================================
   Hero animate-in
   ============================================ */
.animate-in {
    opacity: 0;
    transform: translateY(28px);
    animation: fadeInUp 0.75s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.delay-1 { animation-delay: 0.12s; }
.delay-2 { animation-delay: 0.24s; }
.delay-3 { animation-delay: 0.36s; }
.delay-4 { animation-delay: 0.50s; }

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

/* ============================================
   Scroll Reveal
   ============================================ */
.scroll-reveal {
    opacity: 0;
    transform: translateY(32px);
    transition:
        opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: var(--delay, 0s);
    will-change: opacity, transform;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Card shine sweep
   ============================================ */
.feature-card,
.pricing-card,
.step-card {
    overflow: hidden;
}

.feature-card::after,
.pricing-card::after,
.step-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.03), transparent);
    transition: left 0.55s ease;
    pointer-events: none;
}

.feature-card:hover::after,
.pricing-card:hover::after,
.step-card:hover::after {
    left: 140%;
}

/* ============================================
   Button Ripple
   ============================================ */
.btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0);
    animation: ripple 0.55s ease-out forwards;
    pointer-events: none;
    will-change: transform, opacity;
}

@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ============================================
   Add-to-Cart feedback
   ============================================ */
.add-to-cart {
    transition: background 0.25s ease, transform 0.2s ease;
}

.add-to-cart.added {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #fff !important;
    transform: scale(0.96);
}

/* ============================================
   Particles
   ============================================ */
.particles-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(201, 168, 76, 0.2);
    border-radius: 50%;
    animation: particleFloat linear infinite;
    will-change: transform, opacity;
}

@keyframes particleFloat {
    0% { transform: translateY(110vh); opacity: 0; }
    8% { opacity: 1; }
    92% { opacity: 1; }
    100% { transform: translateY(-8vh); opacity: 0; }
}

/* ============================================
   Toast
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: #14141a;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.87rem;
    color: #e8e6e3;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    max-width: 340px;
    pointer-events: auto;
    will-change: transform, opacity;
}

.toast.toast-exit { animation: toastOut 0.25s ease forwards; }

.toast-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(201, 168, 76, 0.1);
    border: 1px solid rgba(201, 168, 76, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #c9a84c;
}

.toast-content { flex: 1; }
.toast-title { font-weight: 600; font-size: 0.84rem; }
.toast-message { font-size: 0.76rem; color: #8a8680; margin-top: 2px; }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(60px) scale(0.92); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    to { opacity: 0; transform: translateX(60px) scale(0.92); }
}

/* ============================================
   Nav link underline
   ============================================ */
.nav-link { position: relative; }

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #c9a84c;
    border-radius: 1px;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 20px;
}

/* ============================================
   Badge dot pulse
   ============================================ */
.badge-dot {
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.4); }
    50% { opacity: 0.7; transform: scale(0.85); box-shadow: 0 0 0 4px rgba(201, 168, 76, 0); }
}

/* ============================================
   Orb float
   ============================================ */
@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -30px) scale(1.04); }
    66% { transform: translate(-15px, 15px) scale(0.97); }
}

.hero-orb { animation: orbFloat 22s ease-in-out infinite; }
.hero-orb-2 { animation-delay: -8s; }
.hero-orb-3 { animation-delay: -15s; }

/* ============================================
   Reduced motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .scroll-reveal { opacity: 1; transform: none; }
    .animate-in { opacity: 1; transform: none; }
}
