/* Base Styles */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background-color: #d94f35;
    color: #faf9f7;
}

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

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

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

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

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scroll Reveal */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal[data-reveal="left"] {
    transform: translateX(-40px);
}

.reveal[data-reveal="right"] {
    transform: translateX(40px);
}

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

/* Stagger children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0.1s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.2s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.3s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.4s; }
.stagger-children .reveal:nth-child(5) { transition-delay: 0.5s; }
.stagger-children .reveal:nth-child(6) { transition-delay: 0.6s; }

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

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

#navbar.scrolled {
    background: rgba(250, 249, 247, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 0 rgba(45, 42, 38, 0.08);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #d94f35;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Scroll Indicator */
.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 1s 1.5s forwards;
    opacity: 0;
}

.scroll-indicator span {
    animation: fadeIn 1s 1.5s forwards, bounce 2s 2s infinite;
    opacity: 0;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(8px);
    }
    60% {
        transform: translateY(4px);
    }
}

/* Image hover effects */
.group img {
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Button focus */
a:focus-visible, button:focus-visible {
    outline: 2px solid #d94f35;
    outline-offset: 2px;
}

/* Mobile menu transitions */
#mobile-menu {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.mobile-link {
    animation: fadeIn 0.4s ease forwards;
}

.mobile-link:nth-child(1) { animation-delay: 0.1s; opacity: 0; }
.mobile-link:nth-child(2) { animation-delay: 0.2s; opacity: 0; }
.mobile-link:nth-child(3) { animation-delay: 0.3s; opacity: 0; }
.mobile-link:nth-child(4) { animation-delay: 0.4s; opacity: 0; }

/* Thin lines and borders */
.divider-line {
    height: 1px;
    background: linear-gradient(to right, transparent, #ebe6dc, transparent);
}

/* Typography refinements */
.font-serif {
    text-rendering: optimizeLegibility;
}

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