/* ============================================
   Lifeguard EMS – Harlan Station
   Custom Styles & Animations
   ============================================ */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background: rgba(255, 107, 74, 0.2);
    color: #1f2937;
}

/* ============================================
   Hero Animations
   ============================================ */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-up {
    animation-name: fade-up;
    animation-duration: 0.8s;
    animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   Scroll Reveal (Progressive Enhancement)
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    }

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

    /* Stagger children */
    .reveal.stagger > * {
        opacity: 0;
        transform: translateY(16px);
        transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .reveal.stagger.revealed > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: translateY(0); }
    .reveal.stagger.revealed > *:nth-child(2) { transition-delay: 0.12s; opacity: 1; transform: translateY(0); }
    .reveal.stagger.revealed > *:nth-child(3) { transition-delay: 0.19s; opacity: 1; transform: translateY(0); }
    .reveal.stagger.revealed > *:nth-child(4) { transition-delay: 0.26s; opacity: 1; transform: translateY(0); }
    .reveal.stagger.revealed > *:nth-child(5) { transition-delay: 0.33s; opacity: 1; transform: translateY(0); }
    .reveal.stagger.revealed > *:nth-child(6) { transition-delay: 0.40s; opacity: 1; transform: translateY(0); }
}

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

#navbar.scrolled {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

#navbar.scrolled .font-display,
#navbar.scrolled span:not(.text-coral-500):not(.text-coral-400) {
    color: #1f2937 !important;
}

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

#mobile-menu .mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s 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.05s; }
#mobile-menu.open .mobile-link:nth-child(2) { transition-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(3) { transition-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(4) { transition-delay: 0.2s; }

/* Hamburger animation */
#menu-btn.active #menu-icon-1 {
    transform: rotate(45deg);
    top: 1.5px;
}
#menu-btn.active #menu-icon-2 {
    opacity: 0;
}
#menu-btn.active #menu-icon-3 {
    transform: rotate(-45deg);
    top: 1.5px;
    width: 5px;
}

/* ============================================
   Form Styles
   ============================================ */
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='%239ca3af' 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;
}

input:focus, select:focus, textarea:focus {
    outline: none;
}

/* ============================================
   Smooth Scroll Offset for Fixed Nav
   ============================================ */
section[id] {
    scroll-margin-top: 80px;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    section[id] {
        scroll-margin-top: 70px;
    }

    /* Reduce hero text size on mobile */
    #hero h1 {
        font-size: 2.75rem;
    }

    @media (min-width: 769px) {
        #hero h1 {
            font-size: 4rem;
        }
    }

    @media (min-width: 1024px) {
        #hero h1 {
            font-size: 5rem;
        }
    }
}

/* ============================================
   Focus Visible for Accessibility
   ============================================ */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid #FF6B4A;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    #navbar, #mobile-menu, .reveal {
        display: none !important;
    }

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

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