/* === Base Styles === */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(212, 68, 104, 0.2);
    color: #3a0b17;
}

/* === Scroll Reveal (progressive enhancement) === */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
        transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fallback: ensure content is visible even without JS */
.reveal {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(30px);
    }
    
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Floating Cards Animation === */
@media (prefers-reduced-motion: no-preference) {
    .floating-card-1 {
        animation: float1 6s ease-in-out infinite;
    }
    
    .floating-card-2 {
        animation: float2 7s ease-in-out infinite;
    }
    
    .floating-card-3 {
        animation: float3 5.5s ease-in-out infinite;
    }
    
    .floating-card-4 {
        animation: float4 6.5s ease-in-out infinite;
    }
}

@keyframes float1 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(1deg); }
}

@keyframes float2 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(-0.5deg); }
}

@keyframes float3 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(0.5deg); }
}

@keyframes float4 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(-1deg); }
}

/* === Navbar === */
#navbar {
    background: transparent;
}

#navbar.scrolled {
    background: rgba(254, 253, 248, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(129, 28, 57, 0.08), 0 4px 20px rgba(129, 28, 57, 0.06);
}

/* === Mobile Menu === */
.mobile-link {
    position: relative;
}

.mobile-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #d97706;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.mobile-link:hover::after {
    width: 100%;
}

/* === Menu Item Hover === */
#menu .group {
    cursor: default;
}

#menu .group h4 {
    position: relative;
}

/* === Button Focus Styles === */
a:focus-visible, button:focus-visible {
    outline: 2px solid #d97706;
    outline-offset: 2px;
    border-radius: 9999px;
}

/* === Custom Scrollbar === */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #fdf9eb;
}

::-webkit-scrollbar-thumb {
    background: #d44468;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b8274b;
}

/* === Image Lazy Load Fallback === */
img[loading="lazy"] {
    opacity: 1;
    transition: opacity 0.3s ease;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* === 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;
    }
}
