/* ============================================
   J and E Engraving — Custom Styles
   Classic & Elegant | Midnight Blue + Mint
   ============================================ */

/* --- Custom Properties --- */
:root {
    --color-midnight-950: #030a16;
    --color-midnight-900: #0a1f3f;
    --color-mint-300:   #8ed3b8;
    --color-mint-400:   #5fbf9a;
    --color-mint-500:   #3aa87e;
    --color-mint-600:   #2a8564;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans:  'Lato', system-ui, sans-serif;
}

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

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

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

::selection {
    background: rgba(95, 191, 154, 0.3);
    color: #f0faf5;
}

/* --- Navbar Scroll State --- */
.nav-scrolled {
    background: rgba(3, 10, 22, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(142, 211, 184, 0.08);
    box-shadow: 0 1px 0 rgba(142, 211, 184, 0.05);
}

.nav-scrolled .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

.nav-scrolled .nav-link:hover {
    color: var(--color-mint-300);
}

/* --- Hero Animations (above-fold — always visible) --- */
.hero-anim {
    opacity: 1;
    transform: translateY(0);
    animation: heroFadeIn 0.8s ease-out both;
}

.hero-anim:nth-child(1) { animation-delay: 0.1s; }
.hero-anim:nth-child(2) { animation-delay: 0.3s; }
.hero-anim:nth-child(3) { animation-delay: 0.5s; }
.hero-anim:nth-child(4) { animation-delay: 0.7s; }

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

/* --- Scroll Line Animation --- */
.scroll-line {
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(1); }
    50% { opacity: 0.7; transform: scaleY(1.3); }
}

/* --- Reveal Animations (below-fold — progressive enhancement) --- */
@media (prefers-reduced-motion: no-preference) {
    .reveal {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.7s ease-out, transform 0.7s ease-out;
    }

    /* Default state visible — JS adds .revealed for the animation trigger */
    .reveal.revealed {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered delays for grid items */
    .service-card:nth-child(1) { transition-delay: 0.05s; }
    .service-card:nth-child(2) { transition-delay: 0.1s; }
    .service-card:nth-child(3) { transition-delay: 0.15s; }
    .service-card:nth-child(4) { transition-delay: 0.2s; }
    .service-card:nth-child(5) { transition-delay: 0.25s; }
    .service-card:nth-child(6) { transition-delay: 0.3s; }
}

/* Reduced motion — keep everything visible, no animations */
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .reveal.revealed {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .hero-anim {
        opacity: 1;
        transform: none;
        animation: none;
    }
    .scroll-line {
        animation: none;
        opacity: 0.5;
    }
}

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

.mobile-nav-link {
    opacity: 1;
}

.mobile-nav-link:hover {
    letter-spacing: 0.02em;
}

/* --- Service Cards --- */
.service-card {
    opacity: 1;
    transform: translateY(0);
}

/* --- Form Inputs --- */
input:focus,
textarea:focus {
    outline: none;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--color-midnight-950);
}
::-webkit-scrollbar-thumb {
    background: rgba(142, 211, 184, 0.2);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(142, 211, 184, 0.4);
}

/* --- Image loading placeholder --- */
img {
    background-color: rgba(10, 31, 63, 0.5);
}
