:root {
    --bg-color: #0a0e1a;
    --bg-card: #111b33;
    --text-color: #ffffff;
    --text-muted: #d4cfe0;
    --accent-gold: #c9a84c;
    --accent-gold-light: #e8d5a3;
    --accent-wine: #8b2252;
    --accent-wine-light: #b03070;
    --accent-wine-dark: #5e1538;
    --white: #ffffff;
    --navy: #1a2342;
    --navy-light: #243054;
    --envelope-color: #1a2342;
    --font-script: 'Great Vibes', cursive;
    --font-serif: 'Cormorant Garamond', serif;
}

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

html { scroll-behavior: smooth; }

body {
    background: linear-gradient(135deg, #0b1121 0%, #131d3a 50%, #0f1628 100%);
    color: var(--text-color);
    font-family: var(--font-serif);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* ===== ENVELOPE / LETTER CARD ===== */
.envelope-wrapper {
    position: relative;
    width: 100vw; height: 100vh;
    display: flex; justify-content: center; align-items: center;
    perspective: 1200px;
    z-index: 100;
    background: radial-gradient(ellipse at center, #131d3a 0%, #0a0e1a 70%);
}

.envelope {
    position: relative;
    width: 550px; height: 380px;
    background: linear-gradient(160deg, #1a2744, #152040, #1a2744);
    box-shadow:
        0 25px 80px rgba(0,0,0,0.6),
        0 0 60px rgba(201,168,76,0.08),
        inset 0 1px 0 rgba(201,168,76,0.1);
    transition: all 1.5s ease-in-out;
    transform-style: preserve-3d;
    z-index: 50;
    display: flex; justify-content: center; align-items: center;
    border: 2px solid rgba(201,168,76,0.25);
    border-radius: 4px;
}

/* Inner content of the envelope card */
.envelope-inner {
    position: relative; z-index: 45;
    text-align: center;
    padding: 30px;
}
.envelope-border {
    position: absolute; inset: 12px;
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 2px;
    pointer-events: none;
}
.envelope-header {
    font-family: var(--font-serif);
    font-size: 0.75rem; letter-spacing: 5px;
    text-transform: uppercase;
    color: var(--accent-gold-light);
    margin-bottom: 15px; opacity: 0.7;
}
.envelope-names {
    font-family: var(--font-script);
    font-size: 2.8rem;
    color: var(--accent-gold);
    text-shadow: 0 0 20px rgba(201,168,76,0.2);
    margin-bottom: 8px; line-height: 1.2;
}
.envelope-date {
    font-family: var(--font-serif);
    font-size: 0.85rem; letter-spacing: 3px;
    color: var(--accent-gold-light);
    opacity: 0.6;
}

/* Wax seal - now using real image */
.wax-seal {
    width: 130px; height: 130px;
    position: absolute; bottom: -40px; left: 50%;
    transform: translateX(-50%);
    z-index: 100; cursor: pointer;
    border-radius: 50%;
    object-fit: contain;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.5)) drop-shadow(0 0 20px rgba(201,168,76,0.3));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease;
    animation: sealGlow 2.5s ease-in-out infinite;
}

@keyframes sealGlow {
    0%, 100% { filter: drop-shadow(0 5px 15px rgba(0,0,0,0.5)) drop-shadow(0 0 20px rgba(201,168,76,0.3)); }
    50% { filter: drop-shadow(0 5px 15px rgba(0,0,0,0.5)) drop-shadow(0 0 35px rgba(201,168,76,0.6)); }
}

.wax-seal:hover { transform: translateX(-50%) scale(1.08); }

.seal-label {
    position: absolute; bottom: -75px; left: 50%;
    transform: translateX(-50%);
    color: var(--accent-gold-light);
    font-size: 0.8rem; letter-spacing: 3px;
    text-transform: uppercase;
    z-index: 101;
    animation: bounceLabel 2s ease-in-out infinite;
    font-family: var(--font-serif);
    opacity: 0.7; white-space: nowrap;
}
@keyframes bounceLabel {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-4px); }
}

.flap {
    position: absolute; top: 0; left: 0;
    width: 0; height: 0;
    border-left: 275px solid transparent;
    border-right: 275px solid transparent;
    border-top: 190px solid #1a2744;
    transform-origin: top;
    transition: transform 1s ease 0.5s, opacity 0.8s ease 0.5s;
    z-index: 60;
    display: none;
}

.pocket {
    position: absolute; bottom: 0; left: 0;
    width: 0; height: 0;
    border-left: 275px solid transparent;
    border-right: 275px solid transparent;
    border-bottom: 190px solid var(--envelope-color);
    z-index: 55;
    display: none;
}

/* ===== INVITATION CONTENT ===== */
.invitation-content {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: flex-start;
    overflow-y: auto;
    opacity: 0;
    transform: scale(0.8) translateY(50px);
    transition: all 1s ease 1s;
    z-index: 40;
    pointer-events: none;
}

.invitation-content::-webkit-scrollbar { width: 6px; }
.invitation-content::-webkit-scrollbar-track { background: var(--bg-color); }
.invitation-content::-webkit-scrollbar-thumb { background: var(--accent-gold); border-radius: 3px; }

/* OPEN STATES */
.envelope-wrapper.open .envelope {
    transform: scale(0.8) translateY(-60px);
    opacity: 0;
    pointer-events: none;
}
.envelope-wrapper.open .wax-seal { opacity: 0; transform: translateX(-50%) scale(0.5); }
.envelope-wrapper.open .seal-label { opacity: 0; }
.envelope-wrapper.open .envelope-inner { opacity: 0; }

.envelope-wrapper.open ~ .invitation-content {
    opacity: 1; transform: scale(1) translateY(0);
    pointer-events: auto; z-index: 200;
    position: fixed;
    background: linear-gradient(180deg, #0b1121 0%, #111b33 100%);
    height: 100vh; padding: 0;
}

.envelope-wrapper.open ~ .invitation-content .invitation-container {
    margin: 0 auto 50px auto;
    opacity: 0;
    animation: fadeInUp 1s ease forwards 1.2s;
}

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

/* ===== INVITATION CONTAINER ===== */
.invitation-container {
    background: linear-gradient(180deg, #111b33 0%, #0e1628 50%, #111b33 100%);
    width: 100%; max-width: 700px;
    padding: 50px 50px 60px;
    text-align: center;
    position: relative;
    margin: 0 auto;
    overflow: hidden;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, .signature-names { font-family: var(--font-script); font-weight: 400; color: var(--accent-gold); }
p { font-size: 1.2rem; line-height: 1.7; margin-bottom: 20px; letter-spacing: 0.5px; color: var(--white); }

.section-title {
    font-family: var(--font-script);
    font-size: 2.5rem;
    color: var(--accent-gold);
    margin-bottom: 25px; margin-top: 0;
    font-weight: 400;
}

/* ===== DECORATIVE DIVIDER ===== */
.divider {
    width: 200px; height: 2px; margin: 40px auto;
    background: linear-gradient(90deg, transparent, var(--accent-wine), var(--accent-gold), var(--accent-wine), transparent);
    position: relative;
}
.divider::after {
    content: '◆'; position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: var(--accent-wine); font-size: 0.7rem;
    background: var(--bg-card); padding: 0 10px;
}

/* ===== HEADER ===== */
.intro-text {
    font-family: var(--font-script);
    font-size: 1.6rem; margin: 60px auto 20px auto;
    color: var(--accent-gold-light);
    line-height: 1.5; max-width: 85%;
    position: relative; z-index: 2;
}

.sub-intro {
    text-transform: uppercase;
    letter-spacing: 4px; font-size: 0.8rem;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--accent-wine);
    display: inline-block; padding-bottom: 12px;
    color: var(--white);
}

/* ===== NAMES ===== */
.names-section { margin-bottom: 40px; }

.names {
    font-size: 3.8rem; line-height: 1.2;
    margin: 20px 0;
    color: var(--accent-gold);
    text-shadow: 0 0 30px rgba(201,168,76,0.3);
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-light) 50%, var(--accent-gold) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 4s ease-in-out infinite;
}
@keyframes shimmer {
    0%, 100% { background-position: 0% center; }
    50% { background-position: 200% center; }
}

.ampersand {
    font-size: 2.5rem; color: var(--accent-wine);
    display: block; margin: 15px 0;
    font-family: var(--font-serif); font-style: italic;
    text-shadow: 0 0 20px rgba(139,34,82,0.4);
}

.full-names {
    font-size: 1rem; letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--white); margin-top: 10px;
    opacity: 0.85;
}

/* ===== HERO PHOTO ===== */
.hero-photo {
    width: 250px; height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent-gold);
    box-shadow: 0 0 0 6px var(--accent-wine), 0 0 30px rgba(139,34,82,0.3), 0 0 60px rgba(201,168,76,0.15);
    margin: 30px auto; display: block;
}

/* ===== PARENTS ===== */
.parents-section { margin: 40px 0; }
.parents-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 30px; margin-top: 20px;
}
.parent-side {
    background: linear-gradient(145deg, rgba(139,34,82,0.08), rgba(26,35,66,0.5));
    border: 1px solid rgba(139,34,82,0.25);
    border-radius: 12px; padding: 20px;
}
.parent-side h3 {
    font-family: var(--font-script);
    font-size: 1.4rem; color: var(--accent-wine);
    margin-bottom: 10px;
}
.parent-side p {
    font-size: 1rem; color: var(--white);
    margin-bottom: 5px; line-height: 1.5;
}

/* ===== DETAILS ===== */
.date-time {
    font-size: 1.3rem; margin: 40px auto;
    padding: 25px 15px;
    border-top: 2px solid var(--accent-wine);
    border-bottom: 2px solid var(--accent-wine);
    background: rgba(139,34,82,0.06);
    border-radius: 8px;
    display: flex; justify-content: center; align-items: center;
    gap: 30px; width: 85%; color: var(--white);
}

.dt-item { display: flex; align-items: center; gap: 8px; }
.icon { font-size: 1.2rem; opacity: 0.8; }

.venue {
    font-family: var(--font-script);
    font-size: 1.8rem !important; color: var(--accent-gold) !important;
    margin-bottom: 5px !important;
}

.address { font-size: 1rem; color: var(--white); margin-bottom: 15px; opacity: 0.8; }

.btn-maps {
    display: inline-block; text-decoration: none;
    color: var(--accent-gold); border: 1px solid var(--accent-gold);
    padding: 10px 25px; border-radius: 25px;
    font-size: 0.85rem; letter-spacing: 1px;
    transition: all 0.4s ease;
    text-transform: uppercase;
}
.btn-maps:hover { background: var(--accent-gold); color: var(--bg-color); }

/* ===== COUNTDOWN ===== */
.countdown-section { margin: 50px 0; }
.countdown {
    display: flex; justify-content: center; gap: 20px;
    margin-top: 25px; flex-wrap: wrap;
}
.countdown-item {
    background: linear-gradient(145deg, var(--navy), var(--navy-light));
    border: 1px solid var(--accent-wine);
    border-top: 3px solid var(--accent-gold);
    border-radius: 12px; padding: 20px 15px;
    min-width: 80px; text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3), 0 0 15px rgba(139,34,82,0.1);
}
.countdown-number {
    font-family: var(--font-script);
    font-size: 2.5rem; color: var(--accent-gold);
    display: block; line-height: 1;
    font-variant-numeric: tabular-nums;
}
.countdown-label {
    font-size: 0.7rem; text-transform: uppercase;
    letter-spacing: 2px; color: var(--white);
    margin-top: 8px; display: block;
    opacity: 0.7;
}

/* ===== ITINERARY ===== */
.itinerary-section { margin: 50px 0; }
.timeline {
    text-align: left; max-width: 320px;
    margin: 30px auto;
    border-left: 3px solid var(--accent-wine);
    padding-left: 25px;
}
.timeline-item { margin-bottom: 30px; position: relative; }
.timeline-item::before {
    content: ''; position: absolute;
    left: -33px; top: 5px;
    width: 14px; height: 14px;
    background: var(--accent-wine);
    border-radius: 50%;
    border: 3px solid var(--accent-gold);
    box-shadow: 0 0 0 2px var(--accent-wine-dark), 0 0 12px rgba(139,34,82,0.4);
}
.timeline .time {
    display: block; font-weight: 600;
    color: var(--accent-gold); font-size: 1.1rem;
    margin-bottom: 5px;
}
.timeline .event { color: var(--white); font-style: italic; font-size: 1rem; opacity: 0.85; }

/* ===== DRESS CODE ===== */
.dress-code { margin: 50px 0; }
.code-type {
    text-transform: uppercase; letter-spacing: 3px;
    margin-bottom: 25px; font-weight: 600;
    color: var(--accent-gold-light); font-size: 0.9rem;
}
.dress-icons { display: flex; justify-content: center; gap: 50px; flex-wrap: wrap; margin-bottom: 20px; }
.dress-item { text-align: center; }
.dress-item .dress-icon-img { font-size: 3rem; margin-bottom: 10px; display: block; }
.dress-label { font-weight: bold; margin-bottom: 5px; color: var(--accent-gold); font-size: 1.1rem; }
.dress-desc { font-size: 0.95rem; color: var(--text-muted); line-height: 1.4; }

.color-restriction {
    display: inline-block; margin-top: 15px;
    background: rgba(139,34,82,0.2);
    border: 1px solid var(--accent-wine);
    padding: 12px 28px; border-radius: 20px;
    font-size: 0.85rem; color: var(--white);
    font-weight: 600;
}
.color-dots { display: flex; gap: 10px; justify-content: center; margin-top: 15px; }
.color-dot {
    width: 30px; height: 30px; border-radius: 50%;
    border: 2px solid rgba(201,168,76,0.3);
}

/* ===== GALLERY ===== */
.gallery-section { margin: 50px 0; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px; margin-top: 25px;
}
.gallery-item {
    width: 100%; aspect-ratio: 1;
    object-fit: cover; border-radius: 8px;
    border: 2px solid rgba(139,34,82,0.3);
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    cursor: pointer;
}
.gallery-item:hover {
    transform: scale(1.05);
    border-color: var(--accent-gold);
    box-shadow: 0 8px 25px rgba(201,168,76,0.3), 0 0 15px rgba(139,34,82,0.2);
    z-index: 2;
}
.gallery-item.featured {
    grid-column: span 2; grid-row: span 2;
    aspect-ratio: auto;
}

/* Lightbox */
.lightbox {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.95); z-index: 9999;
    justify-content: center; align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.lightbox.active { display: flex; animation: fadeIn 0.3s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox img {
    max-width: 90%; max-height: 90vh;
    object-fit: contain; border-radius: 8px;
    box-shadow: 0 0 40px rgba(201,168,76,0.2);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}
.lightbox.active img { transform: scale(1); }
.lightbox-close {
    position: absolute; top: 20px; right: 30px;
    font-size: 2.5rem; color: var(--white);
    cursor: pointer; z-index: 10000;
    opacity: 0.7; transition: opacity 0.3s ease;
    line-height: 1;
}
.lightbox-close:hover { opacity: 1; }

/* ===== FOOTER ===== */
.footer { position: relative; z-index: 10; margin-top: 50px; }

.signature-intro {
    font-family: var(--font-script);
    font-size: 1.8rem; margin-bottom: 5px;
    color: var(--accent-gold-light);
}
.signature-names { font-size: 2.5rem; margin-bottom: 20px; }

.final-msg {
    font-size: 0.8rem; text-transform: uppercase;
    letter-spacing: 2px; margin-bottom: 40px;
    color: var(--white); opacity: 0.8;
}

.actions { display: flex; justify-content: center; gap: 20px; margin-top: 30px; flex-wrap: wrap; }

.btn {
    text-decoration: none; color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
    padding: 14px 28px; border-radius: 30px;
    transition: all 0.4s ease;
    text-transform: uppercase; letter-spacing: 2px;
    font-size: 0.8rem; background: transparent;
    font-family: var(--font-serif);
}
.btn:hover { background: var(--accent-gold); color: var(--bg-color); }
.btn-primary {
    background: linear-gradient(135deg, var(--accent-gold), #b8942e);
    color: var(--bg-color); border-color: var(--accent-gold);
    font-weight: 600;
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold));
    box-shadow: 0 4px 20px rgba(201,168,76,0.4);
}
.btn-wine { border-color: var(--accent-wine); color: #e8a0c0; }
.btn-wine:hover { background: var(--accent-wine); color: white; }

/* ===== FLORAL CORNERS ===== */
.floral-corner {
    position: absolute; width: 280px; height: 280px;
    pointer-events: none; z-index: 1;
    overflow: hidden;
}
.floral-corner img {
    width: 100%; height: 100%;
    object-fit: contain;
    mix-blend-mode: screen;
    opacity: 0.85;
}
.top-left { top: -20px; left: -20px; }
.top-right { display: none; }
.bottom-left { display: none; }
.bottom-right {
    bottom: -20px; right: -20px;
    transform: rotate(180deg);
}

/* ===== PARTICLES ===== */
.particles {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0;
    overflow: hidden;
}
.particle {
    position: absolute; width: 3px; height: 3px;
    background: var(--accent-gold); border-radius: 50%;
    opacity: 0;
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0% { opacity: 0; transform: translateY(100vh) scale(0); }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { opacity: 0; transform: translateY(-10vh) scale(1); }
}

/* ===== SCROLL ANIMATIONS ===== */
.scroll-reveal {
    opacity: 0; transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.scroll-reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== MUSIC CONTROL ===== */
.music-control {
    position: fixed; bottom: 20px; right: 20px;
    width: 50px; height: 50px;
    background: linear-gradient(145deg, var(--accent-gold), #8b6914);
    color: var(--bg-color); border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(201,168,76,0.4);
    cursor: pointer; font-size: 1.5rem;
    opacity: 0; transition: opacity 1s ease, transform 0.3s ease;
    pointer-events: none;
}
.music-control.visible { opacity: 1; pointer-events: auto; }
.music-control:hover { transform: scale(1.1); }

.hidden-player {
    position: fixed; top: -9999px; left: -9999px;
    width: 1px; height: 1px; overflow: hidden;
    opacity: 0.001; pointer-events: none;
    z-index: -9999; visibility: hidden;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .names { font-size: 2.8rem; }
    .invitation-container { padding: 40px 20px 50px; }
    .floral-corner { width: 180px; height: 180px; }
    .top-left { top: -15px; left: -15px; }
    .bottom-right { bottom: -15px; right: -15px; }
    .date-time { flex-direction: column; gap: 10px; }
    .parents-grid { grid-template-columns: 1fr; gap: 20px; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery-item.featured { grid-column: span 2; }
    .countdown { gap: 12px; }
    .countdown-item { min-width: 65px; padding: 15px 10px; }
    .countdown-number { font-size: 2rem; }
    .hero-photo { width: 200px; height: 200px; }
    .intro-text { font-size: 1.3rem; }
    .section-title { font-size: 2rem; }

    .envelope { width: 85vw; height: auto; min-height: 280px; padding: 15px; }
    .envelope-names { font-size: 2rem; }
    .envelope-header { font-size: 0.65rem; letter-spacing: 3px; }
    .wax-seal { width: 100px; height: 100px; bottom: -30px; }
    .seal-label { bottom: -60px; font-size: 0.7rem; }
}