/* =============================================
   North Star Fence — Custom Styles
   ============================================= */

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

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #faf5f8;
}
::-webkit-scrollbar-thumb {
    background: #d6b3cc;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a04d84;
}

/* Navbar Transitions */
#navbar {
    transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
}

#navbar.scrolled {
    background-color: rgba(250, 245, 248, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(160, 77, 132, 0.1);
}

.nav-logo-text {
    transition: color 0.4s ease;
}

#navbar.scrolled .nav-logo-text {
    color: #47233b;
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #f5a623;
    transition: width 0.3s ease;
}

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

#navbar.scrolled .nav-link {
    color: #6c3158;
}

#navbar.scrolled .nav-link:hover {
    color: #d98a10;
}

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

#mobile-menu.open .mobile-link {
    animation: fadeUp 0.4s ease forwards;
    opacity: 0;
}

#mobile-menu.open .mobile-link:nth-child(1) { animation-delay: 0.05s; }
#mobile-menu.open .mobile-link:nth-child(2) { animation-delay: 0.1s; }
#mobile-menu.open .mobile-link:nth-child(3) { animation-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(4) { animation-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(5) { animation-delay: 0.25s; }

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

/* Menu Button Animation */
.menu-btn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}
.menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
}
.menu-btn.active .menu-line:nth-child(3) {
    width: 100%;
    transform: rotate(-45deg) translate(3px, -3px);
}

/* Service Cards */
.service-card {
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(71, 35, 59, 0.08);
}

/* Gallery Items */
.gallery-item {
    cursor: pointer;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    transition: border-color 0.4s ease;
    pointer-events: none;
}

.gallery-item:hover::after {
    border-color: rgba(245, 166, 35, 0.5);
}

/* Form Inputs */
input:focus,
select:focus,
textarea:focus {
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

/* Selection Color */
::selection {
    background-color: #d6b3cc;
    color: #260f1f;
}

/* Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* Stagger children */
.stagger-children > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.stagger-children.revealed > *:nth-child(1) { transition-delay: 0.0s; }
.stagger-children.revealed > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.revealed > *:nth-child(3) { transition-delay: 0.2s; }
.stagger-children.revealed > *:nth-child(4) { transition-delay: 0.3s; }
.stagger-children.revealed > *:nth-child(5) { transition-delay: 0.4s; }
.stagger-children.revealed > *:nth-child(6) { transition-delay: 0.5s; }

.stagger-children.revealed > * {
    opacity: 1;
    transform: translateY(0);
}

/* Button Ripple */
button, a {
    position: relative;
    overflow: hidden;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    
    .reveal,
    .stagger-children > * {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    .gallery-item img,
    .gallery-item::after {
        transition: none;
    }
    
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    #navbar,
    #mobile-menu,
    .gallery-item::after {
        display: none !important;
    }
    
    body {
        color: #000;
        background: #fff;
    }
}
