/* ========================================
   Alberto Loyo Castillo — Custom Styles
   ======================================== */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

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

/* Selection */
::selection {
    background-color: #228E4C;
    color: #fefdf8;
}

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

#navbar.scrolled {
    background: rgba(254, 253, 248, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(14, 101, 51, 0.06), 0 4px 20px rgba(14, 101, 51, 0.06);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #228E4C;
    border-radius: 1px;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 60%;
}

/* ========================================
   Mobile Menu
   ======================================== */
.mobile-nav-link {
    border-radius: 0.75rem;
}

#mobile-menu {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.animate-fade-in-up {
    animation: fadeInUp 0.7s ease forwards;
    opacity: 0;
}

.animation-delay-100 { animation-delay: 0.1s; }
.animation-delay-200 { animation-delay: 0.2s; }
.animation-delay-300 { animation-delay: 0.3s; }
.animation-delay-400 { animation-delay: 0.4s; }

/* Scroll indicator */
@keyframes scrollIndicator {
    0%, 100% { opacity: 0.3; transform: scaleY(0.5); transform-origin: top; }
    50% { opacity: 1; transform: scaleY(1); }
}

.animate-scroll-indicator {
    animation: scrollIndicator 2s ease-in-out infinite;
}

/* ========================================
   Reveal Animations
   ======================================== */
.reveal-up, .reveal-left, .reveal-right {
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-up {
    transform: translateY(40px);
}

.reveal-left {
    transform: translateX(-40px);
}

.reveal-right {
    transform: translateX(40px);
}

.reveal-up.visible,
.reveal-left.visible,
.reveal-right.visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* ========================================
   Service Cards
   ======================================== */
.service-card {
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #228E4C, #6fc48a);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.service-card:hover::before {
    opacity: 1;
}

/* ========================================
   Form
   ======================================== */
input:focus,
textarea:focus,
select:focus {
    border-color: #6fc48a !important;
    box-shadow: 0 0 0 3px rgba(111, 196, 138, 0.15) !important;
}

/* ========================================
   Back to Top
   ======================================== */
#back-to-top {
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

#back-to-top.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#back-to-top:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(34, 142, 76, 0.4) !important;
}

/* ========================================
   Utility — Animation Delays for Reveal
   ======================================== */
.animation-delay-100 { transition-delay: 0.1s; }
.animation-delay-200 { transition-delay: 0.2s; }
.animation-delay-300 { transition-delay: 0.3s; }
.animation-delay-400 { transition-delay: 0.4s; }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 768px) {
    html {
        scroll-padding-top: 70px;
    }

    .font-serif {
        line-height: 1.15;
    }
}

/* ========================================
   Print
   ======================================== */
@media print {
    #navbar, #back-to-top, .animate-scroll-indicator {
        display: none !important;
    }

    body {
        color: #1a1a1a;
        background: white;
    }

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