*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    overflow-x: hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #fdf6ec;
}
::-webkit-scrollbar-thumb {
    background: #e8a87c;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #d9411e;
}

/* Selection */
::selection {
    background: #f9c5b5;
    color: #742618;
}

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

/* Scroll reveal animations — progressive enhancement, only active when JS adds class */
.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);
}

.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; }

/* Mobile menu animation */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
    opacity: 0;
}

#mobile-menu.open {
    max-height: 400px;
    opacity: 1;
}

/* Header scroll state */
header.scrolled {
    background: rgba(254, 252, 247, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}

/* Smooth image loading */
img {
    image-rendering: auto;
    will-change: transform;
}

/* Focus styles */
a:focus-visible, button:focus-visible {
    outline: 2px solid #d9411e;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Form styles */
input, textarea {
    font-family: inherit;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #d9411e;
    box-shadow: 0 0 0 3px rgba(217, 65, 30, 0.15);
}

/* Success message */
#form-success {
    animation: fadeInUp 0.5s ease forwards;
}

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

/* Subtle float animation for decorative elements */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.float-slow {
    animation: float 6s ease-in-out infinite;
}

.float-medium {
    animation: float 4s ease-in-out infinite;
}
