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

:root {
    --terracotta-500: #c4856d;
    --terracotta-600: #b56a4f;
    --sand-400: #efcf82;
    --sand-500: #e6b855;
    --cream: #faf8f5;
    --warm-900: #2d2418;
    --warm-600: #6b5e50;
    --warm-500: #8b7d6e;
    --warm-400: #b0a496;
    --warm-200: #e8e0d8;
}

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

body {
    overflow-x: hidden;
}

::selection {
    background: var(--terracotta-500);
    color: white;
}

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

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

@keyframes bounceSlow {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

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

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

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

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

.animate-bounce-slow {
    animation: bounceSlow 2s ease-in-out infinite;
}

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

/* Fallback: content is visible without JS */
.reveal {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(40px);
    }
}

/* ===== Service Cards ===== */
.service-card {
    will-change: transform;
}

/* ===== Gallery Items ===== */
.gallery-item {
    cursor: pointer;
}

/* ===== Mobile Menu ===== */
.mobile-link {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, color 0.3s ease;
}

.mobile-menu-open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu-open .mobile-link:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu-open .mobile-link:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu-open .mobile-link:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu-open .mobile-link:nth-child(4) { transition-delay: 0.25s; }
.mobile-menu-open .mobile-link:nth-child(5) { transition-delay: 0.3s; }

/* ===== Navbar Scroll State ===== */
.navbar-scrolled {
    background: rgba(107, 55, 41, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

.navbar-scrolled #bar1,
.navbar-scrolled #bar2,
.navbar-scrolled #bar3 {
    background: white;
}

/* ===== Testimonial Stars Hover ===== */
.testimonial-card:hover .star {
    animation: starPulse 0.4s ease forwards;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.testimonial-card:hover .star:nth-child(1) { animation-delay: 0s; }
.testimonial-card:hover .star:nth-child(2) { animation-delay: 0.05s; }
.testimonial-card:hover .star:nth-child(3) { animation-delay: 0.1s; }
.testimonial-card:hover .star:nth-child(4) { animation-delay: 0.15s; }
.testimonial-card:hover .star:nth-child(5) { animation-delay: 0.2s; }

/* ===== Custom Select Arrow ===== */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b7d6e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ===== Smooth Image Loading ===== */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* ===== Focus Visible ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--terracotta-500);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
}

@media (max-width: 360px) {
    html {
        font-size: 14px;
    }
}
