/* Base & Utilities */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
}

::selection {
    background-color: #C4704B;
    color: white;
}

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

.hero-appear {
    opacity: 0;
    animation: fadeInUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-appear:nth-child(2) { animation-delay: 0.15s; }
.hero-appear:nth-child(3) { animation-delay: 0.3s; }
.hero-appear:nth-child(4) { animation-delay: 0.45s; }
.hero-appear:nth-child(5) { animation-delay: 0.6s; }
.hero-appear:nth-child(6) { animation-delay: 0.75s; }

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

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

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

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

.nav-logo {
    transition: color 0.3s ease;
}

#navbar.scrolled .nav-logo {
    color: #8B472E;
}

.nav-link {
    position: relative;
}

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

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

#navbar.scrolled .nav-link {
    color: #5C4033;
}

#navbar.scrolled .nav-link:hover {
    color: #A85A3A;
}

/* Mobile Menu */
#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

#mobile-menu.open .mobile-link {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Mobile menu lines animation */
#menu-toggle.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

#menu-toggle.active .menu-line:nth-child(2) {
    opacity: 0;
}

#menu-toggle.active .menu-line:nth-child(3) {
    width: 24px;
    transform: rotate(-45deg) translate(4px, -4px);
}

/* Image hover effects */
.group:hover .group-hover\!scale-105 {
    transform: scale(1.05);
}

/* Smooth focus styles */
input:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(196, 112, 75, 0.15);
}

/* Subtle gradient border on cards */
.reveal:nth-child(1) { transition-delay: 0ms; }
.reveal:nth-child(2) { transition-delay: 100ms; }
.reveal:nth-child(3) { transition-delay: 200ms; }

/* Print styles */
@media print {
    nav, #contacto, #menu-toggle { display: none; }
    body { color: #000; background: #fff; }
    section { padding: 20px 0; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    html { scroll-behavior: auto; }
    .reveal {
        opacity: 1;
        transform: none;
    }
    .hero-appear {
        opacity: 1;
        animation: none;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: #D9C59A;
    border-radius: 4px;
}

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