/* ============================================
   Jason Sculos — Mortgage Strategist
   Premium Dark Luxury Design System
   ============================================ */

/* --- Custom Properties --- */
:root {
    --color-charcoal-950: #0d0d0f;
    --color-charcoal-900: #1c1c1e;
    --color-charcoal-800: #2c2c2e;
    --color-charcoal-700: #3a3a3c;
    --color-charcoal-500: #636366;
    --color-charcoal-400: #86868b;
    --color-charcoal-300: #aeaeb2;
    --color-charcoal-200: #d1d1d8;
    --color-charcoal-100: #e8e8ed;
    --color-coral-500: #ff6347;
    --color-coral-400: #ff7f6e;
    --color-gold-400: #c9a84c;
    --color-gold-300: #e8d5a3;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Inter', system-ui, sans-serif;
    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s ease;
    --transition-slow: 0.6s ease;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    font-size: 16px;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

select, input, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes drawLine {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(201, 168, 76, 0.1); }
    50% { box-shadow: 0 0 40px rgba(201, 168, 76, 0.2); }
}

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

.animate-fade-in {
    animation: fadeIn 0.8s ease forwards;
}

/* --- Scroll-triggered animations --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

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

#navbar.scrolled {
    background: rgba(13, 13, 15, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 rgba(201, 168, 76, 0.1);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--color-gold-400);
    transition: width 0.3s ease;
}

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

/* 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.1s; }
#mobile-menu.open .mobile-link:nth-child(2) { animation-delay: 0.15s; }
#mobile-menu.open .mobile-link:nth-child(3) { animation-delay: 0.2s; }
#mobile-menu.open .mobile-link:nth-child(4) { animation-delay: 0.25s; }
#mobile-menu.open .mobile-link:nth-child(5) { animation-delay: 0.3s; }

.menu-line {
    display: block;
    transition: all 0.3s ease;
}

#mobile-menu-btn.active .menu-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

#mobile-menu-btn.active .menu-line:nth-child(2) {
    opacity: 0;
}

#mobile-menu-btn.active .menu-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
    width: 1.5rem;
}

/* --- Hero --- */
.scroll-indicator {
    animation: scroll-indicator 2s ease-in-out infinite;
}

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

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 99, 71, 0.03) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.service-card:hover::before {
    opacity: 1;
}

/* --- Process Steps --- */
.process-step {
    position: relative;
}

.process-step::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-charcoal-700);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.process-step:hover::after {
    background: var(--color-gold-400);
    box-shadow: 0 0 12px rgba(201, 168, 76, 0.4);
}

/* --- Testimonial Cards --- */
.testimonial-card {
    position: relative;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.5s ease, box-shadow 0.5s ease;
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 20px;
    right: 30px;
    font-family: var(--font-serif);
    font-size: 8rem;
    line-height: 1;
    color: rgba(201, 168, 76, 0.06);
    pointer-events: none;
    transition: color 0.5s ease;
}

.testimonial-card:hover::before {
    color: rgba(201, 168, 76, 0.12);
}

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

/* --- Form Styles --- */
input:focus,
select:focus,
textarea:focus {
    border-color: rgba(201, 168, 76, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.1) !important;
}

input::placeholder,
textarea::placeholder {
    color: var(--color-charcoal-500);
}

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='%2386868b' 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 1rem center;
    padding-right: 2.5rem;
}

/* --- Utility --- */
.gold-gradient-text {
    background: linear-gradient(135deg, var(--color-gold-300) 0%, var(--color-gold-400) 50%, var(--color-gold-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Selection --- */
::selection {
    background: rgba(201, 168, 76, 0.3);
    color: var(--color-charcoal-100);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-charcoal-950);
}

::-webkit-scrollbar-thumb {
    background: var(--color-charcoal-700);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-charcoal-600);
}

/* --- 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; }
    .reveal, .reveal-left, .reveal-right, .reveal-scale {
        opacity: 1;
        transform: none;
    }
}

/* --- Responsive --- */
@media (max-width: 767px) {
    html { font-size: 15px; }

    .testimonial-card::before {
        font-size: 5rem;
        top: 10px;
        right: 15px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    html { font-size: 16px; }
}

/* --- Print --- */
@media print {
    body { background: white; color: black; }
    #navbar, .scroll-indicator { display: none; }
}
