/* --- CUSTOM FONTS --- */
@font-face {
    font-family: 'Medium';
    /* The name we will use to call the font later */

    /* We use ../ to step out of the /css/ folder, and into the /fonts/ folder */
    src: url('../fonts/Medium.woff2') format('woff2');

    font-weight: normal;
    font-style: normal;

    /* CRITICAL FOR PERFORMANCE: Tells the browser to load standard text instantly, then 'swap' in the custom font when it finishes downloading, preventing invisible text during load times. */
    font-display: swap;
}

/* --- BASE SETUP & VARIABLES --- */
:root {
    --bg-dark: #121212;
    --text-light: #eeeade;
    --kwills-gold: #d4af37;
    --kwills-gradient: linear-gradient(135deg, #b8831e, #dfa10f, #ecb80e, #f0d35c, #e7ac0f, #bd8c33);
    --nav-height: 80px;
    --image-radius: 12px;
    --nav-radius: 24px;
    --font-heading: 'Medium', sans-serif;
}

/* --- CUSTOM CURSOR --- */
* {
    cursor: none !important;
}

.cursor-dot {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background: var(--text-light);
    border-radius: 50%;
    pointer-events: none;
    z-index: 20000;
    transform: translate(-50%, -50%);
}

.cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 19999;
    /* Base transform to support scaling in animations */
    transform: translate(-50%, -50%);
    overflow: hidden;
    /* Brightness and Saturation Radius (Blur removed) */
    backdrop-filter: brightness(1.4) saturate(1.8);
    -webkit-backdrop-filter: brightness(1.4) saturate(1.8);

    /* SEAMLESS FALLOFF: Mask makes the effect fade out towards the edges */
    -webkit-mask-image: radial-gradient(circle, black 0%, rgba(0, 0, 0, 0.5) 40%, transparent 80%);
    mask-image: radial-gradient(circle, black 0%, rgba(0, 0, 0, 0.5) 40%, transparent 80%);

    border: none;
    transition: width 0.3s ease, height 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
}

/* --- CURSOR HOVER STATE --- */
.cursor-follower.hover-active {
    width: 120px;
    height: 120px;
    backdrop-filter: brightness(1.6) saturate(2.5);
    -webkit-backdrop-filter: brightness(1.6) saturate(2.5);
    border: 1px solid rgba(223, 161, 15, 0.4);
    box-shadow: 0 0 40px rgba(223, 161, 15, 0.3);
    animation: cursorPulse 1.5s infinite ease-in-out;
}

@keyframes cursorPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 1;
        box-shadow: 0 0 60px rgba(223, 161, 15, 0.5);
    }
}

.cursor-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 15px 15px;
    opacity: 0.6;
}

.cursor-trail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 19998;
    /* Just below the follower */
    mix-blend-mode: screen;
    /* Enhances the iridescent glow */
    filter: blur(4px);
    /* Smeared, subtle look */
}

/* --- LENIS SMOOTH SCROLL BOILERPLATE --- */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-smooth iframe {
    pointer-events: none;
}

/* --- CUSTOM FONTS --- */
/* Paths go up one level from the CSS folder (../) and into the fonts folder */
@font-face {
    font-family: 'Sofachrome';
    src: url('../fonts/sofachrome rg.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Delight';
    src: url('../fonts/DELIGHT-VF.woff2') format('woff2');
    font-weight: 100 900;
    /* Maps the variable font weight range */
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    color: var(--text-light);
    font-family: 'Delight', Arial, sans-serif;
    line-height: 1.6;

    /* The Global Background Texture */
    background-color: #0a0a0a;
    background-image:
        radial-gradient(rgba(238, 234, 222, 0.05) 1.5px, transparent 1.5px),
        linear-gradient(135deg, #0a0a0a 0%, #252525 100%);
    background-size: 30px 30px, 100% 100%;
    background-position: 0 0, 0 0;
    background-attachment: fixed;
    /* Locks the texture in place */
}

/* --- THE BOTTOM GRADIENT BLUR --- */
.loader-status-text {
    font-family: 'Delight', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: var(--kwills-gold);
    opacity: 0.7;
    margin-top: 1rem;
    text-transform: uppercase;
}



/* --- NAVBAR --- */
/* --- DUAL PILL NAVBAR WRAPPER --- */

/* --- NAV LOGO & BRANDING --- */
.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    /* Space between the icon and the text */
    text-decoration: none;
    color: var(--text-light);
    /* Assuming your brand color */
}

/* Forces the Sofachrome font you already imported */
.brand-title {
    font-family: 'Sofachrome', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 1px;
}

/* Sizing for the reinstated logo image */
.nav-logo-icon {
    height: 35px;
    /* Adjust this to match your desired logo size */
    width: auto;
    border-radius: 4px;
    /* Optional: Softens the edges of the JPG */
}

.site-header-wrapper {
    position: fixed;
    top: 3.75rem;
    /* Increased from 2.5rem to provide +20px breathing space */
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 1200px;
    height: var(--nav-height);

    /* The Split Math */
    display: flex;
    gap: 1rem;
    /* The physical gap between the two pills */
    z-index: 1000;

    /* THE FIX: Let's clicks pass through the invisible gap between pills */
    pointer-events: none;

    /* Transition for the bottom-to-top movement */
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;
}

body.home-page .site-header-wrapper {
    /* Pushes the navbar to the bottom of the viewport initially */
    transform: translate(-50%, calc(100vh - 10rem));
}

/* Snap back to the top when scrolled past hero */
body.home-page .site-header-wrapper.scrolled-past-hero {
    transform: translate(-50%, 0);
}

/* --- SCROLL PROGRESS INDICATOR --- */
.scroll-progress-container {
    position: absolute;
    /* Locked perfectly below the navbar pills regardless of its screen position */
    bottom: -15px;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    z-index: 999;
    pointer-events: auto;
    /* Enable hover */
    overflow: visible;
    /* Allow tooltip to show outside */
    backdrop-filter: blur(5px);
    transition: background 0.3s ease, height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-progress-container:hover {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
}

.scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--kwills-gradient);
    border-radius: 20px;
    transition: width 0.1s ease;
    position: relative;
    /* Anchor for tooltip and pulse */
    box-shadow: 0 0 10px rgba(223, 161, 15, 0.3);
}

/* --- SIGNAL PULSE EFFECT --- */
.scroll-progress-bar::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 0;
    width: 12px;
    height: 12px;
    background: var(--kwills-gold);
    border-radius: 50%;
    transform: translate(50%, -50%) scale(0);
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 0 20px var(--kwills-gold);
}

.scroll-progress-container:hover .scroll-progress-bar::after {
    animation: signalPulse 1.5s infinite ease-out;
}

@keyframes signalPulse {
    0% {
        transform: translate(50%, -50%) scale(1);
        opacity: 0.8;
    }

    100% {
        transform: translate(50%, -50%) scale(4);
        opacity: 0;
    }
}

.scroll-progress-tooltip {
    position: absolute;
    top: 50%;
    right: -15px;
    /* Positioned to the right of the bar end */
    transform: translateY(-50%) translateX(10px);
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 6px;
    font-family: 'Delight', sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--kwills-gold);
    border: 1px solid rgba(223, 161, 15, 0.5);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.8);
    z-index: 1000;
}

.scroll-progress-container:hover .scroll-progress-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(100%);
}

/* --- THE UNIVERSAL PILL MATH --- */
.nav-pill {
    /* Restores clicking functionality to the actual glass elements */
    pointer-events: auto;

    /* The Apple Glass Math */
    background-color: rgba(10, 10, 10, 0.45);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--nav-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);

    display: flex;
    align-items: center;
}

/* --- PILL 1 LAYOUT --- */
.main-pill {
    flex: 1;
    justify-content: space-between;
    padding: 0 3rem;
    position: relative;

    /* THE FIX: Obliterates any invisible clipping walls */
    overflow: visible !important;
}

/* 2. The Isolated Contact Pill */
.cta-pill {
    padding: 0 2.5rem;
    color: var(--text-light);
    text-decoration: none;
    font-family: 'Delight', sans-serif;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;

    /* THE FIX: Made this mathematically heavier than the main nav links to establish prominence */
    font-weight: 800;

    /* Prominence through color alone, removing explicit box shadow to match nav bar */
    border-color: var(--kwills-gold);

    /* Animation setup */
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* --- THE STAGGER TEXT EFFECT --- */
.cta-text,
.cta-text-clone {
    display: flex;
    transition: opacity 0.3s ease;
}

.page-transition-overlay.fade-text-out .transition-text {
    opacity: 0;
}

.cta-text-clone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
}

.cta-pill span>span,
.btn-stagger span>span,
.form-submit-btn span>span {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--i) * 0.03s);
}

/* Start position for clone */
.cta-text-clone>span {
    transform: translateY(100px);
}

/* --- THE SHINE REFLECTION EFFECT --- */
.cta-pill::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.4) 50%,
            rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: none;
    /* No transition on leave to instantly reset */
    pointer-events: none;
    z-index: 10;
}

/* The Eye-Candy Hover State */
.cta-pill:hover {
    background-color: var(--kwills-gold);
    color: #000;
    box-shadow: 0 0 30px rgba(223, 161, 15, 0.3);
    border-color: var(--kwills-gold);
    transform: translateY(-2px);
    /* Physical lift effect */
}

/* Hover position for text */
.cta-pill:hover .cta-text>span {
    transform: translateY(-100px);
}

.cta-pill:hover .cta-text-clone>span,
.btn-stagger:hover .cta-text-clone>span {
    transform: translateY(0%);
}

/* Hover reflection trigger */
.cta-pill:hover::after {
    left: 200%;
    transition: left 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- THE NAVIGATION CONTAINER --- */
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    position: relative;

    /* THE FIX: Ensures the inner wrapper also allows the vertical breach */
    overflow: visible !important;
}

/* Hidden on desktop by default */
.mobile-menu-cta {
    display: none !important;
}


/* --- THE MAIN NAVIGATION LINKS --- */
.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    padding: 0.35rem 0.75rem;
    position: relative;
    z-index: 1;

    /* 1. CRITICAL: Standard 'inline' text cannot be mathematically transformed. We must change it to inline-block. */
    display: inline-block;

    /* 2. Changed transition from 'color' to 'all' so the scale animation triggers */
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.nav-links a:hover {
    color: var(--kwills-gold);

    /* 3. The Text Pop: Physically grows the text by 8% */
    transform: scale(1.08);
}

/* --- THE FLOATING PILL --- */
.hover-pill-bg {
    position: absolute;
    left: 0;
    height: calc(100% + 3.5rem);
    top: -1.75rem;

    /* 1. The Translucency Fix: Dropped the opacity from 0.8 down to 0.35 
       for a much softer, highly transparent dark wash. */
    background-color: rgba(15, 15, 15, 0.35);

    border: 1px solid rgba(223, 161, 15, 0.6);
    box-shadow: 0 0 15px rgba(223, 161, 15, 0.15);

    /* 2. The Geometry Fix: Changed from a full 50px round pill to a sleek 12px rounded rectangle. */
    border-radius: 24px;

    z-index: 0;
    pointer-events: none;

    opacity: 0;
    transform: translateX(0) scale(0.5, 0.15) translateY(10px);
    transform-origin: bottom center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- MOBILE HAMBURGER BUTTON (DESKTOP HIDDEN) --- */
.mobile-menu-toggle {
    display: none;
    /* Hidden by default on desktop */
    background: transparent;
    border: none;
    cursor: pointer;

    /* 1. Force the physical dimensions of the hitbox */
    width: 30px;
    height: 20px;

    position: relative;
    z-index: 100;
    padding: 0;
    pointer-events: auto !important;
}

/* The 3 Lines */
.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text-light);
    border-radius: 2px;
    position: absolute;
    left: 0;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Mathematically space the lines */
.hamburger-line:nth-child(1) {
    top: 0;
}

.hamburger-line:nth-child(2) {
    top: 9px;
}

/* Center line */
.hamburger-line:nth-child(3) {
    top: 18px;
}

/* Bottom line */

/* --- HAMBURGER "X" ANIMATION MATH --- */
/* Top Line rotates 45 degrees down */
.mobile-menu-toggle.is-active .hamburger-line:nth-child(1) {
    top: 9px;
    transform: rotate(45deg);
}

/* Center Line mathematically disappears */
.mobile-menu-toggle.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
    /* Slides slightly left as it fades */
}

/* Bottom Line rotates 45 degrees up to intersect the top line */
.mobile-menu-toggle.is-active .hamburger-line:nth-child(3) {
    top: 9px;
    transform: rotate(-45deg);
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {

    /* 1. Show the Hamburger Button */
    .mobile-menu-toggle {
        display: block !important;
    }

    /* 2. Convert the horizontal nav-links into a vertical dropdown card */
    .nav-links {
        position: absolute;
        top: calc(100% + 1rem);
        /* Drops it just below the main glass pill */
        left: 0;
        width: 100%;
        flex-direction: column;
        /* Stacks the links vertically */

        /* The Dropdown UI */
        background-color: rgba(15, 15, 15, 0.95);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        padding: 2rem 1.5rem;
        border-radius: 16px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);

        /* The Hidden State */
        opacity: 0;
        pointer-events: none;
        transform: translateY(-15px);
        transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* 3. The Active State (Triggered by the JS toggle we just added) */
    .nav-links.mobile-active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    /* 4. Fix the individual link spacing for vertical reading */
    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 1rem 0;
        font-size: 1.2rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    }

    /* 1. Obliterate the second floating pill entirely */
    .cta-pill {
        display: none !important;
    }

    /* 2. Remove the gap since there is only one pill now, allowing it to stretch */
    .site-header-wrapper {
        gap: 0;
    }

    .main-pill {
        width: 100%;
        padding: 0 1.5rem;
    }

    /* 3. Reveal and style the Contact button inside the dropdown */
    .mobile-menu-cta {
        display: block !important;
        margin-top: 1.5rem;
        padding: 1rem !important;
        /* Overrides the standard nav link padding */

        /* Prominent Button Styling */
        background-color: var(--kwills-gold);
        color: #000 !important;
        /* Force black text for contrast against the gold */
        border-radius: 8px;
        font-family: 'Delight', sans-serif;
        font-weight: 800;
        text-align: center;
        letter-spacing: 1px;
    }

    /* Ensure the liquid morph hover pill doesn't apply to this button */
    .mobile-menu-cta::before {
        display: none !important;
    }
}


.hero-scroll-wrapper {
    width: 100%;
    height: 100vh;
    /* Restore height so IntersectionObserver can track it */
    margin: 0;
}

.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* --- THE VIDEO BEHAVIOR --- */
#hero-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- INFINITE TEXT TICKER --- */
.ticker-section {
    padding: 3rem 0;
    overflow: hidden;
    width: 100%;
    background: transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    position: relative;
    z-index: 5;
}

.ticker-wrapper {
    display: flex;
    width: max-content;
}

.ticker-track {
    display: flex;
    white-space: nowrap;
    will-change: transform;
    animation: infiniteTicker 40s linear infinite;
}

.ticker-track span {
    font-family: 'Delight', sans-serif;
    font-weight: 600;
    font-size: clamp(2.5rem, 6vw, 5rem);
    text-transform: uppercase;
    color: var(--text-light);
    /* Skewing the text on X-axis makes it look slanted/italicized */
    transform: skewX(-15deg);
    padding: 0 2rem;
    letter-spacing: 2px;
    display: inline-block;
}

@keyframes infiniteTicker {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* --- HERO OVERLAY --- */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(10, 10, 10, 0.4) 100%);
    z-index: 1;
    pointer-events: none;
}

/* The Text Container */


/* --- ABOUT PAGE HERO --- */
.about-hero {
    min-height: 0vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 220px 1vw 20px 1vw;
    /* Increased top margin */
}

.about-massive-title {
    font-family: 'Medium', sans-serif;
    /* 22vw ensures "ABOUT US" fits even on very narrow screens as it scales perfectly with viewport */
    font-size: clamp(2rem, 22vw, 25rem);
    text-transform: uppercase;
    color: var(--text-light);
    opacity: 0.8;
    line-height: 0.8;
    text-align: center;
    width: 100%;
    letter-spacing: 0.02em;
    /* Increased letter spacing */
    margin: 0;
    white-space: nowrap;
    /* Force single line */
}

/* --- PERSON CARDS SECTION --- */
.person-cards-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    padding-bottom: 4rem;
}

.person-card {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 6%;
}

.person-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.person-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    z-index: 2;
}

.person-card-content {
    position: relative;
    z-index: 3;
    max-width: 700px;
    color: var(--text-light);
}

.person-name {
    font-family: 'Medium', sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    line-height: 1;
    letter-spacing: -0.02em;
}

.person-title {
    display: block;
    font-family: 'Medium', sans-serif;
    color: var(--kwills-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.person-explainer {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    opacity: 0.8;
}

.person-socials {
    display: flex;
    gap: 2rem;
}

.person-socials a img {
    width: 28px;
    height: 28px;
    filter: brightness(0) invert(1);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.3s ease;
}

.person-socials a:hover img {
    transform: translateY(-5px);
    filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}



.btn {
    padding: 12px 30px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-block;
    margin: 0 10px;
}

/* --- BUTTON STAGGER ANIMATION --- */
.btn-stagger {
    position: relative;
    overflow: hidden;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
}

.btn-stagger:hover .cta-text>span {
    transform: translateY(-100px);
}

/* Secondary Button: Solid Border Default */
.btn-secondary {
    border: 1px solid var(--kwills-gold);
    color: var(--kwills-gold);
    background: transparent;
}

/* Secondary Button: Gradient Border Hover Hack */
.btn-secondary:hover {
    border: 1px solid transparent;
    /* Makes the physical border invisible */

    /* Layer 1: Dark inside | Layer 2: Gradient outside */
    background-image: linear-gradient(var(--bg-dark), var(--bg-dark)), var(--kwills-gradient);
    background-origin: border-box;
    background-clip: padding-box, border-box;

    color: #fff;
    /* Turns the text crisp white on hover to contrast the dark button */
}

/* --- GLOBAL SECTION HEADERS --- */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
    /* Forces adequate spacing between the title and the cards */
}

/* --- GLOBAL SECTION HEADERS --- */
.section-header h2 {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--text-light);
    text-transform: uppercase;

    /* The Base Spacing */
    letter-spacing: 2px;
    margin-bottom: 1rem;

    /* NEW: The Math for the Animation. 
       Using a cubic-bezier curve instead of 'ease' gives it a snappy, premium feel 
       that slows down smoothly at the end of the animation. */
    transition: letter-spacing 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* --- THE HOVER INTERACTION (DESKTOP ONLY) --- */
@media (hover: hover) and (min-width: 993px) {
    .section-header h2:hover {
        letter-spacing: 8px;
        /* The text mathematically stretches outwards */

        /* Optional: Adding a slight text-shadow enhances the "glowing" feel as it spreads */
        text-shadow: 0 0 15px rgba(223, 161, 15, 0.4);
    }
}

/* The Gold Accent Line */
.section-header .accent-line {
    width: 60px;
    height: 3px;
    background: var(--kwills-gradient);
    /* Uses your multi-stop gold gradient */
    margin: 0 auto;
    /* Mathematically centers a block element */
    border-radius: 2px;
}

/* --- GLOBAL REVEAL ANIMATION --- */
.reveal-on-scroll {
    opacity: 0;
    /* We use a CSS variable for the Y offset so it can be animated/overridden easily */
    --reveal-y: 80px;
    --reveal-scale: 0.98;

    /* We combine the reveal transform with a slight scale for that "opening" feel */
    transform: translateY(var(--reveal-y)) scale(var(--reveal-scale));

    /* Ultra-smooth transition timing with a half-second delay for cinematic effect */
    transition:
        opacity 1.6s cubic-bezier(0.16, 1, 0.3, 1),
        transform 1.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: 0.5s;

    will-change: transform, opacity;
    pointer-events: none;
    /* Disable clicks until visible to prevent accidental interactions */
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    --reveal-y: 0px;
    --reveal-scale: 1;
    pointer-events: auto;
}

/* --- ABOUT SECTION --- */
.about-section {
    width: 92%;
    max-width: 1400px;
    margin: 4rem auto;
    padding: 6rem 0;
    background: transparent;

    /* Parallax Pan Support */
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translate(var(--pan-x, 0), var(--pan-y, 0));
}

/* The Macro Layout: CSS Grid */
.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Defaults to 1 column for mobile */
    gap: 2rem;
    width: 100%;
    margin: 0 auto;
    /* Centers the grid */

    /* 3D PERSPECTIVE */
    perspective: 1200px;
}

/* The Micro Layout: Flexbox inside the card */
.team-card {
    display: flex;
    flex-direction: column;
    /* Defaults to stacked (Image on top, text below) for mobile */
    align-items: center;
    text-align: center;
    background-color: rgba(15, 15, 15, 0.6);
    /* Matching the YouTube cards */
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 2.5rem;
    gap: 2rem;
    position: relative;
    overflow: hidden;

    /* 3D TRANSFORM PREP */
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;

    /* SPOTLIGHT GLOW VARIABLES */
    --mouse-x: 50%;
    --mouse-y: 50%;
    --glow-opacity: 0;
}

.team-card:hover {
    background-color: rgba(20, 20, 20, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

/* THE REACTIVE GLOW OVERLAY */
.team-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(800px circle at var(--mouse-x) var(--mouse-y),
            rgba(212, 175, 55, 0.08),
            transparent 40%);
    opacity: var(--glow-opacity);
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 1;
}

/* THE BORDER GLOW (Edge Effect) */
.team-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    background: radial-gradient(400px circle at var(--mouse-x) var(--mouse-y),
            rgba(212, 175, 55, 0.4),
            transparent 40%);
    -webkit-mask:
        linear-gradient(#fff, #fff) content-box,
        linear-gradient(#fff, #fff);
    mask:
        linear-gradient(#fff, #fff) content-box,
        linear-gradient(#fff, #fff);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 1px;
    /* Border thickness */
    opacity: var(--glow-opacity);
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 2;
}

/* Ensure content stays above the glow */
.team-image,
.team-info {
    position: relative;
    z-index: 3;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform-style: preserve-3d;
}

.team-image {
    width: 150px;
    height: 200px;
    /* Taller height for a portrait rectangle */

    /* Replaces the 50% circle math with your new variable */
    border-radius: var(--image-radius);

    object-fit: cover;
    border: 2px solid var(--kwills-gold);
}

.team-name,
.team-title,
.team-bio {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.team-name {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: var(--text-light);
}

.team-title {
    display: block;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--kwills-gold);
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.team-bio {
    color: #a0a0a0;
    font-size: 1rem;
    line-height: 1.6;
}

/* --- SERVICES OVERHAUL (APPLE CAROUSEL) --- */
.services-overhaul {
    padding: 6rem 0;
    background: transparent;
    overflow: hidden;
}

.apple-carousel-container {
    width: 100%;
    /* Reduced top padding to bring cards closer to the heading */
    padding: 0.5rem 0 3rem 0;
    position: relative;
}

.apple-carousel-track {
    display: flex;
    gap: 3rem;
    overflow-x: auto;
    /* Enable high-performance horizontal scrolling */
    scroll-snap-type: x mandatory;
    /* Hide scrollbar for a clean UI */
    -ms-overflow-style: none;
    scrollbar-width: none;

    /* THE MATH: Side padding centers the first and last cards exactly in the viewport.
       Updated for ultra-wide 97vw cards. */
    padding: 0 calc((100vw - min(97vw, 1700px)) / 2);

    /* Smooth out manual scrolling */
    scroll-behavior: smooth;
}

.apple-carousel-track::-webkit-scrollbar {
    display: none;
}

.apple-card {
    flex: 0 0 97vw;
    /* Massive width for maximum immersion */
    max-width: 1700px;
    /* Cinematic scale */
    aspect-ratio: 16 / 9;
    /* Professional broadcast standard ratio */
    border-radius: 32px;
    overflow: hidden;
    position: relative;
    scroll-snap-align: center;
    background-color: #1a1a1a;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    /* box-shadow removed per request */
}

/* Hover animations REMOVED per request */

.apple-card-img,
.apple-card-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.apple-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Darker gradient for text legibility */
    background: linear-gradient(to bottom, transparent 30%, rgba(0, 0, 0, 0.7) 100%);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 4rem;
}

.apple-card-content {
    max-width: 600px;
    color: var(--text-light);
}

.apple-card-category {
    display: block;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--kwills-gold);
    margin-bottom: 0.5rem;
}

.apple-card-content h3 {
    font-family: 'Delight', sans-serif;
    font-weight: 700;
    /* Bolder variant as requested */
    font-size: 3.5rem;
    /* Increased size for impact */
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
}

.apple-card-divider {
    width: 40px;
    height: 2px;
    background: var(--kwills-gold);
    margin-bottom: 1.5rem;
}

.apple-card-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

/* --- APPLE CAROUSEL CONTROLS & TIMELINE --- */
.apple-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 3rem;
}

.carousel-control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.2s ease;
}

.carousel-control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.carousel-control-btn svg {
    width: 16px;
    height: 16px;
    fill: var(--text-light);
}

.apple-carousel-timeline {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 12px 24px;
    border-radius: 30px;
    display: flex;
    gap: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.timeline-item {
    cursor: pointer;
    display: flex;
    align-items: center;
    position: relative;
}

.timeline-bar {
    width: 60px;
    height: 2px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

/* Tooltip math */
.timeline-item::after {
    content: attr(data-name);
    position: absolute;
    bottom: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
}

.timeline-item:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.timeline-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: var(--text-light);
}

/* View All Link */
.timeline-view-all {
    font-size: 0.9rem;
    color: var(--text-light);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
}

.timeline-view-all:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--kwills-gold);
    color: var(--kwills-gold);
}

@media (max-width: 768px) {
    .apple-card {
        flex: 0 0 97vw;
        aspect-ratio: 16 / 9;
        border-radius: 24px;
    }

    .apple-card-overlay {
        padding: 2rem;
    }

    .apple-card-content h3 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .apple-card-content p {
        font-size: 0.9rem;
    }

    .apple-carousel-track {
        padding: 0 calc((100vw - 97vw) / 2);
        gap: 1.5rem;
    }

    .timeline-bar {
        width: 40px;
    }

    .apple-carousel-controls {
        gap: 1rem;
        flex-direction: column;
    }
}

/* --- GLOBAL PAGE HEADERS (About, Services, Projects) --- */
.global-page-header {
    width: 100%;
    /* Increased spacing from the fixed navbar for a more premium feel */
    padding-top: 170px;
    /* Increased by +20px to maintain breathing room with the lowered navbar */
    padding-bottom: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
}

.page-title {
    font-family: 'Delight', sans-serif;
    /* DRIVE SIZE BY NAVBAR SPAN: Matching the navbar's physical width constraints */
    width: 92%;
    max-width: 1200px;

    font-size: clamp(3rem, 10vw, 8rem);
    /* Massive scale driven by viewport width */
    font-weight: 800;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--text-light);
    margin: 0;
    line-height: 1;
    text-align: center;
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
    user-select: none;
}

.page-title:hover {
    color: var(--kwills-gold);
    letter-spacing: 10px;
    /* Subtle increase from 4px */
    text-shadow: 0 0 25px rgba(223, 161, 15, 0.4);
}

@media (max-width: 768px) {
    .global-page-header {
        padding-top: 120px;
        padding-bottom: 30px;
    }

    .page-title {
        font-size: 0.9rem;
        letter-spacing: 8px;
    }
}








/* --- DESKTOP BREAKPOINT MATH --- */
@media (min-width: 992px) {

    /* Switch Grid to 2 columns */
    .about-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Switch Flexbox to side-by-side */
    .team-card {
        flex-direction: row;
        /* Puts image next to text */
        align-items: flex-start;
        /* Aligns image to the top of the text */
        text-align: left;
        /* Reverts text to professional left-alignment */
    }

    .team-image {
        flex-shrink: 0;
        /* Mathematically prevents the text from crushing the image */
    }
}

/* --- SOFTWARE CAROUSEL SECTION --- */
.resources-section {
    padding: 6rem 0;
    width: 100%;
    overflow: hidden;
    /* CRITICAL: Prevents horizontal scrolling on the main window */
    position: relative;
}

.resources-header {
    text-align: center;
    margin-bottom: 4rem;
}

/* The Invisible Masking Container */
.software-carousel-wrapper {
    width: 100%;
    position: relative;
    left: 50%;
    transform: translateX(-50%);

    /* Ensure the transparent zones are at least 10% to 15% wide so the fade is buttery smooth on large screens */
    mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
}

/* --- SOFTWARE CAROUSEL SECTION --- */

/* 1. The Moving Track Adjustment */
.software-track {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    /* Increased gap to give larger cards breathing room */
    width: max-content;
    padding: 2rem 0;
    /* Extra vertical padding for the "pop" effect */
    will-change: transform;
}

.track-group {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

/* 2. The Individual Software Cards (Formerly Pills) */
.software-pill {
    display: flex;

    /* THE LAYOUT FIX: Stacks items vertically */
    flex-direction: column;

    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    /* Space between icon and text */

    /* THE GEOMETRY FIX: More square-ish for cards */
    padding: 2.5rem 2rem;
    min-width: 180px;
    /* Ensures all cards have a uniform visual footprint */

    background: rgba(15, 15, 15, 0.45);
    /* Slightly more translucent */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);

    /* Changed from 50px (pill) to 20px (card) to match your hero/nav vibe */
    border-radius: 20px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 3. The Scaled-Up Icons */
.software-icon {
    /* THE SIZE FIX: Increased from 30px to 60px */
    height: 60px;
    width: auto;
    max-width: 80px;
    object-fit: contain;

    filter: brightness(0) invert(1);
    opacity: 0.7;
    /* Subtly dimmed until hover */
    transition: all 0.3s ease;
}

/* 4. The Typography Polish */
.software-name {
    color: var(--text-light);
    font-size: 0.85rem;
    /* Slightly smaller for a "caption" look */
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    /* Clean, professional studio look */
    text-align: center;
    opacity: 0.5;
    transition: all 0.3s ease;
}

/* --- HOVER INTERACTIONS --- */
.software-pill:hover {
    background: rgba(25, 25, 25, 0.8);
    border-color: rgba(223, 161, 15, 0.4);
    transform: translateY(-10px);
    /* Card physically lifts on hover */
}

.software-pill:hover .software-icon {
    opacity: 1;
    transform: scale(1.1);
    /* Icon pulses slightly */
}

.software-pill:hover .software-name {
    opacity: 1;
    color: var(--kwills-gold);
    /* Text lights up gold */
}


/* --- YOUTUBE FEED SECTION --- */
.youtube-section {
    width: 92%;
    max-width: 1400px;
    margin: 4rem auto;
    padding: 2rem 0;
}

.youtube-grid {
    display: grid;
    /* Strictly forces exactly 2 columns and 2 rows for 4 videos */
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;

    /* 3D PERSPECTIVE: Enables the 3D space for the children cards */
    perspective: 1200px;
}

/* The New Card Interface */
.video-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;

    /* Card Aesthetics */
    background-color: rgba(15, 15, 15, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.25rem;
    /* Physical inner boundary */

    /* 3D TRANSFORM PREP */
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out, border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    will-change: transform;
}

.video-card:hover {
    border-color: var(--kwills-gold);
    background-color: rgba(20, 20, 20, 0.9);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.1);
}

.video-thumbnail-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    /* Slightly sharper inner radius to nest correctly inside the 12px card */
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.video-card:hover .video-thumbnail {
    transform: scale(1.05);
}

/* The Play Button Overlay */
.play-overlay {
    position: absolute;
    bottom: 1.25rem;
    left: 1.25rem;
    width: 45px;
    height: 45px;
    background-color: rgba(10, 10, 10, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-light);
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
}

.video-card:hover .play-overlay {
    background-color: var(--kwills-gold);
    color: #000;
    border-color: var(--kwills-gold);
    transform: scale(1.1);
    /* Subtle pop on hover */
}

.video-title {
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.4;
    font-weight: 500;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* The Bottom Button Wrapper */
.section-footer {
    text-align: center;
    margin-top: 4rem;
}

/* --- MOBILE SQUISH PREVENTION MATH --- */
@media (max-width: 768px) {
    .youtube-grid {
        gap: 1rem;
        /* Shrinks the space between columns so cards have more room */
    }

    .video-card {
        padding: 0.75rem;
        /* Thinner padding maximizes thumbnail size on small screens */
    }

    .video-title {
        font-size: 0.85rem;
        /* Prevents the text from wrapping awkwardly */
        margin-top: 0.75rem;
    }

    .play-overlay {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
        bottom: 0.75rem;
        left: 0.75rem;
    }
}

/* --- CONTACT MACRO-CARD SECTION --- */
.contact-macro-section {
    width: 92%;
    max-width: 1400px;
    margin: 6rem auto 4rem auto;
    /* Large top margin to separate it from the previous content */
    padding: 5rem 4% 3rem 4%;
    border-radius: 24px;
    position: relative;

    /* 1. The Amplified Frosted Glass */
    background-color: rgba(10, 10, 10, 0.4);
    backdrop-filter: blur(20px);
    /* Increased blur for prominence */
    -webkit-backdrop-filter: blur(20px);

    /* 2. The Boosted Internal Light (10% opacity instead of 5%) */
    background-image: radial-gradient(circle at 50% 10%, rgba(223, 161, 15, 0.1) 0%, transparent 80%);

    border: 1px solid rgba(223, 161, 15, 0.2);
    /* Stronger border */

    /* 3. The Heavy Aura */
    box-shadow:
        0 40px 100px rgba(223, 161, 15, 0.06),
        inset 0 0 100px rgba(223, 161, 15, 0.03);
}

/* --- CONTACT GRID SYSTEM --- */

.contact-grid-container {
    display: grid;
    /* Forces 2 columns of equal width */
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    max-width: 1400px;
    /* Slightly wider to look better on ultrawide */
    margin: 0 auto 4rem auto;
    padding: 0 2rem;
    align-items: start;
}

/* --- FORM STYLING --- */

.kwills-contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    /* For error hint positioning */
}

.form-error-hint {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.65rem;
    color: #ff4d4d;
    background: rgba(255, 77, 77, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.form-error-hint.visible {
    opacity: 1;
    transform: translateY(0);
}

.kwills-contact-form input.invalid {
    border-color: rgba(255, 77, 77, 0.5) !important;
    background: rgba(255, 77, 77, 0.02) !important;
}

.form-group label {
    color: var(--kwills-gold, #dfa10f);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.kwills-contact-form input,
.kwills-contact-form textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.2rem;
    color: white;
    font-family: inherit;
    transition: all 0.3s ease;
    resize: none;
}

.kwills-contact-form input:focus,
.kwills-contact-form textarea:focus {
    border-color: var(--kwills-gold, #dfa10f);
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

/* --- FORM SUCCESS OVERLAY --- */
.form-success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 25, 10, 0.9);
    backdrop-filter: blur(25px);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    padding: 2rem;
    box-sizing: border-box;
    /* Glides up from the bottom */
    transform: translateY(50px);
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(77, 255, 77, 0.2);
    box-shadow: 0 0 50px rgba(0, 255, 0, 0.1);
    overflow: hidden;
}

.form-success-overlay.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Glides back down on exit */
.form-success-overlay.exiting {
    opacity: 0;
    transform: translateY(50px);
}

.success-message {
    color: #4dff4d;
    font-family: 'Medium', sans-serif;
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: center;
    text-shadow: 0 0 25px rgba(77, 255, 77, 0.4);
    width: 100%;
    line-height: 1.2;
}

.success-message span {
    display: inline-block;
    white-space: pre;
    /* Preserves the &nbsp; width */
    opacity: 0;
    /* Stagger from the left */
    transform: translateX(-40px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    transition-delay: calc(var(--i) * 0.03s);
}

.form-success-overlay.visible .success-message span {
    opacity: 1;
    transform: translateX(0);
}

/* Leave to the right */
.form-success-overlay.exiting .success-message span {
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.4s ease-in;
    transition-delay: calc(var(--i) * 0.02s);
}

.form-submit-btn {
    /* The Apple Liquid Pill Math */
    background-color: rgba(10, 10, 10, 0.45);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);

    /* Typography & Sizing */
    padding: 1.2rem 3rem;
    color: var(--text-light);
    font-family: 'Delight', sans-serif;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 800;
    cursor: pointer;

    /* Layout & Animation Setup */
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* KWILLS Gradient Stroke */
.form-submit-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 1.5px;
    /* Stroke thickness */
    background: var(--kwills-gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.form-submit-btn:hover {
    background-color: var(--kwills-gold);
    color: #000;
    box-shadow: 0 0 30px rgba(223, 161, 15, 0.4);
    transform: translateY(-3px);
}

/* Hover position for staggering text inside the button */
.form-submit-btn:hover .cta-text>span {
    transform: translateY(-100px);
}

.form-submit-btn:hover .cta-text-clone>span {
    transform: translateY(0);
}

/* --- MAP OVERRIDE --- */

.contact-grid-container .map-container {
    margin: 0;
    width: 100%;
    /* We set height: 100% and min-height so it matches the form's height visually */
    height: 100%;
    min-height: 500px;
}

/* --- RESPONSIVE FALLBACK --- */
@media (max-width: 1024px) {
    .contact-grid-container {
        grid-template-columns: 1fr;
        /* Stacks on smaller tablets/phones */
        gap: 3rem;
    }
}

/* --- MAP WRAPPER & CONTAINER --- */
.map-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.map-container {
    width: 100%;
    height: 500px;
    background: #111;
    /* Fallback color before satellite loads */
}

/* --- 1. THE MAP WRAPPER (CRITICAL FOR GRID STABILITY) --- */
.map-container-wrapper {
    position: relative;
    /* Acts as the anchor for the absolute UI overlay */
    width: 100%;
    min-height: 500px;
    height: 100%;
    /* Adapts to your CSS Grid row */
    border-radius: 12px;
    overflow: hidden;
    /* Prevents anything from bleeding out of the box */
}

.map-canvas {
    width: 100%;
    height: 100%;
    background: #0a0a0a;
}

/* --- 2. THE UI OVERLAY LAYOUT --- */
.map-ui-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;

    display: flex;
    justify-content: space-between;
    /* Pushes the left and right divs apart */
    align-items: flex-end;

    z-index: 100;
    pointer-events: none;
    /* Allows the user to click/drag the map beneath the empty space */
}

/* Re-enables clicking specifically for the button groups */
.ui-left,
.ui-right {
    pointer-events: auto;
}

/* --- 3. BUTTON AESTHETICS --- */
.map-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

/* The 3D Dive Button */
.primary-btn {
    background: white;
    color: #0a0a0a;
}

.primary-btn:hover {
    background: var(--kwills-gold, #dfa10f);
    transform: translateY(-3px);
}

/* The 2D Revert Button */
.secondary-btn {
    background: rgba(15, 15, 15, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.secondary-btn:hover {
    background: #0a0a0a;
    border-color: var(--kwills-gold, #dfa10f);
}

/* The Permanent Directions Button */
.dir-btn {
    background: rgba(20, 20, 20, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    border: 1px solid rgba(223, 161, 15, 0.3);
    /* Subtle gold rim */
}

.dir-btn:hover {
    background: #0a0a0a;
    color: var(--kwills-gold, #dfa10f);
    border-color: var(--kwills-gold, #dfa10f);
    transform: translateY(-3px);
}

/* --- 4. THE HIDE CLASS --- */
.hidden {
    display: none !important;
    /* Physically removes the button from the flexbox math */
}


/* --- CUSTOM KWILLS POPUP OVERRIDE --- */
.maplibregl-popup-content {
    background: rgba(15, 15, 15, 0.95) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px !important;
    color: white !important;
}

.maplibregl-popup-tip {
    border-top-color: rgba(15, 15, 15, 0.95) !important;
}

/* --- SOCIAL BADGES --- */
/* --- KWILLS MAIN STUDIO MARKER --- */
.kwills-studio-marker {
    position: relative;
    width: 0;
    height: 0;
    pointer-events: none;
    /* Allows users to drag the map beneath the label */
    z-index: 20;
    /* Ensures it floats above the minor landmarks */
}

/* The Constantly Glowing Dot */
.kwills-pulse-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    width: 20px;
    height: 20px;
    background-color: var(--kwills-gold, #dfa10f);
    border-radius: 50%;
    border: 3px solid #111;

    /* The infinite sonar pulse */
    animation: goldPulse 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

/* The Permanent Studio Label */
/* The Permanent Studio Label (Moved to Top) */
.kwills-studio-label {
    position: absolute;

    /* 1. Centers the box perfectly over the anchor */
    left: 50%;
    transform: translateX(-50%);

    /* 2. Pushes it UP to sit nicely above the pulsing dot */
    bottom: 25px;

    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--kwills-gold, #dfa10f);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    border: 1px solid rgba(223, 161, 15, 0.3);
    white-space: nowrap;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.kwills-studio-label span {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: #e0e0e0;
    margin-top: 2px;
    text-transform: uppercase;
    text-align: center;
    /* Added to keep the subtext balanced */
}

/* --- THE POINTER TAIL --- */
.kwills-studio-label::after {
    content: '';
    position: absolute;

    /* 1. Position it at the very bottom center */
    bottom: -7px;
    left: 50%;

    /* 2. Size of the diamond */
    width: 14px;
    height: 14px;

    /* 3. Match the parent box's glass background */
    background: #0d0d0d;

    /* 4. Only apply the gold border to the bottom two edges */
    border-right: 1px solid rgba(223, 161, 15, 0.3);
    border-bottom: 1px solid rgba(223, 161, 15, 0.3);

    /* 5. Rotate it 45 degrees to point downward, and center it */
    transform: translateX(-50%) rotate(45deg);

    /* 6. Push it behind the text so it seamlessly blends into the box */
    z-index: -1;
}

/* The Keyframes for the Sonar Pulse */
@keyframes goldPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(223, 161, 15, 0.7);
    }

    70% {
        box-shadow: 0 0 0 20px rgba(223, 161, 15, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(223, 161, 15, 0);
    }
}

/* --- CUSTOM LANDMARK MARKERS --- */

.landmark-marker {
    position: relative;

    /* THE FIX: A 0x0 container ensures MapLibre tracks this exact microscopic point */
    width: 0;
    height: 0;

    pointer-events: none;
    opacity: 0;
    animation: fadeInLandmark 0.5s ease forwards;

    /* Ensures these sit slightly below your main KWILLS pin if they overlap */
    z-index: 1;
}

/* The tiny dot */
.landmark-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);

    /* Centers the dot perfectly over the 0x0 anchor point */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* The floating text label */
.landmark-label {
    position: absolute;

    /* Pushes the label to the right of the dot, independently of the anchor */
    top: 50%;
    left: 15px;
    transform: translateY(-50%);

    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

@keyframes fadeInLandmark {
    to {
        opacity: 1;
    }
}

/* --- SOCIAL MEDIA ICONS --- */
.social-links-container {
    display: flex;

    /* THE ALIGNMENT FIX: Forces the icons to the dead center of the container */
    justify-content: center;
    align-items: center;

    /* Increased the gap slightly to balance the larger icon size */
    gap: 2rem;

    /* Optional: Adds a bit of breathing room between the heading and the icons */
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
}

.social-svg {
    /* THE SIZE FIX: Increased from 24px to 36px for a premium, heavy footprint */
    width: 40x;
    height: 40px;

    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.6;
    transition: all 0.3s ease;
}

/* Ensure the hover state logic remains intact */
.social-icon-link:hover .social-svg {
    opacity: 1;
    transform: scale(1.15) translateY(-2px);
}

/* --- THE CURSOR FOLLOWER TOOLTIP --- */
.cursor-tooltip {
    position: fixed;
    top: 0;
    left: 0;

    background: rgba(255, 255, 255, 0.95);
    color: #0a0a0a;
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;

    opacity: 0;
    transform: translate(0, 0) scale(0.8);

    /* THE ANIMATION FIX: Forces the pop-up to grow outward from the cursor tip */
    transform-origin: bottom left;

    pointer-events: none;
    z-index: 10000;
    transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cursor-tooltip.visible {
    opacity: 1;
    transform: translate(0, 0) scale(1);
    /* Snaps to full size */
}

/* --- THE SPLIT GRID --- */
.contact-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Exact 50/50 split */
    gap: 4rem;
    margin-bottom: 4rem;
    padding-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    /* Structural divider */
}

.contact-label {
    color: #a0a0a0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 2rem;
}

/* Left Side: Direct Lines */
.contact-left {
    display: flex;
    flex-direction: column;
    position: relative;
    /* CRITICAL: Allows us to position the divider line relative to this box */

    /* Removed the 'gap' property that was causing the vertical misalignment */
}

/* We re-apply the spacing ONLY between the links, not against the heading */
.direct-link+.direct-link {
    margin-top: 1.5rem;
}

.direct-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.direct-link:hover {
    transform: translateX(10px);
}

.direct-type {
    font-size: 0.85rem;
    color: var(--kwills-gold);
    margin-bottom: 0.25rem;
}

.direct-value {
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: var(--text-light);
    font-weight: 400;
}

.direct-link:hover .direct-value {
    color: var(--kwills-gold);
}

/* --- THE ROUNDED VERTICAL DIVIDER --- */
/* We only apply this on desktop. If it triggers on mobile, it will float awkwardly on the right side of the screen. */
@media (min-width: 769px) {
    .contact-left::after {
        content: '';
        position: absolute;
        top: 0;

        /* The grid gap is 4rem. Moving this right by 2rem places it perfectly in the mathematical center */
        right: -2rem;

        width: 2px;
        height: 100%;

        /* The Rounded Ends */
        border-radius: 2px;

        /* A subtle gold gradient fade makes it look like light catching the edge of glass, rather than a harsh solid line */
        background: linear-gradient(to bottom, rgba(223, 161, 15, 0), rgba(223, 161, 15, 0.8), rgba(223, 161, 15, 0));
    }
}

/* Right Side: Navigation */
.contact-right {
    display: flex;
    flex-direction: column;

    /* 1. Forces the entire column to snap to the right boundary */
    align-items: flex-end;
    text-align: right;
}

.contact-right .contact-label {
    /* Ensures the "Navigation" heading also aligns right */
    width: 100%;
}

.footer-nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;

    /* 2. Forces the individual links to stack flush against the right edge */
    align-items: flex-end;
}

.footer-nav a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    width: fit-content;
}

.footer-nav a:hover {
    color: var(--kwills-gold);

    /* 3. The Kinetic UX Fix: Sliding negatively (-10px) pushes the text INWARD to the left, rather than pushing it off the right edge of the card */
    transform: translateX(-10px);
}

/* Copyright */
/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .contact-split-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .contact-left,
    .contact-right,
    .footer-nav {
        align-items: center;
        /* THE FIX: Explicitly overrides the desktop right-alignment */
        text-align: center;
    }

    .direct-link:hover,
    .footer-nav a:hover {
        transform: translateY(-5px);
    }
}

/* --- THE FOOTER BOTTOM BAR --- */
.footer-bottom {
    display: flex;

    /* THE MATH FIX: This pushes the copyright to the far left edge, and the design credits to the far right edge. */
    justify-content: space-between;
    align-items: center;

    width: 100%;
    margin-top: 3rem;
    /* Creates breathing room between the links above and this bottom bar */
    padding-top: 1.5rem;

    /* Optional: A very subtle line to visually separate the links from the legal text */
    border-top: 1px solid rgba(255, 255, 255, 0.08);

    /* Styling for the text itself */
    color: rgba(255, 255, 255, 0.5);
    /* Muted grey so it doesn't distract from the main links */
    font-size: 0.9rem;
}

/* --- FOOTER TYPOGRAPHY DETAILS --- */

.footer-bottom strong {
    font-weight: 700;
    color: var(--text-light);
}

/* The Link Styling for the Designer Name */
.footer-bottom .designer-name {
    /* Replaces the <strong> tag's functionality */
    font-weight: 700;
    color: var(--text-light);

    /* Kills the default browser hyperlink underline */
    text-decoration: none;

    transition: color 0.3s ease;
}

.footer-bottom .designer-name:hover {
    color: var(--kwills-gold);
}



/* --- INITIAL ANAMORPHIC LOADER --- */
.initial-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    pointer-events: none;
    display: none;
    /* Immersive Blur Effect in the center */
    backdrop-filter: blur(50px) saturate(150%);
    -webkit-backdrop-filter: blur(50px) saturate(150%);
    transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

html.is-initial-load .initial-loader-overlay {
    display: flex;
    pointer-events: auto;
}

html.is-initial-load body {
    overflow: hidden;
}

.anamorphic-bar {
    position: absolute;
    left: 0;
    width: 100%;
    height: 15vh;
    /* Cinematic 2.35:1 style crop */
    background: #000;
    z-index: 10;
    transition: transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-top {
    top: 0;
    transform: translateY(0);
}

.bar-bottom {
    bottom: 0;
    transform: translateY(0);
}

.initial-loader-overlay.loaded {
    backdrop-filter: blur(0px) saturate(100%);
    -webkit-backdrop-filter: blur(0px) saturate(100%);
    /* Removed opacity fade - only bars swipe away */
}

.initial-loader-overlay.loaded .bar-top {
    transform: translateY(-100%);
}

.initial-loader-overlay.loaded .bar-bottom {
    transform: translateY(100%);
}

.initial-loader-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-light);
    opacity: 1;
    transition: opacity 0.5s ease;
}

.initial-loader-overlay.loaded .initial-loader-content {
    opacity: 0;
}

.loader-progress-text {
    font-family: 'Delight', sans-serif;
    font-size: clamp(2rem, 10vw, 6rem);
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-align: center;
}

.loader-progress-bar-container {
    width: 300px;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    margin-top: 2rem;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.loader-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--kwills-gradient);
    box-shadow: 0 0 20px rgba(223, 161, 15, 0.6);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    animation: barGlowPulse 2s infinite ease-in-out;
}

@keyframes barGlowPulse {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(223, 161, 15, 0.4);
        opacity: 0.8;
    }

    50% {
        box-shadow: 0 0 35px rgba(223, 161, 15, 0.9);
        opacity: 1;
    }
}

/* --- PAGE TRANSITION OVERLAY --- */
.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: #0f0f0f;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;

    /* Default state: off-screen bottom */
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.85, 0, 0.15, 1);
}

/* Entering state: covers screen instantly */
.page-transition-overlay.is-entering {
    transform: translateY(0);
    transition: none;
    /* Instant on page load */
    pointer-events: all;
}

/* Exiting state: slides up from bottom */
.page-transition-overlay.is-exiting {
    transform: translateY(0);
    pointer-events: all;
}

/* Sliding left state: sweeps to the left */
.page-transition-overlay.is-sliding-left {
    transform: translateX(-100%);
    transition: transform 0.8s cubic-bezier(0.85, 0, 0.15, 1);
}


.transition-text {
    font-family: var(--font-heading);
    color: var(--text-light);
    font-size: clamp(3rem, 6vw, 5.5rem);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    transition: opacity 0.4s ease, filter 0.4s ease;
}

.page-transition-overlay.fade-text-out .transition-text {
    opacity: 0;
    filter: blur(15px);
}

.transition-text span {
    display: inline-block;
    transform: translateY(100vh);
    /* Starts from the very bottom of the box */
    filter: blur(15px);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* When exiting the current page, we add stagger */
.page-transition-overlay.is-exiting .transition-text span {
    transform: translateY(0);
    filter: blur(0px);
    transition-delay: calc(var(--i) * 0.04s);
}

/* When entering the new page, the text is already visible */
.page-transition-overlay.is-entering .transition-text span {
    transform: translateY(0);
    filter: blur(0px);
    transition: none;
}

/* When the box slides left, text moves left too (parallax effect) */
.page-transition-overlay.is-sliding-left .transition-text {
    transform: translateX(-100px);
    transition: transform 0.8s cubic-bezier(0.85, 0, 0.15, 1);
}

/* --- THE LOADING BAR --- */
.transition-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.loading-bar-container {
    width: 250px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;

    /* Starts invisible and slightly lower */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Fades in and slides up when the transition begins */
.page-transition-overlay.is-exiting .loading-bar-container {
    opacity: 1;
    transform: translateY(0);
}

/* Fades out with the text */
.page-transition-overlay.fade-text-out .loading-bar-container {
    opacity: 0;
    filter: blur(10px);
}

.loading-bar {
    width: 0%;
    height: 100%;
    background: #ffffff;
    border-radius: 4px;
    position: relative;

    /* Width is instant normally so it can reset instantly on page load */
    transition: width 0s;
}

/* The invisible gradient overlay */
.loading-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--kwills-gradient);
    opacity: 0;
    border-radius: 4px;
    transition: opacity 0s;
}

/* The Animation Trigger (Duration: 0.8s) */
.page-transition-overlay.is-exiting .loading-bar {
    width: 100%;
    /* Snappy but smooth cubic-bezier that mimics a fast network request */
    transition: width 0.8s cubic-bezier(0.85, 0, 0.15, 1);
    /* Tiny delay to wait for the container to slide up */
    transition-delay: 0.1s;
}

.page-transition-overlay.is-exiting .loading-bar::after {
    opacity: 1;
    transition: opacity 0.8s cubic-bezier(0.85, 0, 0.15, 1);
    transition-delay: 0.1s;
}

/* --- SERVICES PAGE SPECIFIC: HORIZONTAL ACCORDION --- */
/* We scope this only to .services-category so the index.html home page remains untouched */
@media (min-width: 993px) {
    .services-category .services-track {
        display: flex;
        gap: 0.5rem;
        /* Noticeably decreased gap to enhance the squeezing effect */
        width: 100%;
    }

    .services-category .service-card {
        flex: 1;
        /* All cards start at uniform width */
        /* We add a custom flex transition for the stretching while keeping the base transitions */
        transition: flex 0.6s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s ease, transform 0.4s ease, box-shadow 0.4s ease;
        text-align: left;
        /* Left align the text for the accordion cards */
    }

    .services-category .service-content {
        padding: 2rem 2.5rem;
        /* Adequate padding from the left side */
    }

    .services-category .service-card:hover {
        flex: 3;
        /* The hovered card expands aggressively, squeezing the rest */
        /* Keeping the slight vertical bump to emphasize depth */
        transform: translateY(-5px);
    }
}

/* --- CONTACT US FORM STYLES --- */
.phone-input-wrapper {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.country-code-select {
    flex: 0 0 160px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-light);
    font-family: 'Delight', sans-serif;
    font-size: 0.95rem;
    padding: 0 1rem;
    height: 60px;
    /* Matching the input height */
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' 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;
    background-size: 1em;
}

.country-code-select:focus {
    border-color: var(--kwills-gold);
    background-color: rgba(255, 255, 255, 0.07);
}

.country-code-select option {
    background-color: #1a1a1a;
    color: white;
}

@media (max-width: 480px) {
    .phone-input-wrapper {
        flex-direction: column;
        gap: 0.5rem;
    }

    .country-code-select {
        width: 100%;
        flex: none;
    }
}

.phone-input-wrapper input[type="tel"] {
    flex: 1;
    /* Ensures the input stretches to match the width of other form fields */
}

/* --- FORM CONSENT TICKBOX --- */
.form-consent {
    margin: 1.5rem 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.form-consent input[type="checkbox"] {
    appearance: none;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin-top: 2px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.form-consent input[type="checkbox"]:checked {
    background: var(--kwills-gold);
    border-color: var(--kwills-gold);
}

.form-consent input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -52%);
    color: #000;
    font-size: 14px;
    font-weight: bold;
}

.consent-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
    font-family: 'Delight', sans-serif;
}

.consent-text a {
    color: var(--kwills-gold);
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.consent-text a:hover {
    opacity: 0.8;
}

/* --- RED GLOW FOR INVALID SUBMISSION --- */
.form-submit-error {
    animation: buttonRedGlow 0.5s ease;
}

@keyframes buttonRedGlow {

    0%,
    100% {
        box-shadow: none;
        border-color: rgba(223, 161, 15, 0.2);
    }

    50% {
        box-shadow: 0 0 30px rgba(255, 0, 0, 0.6);
        border-color: rgba(255, 0, 0, 0.8);
    }
}

/* --- COOKIE CONSENT BANNER --- */
.cookie-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    transform: translateY(-100%);
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.6rem 4%;
    z-index: 2000;
    /* Higher than navbar */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-content {
    flex: 1;
}

.cookie-content p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
    margin: 0;
    font-family: 'Delight', sans-serif;
    letter-spacing: 0.5px;
}

.cookie-actions {
    display: flex;
    gap: 1rem;
}

.cookie-btn {
    padding: 0.4rem 1.2rem;
    border-radius: 6px;
    font-family: 'Delight', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.btn-accept {
    background: var(--kwills-gold);
    color: #000;
    border: none;
}

.btn-accept:hover {
    box-shadow: 0 0 15px rgba(223, 161, 15, 0.4);
}

.btn-reject {
    background: transparent;
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-reject:hover {
    background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 900px) {
    .cookie-banner {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
        text-align: center;
    }

    .cookie-content p {
        font-size: 0.75rem;
    }
}