/* ============================================
   Middle Quarry — Custom Styles
   ============================================ */

/* Base & Typography */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Selection Color */
::selection {
    background-color: rgba(15, 76, 92, 0.2);
    color: #0F4C5C;
}

/* ============================================
   Navbar Styles
   ============================================ */
.nav-logo-color {
    color: #0F4C5C;
}

.nav-sub-color {
    color: #64748b;
}

.nav-link-color {
    color: #475569;
}

/* Scrolled state */
header.scrolled .nav-logo-color {
    color: #0F4C5C;
}

header.scrolled .nav-sub-color {
    color: #64748b;
}

header.scrolled .nav-link-color {
    color: #475569;
}

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

/* Hero navbar state */
header:not(.scrolled) .nav-logo-color {
    color: #f0f7f7;
}

header:not(.scrolled) .nav-sub-color {
    color: #94a3b8;
}

header:not(.scrolled) .nav-link-color {
    color: #cbd5e1;
}

header:not(.scrolled) {
    background-color: transparent;
    box-shadow: none;
}

/* ============================================
   Mobile Menu
   ============================================ */
#mobileMenu {
    opacity: 0;
    pointer-events: none;
}

#mobileMenu.active {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

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

#mobileMenu.active .menu-line:nth-child(3) {
    width: 24px;
    transform: rotate(-45deg) translate(5px, -5px);
    margin-left: 0;
}

/* ============================================
   Scroll Reveal
   ============================================ */
.scroll-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal {
        opacity: 0;
        transform: translateY(24px);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }

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

/* ============================================
   Hero Elements — always visible
   ============================================ */
.hero-elem {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: no-preference) {
    .hero-elem {
        animation: heroFadeIn 0.8s ease forwards;
    }

    .hero-elem:nth-child(1) { animation-delay: 0.1s; }
    .hero-elem:nth-child(2) { animation-delay: 0.2s; }
    .hero-elem:nth-child(3) { animation-delay: 0.3s; }
    .hero-elem:nth-child(4) { animation-delay: 0.4s; }
    .hero-elem:nth-child(5) { animation-delay: 0.5s; }
    .hero-elem:nth-child(6) { animation-delay: 0.6s; }
}

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

/* ============================================
   Form Focus Styles
   ============================================ */
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: 767px) {
    section[id] {
        scroll-margin-top: 60px;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    header, footer, #contactForm, iframe {
        display: none;
    }

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