
/* =====================================
   1. GLOBAL SETTINGS
===================================== */

:root {
    --burgundy: #651d32;
    --dark-burgundy: #421321;
    --wine: #7b293f;
    --ivory: #faf6ef;
    --cream: #f1e7d9;
    --gold: #c5a36a;
    --dark-gold: #9d7945;
    --brown: #514039;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--ivory);
    color: var(--brown);
    font-family: 'Cormorant Garamond', serif;
    overflow-x: hidden;
}

button {
    font: inherit;
}


/* =====================================
   2. AMBIENT BACKGROUND
===================================== */

.ambient {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 10;
}

.pearl {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%,
        #fff 0%, #eadfc9 45%, #c5a36a 100%);
    box-shadow: 0 0 9px rgba(255,255,255,.8);
    animation: pearlFloat linear infinite;
}

.sparkle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #d5b477;
    border-radius: 50%;
    box-shadow: 0 0 9px #d5b477;
    animation: sparkleFloat 4s ease-in-out infinite;
}

@keyframes pearlFloat {
    0% {
        transform: translateY(110vh);
        opacity: 0;
    }

    15% {
        opacity: .7;
    }

    85% {
        opacity: .5;
    }

    100% {
        transform: translateY(-10vh);
        opacity: 0;
    }
}

@keyframes sparkleFloat {
    0%, 100% {
        opacity: .1;
        transform: scale(.5);
    }

    50% {
        opacity: .9;
        transform: scale(1.5);
    }
}


/* =====================================
   3. ENVELOPE INTRO SCREEN
===================================== */

.intro-screen {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: 25px 15px;
    background:
        radial-gradient(ellipse at center,
        #fffdf8 0%,
        #f7efe5 65%,
        #eee2d3 100%);
    transition: opacity 1s ease, visibility 1s ease;
}

.intro-screen.finished {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-content {
    width: 100%;
    display: flex;
    align-items: center;
    flex-direction: column;
    text-align: center;
}

.intro-top {
    color: var(--dark-gold);
    font-family: 'Playfair Display', serif;
    font-size: 11px;
    letter-spacing: 5px;
    margin-bottom: 45px;
}

.intro-footer {
    margin-top: 20px;
    font-size: 17px;
    font-style: italic;
    color: #8c7665;
}

.open-instruction {
    margin-top: 35px;
    color: var(--burgundy);
    font-family: 'Playfair Display', serif;
    font-size: 11px;
    letter-spacing: 3px;
    animation: instructionPulse 2.5s infinite;
}

@keyframes instructionPulse {
    0%, 100% { opacity: .55; }
    50% { opacity: 1; }
}

.instruction-line {
    width: 45px;
    height: 1px;
    background: var(--gold);
    margin-top: 13px;
}


/* =====================================
   4. ENVELOPE SCENE
===================================== */

.envelope-scene {
    position: relative;
    width: 370px;
    height: 270px;
    perspective: 1200px;
}

.envelope {
    position: absolute;
    width: 100%;
    height: 230px;
    bottom: 0;
    left: 0;
    z-index: 5;
    filter: drop-shadow(0 20px 22px rgba(65, 25, 35, .18));
}

.envelope-back {
    position: absolute;
    inset: 0;
    background: linear-gradient(140deg, #842c45, #541729);
    border: 1px solid var(--gold);
    border-radius: 4px;
}

.envelope-pocket {
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, #74243b, #521526);
    clip-path: polygon(0 0, 50% 64%, 100% 0, 100% 100%, 0 100%);
    z-index: 4;
}

.envelope-detail {
    position: absolute;
    inset: 9px;
    border: 1px solid rgba(207, 174, 117, .65);
    z-index: 6;
    pointer-events: none;
}


/* =====================================
   5. ENVELOPE FLAP
===================================== */

.envelope-flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(145deg, #8a304a, #651d32);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform-origin: top center;
    z-index: 8;
    backface-visibility: hidden;
    transition: transform 1.1s cubic-bezier(.65, 0, .35, 1);
    border-top: 1px solid rgba(216, 184, 127, .8);
}


/* =====================================
   6. WAX SEAL
===================================== */

.wax-seal {
    position: absolute;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    top: 72px;
    left: 50%;
    transform: translateX(-50%);
    border: 3px solid #bd8e60;
    background:
        radial-gradient(circle at 35% 30%,
        #a84c5b, #772438 60%, #481423);
    color: #e4c48d;
    box-shadow:
        0 4px 12px rgba(0,0,0,.3),
        inset 0 0 0 3px rgba(220,180,120,.2);
    cursor: pointer;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .4s ease, transform .5s ease;
}

.wax-seal:hover {
    transform: translateX(-50%) scale(1.06);
}

.seal-initial {
    font-family: 'Great Vibes', cursive;
    font-size: 36px;
}

.seal-crack {
    position: absolute;
    width: 2px;
    background: #e8c78f;
    height: 0;
    top: 18px;
    left: 50%;
    opacity: 0;
    transform: rotate(25deg);
}

.crack-one {
    height: 23px;
    transform: rotate(25deg);
}

.crack-two {
    height: 20px;
    transform: rotate(-40deg);
}

.crack-three {
    height: 16px;
    transform: rotate(75deg);
}

.envelope-scene.opening .wax-seal {
    animation: sealBreak .65s ease forwards;
}

.envelope-scene.opening .crack-one {
    animation: crackAppear .3s .1s forwards;
}

.envelope-scene.opening .crack-two {
    animation: crackAppear .3s .2s forwards;
}

.envelope-scene.opening .crack-three {
    animation: crackAppear .3s .3s forwards;
}

@keyframes crackAppear {
    to { opacity: .9; }
}

@keyframes sealBreak {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }

    40% {
        transform: translateX(-50%) scale(1.2) rotate(12deg);
    }

    100% {
        transform: translateX(-50%) scale(.3) rotate(30deg);
        opacity: 0;
    }
}


/* =====================================
   7. INVITATION LETTER
===================================== */

.letter {
    position: absolute;
    width: 310px;
    height: 410px;
    left: 50%;
    bottom: 25px;
    transform: translateX(-50%) translateY(90px) scale(.88);
    background: linear-gradient(145deg, #fffdf7, #f1e7d8);
    box-shadow: 0 5px 25px rgba(0,0,0,.15);
    z-index: 3;
    opacity: 0;
    padding: 10px;
    transition:
        transform 1.5s cubic-bezier(.2,.75,.2,1),
        opacity .6s ease;
}

.letter-border {
    height: 100%;
    width: 100%;
    border: 1px solid var(--gold);
    padding: 25px 15px;
}

.letter-content {
    height: 100%;
    border: 1px solid rgba(197,163,106,.4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
    padding: 12px;
}

.letter-small {
    color: var(--dark-gold);
    font-size: 9px;
    letter-spacing: 3px;
}

.letter-flourish {
    color: var(--gold);
    font-size: 36px;
    margin: 15px 0;
}

.letter h1 {
    font-family: 'Great Vibes', cursive;
    font-size: 55px;
    color: var(--burgundy);
    font-weight: 400;
}

.letter-names {
    font-family: 'Playfair Display', serif;
    color: #8b6746;
    font-size: 14px;
    letter-spacing: 2px;
    margin-top: 8px;
}

.letter-divider {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 22px 0;
}

.letter-divider span {
    width: 35px;
    height: 1px;
    background: var(--gold);
}

.gold-dot {
    width: 6px !important;
    height: 6px !important;
    border-radius: 50%;
}

.letter-date {
    color: var(--burgundy);
    font-size: 9px;
    letter-spacing: 2px;
}

.letter-bottom {
    font-style: italic;
    color: #8c7665;
    margin-top: 30px;
    font-size: 14px;
}


/* =====================================
   8. OPENING ANIMATION
===================================== */

/* =====================================
   8. OPENING ANIMATION
===================================== */

.envelope-scene.opening .envelope-flap {
    transform: rotateX(180deg);
    z-index: 2;
}

.envelope-scene.opening .letter {
    position: fixed;
    left: 50%;
    top: 50%;
    bottom: auto;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    z-index: 200;
}

.envelope-scene.opening .envelope-pocket {
    transition: opacity .8s ease;
}

.envelope-scene.opened .letter {
    position: fixed;
    left: 50%;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%) scale(1);
    z-index: 200;
}

.envelope-scene.opened .envelope {
    transition: opacity .7s ease;
    opacity: 0;
}



/* =====================================
   9. MAIN INVITATION
===================================== */

.invitation {
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.3s ease;
}

.invitation.visible {
    opacity: 1;
    visibility: visible;
}

.invitation section {
    position: relative;
    text-align: center;
    padding: 100px 22px;
}

.section-label {
    font-family: 'Playfair Display', serif;
    color: var(--dark-gold);
    font-size: 10px;
    letter-spacing: 4px;
    margin-bottom: 25px;
}

h2 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    font-size: clamp(35px, 5vw, 52px);
    color: var(--burgundy);
}


/* =====================================
   10. GOLD DIVIDER
===================================== */

.gold-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 30px auto;
}

.gold-divider span {
    width: 55px;
    height: 1px;
    background: var(--gold);
}

.gold-divider i {
    font-style: normal;
    color: var(--dark-gold);
    font-size: 17px;
}


/* =====================================
   11. HERO SECTION
===================================== */

.hero-section {
    background: #f6efe5;
    min-height: 520px;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
}

.arabic-text {
    font-size: clamp(25px, 5vw, 36px);
    color: var(--burgundy);
    margin-bottom: 28px;
    line-height: 1.8;
}

.hero-subtitle {
    color: var(--dark-gold);
    font-size: 9px;
    letter-spacing: 2px;
    line-height: 2;
}

.welcome-text {
    max-width: 520px;
    font-size: 21px;
    line-height: 1.8;
    color: #705b4e;
}


/* =====================================
   12. COUPLE SECTION
===================================== */

.couple-section {
    background:
        linear-gradient(rgba(250,246,239,.94),
        rgba(250,246,239,.94));
    min-height: 650px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.couple-name {
    font-family: 'Great Vibes', cursive;
    font-weight: 400;
    font-size: clamp(55px, 10vw, 90px);
    color: var(--burgundy);
    line-height: 1.3;
}

.ampersand {
    font-family: 'Great Vibes', cursive;
    font-size: 55px;
    color: var(--gold);
    margin: 5px 0;
}

.couple-description {
    font-style: italic;
    font-size: 21px;
    color: #826d5d;
}


/* =====================================
   13. MESSAGE SECTION
===================================== */

.message-section {
    background: #6a2035;
    color: var(--ivory);
}

.message-frame {
    max-width: 700px;
    margin: auto;
    border: 1px solid rgba(210,176,117,.7);
    padding: 65px 35px;
}

.message-section h2 {
    color: #f6e9d4;
    margin-bottom: 25px;
}

.message-section p:not(.section-label) {
    color: #eadaca;
    font-size: 21px;
    line-height: 1.8;
}


/* =====================================
   14. WEDDING DETAILS
===================================== */

.details-section {
    background: #f5eee4;
}

.details-section h2 {
    margin-bottom: 55px;
}

.details-grid {
    max-width: 850px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.detail-item {
    padding: 30px 12px;
    border-right: 1px solid rgba(197,163,106,.5);
}

.detail-item:last-child {
    border-right: none;
}

.detail-icon {
    color: var(--gold);
    font-size: 25px;
}

.detail-label {
    color: var(--dark-gold);
    font-size: 10px;
    letter-spacing: 3px;
    margin: 14px 0;
}

.detail-item h3 {
    font-family: 'Playfair Display', serif;
    color: var(--burgundy);
    font-size: 19px;
    font-weight: 400;
}

.hijri-date {
    margin-top: 40px;
    color: #826d5d;
    font-style: italic;
    font-size: 18px;
}


/* =====================================
   15. VENUE
===================================== */

.venue-section {
    background: var(--ivory);
}

.venue-card {
    max-width: 550px;
    margin: 45px auto 0;
    padding: 50px 25px;
    border: 1px solid var(--gold);
    outline: 1px solid rgba(197,163,106,.3);
    outline-offset: 7px;
}

.venue-decoration {
    font-size: 40px;
    color: var(--gold);
    margin-bottom: 15px;
}

.venue-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 25px;
    color: var(--burgundy);
    margin-bottom: 20px;
}

.venue-card p {
    font-size: 20px;
    line-height: 1.8;
    color: #796557;
}

.map-link {
    display: inline-block;
    margin-top: 30px;
    padding: 13px 25px;
    border: 1px solid var(--gold);
    color: var(--burgundy);
    text-decoration: none;
    font-size: 10px;
    letter-spacing: 2px;
    transition: .3s;
}

.map-link:hover {
    background: var(--burgundy);
    color: white;
    border-color: var(--burgundy);
}


/* =====================================
   16. GALLERY
===================================== */

.gallery-section {
    background: #f3eadf;
}

.gallery-section h2 {
    margin-bottom: 45px;
}

.gallery-grid {
    max-width: 950px;
    margin: auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.gallery-image {
    border: none;
    padding: 0;
    overflow: hidden;
    background: transparent;
    cursor: zoom-in;
    aspect-ratio: 4 / 3;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .7s ease;
}

.gallery-image:hover img {
    transform: scale(1.07);
}


/* =====================================
   17. LIGHTBOX
===================================== */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(34,15,20,.94);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    opacity: 0;
    visibility: hidden;
    transition: .3s;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border: 1px solid var(--gold);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    border: none;
    background: transparent;
    color: white;
    font-size: 42px;
    cursor: pointer;
}


/* =====================================
   18. CLOSING SECTION
===================================== */

.closing-section {
    background: #f8f1e8;
}

.closing-border {
    max-width: 700px;
    margin: auto;
    padding: 55px 30px;
    border: 1px solid var(--gold);
}

.closing-section h2 {
    font-family: 'Great Vibes', cursive;
    font-size: 65px;
}

.closing-section p:not(.section-label):not(.footer-text) {
    max-width: 520px;
    margin: 25px auto;
    font-size: 21px;
    line-height: 1.8;
    color: #776052;
}

.dua {
    font-style: italic;
}

.closing-names {
    font-family: 'Great Vibes', cursive;
    font-size: 38px;
    color: var(--burgundy);
    font-weight: 400;
}

.footer-text {
    color: var(--dark-gold);
    font-size: 9px;
    letter-spacing: 3px;
    margin-top: 45px;
}


/* =====================================
   19. RESPONSIVE DESIGN
===================================== */

@media (max-width: 600px) {

    .intro-top {
        font-size: 9px;
        letter-spacing: 3px;
        margin-bottom: 30px;
    }

    .envelope-scene {
        width: min(88vw, 340px);
        height: 245px;
    }

    .envelope {
        height: 210px;
    }

    .envelope-flap {
        height: 110px;
    }

    .wax-seal {
        width: 64px;
        height: 64px;
        top: 65px;
    }

    .letter {
        width: 270px;
        height: 370px;
    }

    .envelope-scene.opening .letter {
        transform: translateX(-50%) translateY(-170px) scale(.94);
    }

    .envelope-scene.opened .letter {
        transform: translateX(-50%) translateY(-185px) scale(.96);
    }

    .open-instruction {
        font-size: 9px;
        letter-spacing: 2px;
        margin-top: 25px;
    }

    .intro-footer {
        font-size: 15px;
    }

    .invitation section {
        padding: 75px 18px;
    }

    .hero-section {
        min-height: 470px;
    }

    .welcome-text {
        font-size: 18px;
    }

    .couple-section {
        min-height: 570px;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .detail-item {
        border-right: none;
        border-bottom: 1px solid rgba(197,163,106,.4);
        padding: 23px;
    }

    .detail-item:last-child {
        border-bottom: none;
    }

    .gallery-grid {
        gap: 10px;
    }

    .message-frame {
        padding: 45px 20px;
    }

    .venue-card {
        padding: 40px 15px;
    }

    .closing-border {
        padding: 40px 18px;
    }

    .lightbox img {
        max-width: 100%;
    }

}


/* =====================================
   20. ACCESSIBILITY
===================================== */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

}


/* =================================
   MAKE ALL TEXT EXTRA DARK
================================= */

/* Default text everywhere */
body,
body * {
    color: #2B1715 !important;
}

/* Main headings */
h1, h2, h3, h4, h5, h6 {
    color: #4A1020 !important;
    font-weight: 700;
}

/* Paragraphs and descriptions */
p,
span,
div,
li,
label {
    color: #35211D !important;
}

/* Date, time and venue details */
.date,
.time,
.venue,
.details,
.location {
    color: #35211D !important;
    font-weight: 600;
}

/* Gold decorative text */
.gold-text,
.highlight {
    color: #79551F !important;
}

/* Arabic text */
.arabic,
.bismillah {
    color: #4A1020 !important;
}

/* Links and buttons */
a {
    color: #4A1020 !important;
}

/* Keep white text on dark buttons */
button,
button *,
.wax-seal,
.wax-seal * {
    color: #FFF9F0 !important;
}


.message-section,
.message-section * {
    color: #FFF1DC !important;
}




/* OUR MOMENTS VIDEO */

.moments-video-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 25px auto 40px;
    padding: 0;
    text-align: center;
}

.moments-video {
    display: block;
    width: 300px;
    max-width: 85%;
    height: auto;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    margin: 0 auto;
    padding: 0;
    border: 2px solid #c6a56b;
    border-radius: 12px;
    background: transparent;
    box-shadow: 0 4px 15px rgba(65, 20, 30, 0.15);
}

/* TABLET */
@media (max-width: 768px) {
    .moments-video {
        width: 260px;
        max-width: 80%;
    }
}

/* MOBILE */
@media (max-width: 480px) {
    .moments-video {
        width: 220px;
        max-width: 75%;
        border-width: 1.5px;
        border-radius: 10px;
    }
}



/* GOLDEN FRAME AROUND OUR MOMENTS */

.gallery-section {
    border: 1px solid #c6a56b;
    width: calc(100% - 20px);
    margin: 20px auto;
    padding: 45px 20px;
    box-sizing: border-box;
}

/* MOBILE FRAME */
@media (max-width: 480px) {
    .gallery-section {
        width: calc(100% - 16px);
        margin: 12px auto;
        padding: 30px 12px;
    }
}


/* KEEP THE LETTER CLEAR AND CENTRED 

.intro-screen.letter-showing .intro-top,
.intro-screen.letter-showing .intro-footer,
.intro-screen.letter-showing .open-instruction,
.intro-screen.letter-showing .instruction-line {
    opacity: 0;
    visibility: hidden;
}

/* Hide the envelope after the letter comes out 
.envelope-scene.opened .envelope {
    opacity: 0;
    visibility: hidden;
}

/* Keep the letter above everything 
.envelope-scene.opening .letter,
.envelope-scene.opened .letter {
    position: fixed;
    left: 50%;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    z-index: 200;
}
*/

/* KEEP THE LETTER CLEAR AND CENTRED */

.intro-screen.letter-showing .intro-top,
.intro-screen.letter-showing .intro-footer,
.intro-screen.letter-showing .open-instruction,
.intro-screen.letter-showing .instruction-line {
    opacity: 0;
    visibility: hidden;
}

/* Hide the envelope after the letter comes out */
.envelope-scene.opened .envelope {
    opacity: 0;
    visibility: hidden;
}

/* Keep the letter above everything */
.envelope-scene.opening .letter,
.envelope-scene.opened .letter {
    position: fixed;
    left: 50%;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    z-index: 200;
}
