/* ===== CUSTOM STYLES ===== */

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

/* Nav scroll state */
#nav.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(16, 42, 67, 0.08);
}

#nav.scrolled .nav-logo-text {
    color: #102a43 !important;
}

#nav.scrolled .nav-link {
    color: #486581 !important;
}

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

/* Menu button animation */
#mobile-menu.open ~ #menu-btn .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

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

#mobile-menu.open ~ #menu-btn .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
    width: 20px;
}

/* Mobile link transitions */
.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, color 0.2s 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; }

/* Scroll reveal animations */
.scroll-reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .scroll-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .group:hover img,
    .group:hover .relative img {
        transform: none;
    }
}

/* Scroll reveal hidden state — applied via JS */
.scroll-reveal.revealed {
    opacity: 0;
    transform: translateY(30px);
}

@media (prefers-reduced-motion: no-preference) {
    .scroll-reveal.revealed {
        opacity: 0;
        transform: translateY(30px);
    }
}

/* Nav link underline effect */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: #f7db84;
    transition: width 0.3s ease;
    border-radius: 1px;
}

.nav-link:hover::after {
    width: 100%;
}

/* Subtle grain texture overlay for gallery */
#gallery::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* Custom selection color */
::selection {
    background: #f7db84;
    color: #102a43;
}

/* Image loading placeholder */
img {
    background: linear-gradient(135deg, #f0f4f8 0%, #d9e2ec 100%);
}
