/* ============================================
   Avenues on 61st — Custom Styles
   ============================================ */

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

body {
    overflow-x: hidden;
}

::selection {
    background: rgba(161, 39, 65, 0.15);
    color: #6b1d30;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #fdfbf7;
}
::-webkit-scrollbar-thumb {
    background: #e6ce9e;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #c93d64;
}

/* --- Navigation --- */
.nav-fixed {
    background: transparent;
    transition: background 0.5s ease, box-shadow 0.5s ease, backdrop-filter 0.5s ease;
}

.nav-fixed.scrolled {
    background: rgba(254, 253, 251, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 rgba(161, 39, 65, 0.08);
}

.nav-fixed.scrolled .nav-logo-text {
    color: #1a1a1a;
}

.nav-fixed.scrolled .nav-logo-sub {
    color: #1a1a1a;
}

.nav-fixed:not(.scrolled) .nav-logo-text {
    color: #fefdfb;
}

.nav-fixed:not(.scrolled) .nav-logo-sub {
    color: #fefdfb;
}

.nav-fixed:not(.scrolled) .nav-link {
    color: rgba(254, 253, 251, 0.8);
}

.nav-fixed:not(.scrolled) #menu-btn {
    color: #fefdfb;
}

.nav-link {
    color: rgba(26, 26, 26, 0.7);
    transition: color 0.3s ease;
    position: relative;
}

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

.nav-link:hover {
    color: #c93d64;
}

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

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

/* --- Menu Icon Animation --- */
#menu-btn.active #bar1 {
    transform: translateY(4px) rotate(45deg);
}
#menu-btn.active #bar2 {
    opacity: 0;
    transform: scaleX(0);
}
#menu-btn.active #bar3 {
    transform: translateY(-4px) rotate(-45deg);
    width: 1.5rem;
}

/* --- Hero --- */
.hero-eyebrow {
    opacity: 0;
    animation: fadeSlideUp 0.8s ease forwards;
    animation-delay: 0.3s;
}

.hero-headline {
    opacity: 0;
    animation: fadeSlideUp 0.8s ease forwards;
    animation-delay: 0.5s;
}

.hero-subtitle {
    opacity: 0;
    animation: fadeSlideUp 0.8s ease forwards;
    animation-delay: 0.7s;
}

.hero-ctas {
    opacity: 0;
    animation: fadeSlideUp 0.8s ease forwards;
    animation-delay: 0.9s;
}

.scroll-line {
    animation: scrollPulse 2s ease-in-out infinite;
}

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

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.8); transform-origin: top; }
    50% { opacity: 0.7; transform: scaleY(1.2); transform-origin: top; }
}

/* --- Buttons --- */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover::before {
    opacity: 1;
}

/* --- Section Eyebrow --- */
.section-eyebrow {
    display: flex;
}

/* --- Service Cards --- */
.service-card {
    position: relative;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #c93d64, #e0507e);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

.service-card:hover::before {
    transform: scaleX(1);
}

/* --- Select styling --- */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 2rem;
}

select option {
    background: #fefdfb;
    color: #1a1a1a;
}

/* --- Back to Top --- */
.back-to-top {
    box-shadow: 0 4px 20px rgba(107, 29, 48, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.back-to-top:not(.visible) {
    transform: translateY(12px);
}

/* --- Scroll Reveal (progressive enhancement) --- */
@media (prefers-reduced-motion: no-preference) {
    .reveal-up,
    .reveal-left,
    .reveal-right {
        opacity: 1;
    }

    .reveal-up {
        transform: translateY(0);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }

    .reveal-left {
        transform: translateX(0);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }

    .reveal-right {
        transform: translateX(0);
        transition: opacity 0.7s ease, transform 0.7s ease;
    }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .hero-headline {
        font-size: 3rem;
    }
    
    .section-eyebrow {
        justify-content: flex-start;
    }
}
