:root {
    --gold: #c9a84c;
    --gold-light: #e8d08a;
    --gold-dark: #9a7535;
    --blush: #f4c5c5;
    --blush-dark: #e8a0a0;
    --cream: #fdf8f0;
    --bg: #fdf8f0;
    --text: #3a2e2e;
    --text-light: #6b5050;
    --white: #ffffff;
    --card-bg: rgba(255, 255, 255, 0.85);
    --nav-bg: rgba(253, 248, 240, 0.95);
    --shadow: rgba(180, 140, 100, 0.15);
    --overlay: rgba(30, 15, 15, 0.45);
    --heart: #c97070;
}

[data-theme="dark"] {
    --bg: #1a1010;
    --cream: #1a1010;
    --text: #f0e0cc;
    --text-light: #c0a88a;
    --card-bg: rgba(40, 25, 25, 0.92);
    --nav-bg: rgba(20, 12, 12, 0.97);
    --shadow: rgba(0, 0, 0, 0.4);
    --overlay: rgba(10, 5, 5, 0.6);
    --white: #221515;
    --blush: #7a3535;
    --blush-dark: #5a2020;
    --cream-card: #2a1a1a;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Montserrat", sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    transition:
        background 0.4s,
        color 0.4s;
}

/* ─── LOADING SCREEN ─── */
#loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #1a0f0f;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition:
        opacity 0.8s ease,
        visibility 0.8s ease;
}

#loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-names {
    font-family: "Great Vibes", cursive;
    font-size: clamp(2.5rem, 8vw, 5rem);
    color: var(--gold);
    opacity: 0;
    animation: fadeInUp 1s 0.5s forwards;
}

.loader-hearts {
    font-size: 1.4rem;
    color: #c97070;
    letter-spacing: 0.5rem;
    opacity: 0;
    animation: fadeInUp 1s 1s forwards;
}

.loader-enter-btn {
    margin-top: 2.5rem;
    padding: 0.9rem 2.8rem;
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: "Amiri", serif;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.35s;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 1s 1.5s forwards;
}

.loader-enter-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s;
    z-index: -1;
}

.loader-enter-btn:hover:not(:disabled) {
    color: #1a0f0f;
}

.loader-enter-btn:hover:not(:disabled)::before {
    transform: scaleX(1);
}

.loader-enter-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: rgba(201, 168, 76, 0.4);
}

.loader-bar {
    width: 160px;
    height: 2px;
    background: rgba(201, 168, 76, 0.2);
    margin-top: 2rem;
    border-radius: 1px;
    overflow: hidden;
}

.loader-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
    animation: loadBar 8.5s forwards ease-in-out;
}

@keyframes loadBar {
    to {
        width: 100%;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* ─── CONFETTI ─── */
#confetti-canvas {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
}

/* ─── NAVBAR ─── */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(201, 168, 76, 0.15);
    padding: 0.8rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition:
        background 0.4s,
        box-shadow 0.3s;
}

nav.scrolled {
    box-shadow: 0 4px 24px var(--shadow);
}

.nav-logo {
    font-family: "Great Vibes", cursive;
    font-size: 1.6rem;
    color: var(--gold);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
    position: relative;
}

.nav-links a::after {
    content: "";
    position: absolute;
    bottom: -3px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.nav-links a:hover {
    color: var(--gold);
}

.nav-links a:hover::after {
    transform: scaleX(1);
}

.nav-controls {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.icon-btn {
    background: none;
    border: 1px solid rgba(201, 168, 76, 0.3);
    color: var(--gold);
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(201, 168, 76, 0.12);
}

#musicBtn {
    display: none;
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gold);
    border-radius: 1px;
    transition: all 0.3s;
}

.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    top: 60px;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu a {
    font-family: "Cormorant Garamond", serif;
    font-size: 1.8rem;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: color 0.2s;
}

.mobile-menu a:hover {
    color: var(--gold);
}

/* ─── HERO ─── */
#hero {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 20% 50%,
            rgba(201, 168, 76, 0.08) 0%,
            transparent 60%),
        radial-gradient(ellipse at 80% 20%,
            rgba(244, 197, 197, 0.15) 0%,
            transparent 50%),
        linear-gradient(160deg, #1a0f0f 0%, #2d1a1a 40%, #1f1010 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 6rem 2rem 4rem;
}

.hero-names {
    white-space: nowrap;
}

.hero-ornament {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.petal {
    position: absolute;
    width: 6px;
    height: 10px;
    background: radial-gradient(ellipse,
            rgba(244, 197, 197, 0.6),
            rgba(244, 197, 197, 0.1));
    border-radius: 50% 0 50% 0;
    animation: fall linear infinite;
    opacity: 0;
}

@keyframes fall {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    95% {
        opacity: 0.4;
    }

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

.hero-inner {
    text-align: center;
    z-index: 1;
    max-width: 800px;
}

.hero-eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeInUp 0.9s 2.8s forwards;
}

.hero-names {
    font-family: "Great Vibes", cursive;
    font-size: clamp(3.5rem, 12vw, 8rem);
    color: var(--gold-dark);
    line-height: 1;
    opacity: 0;
    animation: fadeInUp 1s 3s forwards;
    text-shadow: 0 0 60px rgba(201, 168, 76, 0.3);
}

.hero-heart {
    color: var(--heart);
    display: inline-block;
    animation: heartbeat 1.4s ease-in-out infinite;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    14% {
        transform: scale(1.15);
    }

    28% {
        transform: scale(1);
    }

    42% {
        transform: scale(1.08);
    }

    70% {
        transform: scale(1);
    }
}

.hero-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
    opacity: 0;
    animation: fadeInUp 1s 3.2s forwards;
}

.hero-divider span {
    color: var(--gold);
    font-size: 0.5rem;
    letter-spacing: 0.2em;
}

.hero-divider::before,
.hero-divider::after {
    content: "";
    flex: 1;
    max-width: 100px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold));
}

.hero-divider::after {
    background: linear-gradient(to left, transparent, var(--gold));
}

.hero-subtitle {
    font-family: "Cormorant Garamond", serif;
    font-style: italic;
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    color: rgba(240, 220, 190, 0.85);
    opacity: 0;
    animation: fadeInUp 1s 3.4s forwards;
    font-weight: 300;
    letter-spacing: 0.03em;
}

.hero-date {
    font-size: 0.75rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--gold);
    margin-top: 1rem;
    opacity: 0;
    animation: fadeInUp 1s 3.6s forwards;
}

.hero-cta {
    display: inline-block;
    margin-top: 2.5rem;
    padding: 0.85rem 2.8rem;
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
    font-family: "Montserrat", sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.35s;
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: fadeInUp 1s 3.8s forwards;
}

.hero-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s;
    z-index: -1;
}

.hero-cta:hover {
    color: #1a0f0f;
}

.hero-cta:hover::before {
    transform: scaleX(1);
}

.scroll-hint {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: rgba(201, 168, 76, 0.5);
    font-size: 0.6rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    animation: bounce 2s ease-in-out infinite;
}

.scroll-hint svg {
    width: 16px;
    opacity: 0.6;
}

@keyframes bounce {

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

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

/* ─── SECTION SHARED ─── */
section {
    padding: 6rem 2rem;
}

.section-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.section-label {
    font-size: 0.65rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.8rem;
}

.section-title {
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 300;
    color: var(--text);
    margin-bottom: 1rem;
    line-height: 1.15;
}

.ornament-line {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.ornament-line::before,
.ornament-line::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(to right,
            transparent,
            rgba(201, 168, 76, 0.4));
}

.ornament-line::after {
    background: linear-gradient(to left,
            transparent,
            rgba(201, 168, 76, 0.4));
}

.ornament-line span {
    color: var(--gold);
    font-size: 0.6rem;
}

/* ─── REVEAL ─── */
.reveal {
    opacity: 0;
    transform: translateY(32px);
    transition:
        opacity 0.8s ease,
        transform 0.8s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 {
    transition-delay: 0.15s;
}

.reveal-delay-2 {
    transition-delay: 0.3s;
}

.reveal-delay-3 {
    transition-delay: 0.45s;
}

/* ─── COUNTDOWN ─── */
#countdown {
    background: linear-gradient(160deg,
            #120808 0%,
            #1e0f0f 50%,
            #120808 100%);
    position: relative;
    overflow: hidden;
}

[data-theme="light"] #countdown {
    background: linear-gradient(160deg, #f9f0e8 0%, var(--cream) 100%);
}

#countdown::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%,
            rgba(201, 168, 76, 0.08) 0%,
            transparent 70%);
}

.countdown-grid {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 3rem;
}

.count-card {
    background: var(--card-bg);
    border: 1px solid rgba(201, 168, 76, 0.2);
    border-radius: 4px;
    padding: 2rem 2.5rem;
    text-align: center;
    min-width: 120px;
    box-shadow: 0 8px 40px var(--shadow);
    position: relative;
    overflow: hidden;
}

.count-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            var(--gold),
            transparent);
}

.count-num {
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(2.8rem, 8vw, 4.5rem);
    font-weight: 300;
    color: var(--gold);
    line-height: 1;
    display: block;
    transition: transform 0.25s;
}

.count-num.flip {
    transform: scale(1.08);
}

.count-label {
    font-size: 0.62rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-top: 0.5rem;
    display: block;
}

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

.countdown-title .section-label {
    justify-content: center;
    display: flex;
}

/* ─── MESSAGE ─── */
#message {
    text-align: center;
    background: var(--bg);
}

.message-arabic {
    font-family: "Amiri", serif;
    font-size: clamp(1.2rem, 3.5vw, 1.8rem);
    color: var(--text-light);
    line-height: 2;
    direction: rtl;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.message-english {
    font-family: "Cormorant Garamond", serif;
    font-size: clamp(1.15rem, 3vw, 1.5rem);
    color: var(--text-light);
    font-style: italic;
    font-weight: 300;
}

.message-box {
    max-width: 680px;
    margin: 0 auto;
    padding: 3rem;
    background: var(--card-bg);
    border: 1px solid rgba(201, 168, 76, 0.15);
    border-radius: 2px;
    box-shadow: 0 4px 40px var(--shadow);
    position: relative;
}

.message-box::before,
.message-box::after {
    font-family: "Great Vibes", cursive;
    font-size: 5rem;
    color: var(--gold);
    opacity: 0.1;
    position: absolute;
    line-height: 1;
}

.message-box::before {
    content: '"';
    top: -1rem;
    left: 1rem;
}

.message-box::after {
    content: '"';
    bottom: -2.5rem;
    right: 1rem;
}

/* ─── EVENT DETAILS ─── */
#details {
    background: var(--bg);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.detail-card {
    background: var(--card-bg);
    border: 1px solid rgba(201, 168, 76, 0.15);
    padding: 2rem 1.5rem;
    text-align: center;
    border-radius: 4px;
    box-shadow: 0 4px 20px var(--shadow);
    transition:
        transform 0.3s,
        box-shadow 0.3s;
}

.detail-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px var(--shadow);
}

.detail-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--gold);
}

.detail-label {
    font-size: 0.62rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.4rem;
}

.detail-value {
    font-family: "Cormorant Garamond", serif;
    font-size: 1.3rem;
    color: var(--text);
    font-weight: 400;
    /* font-family: Great Vibes; */
    font-size: 1.8rem;
    /* color: var(--gold); */
}

/* ─── LOCATION ─── */
#location {
    background: var(--bg);
}

.map-wrap {
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(201, 168, 76, 0.2);
    box-shadow: 0 8px 40px var(--shadow);
    margin-top: 2rem;
}

.map-wrap iframe {
    width: 100%;
    height: 420px;
    border: none;
    display: block;
    filter: sepia(0.15) contrast(1.05);
}

[data-theme="dark"] .map-wrap iframe {
    filter: invert(0.85) hue-rotate(180deg) saturate(0.7);
}

.map-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.85rem 2.2rem;
    background: var(--gold);
    color: #1a0f0f;
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 2px;
    font-weight: 600;
    transition:
        background 0.25s,
        transform 0.2s;
}

.map-btn:hover {
    background: var(--gold-light);
    transform: translateY(-2px);
}

/* ─── GALLERY ─── */
#gallery {
    background: var(--bg);
}

.gallery-grid {
    display: grid;
    /* grid-template-columns: repeat(3, 1fr); */
    gap: 0.8rem;
    margin-top: 2.5rem;
}

.gallery-item {
    /* aspect-ratio: 1; */
    overflow: hidden;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

/* .gallery-item:first-child {
    grid-column: span 2;
    aspect-ratio: 2/1;
} */

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

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

.gallery-item::after {
    content: "⊕";
    position: absolute;
    inset: 0;
    background: rgba(20, 8, 8, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    opacity: 0;
    transition: opacity 0.3s;
}

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

/* Lightbox */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.92);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

#lightbox.open {
    display: flex;
}

#lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 3px;
}

.lightbox-close {
    position: fixed;
    top: 1.5rem;
    right: 2rem;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 2001;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.lightbox-close:hover {
    opacity: 1;
}

/* ─── FOOTER ─── */
footer {
    background: #0e0707;
    padding: 4rem 2rem 3rem;
    text-align: center;
    color: rgba(240, 220, 190, 0.6);
}

[data-theme="light"] footer {
    background: #2a1a1a;
}

.footer-names {
    font-family: "Great Vibes", cursive;
    font-size: 3rem;
    color: var(--gold);
    margin-bottom: 1rem;
}

.footer-message {
    font-family: "Cormorant Garamond", serif;
    font-style: italic;
    font-size: 1.1rem;
    color: rgba(240, 220, 190, 0.7);
    margin-bottom: 1.5rem;
}

.footer-hearts {
    font-size: 1.2rem;
    color: var(--heart);
    letter-spacing: 0.3em;
}

.footer-hearts span {
    display: inline-block;
    animation: heartbeat 1.4s ease-in-out infinite;
}

.footer-hearts span:nth-child(2) {
    animation-delay: 0.2s;
}

.footer-hearts span:nth-child(3) {
    animation-delay: 0.4s;
}

/* ─── FLOATING HEARTS BG ─── */
.float-hearts {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.fh {
    position: absolute;
    bottom: -20px;
    font-size: 1rem;
    opacity: 0;
    animation: riseHeart linear infinite;
    color: rgba(201, 120, 120, 0.25);
}

@keyframes riseHeart {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 0.5;
    }

    100% {
        transform: translateY(-105vh) scale(1.5) rotate(25deg);
        opacity: 0;
    }
}

/* ─── BACK TO TOP ─── */
#backTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 500;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--gold);
    color: #1a0f0f;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    transform: translateY(10px);
}

#backTop.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#backTop:hover {
    background: var(--gold-light);
    transform: translateY(-3px);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    /* .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    } */

    /* .gallery-item:first-child {
        grid-column: span 2;
    } */

    section {
        padding: 4rem 1.2rem;
    }

    .rsvp-form {
        padding: 2rem 1.5rem;
    }

    .count-card {
        padding: 1.5rem 1.5rem;
        min-width: 90px;
    }
}

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

    /* .gallery-item:first-child {
        grid-column: span 1;
        aspect-ratio: 1;
    } */

    .countdown-grid {
        gap: 0.8rem;
    }

    .count-card {
        min-width: 70px;
        padding: 1.2rem 1rem;
    }

    .count-num {
        font-size: 2.2rem;
    }

    .hero-names {
        white-space: nowrap;
        font-size: clamp(2.8rem, 7vw, 5rem);
    }
}