/* ============================================
   Mike McGrath Real Estate — Custom Styles
   ============================================ */

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background: rgba(199, 90, 61, 0.2);
    color: #1A1D23;
}

/* ============================================
   Navigation
   ============================================ */
#navbar {
    color: rgba(255, 255, 255, 0.9);
    transition: background-color 0.4s ease, box-shadow 0.4s ease, color 0.4s ease;
}

#navbar.scrolled {
    background: rgba(26, 29, 35, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05);
}

#navbar.scrolled .nav-link {
    color: rgba(255, 255, 255, 0.8);
}

#navbar.scrolled #nav-logo-name,
#navbar.scrolled #nav-logo-sub {
    color: #fff;
}

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

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

#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; }

/* 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: 6;
    transform: rotate(-45deg) translate(3px, -3px);
}

/* ============================================
   Hero Animations
   ============================================ */
.hero-eyebrow {
    opacity: 0;
    transform: translateY(20px);
    animation: heroReveal 0.8s ease 0.3s forwards;
}

.hero-headline {
    opacity: 0;
    transform: translateY(30px);
    animation: heroReveal 0.8s ease 0.5s forwards;
}

.hero-sub {
    opacity: 0;
    transform: translateY(20px);
    animation: heroReveal 0.8s ease 0.7s forwards;
}

.hero-ctas {
    opacity: 0;
    transform: translateY(20px);
    animation: heroReveal 0.8s ease 0.9s forwards;
}

@keyframes heroReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll indicator */
.scroll-line-fill {
    animation: scrollDown 2s ease-in-out infinite;
}

@keyframes scrollDown {
    0% { transform: translateY(-100%); }
    50% { transform: translateY(100%); }
    51% { opacity: 0; }
    100% { transform: translateY(-100%); opacity: 1; }
}

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

/* ============================================
   CTA Buttons
   ============================================ */
.cta-primary {
    position: relative;
    overflow: hidden;
}

.cta-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.5s ease;
}

.cta-primary:hover::before {
    left: 100%;
}

/* ============================================
   Stats
   ============================================ */
.stat-item {
    position: relative;
}

.stat-item::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #C75A3D, transparent);
    transition: width 0.4s ease;
}

.stat-item:hover::after {
    width: 60%;
}

.stat-number {
    background: linear-gradient(135deg, #fff 0%, #C75A3D 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.service-card.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.service-card.revealed:nth-child(1) { transition-delay: 0.1s; }
.service-card.revealed:nth-child(2) { transition-delay: 0.2s; }
.service-card.revealed:nth-child(3) { transition-delay: 0.3s; }

/* ============================================
   Area Cards
   ============================================ */
.area-card {
    opacity: 0;
    transform: translateY(30px);
}

.area-card.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.area-card.revealed:nth-child(1) { transition-delay: 0.1s; }
.area-card.revealed:nth-child(2) { transition-delay: 0.2s; }
.area-card.revealed:nth-child(3) { transition-delay: 0.3s; }
.area-card.revealed:nth-child(4) { transition-delay: 0.4s; }

/* ============================================
   Testimonials
   ============================================ */
.testimonial-card {
    opacity: 0;
    transform: translateY(30px);
}

.testimonial-card.revealed {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.testimonial-card.revealed:nth-child(1) { transition-delay: 0.1s; }
.testimonial-card.revealed:nth-child(2) { transition-delay: 0.2s; }
.testimonial-card.revealed:nth-child(3) { transition-delay: 0.3s; }

/* ============================================
   Form Styles
   ============================================ */
select option {
    background: #FAFAF8;
    color: #2C3038;
}

/* ============================================
   Back to Top
   ============================================ */
#back-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

#back-to-top:hover {
    transform: translateY(-2px);
}

/* ============================================
   Reveal Animations (below fold only)
   ============================================ */
.reveal-up {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.reveal-right {
    opacity: 1;
    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;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
    
    .reveal-up, .reveal-left, .reveal-right {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .section-eyebrow {
        margin-bottom: 2rem !important;
    }
    
    .service-card {
        margin-bottom: 1rem;
    }
}

@media (max-width: 640px) {
    #navbar {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
