/* === Base & Reset === */
*, *::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(139, 26, 43, 0.15);
    color: #8b1a2b;
}

/* === Animations === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-fade-in {
    animation: fadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* === Scroll Reveal (progressive enhancement) === */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .reveal.revealed {
        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; }
}

/* Fallback: always visible if JS is disabled */
@media not all and (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* === Navbar scroll state === */
.navbar-scrolled {
    background-color: rgba(254, 252, 251, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(139, 26, 43, 0.06);
}

.navbar-scrolled .menu-line {
    background-color: #8b1a2b;
}

/* === Mobile menu === */
.mobile-menu-open {
    opacity: 1 !important;
    pointer-events: all !important;
}

/* === Service card hover === */
.service-card {
    transition: background-color 0.5s ease;
}

/* === Form focus states === */
input:focus,
textarea:focus {
    border-bottom-color: #8b1a2b !important;
}

/* === Smooth image loading === */
img {
    display: block;
    max-width: 100%;
}

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

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

::-webkit-scrollbar-thumb {
    background: #e09a9a;
    border-radius: 3px;
}

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

/* === Mobile menu animation === */
.menu-line {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#menu-btn.active .menu-line:nth-child(1) {
    transform: translateY(4px) rotate(45deg);
}

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

#menu-btn.active .menu-line:nth-child(3) {
    transform: translateY(-4px) rotate(-45deg);
    width: 1.25rem;
}
