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

html,
body {
    width: 100%;
    height: 100%;
    font-family: 'Poppins', sans-serif;
    background: radial-gradient(circle at center, #1a1a1a 0%, #050505 100%);
    color: #ffffff;
    overflow-x: hidden;
}

/* ================= TYPOGRAPHY ================= */
h1,
h2,
h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 500;
}

h1 {
    font-size: 3rem;
    letter-spacing: 1px;
}

h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
}

p {
    font-size: 1rem;
    line-height: 1.6;
    color: #d1d1d1;
}

/* ================= GLOBAL LAYOUT ================= */
section {
    min-height: 100vh;
    padding: 80px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.container {
    max-width: 900px;
    margin: auto;
}

/* ================= ENVELOPE ================= */
#envelope-section {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #111 0%, #000 100%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Envelope Wrapper */
.envelope-wrapper {
    perspective: 1000px;
    position: relative;
}

/* Glow behind envelope */
.envelope-wrapper::before {
    content: "";
    position: absolute;
    width: 400px;
    height: 250px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(40px);
    z-index: -1;
}

/* Envelope Body */
.envelope {
    width: 300px;
    height: 190px;
    position: relative;
    border-radius: 10px;
    cursor: pointer;
    overflow: hidden;

    /* Gradient body */
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d);

    /* Depth */
    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.9),
        inset 0 1px 2px rgba(255, 255, 255, 0.05);

    transform-style: preserve-3d;
}

/* Flap */
.envelope .flap {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;

    /* Realistic gradient */
    background: linear-gradient(145deg, #2a2a2a, #111);

    /* clip-path: polygon(0 0, 100% 0, 50% 60%); */
    clip-path: polygon(0 0, 100% 0, 50% 65%);

    transform-origin: top;
    backface-visibility: hidden;

    /* Subtle edge highlight */
    box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.5);

    z-index: 2;
}

.envelope .flap p {
    padding-top: 2rem;
}

/* Letter Inside */
.envelope .letter {
    position: absolute;
    inset: 0;

    background: linear-gradient(to bottom, #ffffff, #f1f1f1);

    color: #000;
    z-index: 1;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    transform: translateY(40%);

    /* subtle depth */
    box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.1);
}

.envelope .letter h2 {
    font-size: 1.8rem;
}

.envelope .letter p {
    font-size: 0.9rem;
    color: #555;
}

/* ================= MAIN CONTENT ================= */
#main-content {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

/* ================= HERO ================= */
#hero {
    background: linear-gradient(to bottom, #000, #1a1a1a);
    position: relative;
    overflow: hidden;
}

/* Background layer */
.hero-bg {
    position: absolute;
    inset: 0;
    background: url('../assets/images/bg/hero.png') center/cover no-repeat;
    filter: brightness(0.1);
    z-index: 1;
}

/* Content layer */
.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 10px;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.hero-content .date {
    font-size: 1rem;
    color: #aaa;
}

.hero-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(40px);
}

.hero-subtitle,
.date {
    opacity: 0;
    transform: translateY(20px);
}

/* ================= STORY ================= */

.story-line {
    margin-top: 50px;
}

.story-item {
    display: flex;
    align-items: center;
    gap: 40px;
    margin: 60px 0;
}

.story-item.reverse {
    flex-direction: row-reverse;
}

.story-text {
    flex: 1;
    text-align: left;
}

.story-text h3 {
    margin-bottom: 10px;
}

.story-image {
    flex: 1;
}

.story-image img {
    width: 100%;
    border-radius: 12px;
}

/* Mobile */
@media (max-width: 768px) {
    .story-item {
        flex-direction: column;
    }
}

/* ================= GALLERY ================= */

#gallery {
    background: radial-gradient(circle at center, #111, #000);
}

/* Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 15px;
    margin-top: 40px;
}

/* Item */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    cursor: zoom-in;

    transform: translateY(40px);
    opacity: 0;
}

/* Image */
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;

    transition: transform 0.6s ease, filter 0.6s ease;
}

/* Hover effect */
.gallery-item:hover img {
    transform: scale(1.1);
    filter: brightness(0.8);
}

.gallery-item::after {
    content: "View";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;

    color: white;
    font-size: 1rem;
    opacity: 0;
    transition: 0.4s;

    pointer-events: none;
}

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

/* ================= LIGHTBOX ================= */

#lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    pointer-events: none;

    z-index: 9999;
}

#lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
}

/* ================= EVENTS ================= */
#events {
    background: #141414;
}

.event-card {
    background: #1c1c1c;
    padding: 20px;
    margin: 10px 0;
    border-radius: 10px;
}

/* ================= EVENTS TIMELINE ================= */

.timeline {
    margin-top: 50px;
    position: relative;
}

/* Vertical line */
.timeline::before {
    content: "";
    position: absolute;
    left: 50%;
    width: 2px;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-50%);
}

/* Items */
.timeline-item {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
    position: relative;
}

/* Alternate sides */
.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}

/* Date */
.timeline-date {
    width: 45%;
    text-align: right;
    font-size: 1.2rem;
    color: #ddd;
}

.timeline-item:nth-child(even) .timeline-date {
    text-align: left;
}

/* Content Card */
.timeline-content {
    width: 45%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);

    padding: 20px;
    border-radius: 12px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);

    transform: translateY(40px);
    opacity: 0;
}

.timeline-content h3 {
    margin-bottom: 10px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: 50%;
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, 0);
}

.timeline-content iframe {
    width: 100%;
    height: 180px;
    border: none;
    border-radius: 10px;
    margin-top: 10px;

    filter: grayscale(1) contrast(1.2) brightness(0.8);
}

/* ================= RSVP ================= */

#rsvp form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 30px;
}

#rsvp input,
#rsvp select {
    padding: 14px;
    border-radius: 8px;
    border: none;
    outline: none;

    background: rgba(255, 255, 255, 0.08);
    color: white;

    backdrop-filter: blur(10px);
}

#rsvp input::placeholder {
    color: white;
}

#rsvp button {
    padding: 14px;
    border: none;
    border-radius: 8px;

    background: white;
    color: black;
    font-weight: 500;

    cursor: pointer;
    transition: 0.3s;
}

#rsvp button:hover {
    transform: scale(1.05);
}

/* SUCCESS STATE */
#rsvp-success {
    opacity: 0;
    transform: translateY(30px);
    pointer-events: none;
    margin-top: 30px;
}

#rsvp-success h3 {
    font-size: 1.8rem;
}

/* ================= RSVP BUTTON ================= */

.rsvp {
    margin-top: 40px;
    text-align: center;
}

.rsvp p {
    margin-bottom: 30px;
    color: #ccc;
}

.rsvp-p {
    margin-top: 30px;
}

.rsvp-button {
    display: inline-block;
    padding: 14px 28px;
    margin-top: 30px;
    border-radius: 30px;

    background: white;
    color: black;

    font-weight: 500;
    text-decoration: none;

    transition: all 0.3s ease;
}

/* Hover effect */
.rsvp-button:hover {
    transform: scale(1.08);
    background: #f0f0f0;
}

.rsvp-button {
    animation: pulse 2.5s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.3);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(255, 255, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

/* ================= MUSIC TOGGLE ================= */
#music-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #ffffff;
    color: #000;
    padding: 10px 12px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 999;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    section {
        padding: 60px 15px;
    }
}

/* ================= PARALLAX SYSTEM ================= */

.parallax-section {
    position: relative;
    overflow: hidden;
    /* opacity: 0; */
}

.parallax-bg {
    position: absolute;
    inset: 0;

    background-size: cover;
    background-position: center;

    transform: scale(1.2);
    /* prevents edge gaps */
    filter: brightness(0.5);

    z-index: 1;

    will-change: transform;
    transform: translateZ(0);

}

/* Content stays above */
.parallax-section .container,
.parallax-section .hero-content {
    position: relative;
    z-index: 2;
}

#confetti-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.map-wrapper {
    position: relative;
    cursor: pointer;
}

.map-wrapper::after {
    content: "Open in Maps";
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    color: white;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.4);

    opacity: 0;
    transition: 0.3s;
}

.map-wrapper:hover::after {
    opacity: 1;
}