/* Scroll-scrubbed video backgrounds — cinematic, GSAP-ready */

body {
    background-color: #0b0b0b;
}

.hero-video-container {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    overflow: hidden;
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    pointer-events: none;
}

.scroll-video-canvas {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-filter: brightness(0.85) contrast(1.05);
    filter: brightness(0.85) contrast(1.05);
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.scroll-video-canvas--chocolate {
    opacity: 1;
    z-index: 1;
}

.scroll-video-canvas--walk {
    opacity: 0;
    z-index: 2;
}

.hero-video-container video {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.hero-video__overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background:
        linear-gradient(to right,
            rgba(0, 0, 0, 0.55) 0%,
            rgba(0, 0, 0, 0.18) 45%,
            rgba(0, 0, 0, 0.35) 100%),
        rgba(0, 0, 0, 0.25);
    pointer-events: none;
    z-index: 3;
}

/* Fallback when canvas scrub is unavailable (older browsers / strict mobile) */
.hero-video-fallback .scroll-video-canvas {
    display: none;
}

.hero-video-fallback #chocolate-video {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    z-index: 1;
}

.hero-video-fallback #walk-video {
    display: none;
}

.page-content {
    position: relative;
    z-index: 10;
}

/* ─── Hero: logo left, copy right ─── */
.hero-section {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 5rem 1.5rem 5.5rem;
    font-family: 'Inter', sans-serif;
    isolation: isolate;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 2rem;
    width: 100%;
    max-width: 72rem;
    margin: 0 auto;
}

.hero-brand {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-copy {
    text-align: center;
}

.hero-logo {
    display: block;
    width: auto;
    max-width: min(380px, 88vw);
    max-height: clamp(200px, 38vh, 320px);
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.55));
}

.hero-title {
    margin: 0 0 0.75rem;
    font-size: clamp(1.75rem, 4.5vw, 3.25rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: #fff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.55);
}

.hero-subtitle {
    margin: 0 0 1rem;
    font-size: clamp(0.62rem, 1.6vw, 0.82rem);
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.hero-intro {
    margin: 0 auto 1.75rem;
    max-width: 36rem;
    font-size: clamp(0.875rem, 1.8vw, 1.05rem);
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .hero-inner {
        grid-template-columns: minmax(280px, 1fr) minmax(0, 1fr);
        gap: clamp(2rem, 5vw, 4.5rem);
    }

    .hero-logo {
        max-width: min(520px, 44vw);
        max-height: clamp(320px, 58vh, 480px);
    }

    .hero-brand {
        justify-content: flex-end;
        padding-right: clamp(0.5rem, 2vw, 1.5rem);
    }

    .hero-copy {
        text-align: left;
    }

    .hero-intro {
        margin-left: 0;
        margin-right: 0;
    }

    .hero-actions {
        flex-direction: row;
        justify-content: flex-start;
        gap: 1rem;
    }
}

@media (min-width: 1200px) {
    .hero-logo {
        max-width: min(580px, 40vw);
        max-height: clamp(360px, 62vh, 520px);
    }
}

@media (min-width: 640px) and (max-width: 767px) {
    .hero-actions {
        flex-direction: row;
        gap: 1rem;
    }
}

.hero-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 12rem;
    padding: 0.95rem 2rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
    cursor: pointer;
}

.hero-btn--primary {
    border: none;
    background: #fff;
    color: #0b0b0b;
}

.hero-btn--primary:hover {
    background: #e8e8e8;
    transform: translateY(-1px);
}

.hero-btn--ghost {
    border: 2px solid rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.hero-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.48);
    transform: translateY(-1px);
}

.hero-section .scroll-indicator {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

#scrolly,
.story-section {
    position: relative;
    z-index: 10;
}

@media (max-width: 768px) {
    .hero-section {
        padding-top: 4.5rem;
        padding-bottom: 4.75rem;
    }

    .scroll-indicator {
        font-size: 0.6rem;
        letter-spacing: 0.2em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-video-container {
        will-change: auto;
    }

    .hero-section .hero-brand,
    .hero-section .hero-title,
    .hero-section .hero-subtitle,
    .hero-section .hero-intro,
    .hero-section .hero-actions,
    .hero-section .scroll-indicator {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* ─── iOS-style glass panels (all sections except #team) ─── */

.story-section:not(#team) > .glass-card,
.story-section:not(#team) > .glass-card.story-card {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.07) 0%,
        rgba(255, 255, 255, 0.03) 42%,
        rgba(255, 255, 255, 0.015) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top-color: rgba(255, 255, 255, 0.14);
    border-left-color: rgba(255, 255, 255, 0.12);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
}

.story-section:not(#team) > .glass-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.01) 30%,
        transparent 55%
    );
    pointer-events: none;
    z-index: 0;
}

.story-section:not(#team) > .glass-card > * {
    position: relative;
    z-index: 1;
}

.story-section:not(#team) .story-card {
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

/* Nested iOS glass tiles */
.story-section:not(#team) .core-capability,
.story-section:not(#team) .rounded-2xl.bg-white\/5,
.story-section:not(#team) .creation-card,
.story-section:not(#team) .creation-lab-card,
.story-section:not(#team) .creation-lab-item,
.story-section:not(#team) .review-card,
.story-section:not(#team) .faq-item {
    background: linear-gradient(
        160deg,
        rgba(255, 255, 255, 0.06) 0%,
        rgba(255, 255, 255, 0.025) 100%
    ) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
    backdrop-filter: blur(16px) saturate(130%);
    -webkit-backdrop-filter: blur(16px) saturate(130%);
}

.story-section:not(#team) .core-capability:hover {
    border-color: rgba(255, 255, 255, 0.18) !important;
    box-shadow:
        0 4px 18px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.09) !important;
}

.story-section:not(#team) .creation-card.is-active {
    box-shadow:
        0 6px 22px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.story-section:not(#team) .client-logo {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(14px) saturate(130%);
    -webkit-backdrop-filter: blur(14px) saturate(130%);
    box-shadow:
        0 2px 10px rgba(0, 0, 0, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.story-section:not(#team) .client-logo:hover,
.story-section:not(#team) .client-logo.is-active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.story-section:not(#team) .creation-nav {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.story-section:not(#team) .creation-nav:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.42);
}

.story-section:not(#team) .glass-card input,
.story-section:not(#team) .glass-card textarea,
.story-section:not(#team) .glass-card select {
    background: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.story-section:not(#team) .inline-block.rounded-2xl.bg-white\/10 {
    background: linear-gradient(
        160deg,
        rgba(255, 255, 255, 0.14) 0%,
        rgba(255, 255, 255, 0.06) 100%
    ) !important;
    border-color: rgba(255, 255, 255, 0.26) !important;
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Team section — preserve original glass, untouched */
#team.glass-card,
#team > .glass-card,
#team .glass-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#team > .glass-card::before {
    display: none;
}

@media (max-width: 768px) {
    .story-section:not(#team) > .glass-card,
    .story-section:not(#team) > .glass-card.story-card {
        backdrop-filter: blur(16px) saturate(130%);
        -webkit-backdrop-filter: blur(16px) saturate(130%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .story-section:not(#team) > .glass-card::before {
        display: none;
    }
}

/* Screen-reader-only content for SEO / AEO (crawlable, not visible) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
