/* ============================================
   Justin Murray — OriginPoint Mortgage
   Custom Styles
   ============================================ */

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

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

body {
    overflow-x: hidden;
}

::selection {
    background: rgba(74, 35, 90, 0.15);
    color: #1A0A1E;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #F5F5F4;
}
::-webkit-scrollbar-thumb {
    background: #B8A0D6;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #8B5FBF;
}

/* ============================================
   Navigation
   ============================================ */
#navbar {
    background: rgba(245, 245, 244, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#navbar.scrolled {
    background: rgba(245, 245, 244, 0.95);
    border-bottom-color: rgba(184, 160, 214, 0.3);
    box-shadow: 0 1px 0 rgba(74, 35, 90, 0.05);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: #D4A017;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Mobile menu */
#mobileMenu {
    background: rgba(245, 245, 244, 0.98);
    backdrop-filter: blur(20px);
}

#mobileMenu.open {
    opacity: 1;
    pointer-events: all;
}

#mobileMenu.closed {
    opacity: 0;
    pointer-events: none;
}

.mobile-link {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

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

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

/* Menu button */
.menu-line {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#menuBtn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}
#menuBtn.active .menu-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
#menuBtn.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
    width: 1.5rem;
}

/* ============================================
   Hero Animations
   ============================================ */
.hero-eyebrow {
    animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

.hero-title {
    animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

.hero-subtitle {
    animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.6s both;
}

.hero-ctas {
    animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.8s both;
}

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

.image-reveal {
    animation: revealImage 1s cubic-bezier(0.4, 0, 0.2, 1) 0.5s both;
}

@keyframes revealImage {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.card-appear {
    animation: appearCard 0.8s cubic-bezier(0.4, 0, 0.2, 1) 1s both;
}

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

.line-appear {
    animation: appearLine 0.6s cubic-bezier(0.4, 0, 0.2, 1) 1.2s both;
}

@keyframes appearLine {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Scroll line animation */
@keyframes scrollLine {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(200%); }
}

.animate-scroll {
    animation: scrollLine 1.5s ease-in-out infinite;
}

/* ============================================
   Reveal Animations (Scroll-triggered)
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }
.reveal.delay-3 { transition-delay: 0.3s; }
.reveal.delay-4 { transition-delay: 0.4s; }

/* ============================================
   Service Cards
   ============================================ */
.service-card {
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card:hover {
    background-color: #1A0A1E;
}

.service-card:hover .service-card-text {
    color: rgba(214, 198, 230, 0.8);
}

/* ============================================
   Process Steps
   ============================================ */
.process-step {
    transition: background-color 0.4s ease;
}

.process-step:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

/* ============================================
   Testimonial Cards
   ============================================ */
.testimonial-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 60px rgba(74, 35, 90, 0.08);
}

/* ============================================
   Form Styles
   ============================================ */
input:focus,
select:focus,
textarea:focus {
    border-bottom-color: #4A235A !important;
}

input::placeholder,
textarea::placeholder {
    color: #D8CFF0;
}

select option {
    background: #F5F5F4;
    color: #2D1233;
}

/* ============================================
   Utility: Thin decorative lines
   ============================================ */
.divider-line {
    position: relative;
}

.divider-line::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 48px;
    height: 1px;
    background: linear-gradient(90deg, #D4A017, transparent);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 767px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .card-appear {
        position: relative;
        bottom: auto;
        left: auto;
        margin-top: 16px;
    }

    .process-step {
        border-color: transparent !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hero-title {
        font-size: 3.5rem;
    }
}

/* ============================================
   Focus visible for accessibility
   ============================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #D4A017;
    outline-offset: 2px;
}

/* ============================================
   Print styles
   ============================================ */
@media print {
    #navbar,
    .scroll-indicator {
        display: none;
    }

    body {
        background: white;
    }

    section {
        page-break-inside: avoid;
    }
}
