/* VARIABLES & RESET */
:root {
    --bg-color: #F9F7F2;
    --text-color: #2C2C2C;
    --accent-pink: #ECCFCF;
    --accent-gold: #C5A028;
    --white: #FFFFFF;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Montserrat', sans-serif;
    --radius-large: 20px;
    --radius-medium: 12px;
    --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 30px 80px rgba(0, 0, 0, 0.1);
    --container-width: 1200px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    font-family: var(--font-serif);
    font-weight: 400;
}

img {
    max-width: 100%;
    display: block;
    border-radius: var(--radius-medium);
}

/* UTILITIES */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    position: relative;
}

.section-padding {
    padding: 160px 0;
}

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

.fade-in-section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
    will-change: opacity, visibility;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
}

.gold-divider {
    width: 80px;
    height: 2px;
    background-color: var(--accent-gold);
    margin: 30px auto;
}

/* HERO SECTION */
header {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    background-color: var(--bg-color);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 10;
    color: #2C2C2C;
    padding: 60px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-large);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
}

.hero-title {
    font-size: 5rem;
    margin-bottom: 20px;
    letter-spacing: -2px;
    animation: fadeUp 1.5s ease-out;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.4rem;
    font-weight: 300;
    max-width: 700px;
    margin: 0 auto;
    letter-spacing: 1px;
    animation: fadeUp 1.5s ease-out 0.3s backwards;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.scroll-indicator {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2.5s infinite;
    opacity: 0.8;
    cursor: pointer;
    z-index: 2;
}

.mouse-icon {
    width: 26px;
    height: 40px;
    border: 2px solid var(--white);
    border-radius: 14px;
    position: relative;
}

.mouse-wheel {
    width: 2px;
    height: 6px;
    background-color: var(--white);
    border-radius: 2px;
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    40% {
        transform: translateX(-50%) translateY(-10px);
    }

    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* NOTE SECTION */
.note-card {
    background: var(--white);
    padding: 80px 100px;
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-soft);
    text-align: center;
    max-width: 900px;
    margin: 60px auto 0;
    position: relative;
    z-index: 10;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 40px;
    color: var(--text-color);
}

.note-text {
    font-size: 1.25rem;
    line-height: 2.1;
    color: #555;
    margin-bottom: 20px;
}

.note-signature {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.4rem;
    margin-top: 40px;
    color: var(--accent-gold);
}

/* GALLERY SECTION */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    grid-gap: 24px;
    grid-auto-flow: dense;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius-medium);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.4s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.8s ease;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

.v-stretch {
    grid-row: span 2;
}

.h-stretch {
    grid-column: span 2;
}

/* MEMORIES SECTION */
.memories-section {
    background-color: #fff;
}

.timeline {
    position: relative;
    max-width: 1000px;
    margin: 80px auto 0;
    padding: 20px 0;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 1px;
    background-color: var(--accent-gold);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -0.5px;
    opacity: 0.2;
}

.memory-item {
    padding: 20px 60px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
    margin-bottom: 80px;
    display: flex;
    flex-direction: column;
}

.memory-item:nth-child(odd) {
    left: 0;
    align-items: flex-end;
    text-align: right;
}

.memory-item:nth-child(even) {
    left: 50%;
    align-items: flex-start;
    text-align: left;
}

.memory-item::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    right: -8px;
    background-color: var(--bg-color);
    border: 2px solid var(--accent-gold);
    top: 25px;
    border-radius: 50%;
    z-index: 1;
    transition: background-color 0.3s ease;
}

.memory-item:nth-child(even)::after {
    left: -8px;
}

.memory-date {
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent-gold);
    margin-bottom: 20px;
    font-weight: 600;
}

.memory-content {
    background-color: var(--bg-color);
    padding: 15px;
    border-radius: var(--radius-medium);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: transform 0.3s ease;
    max-width: 400px;
    width: 100%;
}

.memory-content img {
    border-radius: 8px;
    margin-bottom: 15px;
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: cover;
    object-position: top;
}

.memory-text {
    padding: 0 15px 10px;
    font-size: 1.05rem;
    color: #555;
    line-height: 1.6;
}

/* LOVE GRID */
.love-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 60px;
}

.love-item {
    background: var(--white);
    padding: 40px 30px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.love-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--accent-gold), var(--accent-pink));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.love-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

.love-item:hover::before {
    transform: scaleX(1);
}

.love-icon-bg {
    width: 80px;
    height: 80px;
    background: #fff5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2.5rem;
    transition: transform 0.4s ease;
}

.love-item:hover .love-icon-bg {
    background: #ffebeb;
    transform: scale(1.1) rotate(10deg);
}

.love-item h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #333;
}

.love-text {
    color: #666;
    line-height: 1.6;
}

/* SURPRISE SECTION */
.surprise-section {
    background: linear-gradient(to bottom, #fff 0%, var(--bg-color) 100%);
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.surprise-btn {
    background-color: transparent;
    border: 2px solid var(--text-color);
    color: var(--text-color);
    padding: 20px 50px;
    font-family: var(--font-sans);
    font-size: 1.1rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
    font-weight: 600;
    border-radius: 50px;
}

.surprise-btn:hover {
    border-color: var(--accent-pink);
    background-color: var(--accent-pink);
    color: var(--white);
}

.hidden-message {
    margin: 50px auto 0;
    max-width: 700px;
    text-align: center;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: opacity 1s ease, max-height 1s ease, margin 0.5s ease;
}

.hidden-message.revealed {
    opacity: 1;
    max-height: 600px;
    margin: 60px auto 0;
}

.hidden-text {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    color: var(--text-color);
    font-style: italic;
}

/* FOOTER */
footer {
    padding: 60px 0;
    text-align: center;
    font-size: 0.95rem;
    color: #999;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: #fff;
}

/* AUDIO ANIMATION */
.music-control {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    background: var(--white);
    padding: 15px;
    border-radius: 50%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border: 2px solid var(--accent-gold);
}

.music-control:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.music-icon {
    font-size: 24px;
    animation: spin 4s linear infinite;
    animation-play-state: paused;
}

.music-control.playing .music-icon {
    animation-play-state: running;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* SCROLLING MARQUEE */
.scrolling-grid-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-color);
    z-index: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.scrolling-grid-track {
    display: flex;
    gap: 40px;
    width: max-content;
    animation: scrollMarquee 240s linear infinite;
    margin-bottom: 40px;
    will-change: transform;
}

.scrolling-grid-track:nth-child(even) {
    animation-direction: reverse;
}

.scrolling-grid-track img {
    height: 450px;
    width: auto;
    max-width: none;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s ease;
    filter: grayscale(20%);
}

.scrolling-grid-track img:hover {
    transform: scale(1.05);
    filter: grayscale(0%);
    z-index: 10;
}

@keyframes scrollMarquee {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

/* FLOATING HEARTS */
.heart {
    position: fixed;
    bottom: -50px;
    color: var(--accent-pink);
    font-size: 20px;
    animation: floatUp 8s linear forwards;
    z-index: 0;
    opacity: 0.6;
    pointer-events: none;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.8;
    }

    100% {
        transform: translateY(-110vh) rotate(360deg);
        opacity: 0;
    }
}

/* ANIMATIONS */
.animate-img {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 1s ease, transform 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.animate-img.is-visible {
    opacity: 1;
    transform: scale(1);
}

/* CINEMATIC SECTION */
.cinematic-section {
    background-color: #0a0a0a;
    color: #fff;
    padding: 100px 0;
    position: relative;
}

.cinematic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.edit-card {
    background: #1a1a1a;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #333;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    position: relative;
}

.edit-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.15);
    border-color: var(--accent-gold);
}

.edit-card video {
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16;
    object-fit: contain;
    background: #000;
    display: block;
}

.edit-card .overlay-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.edit-card:hover .overlay-icon {
    opacity: 0;
}

/* MOBILE OPTIMIZATION */
@media (max-width: 768px) {
    .container {
        width: 90%;
    }

    .hero-title {
        font-size: 2.8rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        padding: 0 10px;
    }

    .hero-content {
        padding: 40px 20px;
        width: 95%;
    }

    .note-card {
        margin: 30px auto 0;
        padding: 40px 20px;
        width: 100%;
    }

    .section-title {
        font-size: 2rem;
    }

    .timeline {
        margin: 40px auto 0;
    }

    .timeline::after {
        left: 20px;
    }

    .memory-item {
        width: 100%;
        padding-left: 50px;
        padding-right: 0;
        margin-bottom: 50px;
    }

    .memory-item:nth-child(even),
    .memory-item:nth-child(odd) {
        left: 0;
        text-align: left;
        align-items: flex-start;
    }

    .memory-item::after {
        left: 12px !important;
        right: auto;
    }

    .memory-date {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        margin-bottom: 10px;
        display: inline-block;
        background: var(--accent-gold);
        color: #fff;
        padding: 4px 12px;
        border-radius: 4px;
        font-size: 0.9rem;
        box-shadow: none;
    }

    .memory-content {
        width: 100%;
        max-width: 100%;
    }

    .gallery-grid,
    .cinematic-grid,
    .love-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .cinematic-grid {
        grid-template-columns: repeat(auto-fill, minmax(45%, 1fr));
    }

    .scrolling-grid-track img {
        height: 280px;
        max-width: none;
    }

    .scrolling-grid-track {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .cinematic-grid {
        grid-template-columns: 1fr;
    }
}

.section-padding {
    padding: 100px 0;
}

.container {
    width: 95%;
}

/* MUSIC MODAL */
.music-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.music-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.music-modal-content {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius-medium);
    text-align: center;
    max-width: 90%;
    width: 350px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.music-modal-overlay.show .music-modal-content {
    transform: scale(1);
}

.music-modal-content p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    color: var(--text-color);
}

.music-modal-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.music-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
    font-family: var(--font-sans);
}

.music-btn:hover {
    transform: scale(1.05);
}

.music-btn.yes {
    background: var(--accent-gold);
    color: var(--white);
}

.music-btn.no {
    background: #eee;
    color: #666;
}

/* VISUAL ENHANCEMENTS */
.mouse-sparkle {
    position: absolute;
    background: radial-gradient(circle, #fff 0%, rgba(255, 215, 0, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    box-shadow: 0 0 10px 2px rgba(255, 215, 0, 0.4);
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;
}

/* Ensure 3D context for tilt elements */
.gallery-item,
.memory-content,
.note-card,
.love-item {
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform;
}

/* Enhance Note Text readability during animation */
.note-text span {
    will-change: opacity, transform;
}

/* VISUAL ENHANCEMENTS & COUNTDOWN */

/* Glassmorphism Card */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

/* Custom Cursor */
.cursor-trail {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(197, 160, 40, 0.4);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
    mix-blend-mode: multiply;
}

/* Music Control Enhanced */
.music-control {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border: 2px solid var(--accent-gold);
}

.music-control:hover {
    transform: scale(1.1) rotate(10deg);
}

/* Masonry / Gallery Staggered Animation */
.gallery-item {
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.4s ease;
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

/* Countdown Timer */
#countdown-section {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, #fff5f5 0%, #fff 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.timer-box {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--text-color);
    margin-top: 20px;
    font-weight: 500;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .timer-box {
        font-size: 1.2rem;
    }
}