/* ===== Custom Styles for Trinity Monuments ===== */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom selection color */
::selection {
    background-color: #2f4a20;
    color: #faf9f6;
}

/* ===== Reveal Animations (progressive enhancement) ===== */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 0;
        transform: translateY(24px);
        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);
    }

    .reveal:nth-child(2) { transition-delay: 0.08s; }
    .reveal:nth-child(3) { transition-delay: 0.16s; }
    .reveal:nth-child(4) { transition-delay: 0.24s; }
    .reveal:nth-child(5) { transition-delay: 0.32s; }

    /* Staggered service cards */
    .service-card {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s, box-shadow 0.3s;
    }

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

    .service-card:nth-child(1) { transition-delay: 0s; }
    .service-card:nth-child(2) { transition-delay: 0.08s; }
    .service-card:nth-child(3) { transition-delay: 0.16s; }
    .service-card:nth-child(4) { transition-delay: 0.24s; }
    .service-card:nth-child(5) { transition-delay: 0.32s; }
    .service-card:nth-child(6) { transition-delay: 0.40s; }
}

/* ===== Floating Card Animations ===== */
@media (prefers-reduced-motion: no-preference) {
    .floating-card {
        animation: float 6s ease-in-out infinite;
    }

    .card-1 { animation-delay: 0s; }
    .card-2 { animation-delay: -1.5s; }
    .card-3 { animation-delay: -3s; }
    .card-4 { animation-delay: -4.5s; }

    @keyframes float {
        0%, 100% { transform: translateY(0px); }
        50% { transform: translateY(-12px); }
    }
}

/* ===== Navbar Scroll State ===== */
#navbar.scrolled {
    background-color: rgba(250, 249, 246, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(47, 74, 32, 0.08), 0 4px 20px rgba(47, 74, 32, 0.06);
}

#navbar.scrolled .menu-line {
    background-color: #2f4a20;
}

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

#mobile-menu .mobile-link {
    opacity: 0;
    transform: translateY(12px);
    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; }
#mobile-menu.open .mobile-link:nth-child(5) { transition-delay: 0.25s; }

/* Hamburger animation */
.menu-line {
    transition: transform 0.3s ease, opacity 0.2s ease;
}

#mobile-menu-btn.active .menu-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

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

#mobile-menu-btn.active .menu-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
    width: 5px;
}

/* ===== Image hover overlay ===== */
.group .absolute.inset-0 {
    transition: opacity 0.5s ease;
}

/* ===== Select dropdown arrow ===== */
select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    padding-right: 2.5rem;
}

/* ===== Subtle pattern overlay for sections ===== */
.bg-cream-50::before,
.bg-cream-100::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(47, 74, 32, 0.03) 1px, transparent 0);
    background-size: 24px 24px;
    pointer-events: none;
}

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

/* ===== Print styles ===== */
@media print {
    nav, #contact, .floating-card, .reveal {
        display: none !important;
    }
    body {
        background: white;
        color: black;
    }
}
