/* ===== Base & Utilities ===== */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: rgba(114, 47, 55, 0.2);
    color: #1A1A1A;
}

/* ===== Clip Diagonal ===== */
.clip-diagonal {
    clip-path: polygon(30% 0, 100% 0, 100% 100%, 0% 100%);
}

/* ===== Floating Cards Animation ===== */
.floating-card {
    animation: float-slow 6s ease-in-out infinite;
}

.floating-card-2 {
    animation: float-medium 5s ease-in-out infinite;
    animation-delay: 1s;
}

.floating-card-3 {
    animation: float-fast 4s ease-in-out infinite;
    animation-delay: 2s;
}

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

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

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

/* ===== Navbar Scroll State ===== */
#navbar.scrolled {
    background-color: rgba(250, 248, 247, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(232, 224, 226, 0.8), 0 4px 20px rgba(0, 0, 0, 0.04);
}

#navbar.scrolled .menu-line {
    background-color: #1A1A1A;
}

/* ===== Mobile Menu ===== */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.mobile-menu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu.open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.25s; }

/* ===== Menu Toggle Animation ===== */
.menu-line {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#menu-toggle.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#menu-toggle.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menu-toggle.active .menu-line:nth-child(3) {
    width: 24px;
    margin-right: 0;
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Section Reveal Animation ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ===== Button Hover Glow ===== */
a:hover .glow-sm {
    filter: drop-shadow(0 0 8px rgba(114, 47, 55, 0.3));
}

/* ===== Smooth Image Loading ===== */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* ===== Focus Styles ===== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #722F37;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .clip-diagonal {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
    }
    
    #hero h1 {
        font-size: 2.75rem;
    }
    
    .floating-card,
    .floating-card-2,
    .floating-card-3 {
        display: none;
    }
    
    .floating-card {
        display: block;
        position: relative;
        top: auto;
        left: auto;
        margin-top: 1rem;
        animation: none;
    }
}

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