/* Base & Resets */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #FAF6F3;
}
::-webkit-scrollbar-thumb {
    background: #8b2928;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a83231;
}

/* Selection */
::selection {
    background: #8b2928;
    color: #FAF6F3;
}

/* Hero Animations */
.hero-headline {
    opacity: 0;
    transform: translateY(30px);
    animation: heroReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.hero-subtitle {
    opacity: 0;
    transform: translateY(20px);
    animation: heroReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

.hero-body {
    opacity: 0;
    transform: translateY(20px);
    animation: heroReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 0.5s forwards;
}

.hero-cta {
    opacity: 0;
    transform: translateY(20px);
    animation: heroReveal 1s cubic-bezier(0.16, 1, 0.3, 1) 0.7s forwards;
}

@keyframes heroReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll Reveal */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal[data-revealed="false"] {
    opacity: 0;
    transform: translateY(40px);
}

/* 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;
    }
    .reveal[data-revealed="false"] {
        opacity: 1;
        transform: none;
    }
}

/* Mobile Menu Transitions */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), padding 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#mobile-menu.open {
    max-height: 400px;
    padding-top: 0;
    padding-bottom: 0;
}

.mobile-link {
    transition: color 0.3s ease, padding-left 0.3s ease;
}

.mobile-link:hover {
    color: #c73e3c;
    padding-left: 0.5rem;
}

/* Navbar glass effect on scroll */
#navbar.scrolled {
    background: rgba(250, 246, 243, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(115, 34, 33, 0.08);
}

/* Image hover parallax feel */
.group img {
    will-change: transform;
}

/* Smooth focus styles */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #8b2928;
    outline-offset: 2px;
}

/* Portfolio grid stagger */
#portfolio .reveal:nth-child(1) { transition-delay: 0s; }
#portfolio .reveal:nth-child(2) { transition-delay: 0.1s; }
#portfolio .reveal:nth-child(3) { transition-delay: 0.2s; }
#portfolio .reveal:nth-child(4) { transition-delay: 0.3s; }
#portfolio .reveal:nth-child(5) { transition-delay: 0.4s; }
#portfolio .reveal:nth-child(6) { transition-delay: 0.5s; }

/* Process step hover */
#process .reveal:hover .font-serif {
    color: #a83231;
    transition: color 0.3s ease;
}

/* CTA button hover lift */
section .px-10:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(115, 34, 33, 0.2);
}
