/* Apple Zoom Story Section - Exact copy from original */

.mb-5 {
    margin-bottom: 3rem;
}

#story {
    margin-bottom: 20vh;
    position: relative;
    z-index: var(--z-content);
}

video {
    position: fixed;
    inset: 0;
    object-fit: cover;
    width: 100%;
    height: 150vh;
    filter: saturate(0.1) brightness(0.5);
    opacity: 0;
    animation: fade-in both linear, fade-out both linear;
    animation-timeline: --section;
    animation-range: entry 10% entry 15%, exit 10% exit 15%;
}

@keyframes fade-in {
    to {
        opacity: 0.2;
    }
}

@keyframes fade-out {
    to {
        opacity: 0;
    }
}

.story-container {
    position: relative;
    display: grid;
    place-items: center;
    view-timeline: --section;
}

.min-height-sm {
    min-height: 75vh !important;
}

.story-container:nth-of-type(1) {
    height: 90vh;
}

.story-container:nth-of-type(2) {
    min-height: 70vh;
}

.story-container:nth-of-type(3) {
    height: 120vh;
}

p span {
    opacity: 0;
    animation: highlight both ease-in-out;
    animation-timeline: view();
}

@keyframes highlight {
    25% {
        opacity: 1;
    }
    100% {
        opacity: 1;
    }
}

/* Individual span timing exactly like original */
span:nth-of-type(1) {
    animation-range: cover 5% cover 35%;
}

p span:nth-of-type(2) {
    animation-range: cover 33% cover 40%;
}

p span:nth-of-type(3) {
    animation-range: cover 38% cover 45%;
}

p span:nth-of-type(4) {
    animation-range: cover 43% cover 50%;
}

p span:nth-of-type(5) {
    animation-range: cover 48% cover 55%;
}

p span:nth-of-type(6) {
    animation-range: cover 53% cover 60%;
}

p span:nth-of-type(7) {
    animation-range: cover 58% cover 65%;
}

p span:nth-of-type(8) {
    animation-range: cover 70% cover 85%;
}

.story-text {
    font-size: clamp(1.625rem, 3vw + 1rem, 2rem);
    letter-spacing: 0;
    line-height: 1.5;
}

/* Ensure all text content inherits proper sizing */
.story-text, .story-text span, .story-text div {
    font-size: clamp(1.625rem, 3vw + 1rem, 2rem);
    letter-spacing: 0;
    line-height: 1.5;
}

.story-content {
    width: 800px;
    max-width: 100vw;
    padding: 0 1rem;
    position: relative;
    z-index: var(--z-content);
    text-align: center;
}

/* Second section styling from original */
.story-content div.story-heading {
    opacity: 0;
    animation: fade-in-simple 1s ease-in-out forwards;
    animation-timeline: view();
}

@keyframes fade-in-simple {
    from { opacity: 0; }
    to { opacity: 1; }
}

.story-content div.story-heading:first-of-type {
    animation-range: cover 45% cover 65%;
}

.story-content:nth-of-type(2) .fade-reveal {
    opacity: 0;
    animation: fade-in-simple 1s ease-in-out forwards;
    animation-timeline: view();
}

.story-content:nth-of-type(2) span.fade-reveal:nth-of-type(1) {
    animation-range: cover 50% cover 60%;
}

.story-content:nth-of-type(2) span.fade-reveal:nth-of-type(2) {
    animation-range: cover 58% cover 73%;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .story-container {
        gap: 5vh;
    }
    
    .story-content {
        width: 100%;
        padding: 0 1.5rem;
    }
    
    .story-content div.story-heading:first-of-type {
        animation-range: cover 40% cover 60%;
    }
    
    .story-content:nth-of-type(2) span.fade-reveal:nth-of-type(1) {
        animation-range: cover 45% cover 65%;
    }
    
    .story-content:nth-of-type(2) span.fade-reveal:nth-of-type(2) {
        animation-range: cover 50% cover 70%;
    }
    
    .story-text {
        font-size: clamp(1.25rem, 5vw, 1.75rem);
        line-height: 1.4;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    p span {
        opacity: 1;
        animation: none;
    }
    
    .story-content div.story-heading {
        opacity: 1;
        animation: none;
    }
    
    .story-content:nth-of-type(2) .fade-reveal {
        opacity: 1;
        animation: none;
    }
    
    video {
        opacity: 0.2;
        animation: none;
    }
}