:root {
    --cream: #fbf4ea;
    --paper: #f1e0cc;
    --paper-deep: #d5bea5;
    --wine: #7a1638;
    --wine-deep: #4d0a22;
    --gold: #bd9853;
    --ink: #312b2b;
    --muted: #716a6a;
    --card: rgba(255, 251, 245, 0.9);
    --card-border: rgba(189, 152, 83, 0.34);
    --shadow: 0 14px 34px rgba(68, 39, 16, 0.12);
    --paper-texture: url("https://www.transparenttextures.com/patterns/cream-paper.png");
    --arabesque-texture: url("https://www.transparenttextures.com/patterns/arabesque.png");
    --font-ar-head: "Aref Ruqaa Ink", serif;
    --font-ar-text: "Noto Naskh Arabic", serif;
}

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

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    font-family: "Cairo", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 221, 200, 0.5), transparent 42%),
        radial-gradient(circle at 85% 15%, rgba(245, 206, 229, 0.38), transparent 34%),
        radial-gradient(circle at 60% 92%, rgba(222, 244, 215, 0.35), transparent 38%),
        linear-gradient(130deg, #fff8f1 0%, #f3e7da 52%, #f9efe2 100%);
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.18) 0, rgba(255, 255, 255, 0.18) 2px, transparent 2px, transparent 15px);
    pointer-events: none;
    z-index: -2;
    opacity: 0.24;
}

html[lang="de"] body {
    font-family: "Lato", sans-serif;
}

.background-layer {
    position: fixed;
    inset: 0;
    z-index: -3;
    overflow: hidden;
    pointer-events: none;
}

.bloom {
    position: absolute;
    opacity: 0.56;
    mix-blend-mode: multiply;
    filter: sepia(0.1) saturate(0.92) contrast(1.02) drop-shadow(0 6px 14px rgba(84, 62, 43, 0.2));
    border-radius: 0;
}

.bloom-1 {
    width: min(25vw, 320px);
    top: -5vh;
    left: -4vw;
    transform: rotate(-8deg);
}

.bloom-2 {
    width: min(24vw, 320px);
    top: -4vh;
    right: -5vw;
    transform: rotate(12deg);
}

.bloom-3 {
    width: min(24vw, 300px);
    bottom: -7vh;
    left: -3vw;
    transform: rotate(-18deg);
}

.bloom-4 {
    width: min(24vw, 300px);
    bottom: -8vh;
    right: -5vw;
    transform: rotate(10deg);
}

.bloom-5 {
    width: min(18vw, 250px);
    right: 13vw;
    bottom: 34vh;
    transform: rotate(-8deg);
    opacity: 0.46;
}

.lang-toggle {
    position: fixed;
    top: 16px;
    inset-inline-end: 18px;
    z-index: 1200;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(189, 152, 83, 0.7);
    background: rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(6px);
    color: #5a4a34;
    font-size: 0.88rem;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease;
}

.lang-toggle:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.88);
}

#intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #e8dbc9;
    background-image: var(--paper-texture);
    perspective: 2200px;
}

#intro-overlay::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.08));
    pointer-events: none;
    z-index: 0;
}

.envelope-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.envelope-paper {
    position: absolute;
    inset: 0;
    background: linear-gradient(150deg, #f7eee3 0%, #ebddcb 58%, #ddcbb5 100%);
    box-shadow:
        inset 0 -52px 88px rgba(127, 96, 65, 0.18),
        inset 0 34px 42px rgba(255, 255, 255, 0.6),
        0 10px 24px rgba(66, 50, 35, 0.12);
    overflow: hidden;
}

.envelope-paper::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0));
    opacity: 0.5;
    pointer-events: none;
}

.envelope-paper::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.32), transparent 59%);
    opacity: 0.86;
    pointer-events: none;
}

.fold {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.fold-left {
    clip-path: polygon(0 0, 50% 56%, 0 100%);
    background: linear-gradient(130deg, #e9decf 0%, #d9c7b1 100%);
}

.fold-right {
    clip-path: polygon(100% 0, 50% 56%, 100% 100%);
    background: linear-gradient(230deg, #e9decf 0%, #d9c7b1 100%);
}

.fold-bottom {
    clip-path: polygon(0 100%, 50% 56%, 100% 100%);
    background: linear-gradient(0deg, #d7c3ab 0%, #eee1d1 100%);
}

.flap-group {
    position: absolute;
    inset-inline-start: 0;
    inset-inline-end: 0;
    top: 0;
    height: 52%;
    transform-origin: top center;
    transition: transform 3.8s cubic-bezier(0.2, 0.8, 0.14, 1), filter 2.2s ease;
    z-index: 10;
}

.flap-top {
    position: absolute;
    inset: 0;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    background:
        linear-gradient(180deg, #f5ede4 0%, #ebdfcf 64%, #dac8b2 100%),
        var(--arabesque-texture);
    background-blend-mode: normal, multiply;
    background-size: auto, 250px;
    z-index: 1;
    box-shadow: 0 18px 34px rgba(72, 53, 33, 0.22);
}

.center-seam {
    position: absolute;
    left: 50%;
    top: 16%;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, transparent, rgba(149, 120, 89, 0.34), transparent);
    transform: translateX(-50%);
    z-index: 2;
}

.wax-seal {
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translate(-50%, -48%);
    width: 156px;
    height: 156px;
    border-radius: 0;
    border: 0;
    background: url("./stempel.png") center / contain no-repeat;

    cursor: pointer;
    z-index: 2;
    transition: opacity 1.9s ease, transform 2.9s cubic-bezier(0.2, 0.8, 0.18, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    will-change: transform, opacity;
}

.wax-seal::before {
    content: none;
}

.wax-seal::after {
    content: none;
}

.wax-seal span {
    position: absolute;
    z-index: 2;
    font-family: "Great Vibes", cursive;
    font-size: 2.35rem;
    letter-spacing: 0.4px;
    color: #fce8bd;
    text-shadow: 0 2px 4px rgba(37, 15, 12, 0.7);
    transform: translateY(-4px);
}

.click-hint {
    position: absolute;
    left: 50%;
    bottom: 8vh;
    transform: translateX(-50%);
    z-index: 30;
    color: #6e4f36;
    font-weight: 600;
    letter-spacing: 1px;
    font-size: 0.95rem;
    text-transform: uppercase;
    animation: pulse 1.7s infinite;
    transition: opacity 0.4s ease;
    background: rgba(255, 255, 255, 0.66);
    padding: 8px 14px;
    border-radius: 999px;
    white-space: nowrap;
}

#intro-overlay.opening .flap-group {
    transform: rotateX(178deg) translateY(-7%);
    filter: brightness(0.92);
}

#intro-overlay.opening .wax-seal {
    opacity: 0;
    transform: translate(-50%, -98%) scale(0.76) rotate(-10deg);
}

#intro-overlay.fade-out {
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.3s ease, visibility 1.3s ease;
}

#main-content {
    display: none;
    opacity: 0;
    transition: opacity 1.1s ease;
    max-width: 980px;
    margin: 0 auto;
    padding: 66px 16px 60px;
    position: relative;
    z-index: 1;
}

#main-content.show {
    opacity: 1;
}

.section {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 34px 24px;
    margin: 22px 0;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.86), rgba(255, 247, 235, 0.72)),
        radial-gradient(circle at 12% 10%, rgba(242, 217, 177, 0.22), transparent 30%),
        radial-gradient(circle at 88% 90%, rgba(223, 184, 195, 0.18), transparent 26%);
    border: 1px solid rgba(189, 152, 83, 0.3);
    box-shadow: 0 14px 30px rgba(68, 39, 16, 0.1);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.95s ease, transform 0.95s ease;
}

.section::before {
    content: "";
    position: absolute;
    inset: 10px;
    border-radius: 18px;
    border: 1px solid rgba(189, 152, 83, 0.2);
    pointer-events: none;
}

.section::after {
    content: "❁";
    position: absolute;
    inset-inline-start: 16px;
    top: 12px;
    font-size: 0.95rem;
    color: rgba(189, 152, 83, 0.62);
    pointer-events: none;
}

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

.hero {
    padding: 0;
    overflow: hidden;
    border: 0;
    box-shadow: 0 20px 40px rgba(54, 26, 26, 0.22);
}

.hero::before,
.hero::after {
    display: none;
}

.hero-video-shell {
    position: relative;
    min-height: 62vh;
    overflow: hidden;
}

.hero-video-shell video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(1.15) contrast(1.05);
}

.hero-overlay {
    position: relative;
    z-index: 2;
    min-height: 62vh;
    padding: 42px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fffdf9;
    background: linear-gradient(180deg, rgba(67, 27, 38, 0.56), rgba(32, 19, 31, 0.6));
}

h1 {
    font-family: "Amiri", serif;
    font-size: clamp(2.2rem, 6vw, 4.4rem);
    line-height: 1.15;
    margin-bottom: 12px;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

html[lang="de"] h1 {
    font-family: "Playfair Display", serif;
}

.hero-couple {
    margin: 0;
    font-size: clamp(2.8rem, 8vw, 5.4rem);
    letter-spacing: 1.2px;
    color: #fff8ec;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.42), 0 0 26px rgba(240, 217, 164, 0.36);
}

html[lang="ar"] .hero-couple {
    font-family: "Reem Kufi Fun", "Aref Ruqaa Ink", serif;
    font-size: clamp(3rem, 8.4vw, 5.7rem);
    letter-spacing: 0.2px;
}

html[lang="de"] .hero-couple {
    font-family: "Great Vibes", cursive;
    font-size: clamp(3.3rem, 9vw, 6.2rem);
    letter-spacing: 0.2px;
    font-weight: 400;
}

.bismillah {
    width: min(210px, 55vw);
    margin: 0 auto 18px;
    filter: sepia(90%) saturate(0.75);
}

html[lang="de"] .bismillah {
    display: none;
}

h2 {
    font-family: "Amiri", serif;
    color: #4a3030;
    font-size: clamp(1.7rem, 4.3vw, 2.4rem);
    text-align: center;
    margin-bottom: 14px;
}

html[lang="de"] h2 {
    font-family: "Playfair Display", serif;
}

html[lang="ar"] h3 {
    font-family: var(--font-ar-head);
    font-size: clamp(1.2rem, 2.2vw, 1.52rem);
    letter-spacing: 0.2px;
}

html[lang="ar"] p {
    font-family: var(--font-ar-text);
    font-size: clamp(1.03rem, 2.15vw, 1.2rem);
    line-height: 1.95;
}

.quran-verse {
    text-align: center;
    color: var(--muted);
    line-height: 2;
    font-size: clamp(1rem, 2.5vw, 1.15rem);
    max-width: 830px;
    margin: 0 auto;
}

.countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    direction: ltr;
    unicode-bidi: bidi-override;
    gap: 10px;
    font-family: "Cinzel", serif;
    color: var(--gold);
    font-size: clamp(1.7rem, 5vw, 3rem);
    margin: 16px 0;
}

#days,
#hours,
#mins {
    min-width: 2ch;
    text-align: center;
    display: inline-block;
}

.countdown .sep {
    opacity: 0.56;
}

.center-text {
    text-align: center;
    line-height: 1.9;
    color: #5f5858;
}

.countdown-note {
    text-align: center;
    line-height: 1.9;
    margin-top: 8px;
    color: #5b4d4d;
}

.countdown-note.highlight {
    color: #8f6a2a;
    font-weight: 700;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.info-card {
    background: rgba(255, 255, 255, 0.64);
    border-radius: 18px;
    border: 1px solid rgba(189, 152, 83, 0.25);
    padding: 24px;
    text-align: center;
}

.info-card i {
    font-size: 1.9rem;
    color: #b97781;
    margin-bottom: 10px;
}

.info-card h3 {
    font-size: 1.16rem;
    margin-bottom: 6px;
}

.muted {
    color: #7a7474;
    font-size: 0.95rem;
}

.map-link {
    display: inline-block;
    margin-top: 8px;
    color: #a17b3e;
    text-decoration: none;
    font-weight: 600;
}

.special-text-card p {
    text-align: center;
    line-height: 2;
    margin: 8px auto;
    max-width: 820px;
    color: #5e5252;
    font-size: clamp(0.96rem, 2.2vw, 1.14rem);
}

.rules-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.rule-item {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    padding: 20px 18px;
    border-inline-start: 4px solid var(--gold);
    box-shadow: 0 6px 14px rgba(80, 45, 29, 0.08);
}

.rule-item h3 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.05rem;
    margin-bottom: 10px;
    color: #463333;
    text-align: center;
}

.rule-item p {
    color: #6a6262;
    line-height: 1.8;
    font-size: 0.95rem;
    text-align: center;
}

.rule-item i {
    color: #b97781;
}

.qr-section p {
    text-align: center;
    line-height: 1.9;
    color: #615959;
}

.qr-box {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.qr-box img {
    width: clamp(180px, 33vw, 240px);
    height: clamp(180px, 33vw, 240px);
    border-radius: 18px;
    background: #fff;
    padding: 10px;
    border: 2px solid rgba(189, 152, 83, 0.36);
    box-shadow: 0 10px 24px rgba(65, 35, 20, 0.14);
    object-fit: cover;
}

.qr-token {
    display: inline-block;
    margin-top: 2px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(189, 152, 83, 0.34);
    font-size: 0.9rem;
    color: #665a4a;
}

.form-wrap {
    max-width: 670px;
    margin: 0 auto;
}

input,
select,
button {
    width: 100%;
    font: inherit;
    border-radius: 12px;
    border: 1px solid rgba(189, 152, 83, 0.28);
    background: #fff;
    padding: 13px 14px;
    margin-bottom: 12px;
}

.guest-count {
    max-width: 110px;
    margin-inline: auto;
    display: block;
    text-align: center;
}

.submit-btn {
    background: linear-gradient(135deg, #60304a, #8f415f);
    border: 0;
    color: #fff7ed;
    font-weight: 600;
    letter-spacing: 0.6px;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(90, 45, 59, 0.28);
}

.rsvp-feedback {
    min-height: 1.6em;
    margin-top: 4px;
    font-size: 0.92rem;
    color: #6a5c4d;
    text-align: center;
}

.rsvp-feedback.ok {
    color: #2f7a4b;
}

.rsvp-feedback.error {
    color: #a32d46;
}

footer {
    text-align: center;
    color: rgba(80, 60, 46, 0.56);
    font-size: 0.84rem;
    padding: 12px 0 8px;
}

.particle {
    position: fixed;
    top: -20px;
    z-index: 1050;
    pointer-events: none;
    animation: fall linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(112vh) rotate(90deg);
        opacity: 0;
    }
}

@keyframes pulse {
    0% { opacity: 0.45; }
    50% { opacity: 1; }
    100% { opacity: 0.45; }
}

@media (max-width: 980px) {
    .rules-container {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    #main-content {
        padding-top: 62px;
    }

    .envelope-paper {
        inset: 0;
    }

    .wax-seal {
        width: 210px;
        height: 210px;
        top: 100%;
    }

    .wax-seal span {
        font-size: 1.95rem;
        letter-spacing: 0.25px;
    }

    .click-hint {
        font-size: 0.78rem;
        bottom: 6vh;
        padding: 7px 10px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .rules-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .lang-toggle {
        font-size: 0.78rem;
        top: 10px;
        inset-inline-end: 10px;
        padding: 7px 12px;
    }

    #intro-overlay {
        padding-bottom: 0;
    }

    .envelope-paper {
        inset: 0;
    }

    .hero-overlay {
        min-height: 58vh;
        padding: 35px 16px;
    }

    .section {
        border-radius: 18px;
        padding: 28px 16px;
    }

    .bloom {
        opacity: 0.26;
    }
}
