/* ========================================
   American Family Insurance — Alex Acosta
   Custom Styles
   ======================================== */

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

body {
    overflow-x: hidden;
}

/* Selection */
::selection {
    background: #B85C38;
    color: #fff;
}

/* ========================================
   Navigation
   ======================================== */
#navbar {
    background: transparent;
    transition: background 0.4s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

#navbar.scrolled {
    background: rgba(253, 252, 250, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
}

/* ========================================
   Hero Animations
   ======================================== */
.hero-tagline {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.1s;
    opacity: 0;
    transform: translateY(20px);
}

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

.hero-subtext {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.4s;
    opacity: 0;
    transform: translateY(20px);
}

.hero-cta-primary,
.hero-cta-secondary {
    animation: slideUp 0.8s ease forwards;
    animation-delay: 0.55s;
    opacity: 0;
    transform: translateY(20px);
}

.hero-image-wrapper {
    animation: fadeIn 1s ease forwards;
    animation-delay: 0.5s;
    opacity: 0;
    transform: translateY(20px);
}

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

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

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

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

/* ========================================
   Section Labels & Titles
   ======================================== */
.section-label {
    animation: fadeIn 0.6s ease forwards;
}

.section-title {
    animation: fadeIn 0.6s ease forwards;
}

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

.service-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.service-card:nth-child(1) { transition-delay: 0.05s; }
.service-card:nth-child(2) { transition-delay: 0.1s; }
.service-card:nth-child(3) { transition-delay: 0.15s; }
.service-card:nth-child(4) { transition-delay: 0.2s; }
.service-card:nth-child(5) { transition-delay: 0.25s; }
.service-card:nth-child(6) { transition-delay: 0.3s; }

/* ========================================
   Testimonial Cards
   ======================================== */
.testimonial-card {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.testimonial-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.testimonial-card:nth-child(1) { transition-delay: 0.05s; }
.testimonial-card:nth-child(2) { transition-delay: 0.15s; }
.testimonial-card:nth-child(3) { transition-delay: 0.25s; }

/* ========================================
   Mobile Menu
   ======================================== */
.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#mobile-menu.open .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

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

/* Menu toggle animation */
#menu-icon.active #bar1 {
    transform: rotate(45deg) translate(3px, 3px);
}

#menu-icon.active #bar2 {
    opacity: 0;
    transform: translateX(10px);
}

#menu-icon.active #bar3 {
    transform: rotate(-45deg) translate(3px, -3px);
}

/* ========================================
   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='%239CA3AF' 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 12px center;
    padding-right: 40px;
}

/* ========================================
   Focus visible for accessibility
   ======================================== */
:focus-visible {
    outline: 2px solid #B85C38;
    outline-offset: 2px;
}

/* ========================================
   Responsive adjustments
   ======================================== */
@media (max-width: 768px) {
    .hero-headline {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2.25rem;
    }

    .service-card,
    .testimonial-card {
        padding: 1.5rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .hero-headline {
        font-size: 3.5rem;
    }
}
