/* ============================================
   CREA STUDIO — White Minimal
   ============================================ */

/* Geist self-hosted — no third-party request to Google Fonts (GDPR) */
@font-face {
    font-family: 'Geist';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('../fonts/geist-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Geist';
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url('../fonts/geist-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

:root {
    --black: #0a0a0a;
    --white: #ffffff;
    --gray: #999;
    --light: #f5f5f5;
    --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html, body {
    width: 100%;
    font-family: var(--font);
    background: var(--white);
    color: var(--black);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Prevent horizontal overflow without blocking vertical scroll on iOS.
   Using clip instead of hidden — clip doesn't create a new scroll context
   on iOS Safari, so vertical scrolling works normally. */
body {
    overflow-x: clip;
}

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

/* ============================================
   HERO REELS — Vertical videos
   ============================================ */

.hero-reels {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(14px, 1.8vw, 30px);
    z-index: 1;
    pointer-events: none;
    perspective: 1200px;
    height: 70vh;
    max-height: 600px;
}

.hero-reel {
    width: auto;
    height: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 16px;
    overflow: hidden;
    flex: 0 0 auto;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08);
    opacity: 0;
    transform: translateY(60px) scale(0.9);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.3s ease;
    will-change: transform, opacity;
}

.hero-reel.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Staggered vertical offset for visual rhythm */
.hero-reel-2 { margin-top: -30px; }
.hero-reel-3 { margin-top: 20px; }
.hero-reel-4 { margin-top: -15px; }

.hero-reel.visible.hero-reel-2 { transform: translateY(-30px) scale(1); }
.hero-reel.visible.hero-reel-3 { transform: translateY(20px) scale(1); }
.hero-reel.visible.hero-reel-4 { transform: translateY(-15px) scale(1); }

.hero-reel video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Hover glow effect */
@media (hover: hover) {
    .hero-reels { pointer-events: auto; }
    .hero-reel {
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                    box-shadow 0.3s ease;
    }
    .hero-reel:hover {
        box-shadow:
            0 12px 48px rgba(0, 0, 0, 0.2),
            0 0 0 1px rgba(255, 255, 255, 0.1);
        z-index: 2;
    }
}

/* ============================================
   CORNERS — Fixed UI Layer
   ============================================ */
.corner {
    position: fixed;
    z-index: 102;
    display: flex;
    align-items: center;
}

.corner-tl {
    /* fluid: 20px @320 → 32px @1200+ */
    top: clamp(1.25rem, 1.5vw + 0.5rem, 2rem);
    left: clamp(1.25rem, 2vw + 0.5rem, 2.5rem);
}

.corner-tr {
    top: clamp(1.25rem, 1.5vw + 0.5rem, 2rem);
    right: clamp(1.25rem, 2vw + 0.5rem, 2.5rem);
}

.corner-bl {
    position: absolute;
    bottom: clamp(1.25rem, 1.5vw + 0.5rem, 2rem);
    left: clamp(1.25rem, 2vw + 0.5rem, 2.5rem);
    flex-direction: column;
    align-items: flex-start;
}

.corner-br {
    position: absolute;
    bottom: clamp(1.25rem, 1.5vw + 0.5rem, 2rem);
    right: clamp(1.25rem, 2vw + 0.5rem, 2.5rem);
    gap: 16px;
}

/* Logo */
.logo {
    height: 28px;
    width: auto;
    display: block;
}

/* Menu Button */
.menu-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: 1px solid rgba(10,10,10,0.15);
    border-radius: 100px;
    padding: 10px 20px;
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--black);
    cursor: pointer;
    /* Avoid animating 'all' — it includes layout properties (padding, border-width)
       that trigger reflow. Restrict to compositor-friendly properties only. */
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.menu-btn:hover {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

.menu-icon {
    width: 18px;
    height: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-icon span {
    display: block;
    width: 100%;
    height: 1.5px;
    background: currentColor;
    /* 'all' would include layout-triggering props. Only transform changes here. */
    transition: transform 0.3s ease;
    transform-origin: center;
}

.menu-btn.active .menu-icon span:first-child {
    transform: translateY(4px) rotate(45deg);
}

.menu-btn.active .menu-icon span:last-child {
    transform: translateY(-4px) rotate(-45deg);
}

/* Corner Labels */
.corner-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gray);
}

.corner-city {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--black);
    margin-top: 2px;
}

/* Social Links */
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(10,10,10,0.12);
    color: var(--black);
    /* Replace 'all' with only what actually changes on :hover */
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.social-link:hover {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

/* ============================================
   STATS BAR
   ============================================ */
.stats-bar {
    position: absolute;
    bottom: clamp(40px, 6vh, 80px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: clamp(24px, 3.2vw, 64px);
    pointer-events: none;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-number {
    font-family: var(--font);
    font-size: clamp(1rem, 1vw, 1.4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--black);
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray);
    margin-top: 2px;
}

/* ============================================
   HERO TEXT — Centered
   ============================================ */
.hero-text {
    position: absolute;
    top: 6%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
    pointer-events: none;
    width: 100%;
    padding: 0 clamp(16px, 2vw, 40px);
}

.headline {
    font-family: var(--font);
    font-size: clamp(2.5rem, 5.5vw, 6rem);
    white-space: nowrap;
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -0.04em;
    color: var(--black);
}

.headline .line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.1em; /* breathing room for descenders during reveal animation */
}

.headline .word {
    display: block;
    transform: translateY(110%);
    animation: wordReveal 1.2s cubic-bezier(0.77, 0, 0.175, 1) forwards;
}

.headline .line:nth-child(1) .word {
    animation-delay: 0.3s;
}

.headline .line:nth-child(2) .word {
    animation-delay: 0.5s;
}

@keyframes wordReveal {
    to {
        transform: translateY(0);
    }
}

/* ============================================
   FULLSCREEN MENU
   ============================================ */
.fullscreen-menu {
    position: fixed;
    inset: 0;
    z-index: 101;
    background: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(100px, 14vh, 160px) clamp(24px, 4vw, 80px) clamp(40px, 5vh, 60px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    /* will-change managed by JS menuBtn click handler — promoted only while
       the open/close transition is running, not for the entire page lifetime. */
}

.fullscreen-menu.active {
    opacity: 1;
    visibility: visible;
}

.menu-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.menu-link {
    font-family: var(--font);
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--black);
    display: flex;
    align-items: baseline;
    gap: 20px;
    padding: 8px 0;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.5s ease, transform 0.5s ease, color 0.3s ease;
    position: relative;
    /* will-change removed from static state — the menu is hidden most of the time.
       Promoting 5 large text layers unconditionally wastes GPU memory.
       The browser animates opacity+transform fine without pre-promotion at this scale. */
}

/* Apply will-change only while the menu is active — frees GPU memory at rest */
.fullscreen-menu.active .menu-link {
    opacity: 1;
    transform: translateY(0);
    will-change: opacity, transform;
}

.fullscreen-menu.active .menu-link:nth-child(1) { transition-delay: 0.1s; }
.fullscreen-menu.active .menu-link:nth-child(2) { transition-delay: 0.15s; }
.fullscreen-menu.active .menu-link:nth-child(3) { transition-delay: 0.2s; }
.fullscreen-menu.active .menu-link:nth-child(4) { transition-delay: 0.25s; }
.fullscreen-menu.active .menu-link:nth-child(5) { transition-delay: 0.3s; }

.menu-link::before {
    content: attr(data-index);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray);
    letter-spacing: 0.05em;
    min-width: 30px;
}

/* Text slide-up hover effect */
.menu-link-text {
    display: inline-flex;
    flex-direction: column;
    height: 1.1em;
    overflow: hidden;
}

.menu-link-top,
.menu-link-bottom {
    display: block;
    transition: transform 0.45s cubic-bezier(0.77, 0, 0.175, 1);
}

.menu-link:hover .menu-link-top {
    transform: translateY(-100%);
}

.menu-link:hover .menu-link-bottom {
    transform: translateY(-100%);
}

.menu-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50px;
    right: 0;
    height: 1px;
    background: rgba(0,0,0,0.08);
}

/* Menu Footer */
.menu-footer {
    margin-top: auto;
    display: flex;
    align-items: flex-end;
    gap: clamp(24px, 4vw, 80px);
    padding-top: 40px;
    padding-bottom: 60px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

.menu-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-right: auto;
}

.menu-footer-agency {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray);
}

.menu-footer-city {
    font-size: 0.9rem;
    font-weight: 500;
}

.menu-footer-info {
    display: contents;
}

.menu-footer-col {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-label {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray);
}

.menu-footer-col a,
.menu-footer-col span {
    font-size: 0.9rem;
    font-weight: 500;
}

.menu-footer-col a:hover {
    text-decoration: underline;
}

.social-icons {
    display: flex;
    gap: 16px;
    align-items: center;
}

.social-icons a {
    display: flex;
    align-items: center;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.social-icons a:hover {
    opacity: 1;
    text-decoration: none;
}

/* ============================================
   VIRAL CONTENT SECTION
   ============================================ */
.viral-section {
    position: relative;
    z-index: 50;
    background: var(--white);
    padding: clamp(60px, 6vw, 120px) clamp(20px, 4vw, 80px) clamp(60px, 5vw, 100px);
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    overflow: hidden;
    content-visibility: auto;
    contain-intrinsic-size: auto 900px;
}

.viral-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Decorative — watermark */
.viral-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font);
    font-size: clamp(12rem, 22vw, 28rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    color: rgba(10, 10, 10, 0.025);
    pointer-events: none;
    white-space: nowrap;
    z-index: 0;
    user-select: none;
    /* Static decorative text — layout/style/paint containment without size
       (strict includes size, which can collapse elements without explicit dimensions) */
    contain: layout style paint;
}

/* Decorative — gradient blobs
   filter: blur() on animated elements is expensive unless the element has its
   own compositor layer. `will-change: transform` promotes each blob so the blur
   is resolved on the GPU texture once and composited — not re-rasterised every
   frame. Using transform-only keyframes keeps everything on the compositor. */
.viral-blob {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(80px);
    opacity: 0.4;
    will-change: transform;
}

.viral-blob-1 {
    width: clamp(200px, 18vw, 400px);
    height: clamp(200px, 18vw, 400px);
    background: radial-gradient(circle, rgba(63, 169, 245, 0.3) 0%, transparent 70%);
    top: 10%;
    right: -5%;
    animation: blobFloat1 8s ease-in-out infinite;
}

.viral-blob-2 {
    width: clamp(180px, 16vw, 350px);
    height: clamp(180px, 16vw, 350px);
    background: radial-gradient(circle, rgba(63, 169, 245, 0.2) 0%, transparent 70%);
    bottom: 10%;
    left: -5%;
    animation: blobFloat2 10s ease-in-out infinite;
}

@keyframes blobFloat1 {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(-30px, 20px, 0); }
}

@keyframes blobFloat2 {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(20px, -30px, 0); }
}

/* Decorative — vertical lines */
.viral-line {
    position: absolute;
    top: 80px;
    bottom: 80px;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(10,10,10,0.06) 30%, rgba(10,10,10,0.06) 70%, transparent);
    pointer-events: none;
    z-index: 0;
}

.viral-line-left {
    left: 40px;
}

.viral-line-right {
    right: 40px;
}

.viral-header {
    text-align: center;
    margin-bottom: clamp(32px, 3vw, 72px);
    max-width: clamp(320px, 32vw, 600px);
    position: relative;
    z-index: 1;
}

.viral-label {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--gray);
    display: block;
    margin-bottom: 12px;
}

.viral-title {
    font-family: var(--font);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--black);
    margin-bottom: 16px;
}

.viral-subtitle {
    font-size: 1.05rem;
    color: var(--gray);
    font-weight: 400;
}

/* Rocket video — flies across behind cards */
.rocket-video-wrapper {
    position: absolute;
    left: -80px;
    right: -80px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.rocket-video {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rocket-video.playing {
    opacity: 1;
}

/* Showcase — side by side cards */
.viral-showcase {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(20px, 2vw, 40px);
    width: 100%;
    max-width: clamp(500px, 55vw, 1000px);
    position: relative;
    z-index: 1;
}

.viral-card {
    display: flex;
    flex-direction: column;
}

.viral-card-inner {
    position: relative;
    border-radius: clamp(14px, 1.3vw, 24px);
    overflow: hidden;
    border: 1px solid rgba(10,10,10,0.08);
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}


/* removed dark gradient overlay — using pulse dots instead */

.viral-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
    /* will-change removed — the image is inside a card that only transforms on hover.
       Static promotion costs a GPU layer for an element that is rarely animated. */
}

.viral-img-crop {
    margin-top: 0;
}

.viral-img-crop-top {
    margin-top: 0;
}

.viral-card-feed .viral-img {
    margin-top: 0;
}

/* Hand-drawn red circles — SVG overlay on full image */
.viral-circles-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
}

.vc-draw {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
}

/* When section is visible, draw the circles */
.viral-section.visible .vc-draw {
    animation: drawCircle 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.viral-section.visible .vc-delay-1 {
    animation-delay: 0.5s;
}

.viral-section.visible .vc-delay-2 {
    animation-delay: 1s;
}

.viral-section.visible .vc-delay-3 {
    animation-delay: 1.5s;
}

@keyframes drawCircle {
    0% {
        stroke-dashoffset: 100;
        opacity: 0.8;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}


/* (overlay stats removed — using pulse dots) */

/* Client info under card */
.viral-card-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 4px 0;
}

.viral-client-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: contain;
    background: var(--light);
    padding: 4px;
}

.viral-client-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--black);
}

.viral-client-type {
    display: block;
    font-size: 0.72rem;
    color: var(--gray);
}

/* ============================================
   VIRAL EXTRA — Fixed elevated cards below Pro Recco
   ============================================ */
.viral-extra {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(20px, 2vw, 36px);
    width: 100%;
    max-width: clamp(600px, 62vw, 1100px);
    margin-top: clamp(40px, 4vw, 72px);
    position: relative;
    z-index: 1;
}

.viral-extra-card {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Staggered entrance */
.viral-section.visible .viral-extra-card:nth-child(1) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

.viral-section.visible .viral-extra-card:nth-child(2) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.5s;
}

.viral-section.visible .viral-extra-card:nth-child(3) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.7s;
}

.viral-extra-inner {
    position: relative;
    border-radius: clamp(14px, 1.3vw, 24px);
    overflow: hidden;
    background: var(--white);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(10, 10, 10, 0.06);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.viral-extra-inner:hover {
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.18),
        0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-6px);
}

.viral-extra-inner img {
    width: 100%;
    height: auto;
    display: block;
    margin-top: -12%;
}

.viral-extra-handle {
    display: block;
    padding: 12px 4px 0;
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray);
    text-align: center;
}


/* ============================================
   VIDEO GALLERY — Infinite Marquee
   ============================================ */
.gallery-section {
    position: relative;
    z-index: 50;
    background: var(--white);
    padding: clamp(60px, 7vw, 140px) 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    content-visibility: auto;
    contain-intrinsic-size: auto 1000px;
}

.gallery-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-header {
    padding: 0 clamp(24px, 4vw, 80px);
    margin-bottom: clamp(40px, 4vw, 80px);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.gallery-header-left {
    display: flex;
    flex-direction: column;
}

.gallery-number {
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--gray);
    margin-bottom: 20px;
}

.gallery-title {
    font-family: var(--font);
    font-size: clamp(4rem, 8vw, 9rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 0.85;
    color: var(--black);
    white-space: nowrap;
}

.gallery-header-right {
    max-width: 280px;
    padding-bottom: 12px;
}

.gallery-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--gray);
    font-weight: 400;
}

/* Gallery layout */
.gallery-perspective {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

.gallery-row {
    overflow: hidden;
    position: relative;
}

.gallery-track {
    display: flex;
    gap: 20px;
    width: max-content;
    will-change: transform;
    /* Contain paint so hover scale effects on children don't repaint siblings */
    contain: layout style;
    /* Force GPU layer immediately — avoids promotion stutter on first frame */
    transform: translateZ(0);
}

.gallery-row-1 .gallery-track {
    animation: marqueeLeft 120s linear infinite;
}

.gallery-row-2 .gallery-track {
    animation: marqueeRight 115s linear infinite;
}

/* translate3d instead of translateX — explicit 3D hint that keeps the
   animation on the GPU compositing thread, not the main thread. */
@keyframes marqueeLeft {
    0%   { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

@keyframes marqueeRight {
    0%   { transform: translate3d(-50%, 0, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

.gallery-item {
    flex-shrink: 0;
    width: clamp(200px, 20vw, 400px);
    height: clamp(355px, 35.5vw, 710px);
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    background: #111;
    /* Only animate transform — box-shadow triggers paint.
       Shadow is handled via a pseudo-element so it composites separately. */
    transition: transform 0.5s cubic-bezier(0.2, 0, 0, 1);
    cursor: pointer;
    /* will-change is applied only on :hover below — holding it statically on all
       44 items simultaneously creates 44 GPU compositor layers at rest, which
       saturates GPU memory and causes compositor jank on the marquee animation. */
}

/* will-change: transform lives on :hover only — see the second .gallery-item:hover rule below */

/* GPU-compositable hover shadow: two pseudo-elements layered.
   The base shadow sits at full opacity always.
   The hover shadow starts transparent and fades in — only opacity changes,
   which runs entirely on the compositor without triggering a repaint. */
.gallery-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: 2;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    pointer-events: none;
    z-index: 1;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item:hover {
    transform: scale(1.06) translateY(-6px);
    z-index: 10;
    /* Promote only the hovered item, not all 44 simultaneously */
    will-change: transform;
}

/* Fade edges */
.gallery-row::before,
.gallery-row::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 200px;
    z-index: 5;
    pointer-events: none;
}

.gallery-row::before {
    left: 0;
    background: linear-gradient(to right, var(--white), transparent);
}

.gallery-row::after {
    right: 0;
    background: linear-gradient(to left, var(--white), transparent);
}

/* ============================================
   HERO SECTION — lock to viewport
   ============================================ */
.hero-section {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* ============================================
   PARTNER BANNER
   ============================================ */
.partners {
    position: relative;
    z-index: 50;
    background: var(--white);
    padding: 48px 0;
    overflow: hidden;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.partners-track {
    display: flex;
    align-items: center;
    gap: 64px;
    width: max-content;
    animation: partnerScroll 60s linear infinite;
    will-change: transform;
}

.partner-logo {
    height: 70px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    flex-shrink: 0;
}

.partner-logo--dark {
    filter: brightness(0);
}

@keyframes partnerScroll {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

/* ============================================
   BEFORE / AFTER SECTION
   ============================================ */
.ba-section {
    position: relative;
    z-index: 50;
    background: var(--white);
    padding: clamp(40px, 4vw, 120px) clamp(20px, 4vw, 80px);
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    /* Skip rendering when far offscreen — huge perf win */
    content-visibility: auto;
    contain-intrinsic-size: auto 800px;
}

.ba-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.ba-header {
    text-align: center;
    margin-bottom: clamp(32px, 3.5vw, 64px);
}

.ba-label {
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--gray);
    display: block;
    margin-bottom: 12px;
}

.ba-title {
    font-family: var(--font);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--black);
    margin-bottom: 16px;
}

.ba-subtitle {
    font-size: 1.05rem;
    color: var(--gray);
    font-weight: 400;
    max-width: 440px;
    margin: 0 auto;
}

/* Image Comparison Slider */
.ba-compare {
    position: relative;
    width: 100%;
    max-width: clamp(300px, 30vw, 500px);
    aspect-ratio: 9 / 16;
    overflow: hidden;
    border-radius: clamp(14px, 1.5vw, 24px);
    box-shadow: 0 8px 40px rgba(0,0,0,0.1);
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
}

.ba-img {
    position: absolute;
    width: 100%;
    height: calc(100% + 12%);
    top: -6%;
    left: 0;
    object-fit: cover;
    object-position: center 8%;
    display: block;
}

.ba-img-before {
    filter: saturate(0.3) brightness(0.9);
    z-index: 1;
}

.ba-img-after {
    z-index: 2;
    clip-path: inset(0 0 0 50%);
}

/* Drag handle */
.ba-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
    pointer-events: none;
}

.ba-handle-line {
    flex: 1;
    width: 2px;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 0 6px rgba(0,0,0,0.3);
}

.ba-handle-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--white);
    color: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
    pointer-events: auto;
    cursor: col-resize;
}

.ba-compare:hover .ba-handle-circle {
    transform: scale(1.1);
}

/* PRIMA / DOPO labels */
.ba-label-overlay {
    position: absolute;
    top: 16px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 5px 14px;
    border-radius: 100px;
    z-index: 4;
    pointer-events: none;
}

.ba-label-prima {
    left: 16px;
    background: rgba(255,255,255,0.92);
    color: var(--black);
}

.ba-label-dopo {
    right: 16px;
    background: var(--black);
    color: var(--white);
}

/* Results bar */
.ba-results {
    display: flex;
    gap: clamp(20px, 4vw, 80px);
    margin-top: clamp(32px, 3.2vw, 64px);
    padding-top: 48px;
    border-top: 1px solid rgba(0,0,0,0.08);
}

.ba-result-item {
    text-align: center;
}

.ba-result-number {
    display: block;
    font-family: var(--font);
    font-size: clamp(1.4rem, 1.1vw + 0.4rem, 2.2rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #00c853;
    transition: color 0.4s ease;
}

.ba-result-label {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray);
    margin-top: 4px;
    display: block;
}

/* ============================================
   CTA + PHOTO GRID
   ============================================ */
.cta-section {
    position: relative;
    z-index: 50;
    background: var(--white);
    padding: clamp(60px, 8vw, 160px) 0 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    content-visibility: auto;
    contain-intrinsic-size: auto 800px;
}

.cta-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.cta-text {
    text-align: center;
    margin-bottom: clamp(48px, 6vw, 120px);
    padding: 0 clamp(20px, 4vw, 80px);
}

.cta-label {
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--gray);
    display: block;
    margin-bottom: 32px;
}

.cta-headline {
    font-family: var(--font);
    font-size: clamp(3.5rem, 9vw, 10rem);
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 0.9;
    color: var(--black);
    margin-bottom: 48px;
}

.cta-dot {
    color: #3fa9f5;
}

.cta-button {
    display: inline-block;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--white);
    background: #3fa9f5;
    padding: 18px 48px;
    border-radius: 100px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.cta-button:hover {
    background: #2d8fd4;
    transform: scale(1.05);
}

/* Photo gallery — two rows, opposite directions */
.cta-photos {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    width: 100%;
    padding-bottom: 80px;
}

.cta-row {
    overflow: hidden;
}

.cta-track {
    display: flex;
    gap: 12px;
    width: max-content;
    will-change: transform;
    contain: layout style;
    transform: translateZ(0);
}

.cta-row-1 .cta-track {
    animation: ctaLeft 70s linear infinite;
}

.cta-row-2 .cta-track {
    animation: ctaRight 65s linear infinite;
}

@keyframes ctaLeft {
    0%   { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-50%, 0, 0); }
}

@keyframes ctaRight {
    0%   { transform: translate3d(-50%, 0, 0); }
    100% { transform: translate3d(0, 0, 0); }
}

.cta-photo {
    flex-shrink: 0;
    width: clamp(180px, 16vw, 320px);
    height: clamp(135px, 12vw, 240px);
    border-radius: 16px;
    overflow: hidden;
}

.cta-photo-wide {
    width: clamp(240px, 21vw, 420px);
}

.cta-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ============================================
   CTA INFO BAR + FOOTER
   ============================================ */
.cta-info {
    display: flex;
    justify-content: center;
    gap: clamp(40px, 6vw, 140px);
    padding: clamp(40px, 5vh, 80px) clamp(24px, 4vw, 64px);
    border-top: 1px solid rgba(0,0,0,0.08);
    margin-bottom: clamp(20px, 3vh, 40px);
}

.cta-info__label {
    display: block;
    font-size: clamp(0.65rem, 0.5vw, 0.85rem);
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #999;
    margin-bottom: 12px;
}

.cta-info__col p,
.cta-info__col a {
    font-size: clamp(0.82rem, 0.7vw, 1.1rem);
    line-height: 1.8;
    color: #0a0a0a;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.cta-info__col a:hover {
    opacity: 0.6;
}

.cta-footer {
    text-align: center;
    padding: clamp(20px, 3vh, 32px) clamp(24px, 4vw, 64px);
    border-top: 1px solid rgba(0,0,0,0.06);
}

.cta-footer__brand {
    display: block;
    font-size: clamp(0.65rem, 0.5vw, 0.8rem);
    font-weight: 600;
    letter-spacing: 0.12em;
    color: #999;
}

.cta-footer__sub {
    display: block;
    font-size: clamp(0.6rem, 0.45vw, 0.75rem);
    color: #999;
    letter-spacing: 0.08em;
    margin-top: 4px;
    opacity: 0.6;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Laptop — includes Mac screens up to 1599px */
@media (max-width: 1599px) {
    .partner-logo { height: 55px; max-width: 160px; }
    .partners-track { gap: 48px; }

    /* Gallery header — prevent description overlapping MENU */
    .gallery-header-right {
        max-width: 220px;
    }
}

/* Tablet — 768px–1023px */
@media (max-width: 1023px) {
    .headline {
        font-size: clamp(2.5rem, 6vw, 4rem);
        white-space: normal;
        text-align: center;
    }

    .hero-text {
        top: 5%;
    }

    .stats-bar {
        gap: 24px;
    }

    .viral-showcase {
        grid-template-columns: 1fr;
        gap: 32px;
        max-width: 480px;
    }

    .ba-compare {
        max-width: 400px;
    }

    .ba-results {
        flex-wrap: wrap;
        justify-content: center;
    }

    .gallery-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .gallery-header-right {
        max-width: 100%;
    }

    .menu-footer {
        flex-wrap: wrap;
        gap: 16px 24px;
    }

    .menu-footer-info {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    /* Gallery title: prevent overflow on narrow tablets (768px)
       before the mobile breakpoint takes over */
    .gallery-title {
        white-space: normal;
        font-size: clamp(3rem, 8vw, 7rem);
    }
}

/* Mobile — up to 767px */
@media (max-width: 767px) {
    /* corners are now fluid via clamp() — no overrides needed */

    .cta-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 28px;
    }

    .hero-reels {
        gap: 8px;
    }

    .hero-reel {
        width: 70px;
        border-radius: 10px;
    }

    .hero-reel-2 { margin-top: -15px; }
    .hero-reel-3 { margin-top: 10px; }
    .hero-reel-4 { margin-top: -8px; }

    .logo {
        height: 22px;
    }

    .headline {
        font-size: clamp(2.2rem, 10vw, 3.5rem);
        white-space: normal;
        text-align: center;
    }

    .fullscreen-menu {
        padding: 100px 24px 40px;
        overflow-y: auto;
    }

    /* Reduce menu link font-size slightly so long items don't
       overflow the 272px available width at 320px (padding 24px each side). */
    .menu-link {
        font-size: clamp(2rem, 7vw, 3.5rem);
        gap: 12px;
    }

    /* Menu footer: reduce bottom padding, wrap columns on narrow screens */
    .menu-footer {
        padding-bottom: 24px;
        flex-wrap: wrap;
        gap: 20px 16px;
        align-items: flex-start;
    }

    .menu-footer-info {
        display: flex;
        flex-direction: column;
        gap: 16px;
        width: 100%;
    }

    .menu-footer-col span,
    .menu-footer-col a {
        font-size: 0.85rem;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .social-link {
        width: 44px;
        height: 44px;
    }

    .menu-btn {
        min-height: 44px;
        padding: 10px 16px;
    }

    .corner-br {
        gap: 12px;
    }

    .hero-text {
        top: 14%;
    }

    .headline {
        font-size: clamp(1.6rem, 7vw, 2.5rem);
    }

    .corner-bl {
        display: none;
    }

    /* Social icons in hero corner: hide on mobile */
    .corner-br {
        display: none;
    }

    .stats-bar {
        gap: 16px;
        bottom: 20px;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0 16px;
    }

    .stat-label {
        font-size: 0.5rem;
        letter-spacing: 0.06em;
    }

    .stat-number {
        font-size: 1rem;
    }

    /* Comparison slider: full width on mobile */
    .ba-compare {
        max-width: 100%;
        border-radius: 12px;
    }

    .ba-section {
        padding: 60px 16px;
    }

    .ba-header {
        margin-bottom: 24px;
    }

    .ba-title {
        font-size: clamp(2rem, 8vw, 3rem);
    }

    .ba-handle-circle {
        width: 36px;
        height: 36px;
    }

    .ba-label-overlay {
        font-size: 0.55rem;
        padding: 4px 10px;
        top: 10px;
    }

    .ba-label-prima { left: 10px; }
    .ba-label-dopo { right: 10px; }

    /* Results bar: wrap items and constrain to viewport width */
    .ba-results {
        width: 100%;
        max-width: 100%;
        gap: 16px 20px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .ba-result-number {
        font-size: 1.4rem;
    }

    /* Viral showcase: single column, cards centered and capped */
    .viral-showcase {
        max-width: 320px;
        width: 100%;
        grid-template-columns: 1fr;
        gap: 24px;
        margin: 0 auto;
    }

    .viral-card-inner {
        max-height: 420px;
        overflow: hidden;
    }

    /* Hide red circles on mobile — too small to be meaningful */
    .viral-circles-overlay {
        display: none;
    }

    /* Viral header */
    .viral-header {
        max-width: 100%;
        padding: 0 4px;
    }

    .viral-title {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
    }

    .viral-subtitle {
        font-size: 0.9rem;
    }

    .viral-section {
        padding: 60px 16px;
        overflow: hidden;
    }

    /* Rocket video: hide on mobile to save bandwidth */
    .rocket-video-wrapper {
        display: none;
    }

    .viral-blob,
    .viral-line {
        display: none;
    }

    .viral-extra {
        grid-template-columns: 1fr;
        max-width: 320px;
        gap: 24px;
        margin: clamp(32px, 3vw, 60px) auto 0;
    }

    .gallery-section {
        padding: 80px 0 100px;
    }

    .gallery-header {
        padding: 0 24px;
        margin-bottom: 48px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .gallery-header-right {
        max-width: 100%;
    }

    /* Gallery title: allow wrap and scale down for 375px viewport */
    .gallery-title {
        white-space: normal;
        font-size: clamp(3rem, 12vw, 5rem);
    }

    /* Gallery items: reduce from 200px to 160px so they fit naturally on
       narrow screens without overflowing. Maintain 9:16 aspect ratio. */
    .gallery-item {
        width: 160px;
        height: 284px;
        border-radius: 14px;
    }

    /* Reduce edge fade width so items aren't hidden on 320px screens */
    .gallery-row::before,
    .gallery-row::after {
        width: 40px;
    }

    .gallery-perspective {
        gap: 14px;
    }

    /* Partner logos: scale down on narrow screens */
    .partner-logo {
        height: 44px;
        max-width: 120px;
    }

    /* Partners track: tighter gap on mobile */
    .partners-track {
        gap: 36px;
    }

    /* Partners section: reduce vertical padding */
    .partners {
        padding: 32px 0;
    }

    .cta-section {
        padding: 80px 0 0;
    }

    .cta-text {
        padding: 0 20px;
    }

    /* CTA headline: prevent overflow at 375px */
    .cta-headline {
        font-size: clamp(2.5rem, 12vw, 5rem);
        word-break: break-word;
    }

    /* CTA button: minimum 44px touch target */
    .cta-button {
        min-height: 44px;
        padding: 16px 36px;
        font-size: 0.9rem;
    }

    .cta-photo {
        width: 150px;
        height: 112px;
        border-radius: 10px;
    }

    .cta-photo-wide {
        width: 200px;
    }
}

/* Small mobile — 480px */
@media (max-width: 480px) {
    /* Viral section: ensure no horizontal overflow on very narrow phones */
    .viral-showcase {
        grid-template-columns: 1fr;
        padding: 0;
    }

    /* Gallery: slightly narrower items on very small phones */
    .gallery-item {
        width: 140px;
        height: 249px;
    }

    /* CTA photo grid: smaller tiles on very small screens */
    .cta-photo {
        width: 130px;
        height: 97px;
    }

    .cta-photo-wide {
        width: 174px;
    }
}

/* Extra-small — 320px edge cases */
@media (max-width: 375px) {
    /* Stats bar: at 320px, 3 items + 2×20px gaps can crowd.
       Tighten gap further and shrink number font slightly. */
    .stats-bar {
        gap: 12px;
    }

    .stat-number {
        font-size: 0.95rem;
    }

    .stat-label {
        font-size: 0.5rem;
        letter-spacing: 0.04em;
    }

    /* Hero headline: use a tighter font-size floor for 320px so
       "We create content." wraps cleanly without oversized text */
    .headline {
        font-size: clamp(1.9rem, 10vw, 3rem);
    }

    /* Menu links: ensure no overflow on 320px with side padding of 24px */
    .menu-link {
        font-size: clamp(1.8rem, 7vw, 3rem);
    }

    /* Results bar: 5 items at very narrow width — enforce 2-column wrap */
    .ba-results {
        gap: 12px 16px;
    }

    .ba-result-number {
        font-size: 1.2rem;
    }

    /* CTA headline floor at 320px */
    .cta-headline {
        font-size: clamp(2.2rem, 12vw, 4rem);
    }
}

/* ============================================
   ULTRAWIDE — 2200px+
   ============================================ */
@media (min-width: 2200px) {
    /* Hero: headline has a 6rem cap from clamp() which is safe.
       Push the 3D canvas down slightly so it doesn't crowd the headline. */
    .hero-text {
        top: 8%;
    }

    /* Stats bar: numbers look tiny relative to the large viewport.
       Bump font-size floor while keeping the clamp max reasonable. */
    .stat-number {
        font-size: clamp(1.4rem, 1.2vw, 2rem);
    }

    .stat-label {
        font-size: clamp(0.7rem, 0.55vw, 0.9rem);
    }

    /* Gallery section: the huge title can crowd the description at 3440px.
       Widen the right column cap so it has room to breathe. */
    .gallery-header-right {
        max-width: 400px;
    }

    /* Gallery title font is white-space: nowrap — ensure the clamp still
       caps it at a readable size on very wide screens. */
    .gallery-title {
        font-size: clamp(6rem, 7vw, 11rem);
    }

    /* Partner banner: bump height on ultrawide */
    .partner-logo { height: 90px; max-width: 260px; }
    .partners-track { gap: 80px; }

    /* CTA info bar: scale up on ultrawide */
    .cta-info__label { font-size: clamp(0.75rem, 0.5vw, 1rem); }
    .cta-info__col p, .cta-info__col a { font-size: clamp(0.95rem, 0.7vw, 1.25rem); }
    .cta-info .social-icons svg { width: 28px; height: 28px; }
    .cta-info .social-icons { gap: 20px; }
    .cta-footer__brand { font-size: clamp(0.75rem, 0.5vw, 1rem); }
    .cta-footer__sub { font-size: clamp(0.65rem, 0.45vw, 0.9rem); }

    /* Comparison slider: larger on ultrawide */
    .ba-compare {
        max-width: clamp(400px, 35vw, 650px);
    }

    /* Viral section: cards shouldn't exceed a comfortable reading width */
    .viral-showcase {
        max-width: clamp(700px, 50vw, 1100px);
    }

    /* CTA photos: allow slightly larger tiles */
    .cta-photo {
        width: clamp(280px, 20vw, 420px);
        height: clamp(210px, 15vw, 315px);
    }

    .cta-photo-wide {
        width: clamp(380px, 26vw, 560px);
    }

    /* Menu: nav links are already capped at 5.5rem via clamp — no change
       needed. Footer columns benefit from a bit more spacing. */
    .menu-footer {
        padding-top: 56px;
        padding-bottom: 80px;
    }
}
