* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #020111;
    color: #f8fafc;
    font-family: 'Quicksand', sans-serif;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

.fixed-layers {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

/* Sky Layers */
.sky {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
}

#sky-night {
    background: linear-gradient(to bottom, #020111 0%, #20124d 100%);
    z-index: 1;
}

#sky-sunrise {
    background: linear-gradient(to bottom, #ff7e5f 0%, #feb47b 100%);
    opacity: 0;
    z-index: 2;
}

/* Horizontal Parallax Layers */
.layer {
    position: absolute;
    top: 0;
    left: 0;
    /* Extra width to allow horizontal scrolling */
    width: 200vw; 
    height: 100%;
    background-repeat: repeat-x;
    background-position: left bottom;
    will-change: transform;
}

#stars {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Ccircle cx='50' cy='50' r='1.5' fill='white' opacity='0.8'/%3E%3Ccircle cx='200' cy='150' r='1' fill='white' opacity='0.5'/%3E%3Ccircle cx='300' cy='80' r='2' fill='white' opacity='0.9'/%3E%3Ccircle cx='100' cy='300' r='1.5' fill='white' opacity='0.6'/%3E%3Ccircle cx='350' cy='250' r='1' fill='white' opacity='0.4'/%3E%3C/svg%3E");
    background-size: 400px 400px;
    z-index: 3;
}

/* Ensure background-size matches the SVG viewBox aspect ratio for seamless repeating */
#mountains-bg {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 300' preserveAspectRatio='none'%3E%3Cpath d='M0,300 L0,150 L200,50 L400,200 L600,100 L800,250 L1000,100 L1000,300 Z' fill='%23130c25'/%3E%3C/svg%3E");
    bottom: -10px; height: 60vh; top: auto; z-index: 4;
    background-size: 1000px 100%;
}

#mountains-fg {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 300' preserveAspectRatio='none'%3E%3Cpath d='M0,300 L0,200 L150,100 L350,250 L550,150 L750,280 L1000,150 L1000,300 Z' fill='%230b0514'/%3E%3C/svg%3E");
    bottom: -10px; height: 50vh; top: auto; z-index: 5;
    background-size: 800px 100%;
}

#trees-bg {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 200' preserveAspectRatio='none'%3E%3Cpath d='M0,200 L0,150 L50,100 L100,180 L150,80 L200,160 L250,90 L300,170 L350,70 L400,150 L450,100 L500,190 L550,80 L600,160 L650,90 L700,180 L750,110 L800,190 L850,100 L900,170 L950,90 L1000,150 L1000,200 Z' fill='%2305020a'/%3E%3C/svg%3E");
    bottom: -10px; height: 35vh; top: auto; z-index: 6;
    background-size: 600px 100%;
}

#trees-fg {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 150' preserveAspectRatio='none'%3E%3Cpath d='M0,150 L0,100 L80,20 L160,110 L240,10 L320,120 L400,30 L480,110 L560,20 L640,130 L720,40 L800,110 L880,10 L960,120 L1000,80 L1000,150 Z' fill='%23000000'/%3E%3C/svg%3E");
    bottom: -10px; height: 25vh; top: auto; z-index: 7;
    background-size: 500px 100%;
}

/* Content Sections */
.scroll-sections {
    position: relative;
    z-index: 10;
}

.section {
    height: 120vh; 
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px;
    text-align: center;
}

#sec-1, #sec-6 {
    height: 100vh;
}

.content {
    max-width: 90%;
}

.handwriting {
    font-family: 'Caveat', cursive;
    font-size: 2.8rem;
    line-height: 1.3;
    margin-bottom: 20px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.8);
    opacity: 0;
    transform: translateY(40px);
}

.highlight-main {
    font-size: 4rem;
    color: #fcd34d;
    text-shadow: 0 0 20px rgba(252, 211, 77, 0.6);
}

.highlight {
    font-size: 3.5rem;
    color: #f9a8d4;
    text-shadow: 0 0 20px rgba(249, 168, 212, 0.6);
}

/* Scroll Prompt Animation */
.scroll-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    margin-top: 50px;
}
.prompt-anim {
    animation: fadeInBounce 2s forwards 2s;
}

.mouse-icon {
    width: 30px;
    height: 50px;
    border: 2px solid white;
    border-radius: 20px;
    position: relative;
    margin-bottom: 10px;
}

.wheel {
    width: 4px;
    height: 8px;
    background: white;
    border-radius: 2px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {
    0% { top: 10px; opacity: 1; }
    100% { top: 30px; opacity: 0; }
}
@keyframes fadeInBounce {
    0% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 0.7; transform: translateY(0); }
}

/* --- 3D DOORS --- */
.door-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tap-prompt {
    font-size: 2rem;
    margin-bottom: 30px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.door-container {
    perspective: 1200px;
    width: 320px;
    height: 450px;
    position: relative;
    cursor: pointer;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 4px solid #3d2314;
    background: #000;
}

.door {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background: #5c3a21;
    border: 2px solid #3d2314;
    transition: transform 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    z-index: 10;
    background-image: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(0,0,0,0.2) 100%);
}

.door-panel {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    border: 2px solid #3d2314;
    background: #4a2e15;
}

.door-left {
    left: 0;
    transform-origin: left center;
}

.door-right {
    left: 50%;
    transform-origin: right center;
}

.knob {
    position: absolute;
    top: 50%;
    width: 15px;
    height: 15px;
    background: #fbbf24;
    border-radius: 50%;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

/* --- LOGIN GATE --- */
body.locked {
    overflow: hidden;
}

#login-gate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #020111;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 1.5s ease, visibility 1.5s ease;
}

.login-box {
    text-align: center;
    background: rgba(20, 10, 40, 0.8);
    padding: 40px;
    border-radius: 20px;
    border: 2px solid #f9a8d4;
    box-shadow: 0 0 30px rgba(249, 168, 212, 0.3);
    max-width: 90%;
    transform: translateY(-20px);
}

/* Ensure the handwriting text in the login box is visible */
.login-box .handwriting {
    opacity: 1;
    transform: none;
    margin-bottom: 10px;
}

.login-prompt {
    font-size: 1.2rem;
    margin: 20px 0;
    color: #fdf4ff;
    line-height: 1.5;
}

#love-date {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    border-radius: 10px;
    border: 1px solid #f9a8d4;
    background: #0a0514;
    color: white;
    text-align: center;
    font-family: 'Quicksand', sans-serif;
    outline: none;
    cursor: pointer;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.error-msg {
    color: #ef4444;
    margin-top: 15px;
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: bold;
}

/* --- ENTER OUR STORY BUTTON --- */
#enter-story-btn {
    display: none;
    margin-top: 25px;
    padding: 18px 40px;
    font-family: 'Caveat', cursive;
    font-size: 1.8rem;
    color: #fff;
    background: linear-gradient(135deg, #be185d 0%, #9333ea 50%, #be185d 100%);
    background-size: 200% 200%;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 0 30px rgba(190, 24, 93, 0.5), 0 0 60px rgba(147, 51, 234, 0.3);
    animation: enterBtnGlow 3s ease-in-out infinite, enterBtnGradient 4s ease infinite;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    letter-spacing: 1px;
}

#enter-story-btn:hover,
#enter-story-btn:active {
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(190, 24, 93, 0.7), 0 0 80px rgba(147, 51, 234, 0.5);
}

@keyframes enterBtnGlow {
    0%, 100% { box-shadow: 0 0 30px rgba(190, 24, 93, 0.5), 0 0 60px rgba(147, 51, 234, 0.3); }
    50% { box-shadow: 0 0 50px rgba(190, 24, 93, 0.7), 0 0 100px rgba(147, 51, 234, 0.5); }
}

@keyframes enterBtnGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- MUSIC TOGGLE --- */
.music-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(20, 10, 40, 0.7);
    border: 1px solid rgba(249, 168, 212, 0.4);
    color: #f9a8d4;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.music-toggle:hover {
    background: rgba(40, 20, 60, 0.9);
    border-color: #f9a8d4;
}

.music-toggle.playing .music-icon {
    animation: musicBounce 0.6s ease infinite;
}

.music-toggle.muted {
    opacity: 0.5;
}

@keyframes musicBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* --- STARS ENHANCEMENTS --- */
@keyframes twinkle {
    0% { opacity: 0.2; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

.shooting-star {
    position: absolute;
    width: 150px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 100%);
    border-radius: 50%;
    transform: rotate(-45deg);
    z-index: 2;
    pointer-events: none;
    animation: shoot 1.5s ease-in-out forwards;
}

.shooting-star::before {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 10px white, 0 0 20px white;
    left: 0;
    top: -1px;
}

@keyframes shoot {
    0% { transform: translateX(0) translateY(0) rotate(-45deg); opacity: 1; }
    100% { transform: translateX(-600px) translateY(600px) rotate(-45deg); opacity: 0; }
}

.left-knob { right: 10px; }
.right-knob { left: 10px; }

/* Open State */
.door-container.open .door-left { transform: rotateY(-110deg); }
.door-container.open .door-right { transform: rotateY(110deg); }

/* Inside Content */
.door-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #fdf4ff, #fae8ff);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease 0.5s; /* Fade in after doors start opening */
    z-index: 5;
    padding: 20px;
    text-align: center;
}

.door-container.open .door-content {
    opacity: 1;
}



.final-text {
    font-family: 'Caveat', cursive;
    font-size: 2.8rem;
    color: #be185d;
    margin-bottom: 10px;
    z-index: 2;
}
.final-subtext {
    font-family: 'Quicksand', sans-serif;
    font-size: 1.2rem;
    color: #831843;
    z-index: 2;
}

.heart {
    font-size: 4rem;
    margin-top: 20px;
    z-index: 2;
    animation: beat 1s infinite;
}

@keyframes beat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Global Heart Burst Container */
#heart-burst-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 100;
}

.flying-heart {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
}


/* ============================================== */
/* ========= NEW MEMORY SECTIONS STYLES ========= */
/* ============================================== */

/* --- BASE MEMORY SECTION --- */
.memory-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    background: #020111;
    overflow: hidden;
}

.chapter-section {
    justify-content: flex-start;
    padding-top: 80px;
    padding-bottom: 80px;
}

/* --- CHAPTER HEADERS --- */
.chapter-header {
    margin-bottom: 50px;
    position: relative;
    z-index: 2;
}

.chapter-ornament {
    font-size: 1.8rem;
    margin-bottom: 15px;
    opacity: 0;
    animation: none;
}

.chapter-label {
    display: block;
    font-family: 'Quicksand', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #c4b5fd;
    margin-bottom: 12px;
    opacity: 0;
}

.chapter-title {
    font-family: 'Caveat', cursive;
    font-size: 3rem;
    color: #fcd34d;
    text-shadow: 0 0 30px rgba(252, 211, 77, 0.4);
    margin-bottom: 10px;
    opacity: 0;
    line-height: 1.2;
}

.chapter-date {
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    color: #f9a8d4;
    opacity: 0;
    letter-spacing: 2px;
}

.chapter-subtitle {
    font-family: 'Quicksand', sans-serif;
    font-size: 1rem;
    color: rgba(248, 250, 252, 0.6);
    margin-top: 8px;
    opacity: 0;
    font-style: italic;
}

/* --- TRANSITION SECTION --- */
#sec-transition {
    min-height: 80vh;
    background: linear-gradient(to bottom, transparent 0%, #020111 100%);
}

.transition-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, #020111 50%);
    pointer-events: none;
}

.transition-content {
    position: relative;
    z-index: 2;
}

.transition-text {
    font-family: 'Caveat', cursive;
    font-size: 2.5rem;
    color: #f9a8d4;
    text-shadow: 0 0 20px rgba(249, 168, 212, 0.4);
    opacity: 0;
    transform: none;
}

.scroll-down-arrow {
    margin-top: 40px;
    animation: arrowBounce 2s ease-in-out infinite;
    font-size: 1.5rem;
    opacity: 0.5;
}

@keyframes arrowBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(12px); }
}

/* --- THE BEGINNING SECTION --- */
#sec-beginning {
    min-height: 120vh;
    background: radial-gradient(ellipse at center, #0d0521 0%, #020111 70%);
    overflow: hidden;
}

#firefly-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.beginning-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.beginning-narrative {
    margin-top: 30px;
}

.narrative-line {
    font-family: 'Caveat', cursive;
    font-size: 1.8rem;
    line-height: 1.6;
    margin-bottom: 25px;
    opacity: 0;
    transform: translateY(30px);
    color: rgba(248, 250, 252, 0.8);
}

.narrative-highlight {
    font-size: 2.4rem;
    color: #fcd34d;
    text-shadow: 0 0 30px rgba(252, 211, 77, 0.5);
    margin-top: 40px;
}

/* Message bubbles that fade away */
.message-bubbles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.msg-bubble {
    position: absolute;
    background: rgba(249, 168, 212, 0.1);
    border: 1px solid rgba(249, 168, 212, 0.15);
    border-radius: 18px;
    padding: 12px 20px;
    backdrop-filter: blur(5px);
    animation: bubbleFade var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes bubbleFade {
    0%, 100% { opacity: 0; transform: translateY(0) scale(0.8); }
    30% { opacity: 0.4; transform: translateY(-10px) scale(1); }
    70% { opacity: 0.3; transform: translateY(-20px) scale(1); }
}

/* Heart particles */
.heart-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

.heart-particle {
    position: absolute;
    font-size: 0.8rem;
    opacity: 0;
    animation: particleFloat var(--duration) ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes particleFloat {
    0% { opacity: 0; transform: translateY(0) scale(0); }
    20% { opacity: 0.6; transform: translateY(-30px) scale(1); }
    80% { opacity: 0.3; transform: translateY(-100px) scale(0.8); }
    100% { opacity: 0; transform: translateY(-150px) scale(0.5); }
}

/* --- PHOTO GALLERY (Chapters) --- */
.photo-gallery {
    column-count: 2;
    column-gap: 10px;
    width: 100%;
    max-width: 900px;
    padding: 0 10px;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 10px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.gallery-item:active {
    transform: scale(0.97);
}

.gallery-item img {
    width: 100%;
    display: block;
    border-radius: 12px;
    transition: filter 0.3s ease;
}

.gallery-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to top, rgba(2, 1, 17, 0.4) 0%, transparent 100%);
    border-radius: 0 0 12px 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.gallery-item.visible {
    opacity: 1;
}

/* --- LOVE NOTES (expressing love) --- */
#sec-love-notes {
    background: linear-gradient(to bottom, #020111 0%, #1a0a2e 50%, #020111 100%);
}

.love-notes-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    max-width: 700px;
    padding: 0 15px;
}

.love-note-card {
    width: calc(50% - 10px);
    max-width: 300px;
    background: rgba(30, 15, 50, 0.6);
    border: 1px solid rgba(249, 168, 212, 0.2);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(30px) rotate(var(--rotation));
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.love-note-card:hover,
.love-note-card:active {
    transform: translateY(-5px) rotate(0deg) scale(1.02);
    box-shadow: 0 15px 40px rgba(249, 168, 212, 0.2);
}

.love-note-card.visible {
    opacity: 1;
    transform: translateY(0) rotate(var(--rotation));
}

.love-note-card img {
    width: 100%;
    display: block;
}

.love-note-label {
    padding: 12px 15px;
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    color: #f9a8d4;
    text-align: center;
    border-top: 1px solid rgba(249, 168, 212, 0.15);
}

/* --- POLAROID GALLERY (toons) --- */
#sec-toons {
    background: linear-gradient(to bottom, #020111 0%, #0d1117 50%, #020111 100%);
}

.polaroid-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
    max-width: 800px;
    padding: 0 15px;
}

.polaroid-card {
    background: #f5f0e8;
    padding: 12px 12px 40px 12px;
    border-radius: 4px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0,0,0,0.2);
    width: calc(50% - 15px);
    max-width: 280px;
    transform: rotate(var(--rotation));
    opacity: 0;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
}

.polaroid-card:hover,
.polaroid-card:active {
    transform: rotate(0deg) scale(1.05) translateY(-5px);
    box-shadow: 0 15px 40px rgba(252, 211, 77, 0.2);
}

.polaroid-card.visible {
    opacity: 1;
    transform: rotate(var(--rotation));
}

.polaroid-card img {
    width: 100%;
    display: block;
    border-radius: 2px;
}

.polaroid-caption {
    font-family: 'Caveat', cursive;
    font-size: 1rem;
    color: #4a3728;
    text-align: center;
    margin-top: 10px;
}

/* --- VIDEO GALLERY --- */
#sec-videos {
    background: linear-gradient(to bottom, #020111 0%, #0a0514 50%, #020111 100%);
}

.video-gallery {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
    max-width: 500px;
    padding: 0 15px;
}

.video-card {
    background: rgba(15, 8, 30, 0.8);
    border: 1px solid rgba(196, 181, 253, 0.15);
    border-radius: 16px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: transform 0.3s ease;
}

.video-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.video-card video {
    width: 100%;
    display: block;
    max-height: 70vh;
    object-fit: contain;
    background: #000;
}

.video-card-info {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.video-card-icon {
    font-size: 1.2rem;
}

.video-card-title {
    font-family: 'Caveat', cursive;
    font-size: 1.4rem;
    color: #c4b5fd;
}

/* --- CONTRACT / OUR PROMISE --- */
#sec-contract {
    background: linear-gradient(to bottom, #020111 0%, #1a0e05 50%, #020111 100%);
    min-height: 100vh;
}

.contract-wrapper {
    max-width: 600px;
    width: 100%;
}

.contract-intro {
    font-family: 'Caveat', cursive;
    font-size: 1.6rem;
    color: #d4a574;
    margin-bottom: 40px;
    opacity: 0;
    text-shadow: 0 0 20px rgba(212, 165, 116, 0.3);
}

.parchment {
    background: linear-gradient(135deg, #f5e6d0 0%, #e8d5b8 30%, #f0dfc5 60%, #dcc9a8 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 
        0 0 40px rgba(212, 165, 116, 0.3),
        inset 0 0 30px rgba(139, 100, 60, 0.15);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.95);
}

.parchment::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(139, 100, 60, 0.1) 0%, transparent 70%),
        radial-gradient(ellipse at 80% 20%, rgba(139, 100, 60, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.parchment.visible {
    opacity: 1;
    transform: scale(1);
}

.parchment-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.parchment-content img {
    width: 100%;
    border-radius: 8px;
    display: block;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* --- FINAL LETTER --- */
#sec-letter {
    background: linear-gradient(to bottom, #020111 0%, #0d0521 30%, #0d0521 70%, #020111 100%);
    padding: 80px 20px;
}

.letter-wrapper {
    max-width: 600px;
    width: 100%;
}

.letter-title {
    margin-bottom: 40px;
}

.letter-paper {
    background: rgba(15, 8, 30, 0.5);
    border: 1px solid rgba(249, 168, 212, 0.15);
    border-radius: 20px;
    padding: 35px 25px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: left;
}

.letter-content {
    position: relative;
}

.letter-line {
    font-family: 'Caveat', cursive;
    font-size: 1.5rem;
    line-height: 1.6;
    color: rgba(248, 250, 252, 0.85);
    margin-bottom: 20px;
    opacity: 0;
    transform: translateY(20px);
}

.letter-line:first-child {
    font-size: 1.8rem;
    color: #fcd34d;
    margin-bottom: 25px;
}

.letter-closing {
    font-size: 2rem;
    color: #f9a8d4;
    text-align: center;
    margin-top: 30px;
    margin-bottom: 0;
    text-shadow: 0 0 20px rgba(249, 168, 212, 0.4);
}

.letter-line.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- ENDING SECTION --- */
#sec-ending {
    min-height: 100vh;
    background: #020111;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ending-content {
    text-align: center;
    max-width: 500px;
}

.ending-text {
    font-family: 'Caveat', cursive;
    font-size: 2rem;
    color: rgba(248, 250, 252, 0.7);
    opacity: 0;
    transform: translateY(20px);
    line-height: 1.4;
}

.ending-final {
    font-size: 2.5rem;
    color: #fcd34d;
    text-shadow: 0 0 30px rgba(252, 211, 77, 0.4);
    margin-top: 50px;
}

/* --- LIGHTBOX --- */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.lightbox-close:hover {
    opacity: 1;
}

/* --- RESPONSIVE --- */
@media (min-width: 768px) {
    .photo-gallery {
        column-count: 3;
        column-gap: 15px;
    }

    .chapter-title {
        font-size: 4rem;
    }

    .love-note-card {
        width: calc(50% - 15px);
    }

    .polaroid-card {
        width: calc(33% - 20px);
    }

    .video-gallery {
        max-width: 600px;
    }

    .letter-paper {
        padding: 50px 40px;
    }

    .letter-line {
        font-size: 1.7rem;
    }

    .narrative-line {
        font-size: 2.2rem;
    }
}

@media (min-width: 1024px) {
    .photo-gallery {
        column-count: 4;
    }

    .polaroid-card {
        width: calc(25% - 20px);
    }
}

/* --- SECTION DIVIDER --- */
.section-divider {
    width: 50px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #c4b5fd, transparent);
    margin: 0 auto 30px;
}

/* --- UTILITY ANIMATIONS --- */
@keyframes gentlePulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes slowFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
