/* ============================================
   Ruiz Villasuso — Estilos personalizados
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --color-teal-700: #0f766e;
    --color-teal-800: #115e59;
    --color-slate-900: #0f172a;
    --font-playfair: 'Playfair Display', Georgia, serif;
    --font-lato: 'Lato', system-ui, sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background-color: #0f766e;
    color: #fff;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f5f5f4;
}
::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #0f766e;
}

/* --- Header --- */
#main-header {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#main-header.scrolled {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.08);
}

.nav-link {
    position: relative;
}

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

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

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

#mobile-menu.open .mobile-link {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

#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; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Menu toggle animation */
.menu-toggle.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}
.menu-toggle.active .menu-line:nth-child(2) {
    opacity: 0;
}
.menu-toggle.active .menu-line:nth-child(3) {
    width: 6px;
    transform: rotate(-45deg) translate(3px, -3px);
}

/* --- Hero animations --- */
.hero-content {
    opacity: 0;
    transform: translateY(30px);
    animation: heroIn 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s forwards;
}

.hero-image {
    opacity: 0;
    transform: translateY(30px);
    animation: heroIn 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.4s forwards;
}

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

/* --- Section headers --- */
.section-header {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.section-header.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Service cards --- */
.service-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, background 0.5s ease, box-shadow 0.5s ease, border-color 0.5s ease;
}

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card.visible:nth-child(1) { transition-delay: 0.05s; }
.service-card.visible:nth-child(2) { transition-delay: 0.1s; }
.service-card.visible:nth-child(3) { transition-delay: 0.15s; }
.service-card.visible:nth-child(4) { transition-delay: 0.2s; }
.service-card.visible:nth-child(5) { transition-delay: 0.25s; }
.service-card.visible:nth-child(6) { transition-delay: 0.3s; }

/* --- Property cards --- */
.property-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.5s ease;
}

.property-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.property-card.visible:nth-child(1) { transition-delay: 0.05s; }
.property-card.visible:nth-child(2) { transition-delay: 0.15s; }
.property-card.visible:nth-child(3) { transition-delay: 0.25s; }

/* --- About image --- */
.about-image {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.about-image.visible {
    opacity: 1;
    transform: translateX(0);
}

.about-content {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

.about-content.visible {
    opacity: 1;
    transform: translateX(0);
}

/* --- Form inputs --- */
input:focus,
select:focus,
textarea:focus {
    border-color: #0f766e !important;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12) !important;
    outline: none !important;
}

/* --- Button hover effects --- */
button,
a {
    cursor: pointer;
}

/* --- Responsive adjustments --- */
@media (max-width: 767px) {
    html {
        font-size: 15px;
    }

    .hero-content {
        text-align: center;
    }

    .hero-content p {
        max-width: 100%;
    }

    .hero-content > div:first-child {
        justify-content: center;
    }

    .hero-content > div:last-child {
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }

    .hero-content > div:last-child > a {
        width: 100%;
        max-width: 280px;
    }

    /* Trust indicators */
    .hero-content > div:nth-last-child(2) {
        justify-content: center;
        gap: 6px 24px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hero-image img {
        h-[480px];
    }
}

/* --- Print styles --- */
@media print {
    #main-header,
    #mobile-menu {
        display: none;
    }

    body {
        color: #000;
        background: #fff;
    }

    section {
        page-break-inside: avoid;
    }
}
