/* ===== BASE & RESET ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

body {
    overflow-x: hidden;
}

::selection {
    background: #d95225;
    color: #fff;
}

/* ===== NAVBAR ===== */
#navbar {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
    background: rgba(253, 248, 240, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(162, 48, 20, 0.08);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 2px;
    background: #d95225;
    border-radius: 2px;
    transition: transform 0.3s ease, width 0.3s ease;
}

.nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
    width: 24px;
}

/* ===== MOBILE MENU ===== */
#mobileMenu {
    animation: slideDown 0.3s ease forwards;
}

#mobileMenu.hidden {
    animation: slideUp 0.25s ease forwards;
}

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

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

.mobile-link {
    display: block;
}

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

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

.animate-fade-in {
    animation: fadeIn 0.8s ease forwards;
}

.animate-slide-up {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.2s;
    opacity: 0;
}

.animate-slide-up-delay {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
}

.animate-slide-up-delay-2 {
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.6s;
    opacity: 0;
}

/* ===== SCROLL REVEAL ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.reveal[data-delay="100"] { transition-delay: 100ms; }
.reveal[data-delay="200"] { transition-delay: 200ms; }
.reveal[data-delay="300"] { transition-delay: 300ms; }

/* ===== IMAGE HOVER EFFECTS ===== */
img {
    max-width: 100%;
    height: auto;
}

/* ===== SUBTLE GRAIN TEXTURE ===== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ===== FOCUS STYLES ===== */
a:focus-visible,
button:focus-visible {
    outline: 2px solid #d95225;
    outline-offset: 3px;
    border-radius: 0.5rem;
}

/* ===== RESPONSIVE TWEAKS ===== */
@media (max-width: 640px) {
    html {
        scroll-padding-top: 70px;
    }

    #hero h1 {
        font-size: 2.75rem;
        line-height: 1.1;
    }

    #hero p {
        font-size: 1rem;
    }

    .reveal {
        transform: translateY(25px);
    }
}

@media (min-width: 641px) and (max-width: 1023px) {
    #hero h1 {
        font-size: 4rem;
    }
}

@media (min-width: 1024px) {
    #hero h1 {
        font-size: 5.5rem;
    }
}

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

    .reveal {
        opacity: 1;
        transform: none;
    }

    .animate-bounce {
        animation: none;
    }
}
