/* ============================================
   VANGUARD PAGE SPECIFIC STYLES
   Case study page with carousels and video
   ============================================ */

:root {
    --padding: 5vw;
}

body {
    background: #ffffff;
    /* Solid color matches theme-color exactly for iOS Safari */
    background-color: #ffffff;
    /* Ensure background extends behind status bar on iOS */
    background-attachment: fixed;
    /* iOS safe area support for notched devices */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    /* Match index.html body font settings exactly */
    font-family: var(--font-primary);
    font-weight: 400; /* Google Sans Flex Regular */
    font-optical-sizing: auto;
    font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0;
    /* Optimize rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    color: #000000; /* Base color set to black */
}

/* Google Sans Flex font weight and variation settings */
/* All elements using --font-primary get Regular (400) */
* {
    font-optical-sizing: auto;
    font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0;
}

/* All elements using --font-primary get Regular (400) */
/* EXCLUDE numbered-title from this rule - they need medium weight */
body,
p:not(.numbered-title),
.text-22,
h1,
h2 {
    font-weight: 400; /* Google Sans Flex Regular */
}

/* All elements using --font-medium get Medium (500) */
h3,
[class*="font-medium"] {
    font-weight: 500; /* Google Sans Flex Medium */
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: clamp(6rem, 12vw, 10rem) 0 140px 0;
    margin: 0;
    /* Prevent layout shifts from typing animation */
    contain: layout style;
    /* Stable positioning */
    position: relative;
    /* Ensure hero text stays above the hero video glow */
    z-index: 2;
}

.hero-content {
    max-width: 1000px;
    width: 100%;
    box-sizing: border-box;
    padding: 0 var(--padding);
}

.hero h1 {
    font-size: 48px;
    font-weight: 450;
    margin-bottom: 0;
    line-height: 1.4167; /* ~68px for 48px font (68/48) */
    font-family: var(--font-primary);
    font-optical-sizing: auto;
    font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.hero .typewriter-text {
    font-size: 48px;
    font-weight: 450;
    line-height: 1.4167; /* ~68px for 48px font (68/48) */
    font-family: var(--font-primary);
    font-optical-sizing: auto;
    font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    margin-bottom: 0;
}

/* Ensure consistent line-height across both title lines - no extra spacing */
.hero h1.typewriter-text {
    line-height: 1.4167; /* ~68px for 48px font (68/48) */
    margin-bottom: 0;
}

.hero #mainTitle,
.hero #subTitle {
    line-height: 1.4167; /* ~68px for 48px font (68/48) */
    font-weight: 450;
    font-size: 48px;
    font-family: var(--font-primary);
    font-optical-sizing: auto;
    font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    margin-bottom: 0;
    margin-top: 0;
}

/* Remove any spacing between the two title lines to match index page text flow */
.hero #mainTitle + #subTitle {
    margin-top: 0;
    line-height: 1.4167; /* ~68px for 48px font (68/48) */
}

/* Prevent "CBS Digital" from breaking across lines */
.hero #subTitle {
    white-space: pre-wrap; /* Preserve non-breaking spaces */
}

/* ============================================
   VIDEO CONTAINER
   ============================================ */
.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 100vw;
    display: block;
    padding: 0;
    padding-bottom: 140px;
    overflow: visible;
    box-sizing: border-box;
    /* Stable container - no layout shifts */
    min-height: 400px;
    /* Isolate from hero section typing animation */
    isolation: isolate;
    /* Prevent any scroll effects */
    contain: layout;
    /* Keep hero video stack behind hero title text */
    z-index: 1;
}

.video-container {
    width: 75vw;
    max-width: 75vw;
    opacity: 1;
    border-radius: var(--radius-sm);
    overflow: visible;
    position: relative;
    z-index: 0;
    margin: 0 auto;
    /* Always visible - simple and stable */
    visibility: visible;
    display: block;
    /* No transforms - completely static */
    transform: none;
    -webkit-transform: none;
    /* Fixed height to prevent layout shifts */
    min-height: 400px;
    /* Prevent any layout recalculations */
    contain: layout style;
}

/* Desktop: hero video scales to 3/4 of browser width */
@media (min-width: 751px) {
    .video-container {
        width: 75vw;
        max-width: 75vw;
}

.video-container.visible {
        width: 75vw;
        max-width: 75vw;
    }
    
    /* Ensure desktop blur opacity matches mobile - 0.4 */
    .video-glow-bg video {
        opacity: 0.4 !important;
    }
}

.video-glow-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    z-index: -1;
    pointer-events: none;
    /* Ensure glow is always visible */
    opacity: 1;
    visibility: visible;
    overflow: visible;
}

/* Vanguard (single hero video): keep the glow tighter so it matches Pangea’s perceived size */
.video-wrapper:not(.video-wrapper-dual) .video-glow-bg {
    width: 130%;
    height: 130%;
    /* Slightly lower so the glow doesn't bleed into the hero title area */
    top: 56%;
}

.video-wrapper:not(.video-wrapper-dual) .video-glow-bg video {
    /* Slightly tighter + softer on the single-hero variant */
    filter: blur(70px);
    opacity: 0.34 !important;
}

.hero-content {
    position: relative;
    z-index: 3;
}

/* Mobile: reduce glow even more so it matches Pangea and never feels like it sits "over" the title */
@media (max-width: 750px) {
    .video-wrapper:not(.video-wrapper-dual) .video-glow-bg {
        width: 110%;
        height: 110%;
    }
    .video-wrapper:not(.video-wrapper-dual) .video-glow-bg video {
        filter: blur(48px);
        opacity: 0.28 !important;
    }
}

/* Final override for Vanguard single-hero glow sizing on mobile.
   This must win against later media-query rules in the file. */
@media (max-width: 750px) {
    #heroVideo .video-glow-bg {
        width: 110% !important;
        height: 110% !important;
    }
    #heroVideo .video-glow-bg video {
        filter: blur(48px) !important;
        opacity: 0.28 !important;
    }
}

.video-glow-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(80px);
    opacity: 0.4 !important; /* Same opacity on desktop and mobile - 0.4 */
    border-radius: 0;
    /* Ensure glow video is always visible */
    visibility: visible;
    display: block;
}

.video-container video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-sm);
    position: relative;
    z-index: 1;
    /* Always visible - simple and stable */
    visibility: visible;
    opacity: 1;
    /* NO transforms - completely static */
    transform: none;
    -webkit-transform: none;
    /* Stable object fit */
    object-fit: cover;
}

.hero-main-video {
    position: relative;
    z-index: 2;
    /* Always visible */
    visibility: visible;
    opacity: 1;
    /* NO transforms */
    transform: none;
    -webkit-transform: none;
}

/* ============================================
   DUAL VIDEO LAYOUT (PANGEA)
   ============================================ */
.video-wrapper-dual {
    position: relative;
    width: 100%;
    max-width: 100vw;
    display: block;
    padding: 0;
    padding-bottom: 140px;
    overflow: visible;
    box-sizing: border-box;
    min-height: 400px;
    isolation: isolate;
    contain: layout;
}

.video-container-dual {
    width: 75vw;
    max-width: 75vw;
    margin: 0 auto;
    display: flex;
    gap: 20px;
    opacity: 1;
    visibility: visible;
    transform: none;
    -webkit-transform: none;
    min-height: 400px;
    contain: layout style;
}

.video-item {
    flex: 1;
    position: relative;
    border-radius: var(--radius-sm);
    overflow: visible;
    min-width: 0; /* Prevents flex items from overflowing */
}

.video-item .video-glow-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    z-index: -1;
    pointer-events: none;
    opacity: 1;
    visibility: visible;
    overflow: visible;
}

.video-item .video-glow-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(80px);
    opacity: 0.4 !important;
    border-radius: 0;
    visibility: visible;
    display: block;
}

.video-item video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-sm);
    position: relative;
    z-index: 1;
    visibility: visible;
    opacity: 1;
    transform: none;
    -webkit-transform: none;
    object-fit: cover;
}

/* Desktop: side by side */
@media (min-width: 751px) {
    .video-container-dual {
        flex-direction: row;
        width: 75vw;
        max-width: 75vw;
        gap: 20px;
    }
    
    .video-item {
        flex: 1;
    }
}

/* Mobile: stacked */
@media (max-width: 750px) {
    .video-wrapper-dual {
        padding-left: 30px;
        padding-right: 30px;
        padding-bottom: 88px;
        padding-top: 0;
        box-sizing: border-box;
    }
    
    .video-container-dual {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        gap: 20px;
        min-height: auto;
    }
    
    .video-item {
        width: 100%;
    }
    
    .video-item video {
        width: 100%;
        max-width: 100%;
        height: auto;
        display: block;
        box-sizing: border-box;
    }
}

/* ============================================
   OVERVIEW SECTION
   ============================================ */
.content-section {
    padding: 0 var(--padding) !important;
    padding-bottom: 140px !important;
    margin-top: 0;
    overflow: visible;
}

/* Reduce spacing between consecutive content sections */
.content-section-compact {
    padding-bottom: 60px !important;
}

/* Reduce spacing before footer */
.content-section-last {
    padding-bottom: 60px !important;
}

/* Video wrapper no longer in content-section - removed container constraints */

.overview-content {
    max-width: 565px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Allow video wrapper to break out of overview-content constraints */
.overview-content:has(.clickable-video-wrapper) {
    max-width: 100%;
    width: 100%;
    overflow: visible;
}

.overview-content h3 {
    font-family: var(--font-medium);
    font-size: 18px;
    line-height: 26px;
    margin-bottom: 0;
    margin-top: 2rem;
}

.overview-content h3:first-child {
    margin-top: 0;
}

/* Motion & Surprise Video - matches single column width */
.motion-surprise-video-wrapper {
    width: 100%;
    max-width: 565px;
    margin: 2rem auto;
    box-sizing: border-box;
}

.motion-surprise-video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-sm);
    outline: none;
    border: none;
}

.overview-content p {
    font-family: var(--font-primary);
    font-size: 18px;
    line-height: 26px;
    margin-bottom: 1rem;
    opacity: 0.75;
}

/* Override general paragraph rule for numbered titles - must come after general rule */
.content-section:nth-of-type(2) .overview-content p.numbered-title {
    font-family: 'Google Sans Flex', sans-serif !important;
    font-weight: 500 !important;
    font-optical-sizing: auto !important;
    font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0 !important;
    opacity: 1 !important;
}

.overview-content p .label-medium {
    margin-right: 0.25em;
    font-family: var(--font-medium);
    display: inline;
}

/* Role, Duration, Team list - dedicated class for clean styling */
.overview-content p.meta-line {
    line-height: 26px !important;
    margin-bottom: 1rem;
    display: block;
    position: relative;
    font-size: 18px !important;
    font-family: var(--font-primary) !important;
    font-weight: 400 !important; /* Regular weight for the text */
    opacity: 0.75;
    /* Reset any conflicting properties */
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-indent: 0 !important;
}

/* Ensure label-medium in Role/Duration/Team has consistent styling - MEDIUM WEIGHT ONLY FOR LABELS */
.overview-content p.meta-line .label-medium {
    line-height: 26px !important;
    vertical-align: baseline;
    font-family: var(--font-medium);
    font-weight: 500 !important; /* Medium weight ONLY for labels */
    margin-right: 0.25em;
    display: inline;
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
}

/* Bullet point lists with arrows - hanging indents */
/* Arrow bullets: label-medium with just "→" followed by text */
/* EXCLUDE numbered titles and meta lines */
.overview-content p:has(.label-medium:first-child):not(.numbered-title):not(.meta-line) {
    position: relative;
    /* Create space for arrow: 1.5em for arrow + 0.25em gap = 1.75em total */
    padding-left: 1.75em;
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    /* Match single-column text block line-height exactly */
    line-height: 26px;
    display: block;
    /* Ensure text wraps properly - wrapped lines align with first line text */
    text-indent: 0;
    box-sizing: border-box;
}

/* Numbered list - restructured with dedicated classes */
/* Container for each numbered item */
.content-section:nth-of-type(2) .overview-content .numbered-item {
    margin-bottom: 1.5rem;
    display: block;
    padding-left: 0 !important; /* No indent */
    text-indent: 0 !important;
    /* Ensure proper spacing between items */
    clear: both;
}

/* Numbered list titles (1., 2., 3.) - dedicated rule with maximum specificity */
.content-section:nth-of-type(2) .overview-content .numbered-title,
.content-section:nth-of-type(2) .overview-content p.numbered-title {
    line-height: 26px !important;
    margin-bottom: 1rem !important; /* Regular paragraph spacing */
    margin-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-indent: 0 !important;
    display: block !important;
    font-size: 18px !important;
    /* Force medium font family and weight - override all paragraph rules */
    font-family: 'Google Sans Flex', sans-serif !important;
    font-weight: 500 !important; /* Medium weight for title part */
    font-optical-sizing: auto !important;
    font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0 !important;
    opacity: 1 !important; /* Full opacity for title part */
    /* Override any conflicting rules - ensure no absolute positioning */
    position: relative !important;
    /* Reset any transforms or positioning from arrow bullets */
    transform: none !important;
}

/* Style description spans inside numbered titles - regular weight, match paragraph opacity */
.content-section:nth-of-type(2) .overview-content p.numbered-title span {
    font-weight: 400 !important;
    opacity: 1 !important; /* Match the numbered-title parent opacity */
    font-family: 'Google Sans Flex', sans-serif !important;
    color: inherit; /* Inherit color from parent */
}

/* Paragraphs following numbered list titles - prevent overlap */
.content-section:nth-of-type(2) .overview-content .numbered-description {
    line-height: 26px !important;
    margin-top: 0 !important;
    margin-bottom: 1rem;
    padding-left: 0 !important;
    padding-right: 0 !important;
    /* Ensure no overlap with numbered title above */
    position: relative !important;
    display: block !important;
    font-size: 18px !important;
    font-family: var(--font-primary) !important;
    opacity: 0.75;
    /* Force new line after title - ensure proper spacing */
    clear: both;
    /* Reset any conflicting properties */
    transform: none !important;
}

/* Remove margin from last numbered description in each item */
.content-section:nth-of-type(2) .overview-content .numbered-item .numbered-description:last-child {
    margin-bottom: 0;
}

/* Position the arrow absolutely at the left edge - ONLY for arrow bullets */
/* EXCLUDE numbered titles and meta lines */
.overview-content p:has(.label-medium:first-child):not(.numbered-title):not(.meta-line) .label-medium {
    position: absolute;
    left: 0;
    top: 0;
    margin-right: 0;
    padding-right: 0.25em;
    display: inline-block;
    font-family: var(--font-medium);
    font-weight: 500;
    width: 1.5em;
    text-align: left;
    /* Ensure arrow doesn't wrap */
    white-space: nowrap;
    /* Align arrow vertically with first line of text - match line-height exactly */
    line-height: 26px;
    /* Prevent arrow from being affected by any transforms */
    transform: none;
}

/* Override: Numbered lists should NOT have absolute positioning */
/* This is now handled by .numbered-title .label-medium above - rule removed */

/* Mobile responsive adjustments */
@media (max-width: 750px) {
    /* Arrow bullets - mobile adjustments */
    .overview-content p:has(.label-medium:first-child) {
        padding-left: 1.5em;
        margin-bottom: 0;
        line-height: 26px;
    }
    
    .overview-content p:has(.label-medium:first-child) .label-medium {
        width: 1.25em;
        padding-right: 0.25em;
        line-height: 26px;
    }
    
    /* Numbered lists - mobile adjustments */
    .content-section:nth-of-type(2) .overview-content .numbered-item {
        margin-bottom: 1.5rem;
        clear: both;
        padding-left: 0 !important; /* Remove indent on mobile */
        text-indent: 0 !important;
    }
    
    .content-section:nth-of-type(2) .overview-content .numbered-title,
    .content-section:nth-of-type(2) .overview-content p.numbered-title {
        line-height: 26px !important;
        margin-bottom: 0.5rem !important;
        margin-top: 0 !important;
        font-size: 18px !important;
        /* Force medium font family and weight - override all paragraph rules */
        font-family: 'Google Sans Flex', sans-serif !important;
        font-weight: 500 !important; /* Medium weight for entire numbered title */
        font-optical-sizing: auto !important;
        font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0 !important;
        padding-left: 0 !important;
        text-indent: 0 !important;
        opacity: 1 !important; /* Full opacity for better visibility */
        clear: both;
    }
    
    .content-section:nth-of-type(2) .overview-content .numbered-description {
        line-height: 26px !important;
        margin-top: 0 !important;
        margin-bottom: 1rem;
        font-size: 18px !important;
        padding-left: 0 !important;
        text-indent: 0 !important;
        clear: both;
    }
    
    /* Role, Duration, Team - ensure proper line-height on mobile */
    .overview-content p.meta-line {
        line-height: 26px !important;
        font-size: 18px !important;
        font-weight: 400 !important; /* Regular weight for the text */
        padding-left: 0 !important;
    }
    
    .overview-content p.meta-line .label-medium {
        line-height: 26px !important;
        vertical-align: baseline;
        position: static !important;
        font-weight: 500 !important; /* Medium weight ONLY for labels */
    }
}

/* ============================================
   CAROUSEL SECTIONS
   ============================================ */
.carousel-section {
    padding: 0 !important;
    padding-bottom: 140px !important;
    padding-top: 0 !important;
    max-width: 100vw;
    box-sizing: border-box;
    margin-top: 0;
    overflow: visible;
    /* Ensure carousel sections don't block vertical scrolling */
    touch-action: pan-y;
    /* Prevent layout shifts when carousel enters viewport */
    contain: layout style;
    /* Prevent scroll anchoring issues */
    overflow-anchor: none;
    /* Prevent page jumping - stable positioning */
    position: relative;
    /* Prevent any transforms from affecting layout */
    will-change: auto;
    /* Isolate from scroll effects */
    isolation: isolate;
}

.carousel-section h2 {
    padding: 0 var(--padding);
    margin-bottom: calc(1.4rem - 18px);
}

.carousel-container {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 20px 0;
    padding-bottom: 0;
    scroll-behavior: auto;
    /* Allow both directions for better iOS scrolling */
    touch-action: pan-x pan-y;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto; /* Allow vertical scroll to pass through on desktop */
    /* Prevent layout shifts */
    contain: layout style;
    /* Stable positioning */
    position: relative;
    will-change: auto;
    /* Prevent scroll anchoring */
    overflow-anchor: none;
    /* Mobile: snap items to center - fluid and snappy */
    scroll-snap-type: x mandatory;
    scroll-snap-stop: always;
    /* Smooth scrolling for better snap behavior */
    -webkit-overflow-scrolling: touch;
}

/* Desktop: Allow vertical mouse wheel scrolling when hovering over carousel */
@media (min-width: 751px) {
    .carousel-container {
        overscroll-behavior-y: auto; /* Allow vertical scroll to pass through to page */
    }
    
    .carousel-section,
    .carousel-section-applied {
        /* Allow pointer events to pass through for vertical scrolling */
        pointer-events: auto;
    }
    
    .carousel-container,
    .carousel-track,
    .carousel-item,
    .carousel-item-image-container,
    .carousel-item-image,
    .carousel-section-applied .carousel-container-applied,
    .carousel-section-applied .carousel-track-applied,
    .carousel-section-applied .carousel-item-applied,
    .carousel-section-applied .carousel-item-applied .carousel-item-image-container,
    .carousel-section-applied .carousel-item-applied .carousel-item-image-container .carousel-item-image {
        /* Allow pointer events for mouse wheel scrolling */
        pointer-events: auto;
    }
}

@media (max-width: 750px) {
    .carousel-container {
        scroll-snap-type: x mandatory;
        scroll-snap-stop: always;
    }
    
    .carousel-item,
    .text-carousel-item {
        transition: none !important; /* No ease-out - instant snap */
    }

    /* Mobile: side images smaller by 24px at top + bottom (total 48px) */
    .carousel-item:not(.is-center) .carousel-item-image-container .carousel-item-image,
    .carousel-item:not(.is-center) .carousel-item-image-container-variable .carousel-item-image,
    .carousel-section-applied .carousel-item-applied:not(.is-center) .carousel-item-image-container .carousel-item-image {
        height: calc(100% - 48px);
        margin: 24px 0;
        transform: none;
        transition: height 320ms cubic-bezier(0.2, 0.9, 0.2, 1), margin 320ms cubic-bezier(0.2, 0.9, 0.2, 1);
    }

    .carousel-item.is-center .carousel-item-image-container .carousel-item-image,
    .carousel-item.is-center .carousel-item-image-container-variable .carousel-item-image,
    .carousel-section-applied .carousel-item-applied.is-center .carousel-item-image-container .carousel-item-image {
        height: 100%;
        margin: 0;
        transform: none;
        transition: height 320ms cubic-bezier(0.2, 0.9, 0.2, 1), margin 320ms cubic-bezier(0.2, 0.9, 0.2, 1);
    }

    /* NOTE: title/description width must be overridden in the later mobile breakpoints too
       (this file defines .carousel-item h3/p again in @media 768px and 480px further down). */
}

/* MOBILE/TABLET: widen title/description so it’s actually visible (wins over later rules) */
@media (max-width: 768px) {
    .carousel-item h3,
    .carousel-item p,
    .carousel-section-applied .carousel-item-applied h3,
    .carousel-section-applied .carousel-item-applied p {
        max-width: 85% !important;
    }
}

@media (max-width: 480px) {
    .carousel-item h3,
    .carousel-item p,
    .carousel-section-applied .carousel-item-applied h3,
    .carousel-section-applied .carousel-item-applied p {
        max-width: 85% !important;
    }
}

.carousel-container::-webkit-scrollbar {
    display: none;
}

.carousel-track {
    display: flex;
    gap: 20px;
    padding: 0 var(--padding) 2rem var(--padding);
    overflow: visible;
}

.carousel-track::after {
    content: '';
    flex-shrink: 0;
    width: 1px;
}

.carousel-item {
    flex: 0 0 auto;
    width: 680px;
    max-width: 80vw;
    /* Mobile: snap to center */
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

.carousel-item-image-container {
    width: 100%;
    aspect-ratio: 3 / 2;
    border-radius: var(--radius-sm);
    overflow: hidden; /* Changed from visible to hidden to properly clip border-radius */
    margin-bottom: var(--spacing-sm);
    display: block;
    position: relative;
    /* iOS 26-style spring bounce animation */
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Hover effect for first carousel images on desktop - reduced zoom with iOS bounce */
@media (min-width: 751px) {
    /* Hover effects removed - no hover on desktop */
    .carousel-item-image-container:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

.carousel-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    /* iOS 26-style spring bounce animation */
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: var(--radius-sm);
}

/* Hover effect on image itself - reduced zoom with iOS bounce */
@media (min-width: 751px) {
    /* Hover effects removed - no hover on desktop */
    .carousel-item-image-container:hover .carousel-item-image {
        transform: none !important;
    }
}

/* Variable height container for Applied Examples carousel */
.carousel-item-image-container-variable {
    width: 100%;
    aspect-ratio: unset;
    height: auto;
    border-radius: var(--radius-sm);
    overflow: visible;
    margin-bottom: var(--spacing-sm);
    display: block;
    position: relative;
}

.carousel-item-image-container-variable .carousel-item-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
    display: block;
}

/* Applied Examples Carousel - Different behavior */
.carousel-section-applied {
    overflow: visible;
    /* Ensure carousel sections don't block vertical scrolling - same as first carousel */
    touch-action: pan-y;
}

.carousel-section-applied .carousel-container-applied {
    scroll-snap-type: x mandatory; /* Same as first carousel */
    overflow-x: auto;
    overflow-y: visible; /* Allow vertical scrolling when hovering */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 20px 0;
    padding-bottom: 0;
    scroll-behavior: auto;
    /* Allow both directions for better iOS scrolling - same as first carousel */
    touch-action: pan-x pan-y; /* Critical: allows vertical scroll when hovering */
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto; /* Allow vertical scroll to pass through on desktop */
    /* Prevent layout shifts */
    contain: layout style;
    /* Stable positioning */
    position: relative;
    will-change: auto;
    /* Prevent scroll anchoring */
    overflow-anchor: none;
    scroll-snap-stop: always; /* Same as first carousel */
}

.carousel-section-applied .carousel-container-applied::-webkit-scrollbar {
    display: none;
}

.carousel-section-applied .carousel-track-applied {
    display: flex;
    gap: 20px; /* Same gap as first carousel */
    padding: 0 var(--padding) 2rem var(--padding); /* Same padding as first carousel */
    overflow: visible;
}

/* Add gap after last item - same as first carousel */
.carousel-section-applied .carousel-track-applied::after {
    content: '';
    flex-shrink: 0;
    width: 20px; /* Same as gap between items (20px) */
}

.carousel-section-applied .carousel-item-applied {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 680px; /* Same width as first two carousels */
    max-width: 80vw;
    min-width: 0;
    /* Mobile: snap to center - same as first carousel */
    scroll-snap-align: center;
    scroll-snap-stop: always;
    /* Prevent overlapping on iOS Safari */
    isolation: isolate;
    contain: layout style;
    position: relative;
    z-index: 1;
}

/* Third carousel uses carousel-item-image-container (not -applied) */
.carousel-section-applied .carousel-item-applied .carousel-item-image-container {
    width: 100%;
    aspect-ratio: 3 / 2 !important; /* Same aspect ratio as first two carousels - force it */
    border-radius: var(--radius-sm);
    overflow: hidden; /* Changed from visible to hidden to properly clip border-radius */
    margin-bottom: var(--spacing-sm);
    display: block;
    position: relative;
    /* No hover effects - explicitly disable any transforms or transitions */
    transition: none;
    transform: none;
    /* Ensure aspect ratio is enforced */
    height: auto;
    min-height: 0;
    max-height: none;
}

/* Explicitly disable hover effects on Applied Examples carousel */
@media (min-width: 751px) {
    .carousel-section-applied .carousel-item-applied .carousel-item-image-container:hover {
        transform: none !important;
        filter: none !important;
    }
}

/* Third carousel uses carousel-item-image-container (not -applied) */
.carousel-section-applied .carousel-item-applied .carousel-item-image-container .carousel-item-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover; /* Same as first two carousels */
    border-radius: var(--radius-sm);
    /* Prevent image from overlapping */
    position: relative;
    z-index: 1;
    /* No hover effects - explicitly disable any transforms or transitions */
    transition: none;
    transform: none;
}

/* Explicitly disable hover effects on Applied Examples carousel images */
@media (min-width: 751px) {
    .carousel-section-applied .carousel-item-applied .carousel-item-image-container:hover .carousel-item-image {
        transform: none !important;
    }
}

.carousel-section-applied .carousel-item-applied h3 {
    font-family: var(--font-medium);
    font-size: 18px;
    line-height: 26px;
    margin-bottom: 0.25rem;
    max-width: 75%; /* Same as first two carousels */
    padding-left: 18px; /* Same as first two carousels */
}

.carousel-section-applied .carousel-item-applied p {
    font-family: var(--font-primary);
    font-size: 18px;
    line-height: 26px;
    margin-bottom: 0;
    max-width: 75%; /* Same as first two carousels */
    opacity: 0.75;
    padding-left: 18px; /* Same as first two carousels */
}

.carousel-item h3 {
    font-family: var(--font-medium);
    font-size: 18px;
    line-height: 26px;
    margin-bottom: 0.25rem;
    max-width: 75%;
    padding-left: 18px;
}

.carousel-item p {
    font-family: var(--font-primary);
    font-size: 18px;
    line-height: 26px;
    margin-bottom: 0;
    max-width: 75%;
    opacity: 0.75;
    padding-left: 18px;
}

/* ============================================
   TEXT CAROUSEL ITEMS (DYNAMIC CARDS)
   ============================================ */
.text-carousel-item {
    flex: 0 0 auto;
    width: 380px;
    aspect-ratio: 4 / 3;
    height: auto;
    max-width: 85vw;
    /* Mobile: snap to center */
    scroll-snap-align: center;
    scroll-snap-stop: always;
    background: var(--card-bg);
    color: var(--card-text);
    border-radius: var(--radius-sm);
    padding: 2.5rem;
    backdrop-filter: blur(24px);
    /* iOS 26-style spring bounce animation */
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.text-carousel-item h3 {
    font-family: var(--font-medium);
    font-size: 18px;
    line-height: 26px;
    color: var(--card-text);
}

.text-carousel-item p {
    font-family: var(--font-primary);
    font-size: 18px;
    line-height: 26px;
    color: var(--card-text);
    opacity: 0.75;
}

/* Hover effect for second carousel - reduced zoom with iOS bounce */
@media (min-width: 751px) {
/* Hover effects removed - no hover on desktop */
.text-carousel-item:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

/* Disable hover effects on mobile for better performance */
@media (max-width: 750px) {
    .text-carousel-item:hover {
        transform: none;
    }
}

/* ============================================
   FOOTER CTA
   ============================================ */
/* Footer Typewriter Section - Match index.html styling */
.footer-typewriter {
    text-align: left;
    padding: clamp(4rem, 8vw, 6rem) var(--padding);
    padding-bottom: clamp(6rem, 12vw, 10rem);
}

.footer-typewriter .container {
    max-width: 565px; /* Match single column width from vanguard.html */
    margin: 0 auto;
    width: 100%;
    padding: 0;
    box-sizing: border-box;
}

.typewriter-text-footer {
    /* Match index.html exactly - inherit from body, no explicit font-family override */
    font-size: 48px; /* Match index.html desktop size */
    font-weight: 450; /* Match main titles */
    font-optical-sizing: auto; /* Match index.html */
    font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0; /* Match index.html exactly */
    line-height: 1.4167; /* ~68px for 48px font (68/48) - unified with main titles */
    color: inherit;
    min-height: 1.2em;
    position: relative;
    transition: color var(--transition-slow);
    margin-bottom: 0;
    /* Ensure same font rendering as index.html */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.cursor-footer {
    display: inline-block;
    width: 3px; /* Match index.html cursor width */
    height: 1.2em;
    background-color: currentColor;
    margin-left: 2px;
    animation: blink 1s infinite;
    vertical-align: text-top; /* Match index.html */
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Clickable links - AI agent style with animated circular element - exact same as index page */
.typewriter-text .clickable-link {
    text-decoration: none !important;
    color: inherit !important;
    line-height: inherit !important; /* Inherit exact line-height from parent to prevent expansion */
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                padding-right 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.3s ease,
                backdrop-filter 0.3s ease !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer !important;
    position: relative;
    z-index: 1000 !important;
    pointer-events: auto !important;
    display: inline-block !important;
    /* 2px less vertical padding vs prior (2px -> 0px) */
    padding: 1px 16px; /* Balanced horizontal padding */
    margin: 1px 2px; /* 2px vertical gap between backgrounds in different lines */
    border-radius: 999px; /* Fully rounded background */
    background: rgba(119, 122, 129, 0.33) !important; /* #777A81 with 33% opacity */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* Ensure links are always on top */
    isolation: isolate;
    vertical-align: baseline; /* Consistent baseline alignment */

    /* Circular element sizing/placement (kept INSIDE the pill background) */
    --orbit-size: 28px;  /* desktop default */
    --orbit-inset: 10px;  /* padding between circle and right edge of pill (added 2px) */
    --orbit-gap: 0px;   /* space between text and circle (reduced by 4px from 2px) */
}

/* Circular animated element - appears on hover/touch */
.typewriter-text .clickable-link::before {
    content: '';
    position: absolute;
    right: var(--orbit-inset);
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: var(--orbit-size);
    height: var(--orbit-size);
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease,
                width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: -1;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Rotating gradient band inside circular element */
.typewriter-text .clickable-link::after {
    content: '';
    position: absolute;
    right: var(--orbit-inset);
    top: 50%;
    transform: translateY(-50%) scale(0) rotate(0deg);
    width: var(--orbit-size);
    height: var(--orbit-size);
    border-radius: 50%;
    /* Lighter "AI spectrum" band colors */
    background: conic-gradient(
        from 0deg,
        rgb(0, 255, 255),  /* cyan - more vibrant */
        rgb(0, 100, 255),   /* blue - more saturated */
        rgb(150, 0, 255),   /* violet - more vibrant */
        rgb(255, 0, 150),   /* pink - more saturated */
        rgb(255, 200, 0),   /* warm yellow - more vibrant */
        rgb(0, 255, 150),   /* mint - more saturated */
        rgb(0, 255, 255)   /* cyan loop */
    );
    /* Band mask tuned for 28px circle */
    mask: radial-gradient(circle, transparent 10px, black 10.5px, black 12.5px, transparent 13px);
    -webkit-mask: radial-gradient(circle, transparent 10px, black 10.5px, black 12.5px, transparent 13px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease,
                width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: -1;
    pointer-events: none;
    animation: rotateGradient 3s linear infinite;
    animation-play-state: paused;
    will-change: transform, opacity;
    filter: saturate(1.15) brightness(1.05);
}

@keyframes rotateGradient {
    from {
        transform: translateY(-50%) scale(1) rotate(0deg);
    }
    to {
        transform: translateY(-50%) scale(1) rotate(360deg);
    }
}

.typewriter-text .clickable-link:hover,
.typewriter-text .clickable-link:active,
.typewriter-text .clickable-link.touching {
    text-decoration: none !important;
    color: inherit !important;
    /* Don't translate - keep left side fixed to avoid background moving right */
    padding-top: 1px !important;
    padding-bottom: 1px !important;
    padding-left: 16px !important;
    /* Reduce extension to avoid pushing into next line */
    padding-right: calc(16px + var(--orbit-size) + var(--orbit-gap) + var(--orbit-inset) - 4px) !important;
    background: rgba(119, 122, 129, 0.35) !important; /* #777A81 with 35% opacity on hover */
}

.typewriter-text .clickable-link:hover::before,
.typewriter-text .clickable-link:active::before,
.typewriter-text .clickable-link.touching::before {
    transform: translateY(-50%) scale(1);
    opacity: 1;
    width: var(--orbit-size);
    height: var(--orbit-size);
}.typewriter-text .clickable-link:hover::after,
.typewriter-text .clickable-link:active::after,
.typewriter-text .clickable-link.touching::after {
    transform: translateY(-50%) scale(1) rotate(0deg);
    opacity: 1;
    width: var(--orbit-size);
    height: var(--orbit-size);
    animation-play-state: running;
}

.typewriter-text .clickable-link:active {
    transform: translateX(4px) scale(0.98);
}

/* Desktop hover states */
@media (min-width: 769px) {
    .typewriter-text .clickable-link {
        cursor: pointer !important;
        pointer-events: auto !important;
    }
    
    .typewriter-text .clickable-link:hover {
        text-decoration: none !important;
    }
}

/* Mobile touch states */
@media (max-width: 768px) {
    .typewriter-text .clickable-link:active {
        transform: translateX(4px);
    }

    /* Scale down circular element for 36px type */
    .typewriter-text .clickable-link {
        --orbit-size: 21px;
        --orbit-inset: 7px;
        --orbit-gap: 0px; /* Reduced by 4px from desktop */
    }

    .typewriter-text .clickable-link::after {
        mask: radial-gradient(circle, transparent 7.5px, black 8px, black 9.5px, transparent 10px);
        -webkit-mask: radial-gradient(circle, transparent 7.5px, black 8px, black 9.5px, transparent 10px);
    }
}

@media (max-width: 480px) {
    /* Scale down circular element for 28px type */
    .typewriter-text .clickable-link {
        --orbit-size: 16px;
        --orbit-inset: 6px;
        --orbit-gap: 0px; /* Reduced by 4px from desktop */
    }

    .typewriter-text .clickable-link::after {
        mask: radial-gradient(circle, transparent 5.5px, black 6px, black 7px, transparent 7.5px);
        -webkit-mask: radial-gradient(circle, transparent 5.5px, black 6px, black 7px, transparent 7.5px);
    }
}

.footer-typewriter .clickable-link {
    cursor: pointer;
    text-decoration: underline; /* Match index.html */
    transition: all var(--transition-fast); /* Match index.html */
    -webkit-tap-highlight-color: rgba(37, 99, 235, 0.2); /* Match index.html */
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.footer-typewriter .clickable-link:hover {
    text-decoration: none; /* Match index.html hover behavior */
}

.footer-typewriter .clickable-link:active {
    opacity: 0.7;
    transform: scale(0.98); /* Match index.html */
}

/* ============================================
   FOOTER LINKS - MATCH INDEX (AI AGENT STYLE)
   Including Connect emoji on hover (connect-link)
   ============================================ */
.footer-typewriter .clickable-link {
    text-decoration: none !important;
    color: inherit !important;
    line-height: inherit !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                padding-right 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.3s ease !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer !important;
    position: relative;
    z-index: 1000 !important;
    pointer-events: auto !important;
    display: inline-block !important;
    padding: 1px 14px;
    margin: 1px 2px;
    border-radius: 999px;
    background: rgba(119, 122, 129, 0.33) !important;
    isolation: isolate;
    vertical-align: baseline;
    --orbit-size: 28px;
    --orbit-inset: 10px;
    --orbit-gap: 0px;
}

.footer-typewriter .clickable-link::before {
    content: '';
    position: absolute;
    right: var(--orbit-inset);
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: var(--orbit-size);
    height: var(--orbit-size);
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease,
                width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: -1;
    pointer-events: none;
    will-change: transform, opacity;
}

.footer-typewriter .clickable-link::after {
    content: '';
    position: absolute;
    right: var(--orbit-inset);
    top: 50%;
    transform: translateY(-50%) scale(0) rotate(0deg);
    width: var(--orbit-size);
    height: var(--orbit-size);
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        rgb(0, 255, 255),
        rgb(0, 100, 255),
        rgb(150, 0, 255),
        rgb(255, 0, 150),
        rgb(255, 200, 0),
        rgb(0, 255, 150),
        rgb(0, 255, 255)
    );
    mask: radial-gradient(circle, transparent 10px, black 10.5px, black 12.5px, transparent 13px);
    -webkit-mask: radial-gradient(circle, transparent 10px, black 10.5px, black 12.5px, transparent 13px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease,
                width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: -1;
    pointer-events: none;
    animation: rotateGradient 3s linear infinite;
    animation-play-state: paused;
    will-change: transform, opacity;
    filter: saturate(1.15) brightness(1.05);
}

/* Connect link: replace spinner with emoji animation (same as index) */
.footer-typewriter .clickable-link.connect-link::after {
    content: '';
    background: none;
    mask: none;
    -webkit-mask: none;
    border-radius: 0;
    width: 32px;
    height: 32px;
    background-image: url('https://fonts.gstatic.com/s/e/notoemoji/latest/1f919/512.gif');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: none;
    filter: none;
    image-rendering: auto;
}

.footer-typewriter .clickable-link:hover,
.footer-typewriter .clickable-link:active,
.footer-typewriter .clickable-link.touching {
    text-decoration: none !important;
    color: inherit !important;
    padding-top: 1px !important;
    padding-bottom: 1px !important;
    padding-left: 16px !important;
    padding-right: calc(16px + var(--orbit-size) + var(--orbit-gap) + var(--orbit-inset) - 4px) !important;
    background: rgba(119, 122, 129, 0.35) !important;
}

/* Connect link: adjust padding for fixed emoji size */
.footer-typewriter .clickable-link.connect-link:hover,
.footer-typewriter .clickable-link.connect-link:active,
.footer-typewriter .clickable-link.connect-link.touching {
    padding-right: calc(16px + 32px + var(--orbit-gap) + var(--orbit-inset) - 4px) !important;
}

.footer-typewriter .clickable-link:hover::before,
.footer-typewriter .clickable-link:active::before,
.footer-typewriter .clickable-link.touching::before {
    transform: translateY(-50%) scale(1);
    opacity: 1;
}

.footer-typewriter .clickable-link:hover::after,
.footer-typewriter .clickable-link:active::after,
.footer-typewriter .clickable-link.touching::after {
    transform: translateY(-50%) scale(1) rotate(0deg);
    opacity: 1;
    animation-play-state: running;
}

/* Connect link: emoji doesn't rotate */
.footer-typewriter .clickable-link.connect-link:hover::after,
.footer-typewriter .clickable-link.connect-link:active::after,
.footer-typewriter .clickable-link.connect-link.touching::after {
    transform: translateY(-50%) scale(1);
    animation-play-state: paused;
    width: 32px;
    height: 32px;
}

@media (max-width: 768px) {
    .footer-typewriter .clickable-link {
        --orbit-size: 21px;
        --orbit-inset: 7px;
        --orbit-gap: 0px;
    }
    .footer-typewriter .clickable-link::after {
        mask: radial-gradient(circle, transparent 7.5px, black 8px, black 9.5px, transparent 10px);
        -webkit-mask: radial-gradient(circle, transparent 7.5px, black 8px, black 9.5px, transparent 10px);
    }
    .footer-typewriter .clickable-link.connect-link::after {
        width: 24px;
        height: 24px;
    }
    .footer-typewriter .clickable-link.connect-link:hover,
    .footer-typewriter .clickable-link.connect-link:active,
    .footer-typewriter .clickable-link.connect-link.touching {
        padding-right: calc(16px + 24px + var(--orbit-gap) + var(--orbit-inset) - 4px) !important;
    }
    .footer-typewriter .clickable-link.connect-link:hover::after,
    .footer-typewriter .clickable-link.connect-link:active::after,
    .footer-typewriter .clickable-link.connect-link.touching::after {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .footer-typewriter .clickable-link {
        --orbit-size: 16px;
        --orbit-inset: 6px;
        --orbit-gap: 0px;
    }
    .footer-typewriter .clickable-link::after {
        mask: radial-gradient(circle, transparent 5.5px, black 6px, black 7px, transparent 7.5px);
        -webkit-mask: radial-gradient(circle, transparent 5.5px, black 6px, black 7px, transparent 7.5px);
    }
    .footer-typewriter .clickable-link.connect-link::after {
        width: 20px;
        height: 20px;
    }
    .footer-typewriter .clickable-link.connect-link:hover,
    .footer-typewriter .clickable-link.connect-link:active,
    .footer-typewriter .clickable-link.connect-link.touching {
        padding-right: calc(16px + 20px + var(--orbit-gap) + var(--orbit-inset) - 4px) !important;
    }
    .footer-typewriter .clickable-link.connect-link:hover::after,
    .footer-typewriter .clickable-link.connect-link:active::after,
    .footer-typewriter .clickable-link.connect-link.touching::after {
        width: 20px;
        height: 20px;
    }
}

/* Mobile responsive - Match index.html breakpoints */
@media (max-width: 768px) {
    .footer-typewriter {
        padding: clamp(2rem, 4vw, 3rem) 30px;
        padding-bottom: clamp(3rem, 6vw, 5rem);
    }
    
    .footer-typewriter .container {
        max-width: 100%;
        padding: 0;
    }
    
    .typewriter-text-footer {
        font-size: 36px; /* Match index.html tablet size */
        line-height: 1.4167; /* Proportional to desktop (~51px for 36px font) */
        font-weight: 450; /* Match main titles */
        font-optical-sizing: auto; /* Match index.html */
        font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0; /* Match index.html exactly */
    }
}

@media (max-width: 480px) {
    .typewriter-text-footer {
        font-size: 28px; /* Match index.html mobile size */
        line-height: 1.4167; /* Proportional to desktop (~40px for 28px font) */
        font-weight: 450; /* Match main titles */
        font-optical-sizing: auto; /* Match index.html */
        font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0; /* Match index.html exactly */
    }
}

/* ============================================
   MOBILE RESPONSIVE - TYPOGRAPHY
   Match index page typography exactly
   ============================================ */
@media (max-width: 768px) {
    .hero h1,
    .hero .typewriter-text,
    .hero #mainTitle,
    .hero #subTitle {
        font-size: 36px;
        line-height: 1.4167; /* Proportional to desktop (~51px for 36px font) */
        font-weight: 450;
        font-family: var(--font-primary);
        font-optical-sizing: auto;
        font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }
}

@media (max-width: 480px) {
    .hero h1,
    .hero .typewriter-text,
    .hero #mainTitle,
    .hero #subTitle {
        font-size: 28px;
        line-height: 1.32;
        font-weight: 450;
        font-family: var(--font-primary);
        font-optical-sizing: auto;
        font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }
}

/* ============================================
   MOBILE RESPONSIVE (≤750px)
   Optimized for fast loading and smooth performance
   ============================================ */
@media (max-width: 750px) {
    :root {
        --padding: 30px;
    }

    /* Optimize body for mobile - ensure light background for status bar */
    body {
        background: #ffffff;
        /* Reduce repaints on mobile */
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        /* Optimize rendering */
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
    }

    /* Optimize carousel transforms for mobile */
    .carousel-item,
    .text-carousel-item {
        /* Use GPU acceleration */
        transform: translateZ(0);
        -webkit-transform: translateZ(0);
        /* Only set will-change when actively animating */
        will-change: auto;
    }

    /* Optimize off-screen content for faster rendering */
    .content-section:not(:first-of-type) {
        content-visibility: auto;
        contain-intrinsic-size: auto 500px;
    }

    /* Remove content-section padding on mobile for overview */
    .content-section {
        padding: 0 !important;
        padding-bottom: 88px !important;
    }
    
    /* Reduce spacing on mobile for compact and last sections */
    .content-section-compact {
        padding-bottom: 40px !important;
    }
    
    .content-section-last {
        padding-bottom: 40px !important;
    }

    .overview-content {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding-left: 30px;
        padding-right: 30px;
        box-sizing: border-box;
    }
    
    /* Motion & Surprise Video - mobile responsive */
    .motion-surprise-video-wrapper {
        width: 100%;
        max-width: 100%;
        margin: 2rem 0;
        padding-left: 0;
        padding-right: 0;
    }

    /* Hero video - simple, stable implementation */
    .video-wrapper {
        padding-left: 30px;
        padding-right: 30px;
        padding-bottom: 88px;
        padding-top: 0;
        box-sizing: border-box;
        width: 100%;
        max-width: 100vw;
        min-height: 400px;
        overflow: visible;
        /* Isolate from hero section */
        isolation: isolate;
        contain: layout;
    }

    .video-container {
        width: 100%;
        max-width: 100%;
        opacity: 1 !important;
        min-height: 400px;
        box-sizing: border-box;
        margin: 0 auto;
        position: relative;
        visibility: visible !important;
        display: block !important;
        /* NO transforms - completely static */
        transform: none !important;
        -webkit-transform: none !important;
        /* Allow glow to extend */
        overflow: visible;
        /* Prevent layout shifts */
        contain: layout style;
    }
    
    /* Ensure video element respects container bounds */
    .video-container video {
        width: 100%;
        max-width: 100%;
        height: auto;
        display: block;
        box-sizing: border-box;
        visibility: visible !important;
        opacity: 1 !important;
        object-fit: cover;
        /* NO transforms */
        transform: none !important;
        -webkit-transform: none !important;
    }
    
    /* Ensure glow is visible on mobile */
    .video-glow-bg {
        opacity: 1 !important;
        visibility: visible !important;
        overflow: visible;
    }
    
    .video-glow-bg video {
        visibility: visible !important;
        opacity: 0.4 !important;
        display: block !important;
    }

    /* Bullet point lists on mobile - ONLY for Outcomes section */
    .content-section:last-of-type .overview-content p:has(.label-medium:first-child) {
        padding-left: 2em !important;
        position: relative !important;
        margin-bottom: 0 !important;
    }

    .content-section:last-of-type .overview-content p:has(.label-medium:first-child) .label-medium {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        margin-right: 0.5em !important;
    }

    .carousel-section h2 {
        padding-left: 30px;
        padding-right: 30px;
    }

    .carousel-container {
        /* Strong, solid snap-to-center on mobile */
        scroll-snap-type: x mandatory;
        scroll-snap-stop: always;
        scroll-padding-left: 30px;
        scroll-padding-right: 30px;
        padding: 0;
        padding-bottom: 0;
        /* Allow both horizontal and vertical scrolling on iOS */
        touch-action: pan-x pan-y;
        -webkit-overflow-scrolling: touch;
        /* Improve momentum scrolling on iOS - allow vertical scroll */
        overscroll-behavior-x: contain;
        overscroll-behavior-y: auto; /* Allow vertical scroll to pass through to page */
        /* Auto scrolling for natural feel */
        scroll-behavior: auto;
    }

    .carousel-track {
        gap: 16px;
        padding-left: 30px;
        padding-right: 30px;
        padding-bottom: 2rem;
    }

    /* Applied Examples Carousel - Mobile */
    .carousel-section-applied {
        overflow: visible;
        /* Ensure carousel sections don't block vertical scrolling - same as first carousel */
        touch-action: pan-y;
        /* Ensure images are fully visible - no clipping */
        padding-top: 0;
    }

    .carousel-section-applied .carousel-container-applied {
        scroll-snap-type: x mandatory; /* Same as first carousel */
        overflow-x: auto;
        overflow-y: visible; /* Allow vertical scrolling when hovering */
        /* Allow both horizontal and vertical scrolling on iOS - same as first carousel */
        touch-action: pan-x pan-y; /* Critical: allows vertical scroll when hovering */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 20px 0;
        padding-bottom: 0;
        /* Improve momentum scrolling on iOS - same as first carousel */
        overscroll-behavior-x: contain;
        overscroll-behavior-y: auto; /* Allow vertical scroll to pass through to page - same as first carousel */
        scroll-behavior: auto; /* Same as first carousel */
        /* Prevent layout shifts */
        contain: layout style;
        /* Stable positioning */
        position: relative;
        will-change: auto;
        /* Prevent scroll anchoring */
        overflow-anchor: none;
        scroll-snap-stop: always; /* Same as first carousel */
    }

    .carousel-section-applied .carousel-container-applied::-webkit-scrollbar {
        display: none;
    }

    .carousel-section-applied .carousel-track-applied {
        display: flex;
        gap: 16px; /* Same gap as first carousel on mobile */
        padding: 0 30px 2rem 30px; /* Same padding structure as first carousel */
        overflow: visible;
    }
    
    /* Add gap after last item on mobile - same as first carousel */
    .carousel-section-applied .carousel-track-applied::after {
        content: '';
        flex-shrink: 0;
        width: 16px; /* Same as gap between items on mobile */
    }

    .carousel-section-applied .carousel-item-applied {
        flex: 0 0 auto;
        width: calc(100vw - 60px); /* Match single column text width: 30px padding on each side */
        max-width: calc(100vw - 60px);
        min-width: calc(100vw - 60px);
        scroll-snap-align: center; /* Same as first carousel */
        scroll-snap-stop: normal; /* Same as first carousel - normal for smooth scrolling */
        transition: none !important; /* No ease-out - instant snap - same as first carousel */
        transform-origin: center; /* Same as first carousel */
        flex-shrink: 0; /* Same as first carousel */
        will-change: transform; /* Same as first carousel - enable for smooth transforms */
        margin: 0; /* Same as first carousel */
        display: flex; /* Same as first carousel */
        flex-direction: column; /* Same as first carousel */
        align-items: flex-start; /* Same as first carousel */
        /* Prevent overlapping on iOS Safari */
        isolation: isolate;
        contain: layout style;
        position: relative;
        z-index: 1;
        overflow: visible;
    }

    .carousel-section-applied .carousel-item-applied + .carousel-item-applied {
        /* Ensure each item has proper spacing */
        margin-left: 0;
    }

    /* Third carousel uses carousel-item-image-container (not -applied) */
    /* Mobile: portrait format (3/4) - same as first carousel */
    .carousel-section-applied .carousel-item-applied .carousel-item-image-container {
        width: 100%;
        aspect-ratio: 3 / 4 !important; /* Portrait format on mobile - same as first carousel */
        border-radius: var(--radius-sm);
        overflow: hidden; /* Changed from visible to hidden to properly clip border-radius */
        margin-bottom: var(--spacing-sm);
        display: block;
        position: relative;
        /* Ensure aspect ratio is enforced */
        height: auto;
        min-height: 0;
        max-height: none;
    }

    .carousel-section-applied .carousel-item-applied .carousel-item-image-container .carousel-item-image {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover; /* Same as first carousel */
        object-position: center;
        border-radius: var(--radius-sm);
        position: relative;
        z-index: 1;
    }

    .carousel-section-applied .carousel-item-applied h3 {
        font-family: var(--font-medium);
        font-size: 18px;
        line-height: 26px;
        margin-bottom: 0.25rem;
        width: 100%;
        padding-left: 18px;
        box-sizing: border-box;
    }

    .carousel-section-applied .carousel-item-applied p {
        font-family: var(--font-primary);
        font-size: 18px;
        line-height: 26px;
        margin-bottom: 0;
        width: 100%;
        opacity: 0.75;
        padding-left: 18px;
        box-sizing: border-box;
    }

    .carousel-item {
        width: calc(100vw - 92px);
        max-width: calc(100vw - 92px);
        min-width: calc(100vw - 92px);
        scroll-snap-align: center;
        scroll-snap-stop: normal; /* Normal for smooth, continuous scrolling */
        /* No transition - let JavaScript handle smooth scaling in real-time */
        transition: none !important;
        transform-origin: center;
        flex-shrink: 0;
        will-change: transform; /* Enable for smooth transforms */
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .carousel-item-image-container {
        width: 100%;
        aspect-ratio: 3 / 4;
        border-radius: var(--radius-sm);
        overflow: hidden;
        margin-bottom: var(--spacing-sm);
        display: block;
        position: relative;
    }

    .carousel-item-image-container-variable {
        width: 100%;
        aspect-ratio: unset;
        height: auto;
        border-radius: var(--radius-sm);
        overflow: visible;
        margin-bottom: var(--spacing-sm);
        display: block;
        position: relative;
    }

    .carousel-item-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        display: block;
        border-radius: var(--radius-sm);
    }

    .carousel-item-image-container-variable .carousel-item-image {
        width: 100%;
        height: auto;
        object-fit: contain;
        object-position: center;
        display: block;
        border-radius: var(--radius-sm);
        backface-visibility: hidden;
        -webkit-backface-visibility: hidden;
    }

    .text-carousel-item {
        width: calc(100vw - 92px);
        max-width: calc(100vw - 92px);
        min-width: calc(100vw - 92px);
        aspect-ratio: 3 / 4;
        height: auto;
        min-height: unset;
        scroll-snap-align: center;
        scroll-snap-stop: normal; /* Normal for smooth, continuous scrolling */
        /* No transition - let JavaScript handle smooth scaling in real-time */
        transition: none !important;
        transform-origin: center;
        flex-shrink: 0;
        will-change: transform; /* Enable for smooth transforms */
        margin: 0;
    }

    /* Hero spacing on mobile */
    .hero {
        padding: clamp(6rem, 12vw, 10rem) 0 88px 0;
    }

    /* Video optimizations on mobile - padding handled above */

    /* Unify vertical gaps on mobile */
    .carousel-section {
        padding: 0 !important;
        padding-bottom: 88px !important;
        padding-top: 0 !important;
        overflow: visible;
    }

    .video-glow-bg {
        width: 150%;
        height: 150%;
    }

    .video-glow-bg video {
        filter: blur(80px);
        opacity: 0.4 !important;
    }

}

/* ============================================
   CLICKABLE VIDEO SECTION
   ============================================ */
.clickable-video-wrapper {
    position: relative;
    width: 75vw;
    max-width: 75vw;
    margin: 0 auto;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    background: transparent;
    outline: none;
    border: none;
    box-sizing: border-box;
    /* Reserve space to prevent jumping */
    min-height: 200px;
    /* Remove any borders or backgrounds */
    box-shadow: none;
    -webkit-box-shadow: none;
    /* Force Safari to respect border-radius and clip content properly */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    /* Enable hardware acceleration for better rendering */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    /* Create a proper clipping context */
    isolation: isolate;
}

/* Break out of overview-content constraint on desktop - center relative to viewport */
.overview-content .clickable-video-wrapper,
.clickable-video-wrapper {
    max-width: 75vw;
    width: 75vw;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

/* Desktop: clickable video scales to 3/4 of browser width - match hero video */
@media (min-width: 751px) {
    /* Ensure clickable video scales to 3/4 browser width on all desktop viewports */
    .clickable-video-wrapper {
        width: 75vw;
        max-width: 75vw;
        margin-left: auto;
        margin-right: auto;
    }
}

.clickable-video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-sm);
    outline: none;
    border: none;
    position: relative;
    z-index: 1;
    /* Show video preview - ensure poster or first frame is visible */
    background: transparent;
    min-height: 200px;
    /* Remove any black borders */
    box-shadow: none;
    -webkit-box-shadow: none;
    /* Ensure video and controls are clipped to rounded corners */
    overflow: hidden;
    /* Force Safari to respect border-radius */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
    /* Ensure proper clipping on Safari mobile */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Glow background effect for clickable video - match hero video exactly */
.clickable-video-glow-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200%;
    height: 200%;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    overflow: visible;
}

.clickable-video-wrapper.playing .clickable-video-glow-bg {
    opacity: 1;
}

.clickable-video-glow-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(120px);
    opacity: 0.5;
    border-radius: 0;
}

.clickable-video-wrapper:focus {
    outline: none;
}

.clickable-video-wrapper video:focus {
    outline: none;
}

/* Black overlay with 4% opacity - removed on click to prevent video bleeding into white background */
.video-overlay-clickable {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.04);
    z-index: 2;
    pointer-events: auto;
    border-radius: var(--radius-sm);
    transition: opacity 0.3s ease;
    display: block;
    box-sizing: border-box;
    /* Ensure overlay matches video corner rounding exactly */
    overflow: hidden;
    /* Match video's exact shape - no scaling or offset */
    transform: none;
    /* Force Safari to respect border-radius */
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    mask-image: radial-gradient(white, black);
}

.video-overlay-clickable.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Video overlay removed - no longer needed */

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
}

.video-play-button:hover {
    opacity: 0.9;
    transform: translate(-50%, -50%) scale(1.1);
}

.video-play-button svg {
    width: 80px;
    height: 80px;
}

.clickable-video-wrapper.playing .video-play-button {
    display: none;
}

@media (max-width: 750px) {
    .video-play-button svg {
        width: 60px;
        height: 60px;
    }

    /* Match text content width on mobile - same as overview-content */
    /* Override section overflow to allow glow to extend */
    section:has(.clickable-video-wrapper) {
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        /* Reserve space for floating video */
        min-height: 50vh;
        position: relative;
    }
    
    .content-section:has(.clickable-video-wrapper) {
        padding-left: 30px !important;
        padding-right: 30px !important;
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        /* Allow glow to extend beyond container */
        clip: none;
        clip-path: none !important;
        /* Reserve space for floating video */
        min-height: 50vh;
        position: relative;
    }

    /* On mobile, position video in normal flow below Reflection section */
    .clickable-video-wrapper {
        position: relative !important;
        width: calc(100vw - 60px) !important;
        max-width: calc(100vw - 60px) !important;
        margin: 40px auto !important;
        padding-left: 0;
        padding-right: 0;
        box-sizing: border-box;
        overflow: hidden !important; /* Keep hidden for proper clipping on Safari */
        z-index: 1;
        /* Force Safari to respect border-radius */
        -webkit-mask-image: -webkit-radial-gradient(white, black);
        mask-image: radial-gradient(white, black);
        /* Enable hardware acceleration */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        isolation: isolate;
    }
    
    .clickable-video-wrapper video {
        /* Force Safari mobile to respect border-radius */
        -webkit-mask-image: -webkit-radial-gradient(white, black);
        mask-image: radial-gradient(white, black);
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    /* Glow effect - can be larger since video floats outside container */
    .clickable-video-glow-bg {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 180%;
        height: 180%;
        z-index: -1;
        pointer-events: none;
        overflow: visible !important;
        /* Break out of all container constraints */
        clip: none;
    }

    .clickable-video-glow-bg video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        filter: blur(120px);
        opacity: 0.5;
        border-radius: 0;
    }
}

/* Extra small viewports (below 560px) - ensure video truly floats and glow is not cut off */
@media (max-width: 560px) {
    /* Ensure main and body also allow overflow */
    main,
    body {
        overflow-x: visible !important;
        overflow-y: visible !important;
    }
    
    /* Ensure video wrapper is in normal flow - no container constraints */
    .clickable-video-wrapper {
        position: relative !important;
        width: calc(100vw - 40px) !important;
        max-width: calc(100vw - 40px) !important;
        margin: 40px auto !important;
        z-index: 1 !important;
        overflow: visible !important;
        clip: none !important;
        clip-path: none !important;
    }
    
    /* Glow effect - minimal size for small viewports to prevent clipping */
    .clickable-video-glow-bg {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 105% !important;
        height: 105% !important;
        z-index: -1 !important;
        overflow: visible !important;
        clip: none !important;
        clip-path: none !important;
        /* Ensure glow extends beyond video wrapper */
        margin: 0;
    }
    
    /* Ensure the video wrapper itself doesn't clip the glow - remove all constraints */
    .overview-content .clickable-video-wrapper {
        overflow: visible !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        /* Remove border-radius clipping */
        border-radius: var(--radius-sm);
        /* Ensure wrapper doesn't create clipping context */
        isolation: auto;
    }
}

/* ============================================
   TABLET RESPONSIVE (768px)
   ============================================ */
@media (max-width: 768px) {
    .overview-content {
        max-width: 565px;
        padding: 0 var(--padding);
    }

    .carousel-section {
        padding: clamp(1.5rem, 4vw, 3rem) 0;
    }

    .carousel-section h2 {
        margin-bottom: 1.5rem;
    }

    .carousel-item {
        width: 500px;
        max-width: 85vw;
    }

    .carousel-item-image {
        margin-bottom: 0.75rem;
    }

    .carousel-item h3 {
        font-size: 18px;
        line-height: 26px;
        margin-bottom: 0.2rem;
        max-width: 75%;
        padding-left: 18px;
    }

    .carousel-item p {
        font-size: 18px;
        line-height: 26px;
        max-width: 75%;
        opacity: 0.75;
        padding-left: 18px;
    }

    .text-carousel-item {
        width: 320px;
        max-width: 85vw;
    }
}

/* ============================================
   MOBILE RESPONSIVE (480px)
   ============================================ */
@media (max-width: 480px) {
    /* Remove content-section padding on mobile for overview */
    .content-section {
        padding: 0 !important;
        padding-bottom: 88px !important;
    }

    .overview-content {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding-left: 30px;
        padding-right: 30px;
        box-sizing: border-box;
    }

    .carousel-section {
        padding: clamp(1.2rem, 3.5vw, 2.5rem) 0;
    }

    .carousel-section h2 {
        margin-bottom: 1.2rem;
    }

    .carousel-item {
        width: 450px;
    }

    .carousel-item-image {
        margin-bottom: 0.6rem;
    }

    .carousel-item h3 {
        font-size: 18px;
        line-height: 26px;
        margin-bottom: 0.3rem;
        padding-left: 18px;
    }

    .carousel-item h3:last-of-type {
        margin-bottom: 0.15rem;
    }

    .carousel-item p {
        font-size: 18px;
        line-height: 26px;
        max-width: 75%;
        opacity: 0.75;
        padding-left: 18px;
    }
}



