/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Helvetica, Arial, sans-serif;
    background-color: #000000;
    color: #000000;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Background Container */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden; /* Ensure video doesn't cause scrollbars if aspect ratio mismatches */
}

.background-container video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Cover the area, cropping if necessary */
    transform: translate(-50%, -50%);
    z-index: -1; /* Behind other content in background-container if any, though not strictly needed here */
}

/* Card Container - 3D Perspective */
.card-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    perspective: 2000px;
    z-index: 1;
    pointer-events: auto; /* Ensure container itself is not blocking */
}

/* Card - 3D Transform Container */
.card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    pointer-events: auto; /* Ensure card itself is not blocking */
}

/* Card Flip State */
.card.flipped {
    transform: rotateY(180deg);
}

/* Card Face Base Styles */
.card-face {
    position: absolute;
    top: 0; /* Ensure alignment */
    left: 0; /* Ensure alignment */
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    /* Default to no pointer events, enable per face */
    pointer-events: none;
}

/* Front Face */
.card-front {
    background-color: #FFFFFF;
    z-index: 2;
    pointer-events: auto;
}

/* Back Face */
.card-back {
    background-color: #FFFFFF;
    transform: rotateY(180deg) translateZ(1px); /* Promote to own layer */
    z-index: 1; /* Initially behind front */
    pointer-events: none;
}

/* When card is flipped, adjust z-index and pointer events */
.card.flipped .card-back {
    z-index: 3; /* Bring back to top */
    pointer-events: auto;
}

.card.flipped .card-front {
    z-index: 1; /* Send front to bottom */
    pointer-events: none;
}
/* Agency Text Crossfade */
#agencyTypeContainer {
    position: relative; /* For absolute positioning of children */
    height: 1.2em; /* Adjust if line height causes jump */
    /* width: 100%; Removed */
}

.agency-text {
    position: absolute;
    left: 0; /* Restored */
    top: 0;
    /* width: 100%; Removed */
    /* text-align: right; Removed */
    opacity: 0;
    transition: opacity 2s ease-in-out; /* Updated duration */
    white-space: nowrap; /* Prevent text wrapping */
}

.agency-text.visible {
    opacity: 1;
}

.agency-text.hidden {
    opacity: 0;
    pointer-events: none; /* Prevent interaction when hidden */
}

/* Ensure the switch on the back is interactive when card isflipped */
.card.flipped .card-back .back-footer,
.card.flipped .card-back .switch-group,
.card.flipped .card-back #getInTouchSwitch {
    pointer-events: auto;
    z-index: 50; /* Ensure it's above other content */
}

.card.flipped .card-back #getInTouchSwitch {
    cursor: pointer; /* Re-iterate cursor for this specific state too */
    /* transform: translateZ(2px); Removed this to test event targeting */
}

/* Container */
.container {
    width: 100%;
    height: 100vh;
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 50px;
}

/* Contact Section */
.contact-section {
    max-width: 856px;
    /* display: flex; /* This is handled by .container being a flex parent */
    /* flex-direction: column; /* This is handled by .container being a flex parent */
}

/* Consistent vertical spacing for direct children of .contact-section */
.contact-section > * {
    margin-top: 0;
    margin-bottom: 10px; /* Consistent spacing */
}

/* Remove bottom margin from the last child in the contact section */
.contact-section > *:last-child {
    margin-bottom: 0;
}
/* Specific adjustment for the H2 containing animated agency type */
.contact-section #agencyTypeContainer.logo {
    margin-bottom: -10px; /* Default 10px - 4px = 6px */
}

/* Logo text styles - ensure they adhere to the spacing */
.logo {
    font-size: 80px;
    font-weight: 400;
    line-height: 1em; /* This is key for consistent line height */
    text-transform: capitalize;
    margin: 0; /* Reset all margins first */
    white-space: nowrap;
    /* margin-bottom will be handled by .contact-section > * */
}

/* Links */
.links {
    font-size: 80px;
    font-weight: 400;
    line-height: 1em; /* Ensure consistent line height */
    color: #000000;
    text-decoration: none;
    display: block;
    margin: 0; /* Reset all margins first */
    /* margin-bottom will be handled by .contact-section > * */
}

.links:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    position: absolute;
    bottom: 50px;
    left: 50px;
    display: flex;
    align-items: center;
    gap: 11px;
}

/* Switch Group */
.switch-group {
    display: flex;
    align-items: center;
    gap: 11px;
}

/* Toggle Switch */
.switch {
    width: 135px;
    height: 61px;
    background-color: #FFFFFF;
    border: 5px solid #000000;
    border-radius: 100px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.switch-toggle {
    width: 44px;
    height: 44px;
    background-color: #000000;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    transition: all 0.3s ease;
}

.switch.active .switch-toggle {
    left: calc(100% - 62px);
}

/* More Info text */
.more-info {
    font-size: 50px;
    font-weight: 400;
    line-height: 1.2em;
    color: #000000;
}

/* Back Face Styles */
.back-container {
    width: 100%;
    height: 100vh;
    position: relative;
    display: flex;
}

/* Black right half */
.back-right-black {
    position: absolute;
    right: 0;
    top: 0;
    width: 50%;
    height: 100%;
    background-color: #000000;
}

/* Back content columns */
.back-content {
    position: relative;
    padding: 50px;
    display: flex;
    gap: 150px;
    z-index: 1;
    width: 100%;
}

/* Column styles */
.services-column,
.clients-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.services-column {
    flex: 1;
}

.clients-column {
    flex: 1;
    padding-left: 50px;
}


.column-title {
    font-size: 50px;
    font-weight: 400;
    line-height: 1em;
.client-name-underlined {
    text-decoration: underline;
}
    text-transform: capitalize;
    margin-bottom: 0;
    text-decoration: underline;
}

.services-column .column-title {
    color: #000000;
}

.clients-column .column-title {
    color: #FFFFFF;
}

/* List styles */
.services-list,
.clients-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.services-list li,
.clients-list li {
    font-size: 50px;
    font-weight: 400;
    line-height: 1em;
}

/* .clients-list li { Removed general underline } */

.services-list li {
    color: #000000;
}

.clients-list li {
    color: #FFFFFF;
}
.clients-list li a,
.clients-list li a:visited {
    color: #FFFFFF; /* Normal and visited state white */
    text-decoration: underline; /* Standard link underline */
}

/* Desktop hover for client links */
@media (hover: hover) and (min-width: 769px) { /* Ensures hover capability and desktop size */
    .clients-list li a:hover {
        color: #0D05E2; /* Blue hover color for desktop */
    }
}
/* Back footer */
.back-footer {
    position: absolute;
    bottom: 50px;
    left: 50px;
    z-index: 51;
}

.back-footer .more-info {
    color: #000000;
}

/* Switch for back face */
.switch-back {
    background-color: #FFFFFF;
    border-color: #000000;
    cursor: pointer;
}

.switch-back .switch-toggle {
    background-color: #000000;
}

/* Large screen adjustments */
@media (min-width: 1441px) {
    .logo, .links {
        font-size: 5.56vw;
        white-space: nowrap;
    }

    .more-info,
    .column-title,
    .services-list li,
    .clients-list li {
        font-size: 3.47vw;
    }

    .switch {
        width: 9.38vw;
        height: 4.24vw;
    }

    .switch-toggle {
        width: 3.06vw;
        height: 3.06vw;
    }

    .switch.active .switch-toggle {
        left: calc(100% - 3.8vw);
    }

    .back-content {
        gap: 0;
    }

    .clients-column {
        padding-left: 50px;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    /* Ensure card container fits within viewport on mobile */
    .card-container {
        height: 100vh;
        height: 100dvh; /* Use dynamic viewport height */
    }
    
    /* Ensure card faces fit within container */
    .card, .card-face {
        height: 100vh;
        height: 100dvh; /* Use dynamic viewport height */
        overflow: visible; /* Ensure content is not clipped */
    }
    
    /* General container adjustments for mobile */
    .container {
        padding: 0; /* Remove general padding, apply specifically to faces/sections */
        padding-bottom: 80px; /* Add space for footer */
        min-height: 100vh;
        min-height: 100dvh; /* Use dynamic viewport height */
        box-sizing: border-box;
    }

    /* Front face mobile styles */
    .card-front .container { /* Targets .container inside .card-front */
        padding: 12px;
    }
    
    .contact-section {
        padding: 12px; /* Figma: contact copy has 12px padding */
        gap: 2px;
    }

    .contact-section .logo,
    .contact-section .links {
        font-size: 30px;
        line-height: 1.1em;
        margin-bottom: 2px;
    }
    .contact-section > *:last-child {
        margin-bottom: 0;
    }
.contact-section #agencyTypeContainer.logo {
        margin-bottom: 0px;
    }

    .card-front .footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 20px));
        gap: 11px;
        z-index: 100;
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        width: 100%; /* Make it full width */
        box-sizing: border-box; /* Include padding in width */
        background-color: #FFFFFF; /* Solid white background */
        z-index: 100; /* Ensure it's above other content */
    }

    .card-front .footer .more-info {
        font-size: 32px;
    }
    
    .card-front .footer .switch {
        width: 111px;
        height: 50px;
        border-width: 4px;
    }
    
    .card-front .footer .switch .switch-toggle {
        width: 37px;
        height: 37px;
        top: 3px;
        left: 8px;
        transform: translateY(0);
    }

    /* Back face mobile styles */
    .card-back .container { /* Targets .container inside .card-back */
         padding: 0;
         padding-bottom: 80px; /* Space for the fixed footer (approx height) */
         box-sizing: border-box;
         height: 100%; /* Ensure it takes full card face height */
         overflow: hidden; /* Hide anything that might poke out due to calc issues */
    }

    .back-content {
        padding: 0;
        gap: 0;
        flex-direction: column;
        align-items: stretch;
        height: 100%; /* Fill the space above the footer padding */
        overflow-y: auto; /* Allow vertical scrolling for content */
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 20px)); /* Space for fixed footer */
    }

    .services-column,
    .clients-column {
        padding: 24px 12px; /* Default padding */
        gap: 6px; /* Figma: 6px gap between items */
    }

    /* Add extra bottom padding specifically to clients column for scrolling clearance */
    .clients-column {
        padding-bottom: calc(100px + env(safe-area-inset-bottom, 20px)); /* Extra space for fixed footer + safe area */
    }

    .column-title {
        font-size: 30px;
        text-transform: capitalize; /* Figma: TITLE case, CSS uses capitalize for this */
        line-height: 1em;
        margin-bottom: 6px; /* Consistent with list item gap */
         /* text-decoration: underline; /* Already applied by general rule */
    }

    .services-list li,
    .clients-list li {
        font-size: 30px;
        line-height: 1em;
        margin-bottom: 0; /* Gap is handled by parent column */
    }

    /* Services section specific mobile styles */
    .services-column .column-title,
    .services-list li {
        color: #000000;
    }

    /* Clients section specific mobile styles */
    .clients-column {
        background-color: #000000; /* Figma: black background for clients section */
    }
    .clients-column .column-title,
    .clients-column li { /* General client list items */
        color: #FFFFFF;
    }
    /* Specific for LSD Running link - handled by <a> tag default or specific <a> style if needed */
    .clients-list li a { /* Assuming LSD Running is an <a> tag */
        color: #FFFFFF; /* Mobile link color should be white */
        text-decoration: underline; /* Links are usually underlined */
    }
    /* Ensure Alice + Olivia underline is maintained if it was specific */
    .clients-list li.client-name-underlined {
         text-decoration: underline; /* Keep this if it's still desired */
    }
    
    .back-right-black {
        display: none; /* Keep this hidden as sections are full width now */
    }

    .card-back .footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        gap: 11px;
        width: 100%;
        box-sizing: border-box;
        background-color: #FFFFFF;
        border-top: 1px solid #EEEEEE;
        z-index: 100;
        padding: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 20px));
    }
    .card-back .footer .more-info { /* "Get In Touch" text */
        font-size: 32px;
        color: #000000; /* Ensure text is black on white background */
    }
    .card-back .footer .switch {
        width: 111px;
        height: 50px;
        z-index: 11;
        border: 4px solid #000000; /* Ensure border is black */
        background-color: #FFFFFF; /* Ensure switch background is white */
    }
    .card-back .footer .switch .switch-toggle {
        width: 37px;
        
        height: 37px;
        background-color: #000000; /* Ensure dot is black */
        top: 50%; /* Use 50% */
        left: 8px;
        transform: translateY(-50%); /* Vertically center the dot */
    }
    /* Adjust active state for back footer switch if needed */
    .card-back .footer .switch.active .switch-toggle {
        left: calc(100% - 37px - 8px); /* Adjust for dot width and right padding */
    }
}