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

body {
    font-family: 'Arial', sans-serif;
    overflow-x: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-hearts {
    margin-bottom: 30px;
    font-size: 3rem;
}

.heart {
    display: inline-block;
    margin: 0 10px;
    animation: heartBeat 1.5s ease-in-out infinite;
}

.heart:nth-child(1) { animation-delay: 0s; }
.heart:nth-child(2) { animation-delay: 0.3s; }
.heart:nth-child(3) { animation-delay: 0.6s; }

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

.loading-title {
    font-size: 2.5rem;
    margin-bottom: 40px;
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.loading-progress {
    width: 300px;
    margin: 0 auto;
}

.loading-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 20px;
}

.loading-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.loading-text {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
    letter-spacing: 1px;
    margin: 0;
}

.container {
    position: relative;
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    width: 0%;
    transition: width 0.1s ease-out; /* Faster transition to match 20 FPS */
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* Video Section */
.video-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    will-change: transform;
    transform: translateZ(0); /* Force hardware acceleration */
    transition: transform 0.3s ease-out; /* Smooth scroll out animation */
    /* Use full screen height to prevent mobile Safari status bar jumping */
    min-height: 100vh;
}

/* Use stable full screen dimensions for mobile Safari */
@supports (height: 100dvh) {
    .video-section {
        height: 100vh; /* Use 100vh for stability - prevents status bar jumping */
        min-height: 100vh; /* Ensure minimum full screen height */
    }
}

/* Mobile Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .video-section {
        height: 100vh; /* Force 100vh on mobile Safari for stability */
        min-height: 100vh;
        /* Prevent zoom and ensure full screen coverage */
        -webkit-user-select: none;
        -webkit-touch-callout: none;
    }
}

/* Video section scroll out animation */
.video-section.scroll-out {
    transform: translateY(-100vh);
}

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.frame-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    will-change: transform;
    transform: translateZ(0); /* Force hardware acceleration */
}

.frame-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.02s ease-out; /* Ultra-fast transition for 20 FPS */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    -khtml-user-select: none;
    will-change: opacity;
    transform: translateZ(0); /* Force hardware acceleration */
}

.frame-container img.visible {
    opacity: 1;
}

.download-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 2px solid white !important;
    color: white !important;
    padding: 10px 20px !important;
    border-radius: 25px !important;
    font-size: 1rem !important;
    margin-top: 15px !important;
    cursor: pointer !important;
    backdrop-filter: blur(10px) !important;
    transition: all 0.3s ease !important;
    display: none !important;
}

.download-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2) !important;
}

.download-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

#loveVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.video-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 2;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.main-title {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 1rem;
    animation: fadeInUp 2s ease-out;
}

.subtitle {
    font-size: 1.5rem;
    opacity: 0.9;
    animation: fadeInUp 2s ease-out 0.5s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Photos Section */
.photos-section {
    position: relative;
    z-index: 2;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    min-height: 100vh;
    padding: 100px 0;
    margin-top: 200vh; /* 2x viewport height - matches scroll area for animation completion */
    opacity: 1; /* Always visible - no fade in needed */
    transform: translateY(0); /* No transform needed */
}

/* Use stable full screen dimensions for photos section */
@supports (height: 100dvh) {
    .photos-section {
        margin-top: 200vh; /* Use 100vh for stability - prevents status bar jumping */
    }
}

/* Mobile Safari specific fixes for photos section */
@supports (-webkit-touch-callout: none) {
    .photos-section {
        margin-top: 200vh; /* Force 100vh on mobile Safari for stability */
    }
}

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

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.date-counter {
    margin-bottom: 80px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 40px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.date-counter h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 300;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.counter {
    font-size: 4.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    font-family: 'Arial', sans-serif;
    letter-spacing: -2px;
}

.start-date {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.photos-gallery h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: white;
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 2rem;
}

.photo-item {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.photo-item:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.photo-placeholder {
    width: 100%;
    height: 300px;
    background: linear-gradient(45deg, #ff9a9e, #fecfef);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Mobile-First Responsive Design */
@media (max-width: 1024px) {
    .main-title {
        font-size: 3rem;
    }
    
    .subtitle {
        font-size: 1.3rem;
    }
    
    .counter {
        font-size: 5rem;
    }
    
    .date-counter h2,
    .photos-gallery h2 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .main-title {
        font-size: 2.2rem;
        line-height: 1.2;
        margin-bottom: 0.8rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
        line-height: 1.4;
    }
    
    .date-counter {
        padding: 30px 20px;
        margin-bottom: 60px;
    }
    
    .counter {
        font-size: 3.5rem;
        margin-bottom: 0.8rem;
        letter-spacing: -1px;
    }
    
    .date-counter h2 {
        font-size: 2rem;
        letter-spacing: 1px;
        margin-bottom: 1.5rem;
    }
    
    .photos-gallery h2 {
        font-size: 2rem;
        letter-spacing: 1px;
        margin-bottom: 1.5rem;
    }
    
    .start-date {
        font-size: 1rem;
    }
    
    .photo-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 1.5rem;
    }
    
    .photo-placeholder {
        height: 250px;
        font-size: 1.2rem;
    }
    
    .photos-section {
        padding: 60px 0;
    }
    
    .content-wrapper {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.8rem;
        margin-bottom: 0.6rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .counter {
        font-size: 2.8rem;
    }
    
    .date-counter h2,
    .photos-gallery h2 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .start-date {
        font-size: 0.9rem;
    }
    
    .photo-placeholder {
        height: 200px;
        font-size: 1rem;
    }
    
    .photos-section {
        padding: 40px 0;
    }
    
    .content-wrapper {
        padding: 0 10px;
    }
    
    .video-overlay {
        padding: 0 20px;
    }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
    .photo-item {
        transform: none;
        transition: transform 0.2s ease;
    }
    
    .photo-item:active {
        transform: scale(0.95);
    }
    
    .photo-item:hover {
        transform: none;
    }
}

/* Mobile scroll optimization */
@media (max-width: 768px) {
    body {
        -webkit-overflow-scrolling: touch;
        overflow-x: hidden;
    }
    
    .video-section {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile */
    }
    
    #loveVideo {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .main-title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .video-overlay {
        top: 40%;
    }
    
    .counter {
        font-size: 2.5rem;
    }
    
    .date-counter h2,
    .photos-gallery h2 {
        font-size: 1.3rem;
    }
}

/* Scroll indicator */
.scroll-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 1rem;
    z-index: 3;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    20% { opacity: 1; transform: translateX(-50%) translateY(0); }
    80% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* Mobile-specific enhancements */
.mobile-device {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.mobile-device .photo-item {
    -webkit-tap-highlight-color: transparent;
}

/* Prevent zoom on double tap for mobile */
@media (max-width: 768px) {
    * {
        touch-action: manipulation;
    }
}
