/* ================================================
   STORYBOOK WEDDINGS - CREATIVE SECTIONS CSS
   Premium artistic effects and interactions
   ================================================ */

/* ========== LOADING SCREEN ========== */
.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-logo {
    display: none;
}

.loading-icon {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    opacity: 0;
    animation: loadingFadeIn 0.6s ease 0.2s forwards;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: visible;
    opacity: 0;
    animation: loadingFadeIn 0.6s ease 0.4s forwards;
    position: relative;
}

.loading-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #B8860B, #DAA520, #FFD700, #DAA520, #B8860B);
    background-size: 200% 100%;
    border-radius: 2px;
    position: relative;
    animation: loadingProgress 2s ease-out forwards, shimmerBar 1s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(218,165,32,0.5), 0 0 20px rgba(218,165,32,0.3);
}

.loading-bar-fill::after {
    content: '';
    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #FFD700;
    border-radius: 50%;
    box-shadow: 0 0 10px #FFD700, 0 0 20px #DAA520, 0 0 30px #B8860B;
    animation: sparkleGlow 0.3s ease-in-out infinite alternate;
}

@keyframes loadingProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

@keyframes shimmerBar {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes sparkleGlow {
    0% { box-shadow: 0 0 5px #FFD700, 0 0 10px #DAA520; transform: translateY(-50%) scale(1); }
    100% { box-shadow: 0 0 15px #FFD700, 0 0 25px #DAA520, 0 0 35px #B8860B; transform: translateY(-50%) scale(1.3); }
}

.loading-spinner {
    display: none;
}

.loading-spinner::before,
.loading-spinner::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
}

.loading-spinner::before {
    border-top-color: var(--color-gold);
    animation: spinnerRotate 1s linear infinite;
}

.loading-spinner::after {
    border-right-color: var(--color-gold-light);
    animation: spinnerRotate 1.5s linear infinite reverse;
}

@keyframes spinnerRotate {
    to { transform: rotate(360deg); }
}

@keyframes loadingFadeIn {
    to { opacity: 1; }
}

.loading-progress {
    display: none;
}

.loading-progress-bar {
    display: none;
}

.loading-progress-fill {
    display: none;
}

.loading-text {
    display: none;
}

/* ========== HERO VIDEO FADE IN ========== */
.hero {
    background: #000000;
}

.hero-bg {
    opacity: 0;
    transition: opacity 1s ease-out;
    background: #000000;
    z-index: 0;
}

.hero-bg.visible {
    opacity: 1;
}

/* Ensure overlay is above the background but below content */
.hero-overlay {
    z-index: 1;
}

.hero-content {
    z-index: 2;
}

/* ========== SHARED CREATIVE STYLES ========== */
.creative-section {
    position: relative;
    overflow: hidden;
    background: #0a0a0a;
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove any gaps between sections */
.creative-section + .creative-section,
.creative-section + section,
section + .creative-section {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Ensure main has no gaps */
main {
    background: #0a0a0a;
    padding: 0 !important;
    margin: 0 !important;
}

main > section,
main > .creative-section {
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Override .section padding for creative sections */
.creative-section.section {
    padding: 0 !important;
}

/* Handle testimonials section after creative content */
.scrub-section + testimonials-section,
.scrub-section + testimonials-section .section,
.scrub-section + testimonials-section .testimonial-section {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

testimonials-section {
    display: block;
    background: #0a0a0a;
    margin: 0 !important;
    padding: 0 !important;
}

testimonials-section .section,
testimonials-section .testimonial-section,
section.testimonial-section {
    margin: 0 !important;
    padding: 4rem 0 !important;
    background: #0a0a0a !important;
}

/* Remove all gaps in main after creative sections */
main > * {
    margin: 0 !important;
}

main > section:not(.creative-section) {
    padding-top: 4rem !important;
}

/* Hero section should flow directly into first creative section */
.hero {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.hero + main {
    margin-top: 0 !important;
}

/* ========================================
   SECTION 1: TAKING YOUR WEDDING TO NEW HEIGHTS
   ======================================== */
.heights-section {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: #0a0a0a;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    z-index: 10;
}

.heights-container {
    display: grid;
    grid-template-columns: 50% 50%;
    width: 100%;
    margin: 0;
    padding: 0;
    align-items: stretch;
}

.heights-text {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 4rem;
    padding-right: 3rem;
    background: #0a0a0a;
    text-align: right;
}

.heights-heading {
    font-family: var(--font-serif);
    font-size: clamp(5rem, 12vw, 11rem);
    font-weight: 400;
    line-height: 1.15;
    color: var(--color-text-light);
    margin: 0;
    overflow: visible;
    padding-bottom: 0.1em;
    padding-right: 0.1em; /* Prevent italic letter cropping */
}

.heights-line {
    display: block;
}

.heights-line .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(30px);
    padding-right: 0.02em; /* Prevent cropping on italic letters */
}

.heights-line .letter.animate {
    animation: letterReveal 0.3s ease forwards;
}

@keyframes letterReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.heights-accent {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-style: italic;
}

.heights-accent .letter {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.heights-imagery {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.heights-bg-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.heights-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transform: scale(1.05);
    transition: transform 0.1s linear;
}

.heights-fg-layer {
    position: absolute;
    top: 40px;
    left: 0;
    right: 0;
    bottom: -40px;
    z-index: 5;
    pointer-events: none;
}

.heights-groom-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.4));
}

/* ========================================
   SECTION 2: EVERY FRAME TELLS A STORY
   Single looping filmstrip image on angle
   ======================================== */
.filmstrip-section {
    min-height: auto;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2rem 0 0 0 !important;
    position: relative;
    overflow: hidden;
    margin: 0 !important;
}

.filmstrip-container {
    position: relative;
    width: 100%;
}

.filmstrip-heading {
    text-align: center;
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 400;
    color: var(--color-text-light);
    margin-bottom: 3rem;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

.filmstrip-heading span {
    display: inline;
}

.filmstrip-heading span:first-child::after {
    content: ' ';
}

.filmstrip-accent {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-style: italic;
}

.filmstrip-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    transform: rotate(-3deg);
    margin: 2rem 0;
}

.filmstrip-track {
    display: flex;
    width: max-content;
    animation: filmstripScroll 30s linear infinite;
}

.filmstrip-track img {
    height: 280px;
    width: auto;
    display: block;
    flex-shrink: 0;
}

/* Duplicate image for seamless loop */
.filmstrip-track img:nth-child(2) {
    /* This is the duplicate for seamless looping */
}

@keyframes filmstripScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Film grain overlay */
.film-grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%' height='100%' filter='url(%23noise)'/%3E%3C/svg%3E");
    z-index: 1;
}

/* ========================================
   SECTION 3: TWO BECOME ONE (3 panel layout)
   ======================================== */
.merge-section {
    min-height: auto;
    background: #0a0a0a;
    position: relative;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.merge-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    margin: 0;
}

.merge-text-top {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 400;
    color: white;
    text-align: center;
    margin: 0;
    padding: 0;
    font-style: italic;
}

.merge-text-bottom {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 400;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin: 0;
    padding: 0;
    font-style: italic;
}

.merge-panels {
    display: flex;
    width: 100%;
    height: 50vh;
    min-height: 400px;
    max-height: 600px;
    gap: 4px;
    overflow: hidden;
}

.merge-panel {
    height: 100%;
    overflow: hidden;
    transition: flex 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.merge-panel video,
.merge-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.merge-left,
.merge-right {
    flex: 1;
}

.merge-center {
    flex: 0;
    overflow: hidden;
}

/* Revealed state - panels make room for center */
.merge-panels.revealed .merge-left,
.merge-panels.revealed .merge-right {
    flex: 0.5;
}

.merge-panels.revealed .merge-center {
    flex: 1;
}

.merge-color-overlay {
    display: none;
}

.merge-warm {
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
}

.merge-cool {
    background: linear-gradient(135deg, #4a90a4 0%, #2c3e50 100%);
}


/* ========================================
   SECTION 4: CAPTURED IN TIME (Video Scrub)
   ======================================== */
.scrub-section {
    height: 100vh; /* Match viewport exactly - no extra scroll space creating gap */
    position: relative;
    background: #0a0a0a;
    margin: 0 !important;
    padding: 0 !important;
}

.scrub-container {
    position: relative;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0a0a0a;
    margin: 0 !important;
    padding: 0 !important;
}

.scrub-text-overlay {
    position: absolute;
    z-index: 10;
    text-align: center;
    pointer-events: none;
}

.scrub-heading {
    font-family: var(--font-serif);
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 400;
    color: white;
    text-shadow: 0 4px 60px rgba(0,0,0,0.9);
    margin: 0;
    line-height: 0.9;
    letter-spacing: -0.02em;
}

.scrub-heading span {
    display: block;
}

.scrub-heading span:first-child {
    font-style: italic;
    transform: rotate(-3deg);
    display: inline-block;
}

.scrub-heading .scrub-accent {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-style: normal;
    font-size: 1.2em;
    transform: rotate(2deg) translateX(10%);
    display: inline-block;
    animation: wildFloat 6s ease-in-out infinite;
}

@keyframes wildFloat {
    0%, 100% { transform: rotate(2deg) translateX(10%); }
    50% { transform: rotate(-1deg) translateX(5%); }
}

.scrub-video-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.scrub-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 991px) {
    .heights-container {
        grid-template-columns: 1fr;
    }
    
    .heights-text {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        transform: none;
        padding: 3rem 2rem;
        background: linear-gradient(to top, rgba(10,10,10,1) 0%, rgba(10,10,10,0.95) 40%, rgba(10,10,10,0.7) 70%, transparent 100%);
        width: 100%;
        z-index: 10;
        text-align: center;
        justify-content: center;
    }
    
    .heights-imagery {
        grid-column: 1;
        min-height: 100vh;
    }
    
    /* Groom overlay - shifted down 200px from background */
    .heights-fg-layer {
        position: absolute;
        top: 200px;
        left: 0;
        right: 0;
        bottom: -200px;
        z-index: 5;
        pointer-events: none;
    }
    
    .heights-groom-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
    
    .merge-panels {
        height: 40vh;
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .heights-section {
        min-height: 80vh;
    }
    
    .heights-heading {
        font-size: clamp(2.5rem, 10vw, 4rem);
        line-height: 1.1;
    }
    
    .heights-text {
        padding: 2rem 1.5rem;
        background: linear-gradient(to top, rgba(10,10,10,1) 0%, rgba(10,10,10,0.98) 50%, rgba(10,10,10,0.8) 75%, transparent 100%);
    }
    
    .heights-imagery {
        min-height: 80vh;
    }
    
    /* Filmstrip mobile */
    .filmstrip-section {
        padding: 1.5rem 0 !important;
    }
    
    .filmstrip-heading {
        font-size: clamp(1.8rem, 7vw, 2.5rem);
        margin-bottom: 1.5rem;
        padding: 0 1rem;
    }
    
    .filmstrip-track img {
        height: 160px;
    }
    
    .filmstrip-wrapper {
        margin: 1rem 0;
    }
    
    /* Merge section mobile - taller panels for more video */
    .merge-section {
        padding: 0 !important;
    }
    
    .merge-text-top,
    .merge-text-bottom {
        font-size: clamp(2rem, 8vw, 3rem);
        padding: 0.5rem 0;
    }
    
    .merge-panels {
        height: 45vh;
        min-height: 300px;
        max-height: 450px;
    }
    
    /* Scrub section mobile */
    .scrub-section {
        height: 70vh;
    }
    
    .scrub-container {
        height: 70vh;
    }
    
    .scrub-heading {
        font-size: clamp(2.5rem, 12vw, 5rem);
    }
    
    .scrub-heading span:first-child {
        transform: rotate(-2deg);
    }
    
    .scrub-heading .scrub-accent {
        font-size: 1.1em;
        transform: rotate(1deg) translateX(5%);
    }
}

@media (max-width: 480px) {
    .heights-heading {
        font-size: clamp(2rem, 12vw, 3rem);
    }
    
    .heights-text {
        padding: 1.5rem 1rem;
    }
    
    .filmstrip-heading {
        font-size: 1.5rem;
    }
    
    .filmstrip-track img {
        height: 120px;
    }
    
    .merge-text-top,
    .merge-text-bottom {
        font-size: 1.8rem;
    }
    
    .merge-panels {
        height: 40vh;
        min-height: 250px;
    }
    
    .scrub-heading {
        font-size: clamp(2rem, 14vw, 3.5rem);
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .heights-line {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .film-grain {
        animation: none;
    }
    
    .heights-particle {
        animation: none;
    }
    
    .scrub-subtext {
        animation: none;
        opacity: 1;
    }
    
    .loading-bar-fill {
        animation: none;
    }
    
    .loading-bar-fill::after {
        animation: none;
    }
}
