@import url('https://fonts.googleapis.com/css2?family=Spline+Sans:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================
   Jagdamb Computers Design System - UrbanNest
   ============================================ */

:root {
    /* Fonts */
    --font-sans: 'Spline Sans', sans-serif;

    /* Brand Colors */
    --primary: #4f39f6;
    --primary-dark: #3525cd;
    --primary-light: #eff6ff;
    --primary-foreground: #ffffff;

    --secondary: #008259;
    --secondary-light: #d0fae5;
    --secondary-foreground: #ffffff;

    --tertiary: #edb200;
    --tertiary-light: #fef9c2;
    --tertiary-foreground: #ffffff;

    /* Surfaces & Neutrals */
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-muted: #f1f5f9;

    --foreground: #0f172b;
    --muted-foreground: #475569;
    --outline-variant: #e2e8f0;

    /* Border Radii */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-3xl: 2rem;
    --radius-full: 9999px;

    /* Shadows & Glows */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(15 23 43 / 0.08);
    --shadow-lg: 0 10px 15px -3px rgb(15 23 43 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(15 23 43 / 0.12);
    --shadow-glow: 0 8px 30px -4px rgba(79, 57, 246, 0.35);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--background);
    color: var(--foreground);
    -webkit-font-smoothing: antialiased;
}

/* Enable native View Transitions API */
@view-transition {
    navigation: auto;
}

/* Focus visible rings */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible) {
    outline: none;
}

/* Gradient Utilities */
.bg-gradient-hero {
    background: linear-gradient(135deg, #4f39f6 0%, #edb200 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #4f39f6 0%, #3525cd 100%);
}

.bg-gradient-tertiary {
    background: linear-gradient(135deg, #edb200 0%, #f99c00 100%);
}

.bg-gradient-card {
    background: linear-gradient(135deg, #4f39f6 0%, #432dd7 100%);
}

/* Soft film grain overlay */
.grain::before {
    content: "";
    pointer-events: none;
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    z-index: 1;
}

/* Primary CTA glow */
.btn-primary-glow {
    box-shadow: var(--shadow-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn-primary-glow:hover {
    box-shadow: 0 10px 36px -4px rgba(79, 57, 246, 0.45);
}

.btn-primary-glow:active {
    transform: scale(0.96);
}

/* Card hover lift */
.card-lift {
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease, border-color 0.35s ease;
}

.card-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* Image ken-burns on hover */
.img-kenburns {
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.group:hover .img-kenburns,
.card-lift:hover .img-kenburns {
    transform: scale(1.08);
}

/* Image bottom gradient for badge legibility */
.img-scrim::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 43, 0.55) 0%, transparent 45%);
    pointer-events: none;
}

/* Floating glass search */
.search-glass {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 12px 40px -8px rgba(15, 23, 43, 0.18);
}

/* Navbar scroll intensify */
.navbar-floating {
    position: fixed;
    top: 1rem;
    left: 0;
    right: 0;
    z-index: 50;
    margin-inline: auto;
    width: 95%;
    max-width: 80rem;
    padding: 0.75rem 1.5rem;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(226, 232, 240, 0.6);
    border-radius: 9999px;
    box-shadow: 0 4px 20px -2px rgba(15, 23, 43, 0.08);
    transition: background-color 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}

.navbar-floating.is-scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    box-shadow: 0 8px 28px -4px rgba(15, 23, 43, 0.14);
}

.card-jagdamb {
    background-color: var(--surface);
    border-radius: 1.5rem;
    padding: 1.75rem;
    border: 1px solid transparent;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-jagdamb:hover {
    border-color: rgba(226, 232, 240, 0.8);
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

/* Typography */
.text-hero {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -0.05em;
}

.text-section-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: var(--foreground);
}

.text-subsection-title {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--foreground);
}

.text-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--foreground);
}

.text-body-lg {
    font-size: 1.125rem;
    line-height: 1.625;
    color: var(--muted-foreground);
}

.text-body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--muted-foreground);
}

.text-footer {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #475569;
    font-weight: 500;
}

/* Motion kit & Scroll Entrance */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-up {
    animation: fade-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.fade-up-delay-1 { animation-delay: 0.08s; }
.fade-up-delay-2 { animation-delay: 0.16s; }
.fade-up-delay-3 { animation-delay: 0.24s; }
.fade-up-delay-4 { animation-delay: 0.32s; }

/* IntersectionObserver Scroll Reveal Classes */
.scroll-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

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

/* Dynamic HTMX Lifecycle Swap Animations */
.htmx-swapping {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    transition: opacity 220ms cubic-bezier(0.4, 0, 0.2, 1), transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.htmx-settling {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: opacity 280ms cubic-bezier(0, 0, 0.2, 1), transform 280ms cubic-bezier(0, 0, 0.2, 1);
}

/* Spring Pop for Heart Bookmarks */
@keyframes heart-pop {
    0% { transform: scale(1); }
    40% { transform: scale(1.35) rotate(-10deg); }
    70% { transform: scale(0.95) rotate(4deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.heart-pop-active {
    animation: heart-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Mobile Menu Slide-Down Animation */
@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.animate-slide-down {
    animation: slide-down 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Lightbox Modal Entrance */
@keyframes modal-pop {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-modal-pop {
    animation: modal-pop 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* High-Contrast Crisp Auth Brand Panel */
.auth-brand-panel {
    background:
        linear-gradient(to top, rgba(15, 23, 43, 0.92) 0%, rgba(15, 23, 43, 0.35) 50%, rgba(79, 57, 246, 0.25) 100%),
        url("https://images.unsplash.com/photo-1600585154340-be6161a56a0c?auto=format&fit=crop&w=1600&q=80") center/cover no-repeat;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .fade-up,
    .fade-up-delay-1,
    .fade-up-delay-2,
    .fade-up-delay-3,
    .fade-up-delay-4,
    .scroll-reveal,
    .scroll-reveal.is-visible,
    .animate-slide-down,
    .animate-modal-pop,
    .heart-pop-active,
    .htmx-swapping,
    .htmx-settling {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .img-kenburns,
    .card-lift,
    .btn-primary-glow {
        transition: none !important;
    }

    .group:hover .img-kenburns,
    .card-lift:hover .img-kenburns {
        transform: none !important;
    }
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(15, 23, 43, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    transition: opacity 0.25s ease;
}

.lightbox[hidden] {
    display: none !important;
}

.lightbox img {
    max-height: 75vh;
    max-width: 100%;
    object-fit: contain;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.lightbox-filmstrip {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 0.25rem;
}

.lightbox-filmstrip button {
    width: 4rem;
    height: 3rem;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid transparent;
    flex-shrink: 0;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.lightbox-filmstrip button:hover {
    transform: scale(1.05);
}

.lightbox-filmstrip button.is-active {
    border-color: #fff;
    transform: scale(1.05);
}

.lightbox-filmstrip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    max-height: none;
}

/* Step progress fill */
.step-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #e2e8f0;
    transform: translateY(-50%);
    z-index: 0;
}

.step-track-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.35s ease;
}
