/* ─── GPU-optimized Keyframes ──────────────────────────────────────── */

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

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(168, 216, 234, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(168, 216, 234, 0);
    }
}

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

/* GPU-only: removed filter:blur() to avoid expensive repaints */
@keyframes heroReveal {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes floatBorder {
    0%, 100% {
        border-color: rgba(168, 216, 234, 0.6);
        box-shadow: 0 0 12px rgba(168, 216, 234, 0.15);
    }
    50% {
        border-color: rgba(168, 216, 234, 1);
        box-shadow: 0 0 20px rgba(168, 216, 234, 0.3);
    }
}

/* ─── Scroll Animations ──────────────────────────────────────────── */

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform, opacity;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Hero Animations ────────────────────────────────────────────── */

.hero-text {
    opacity: 0;
    animation: heroReveal 1s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    will-change: transform, opacity;
}

.hero-text:nth-child(1) { animation-delay: 0.1s; }
.hero-text:nth-child(2) { animation-delay: 0.3s; }
.hero-text:nth-child(3) { animation-delay: 0.5s; }

.hero-subtitle {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    animation-delay: 0.8s;
    will-change: transform, opacity;
}

.hero-search {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    animation-delay: 1s;
    will-change: transform, opacity;
}

.hero-filters {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    animation-delay: 1.2s;
    will-change: transform, opacity;
}

/* ─── Stagger Cards ──────────────────────────────────────────────── */

.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform, opacity;
}

.stagger-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ─── Buttons ────────────────────────────────────────────────────── */

.btn-support {
    animation: pulseGlow 2.5s ease-in-out infinite, floatBorder 3s ease-in-out infinite;
}

/* ─── Modal ──────────────────────────────────────────────────────── */

.modal-overlay {
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    pointer-events: none;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    transform: translateY(40px) scale(0.97);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: transform, opacity;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ─── Cards ──────────────────────────────────────────────────────── */

.card-party {
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
}

.card-party:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.initials-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

/* ─── Timeline ───────────────────────────────────────────────────── */

.timeline-progress {
    background: linear-gradient(90deg, var(--accent-celeste) 0%, var(--accent-celeste-dark) 100%);
    border-radius: var(--radius-full);
    transition: width 1.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ─── Filters & Tabs ─────────────────────────────────────────────── */

.filter-btn {
    transition: all var(--transition-fast);
}

.filter-btn.active {
    background-color: var(--text-primary);
    color: white;
}

.tab-btn {
    transition: all var(--transition-fast);
    position: relative;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--text-primary);
    border-radius: var(--radius-full);
}

/* ─── Scrollbar ──────────────────────────────────────────────────── */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-thumb {
    background: #D1D1D1;
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* ─── Skeleton Loading ───────────────────────────────────────────── */

.loading-skeleton {
    background: linear-gradient(90deg, #f0f0ed 25%, #e8e8e3 50%, #f0f0ed 75%);
    background-size: 400% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

/* ─── Screen reader only (accessibility) ─────────────────────────── */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ─── Reduced Motion: respect user preferences ───────────────────── */

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

    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }

    .stagger-item {
        opacity: 1;
        transform: none;
    }

    .hero-text, .hero-subtitle, .hero-search, .hero-filters {
        opacity: 1;
        animation: none;
    }

    .loading-skeleton {
        animation: none;
    }
}

/* ─── Mobile: faster animations ──────────────────────────────────── */

@media (max-width: 768px) {
    .animate-on-scroll {
        transition-duration: 0.5s;
    }

    .stagger-item {
        transition-duration: 0.4s;
    }

    .hero-text {
        animation-duration: 0.7s;
    }

    .hero-text:nth-child(1) { animation-delay: 0.05s; }
    .hero-text:nth-child(2) { animation-delay: 0.15s; }
    .hero-text:nth-child(3) { animation-delay: 0.25s; }

    .hero-subtitle { animation-delay: 0.4s; }
    .hero-search { animation-delay: 0.5s; }
    .hero-filters { animation-delay: 0.6s; }
}
