:root {
    --primary: #f0c1ca;
    --secondary: #e092a0;
    --accent: #6b4c9a;
    --bg-dark: #0f0c29;
    --bg-light: #fdf5f7;
    --text-dark: #2d3436;
    --text-muted: #636e72;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    overflow: hidden;
    line-height: 1.6;
}

h1,
h2 {
    font-family: 'Playfair Display', serif;
}

/* Background Blobs */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    filter: blur(80px);
}

.blob {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary), var(--secondary));
    opacity: 0.6;
    animation: move 20s infinite alternate;
}

.blob1 {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
    background: var(--primary);
}

.blob2 {
    width: 500px;
    height: 500px;
    bottom: -100px;
    right: -100px;
    background: var(--accent);
}

.blob3 {
    width: 300px;
    height: 300px;
    top: 50%;
    left: 50%;
    background: var(--secondary);
}

@keyframes move {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, 50px) scale(1.1);
    }
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 2rem;
}

.hero .content h1 {
    font-size: 5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, var(--accent), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    animation: fadeIn 2s forwards;
}

.hero .subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    opacity: 0;
    animation: fadeInUp 2s forwards 0.5s;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Common Section Styles */
section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    padding: 4rem 2rem;
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    /* Changed from center to allow scrolling from top */
    align-items: center;
    opacity: 0;
    transition: opacity 0.8s ease, transform 0.8s ease;
    transform: translateY(20px);
    z-index: 10;
    overflow-y: auto;
    /* Allow scrolling within the section */
}

/* Hide scrollbar for sections but keep functionality */
section::-webkit-scrollbar {
    display: none;
}

section {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

section.active {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.nav-btn {
    margin-top: 3rem;
    padding: 1.2rem 2.5rem;
    font-size: 1.1rem;
    background: linear-gradient(45deg, var(--accent), var(--secondary));
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(107, 76, 154, 0.3);
    transition: all 0.3s ease;
    z-index: 20;
}

.nav-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(107, 76, 154, 0.4);
}

.section-title {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent);
    margin: 1rem auto;
}

/* Gallery Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
    padding: 1rem;
    padding-right: 2rem;
}

/* Custom Scrollbar for Grid */
.grid::-webkit-scrollbar {
    width: 6px;
}

.grid::-webkit-scrollbar-track {
    background: var(--glass);
    border-radius: 10px;
}

.grid::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
}

.img-wrapper {
    position: relative;
    padding-top: 100%;
    /* Square */
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.img-wrapper:hover {
    transform: scale(1.05);
}

.img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video Section */
.video-wrapper {
    width: 100%;
    max-width: 500px;
    /* Better for portrait videos like WhatsApp clips */
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.video-wrapper video {
    width: 100%;
    height: auto;
    max-height: 55vh;
    /* Reduced to ensure button fits below */
    display: block;
}

/* Note Section */
.envelope-wrapper {
    perspective: 1000px;
    max-width: 600px;
    margin: 0 auto;
}

.envelope {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    position: relative;
    border: 1px solid #eee;
    min-height: 400px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.5s ease;
}

.card.hidden {
    display: none;
}

.reveal-btn {
    padding: 1.2rem 2.5rem;
    font-size: 1.2rem;
    background: linear-gradient(45deg, var(--accent), var(--secondary));
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(107, 76, 154, 0.3);
    transition: all 0.3s ease;
}

.reveal-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(107, 76, 154, 0.4);
}

.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: #f0c1ca;
    position: absolute;
    z-index: 1000;
    pointer-events: none;
}

.note-greeting {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 2rem;
}

.signature {
    margin: 2rem 0;
    font-style: italic;
    font-family: 'Playfair Display', serif;
}

.small-btn {
    margin: 0.5rem;
    padding: 0.8rem 1.5rem;
    font-size: 0.96rem;
}

.outline-btn {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
    box-shadow: none;
}

.outline-btn:hover {
    background: var(--accent);
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 4rem 2rem;
    border-radius: 30px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow);
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-btn:hover {
    color: var(--accent);
}

.note-content p {
    font-size: 1.1rem;
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    text-align: left;
}



/* Celebration Effects */
.heart {
    position: fixed;
    font-size: 20px;
    color: #ff4d6d;
    pointer-events: none;
    z-index: -1;
    animation: floatUp linear forwards;
}

.sparkle {
    position: fixed;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2000;
    box-shadow: 0 0 10px #fff, 0 0 20px var(--accent);
    animation: sparkleFade 0.8s linear forwards;
}

@keyframes sparkleFade {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
}

#fireworks-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1500;
}

@keyframes scroll {
    0% {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, 20px);
        opacity: 0;
    }
}

/* Full Responsiveness */
@media (max-width: 1024px) {
    .container {
        max-width: 900px;
    }
}

@media (max-width: 768px) {
    section {
        padding: 3rem 1.5rem;
    }

    .hero .content h1 {
        font-size: 3.5rem;
    }

    .section-title {
        font-size: 2.5rem;
        margin-bottom: 2.5rem;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        max-height: 55vh;
    }

    .envelope {
        padding: 2rem;
        min-height: 350px;
    }

    .modal-content {
        padding: 3rem 1.5rem;
        width: 95%;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .hero .content h1 {
        font-size: 2.8rem;
    }

    .hero .subtitle {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .nav-btn {
        padding: 1rem 2rem;
        font-size: 1rem;
        width: 100%;
        max-width: 280px;
    }

    .video-wrapper {
        border-radius: 15px;
    }

    .envelope {
        padding: 1.5rem;
        min-height: 300px;
    }

    .modal-content {
        padding: 2.5rem 1rem;
        border-radius: 20px;
    }

    .note-content p {
        font-size: 1rem;
        line-height: 1.6;
    }

    .signature {
        font-size: 0.9rem;
    }

    .close-btn {
        top: 10px;
        right: 20px;
        font-size: 32px;
    }
}

/* Height-based adjustments for short screens */
@media (max-height: 700px) {
    .section-title {
        margin-bottom: 2rem;
    }

    .grid {
        max-height: 45vh;
    }

    .video-wrapper video {
        max-height: 40vh;
    }

    .nav-btn {
        margin-top: 2rem;
    }
}