/* ============================================================================
   Amalfi Rose — invitation design #1
   Standalone (no Bootstrap). Mobile-first. Bilingual: font stacks swap on
   html[lang]; direction is handled by the dir attribute + logical properties.
   ========================================================================== */

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

:root {
    --cream: #f8f1e7;
    --paper: #fffcf7;
    --wine: #3e0c11;
    --wine-mid: #541016;
    --ink: #49342e;
    --ink-soft: rgba(73, 52, 46, 0.72);
    --gold: #b89554;
    --gold-soft: rgba(184, 149, 84, 0.5);
    --on-dark: #f8f1e7;
    --on-dark-soft: rgba(248, 241, 231, 0.74);
    --rule: rgba(73, 52, 46, 0.18);

    --wine-band: linear-gradient(168deg, #651319 0%, #541016 46%, #3e0c11 100%);

    --f-name: "Cormorant Garamond", "Georgia", serif;
    --f-head: "Cormorant Garamond", "Georgia", serif;
    --f-body: "EB Garamond", "Georgia", serif;
    --f-script: "Great Vibes", "Cormorant Garamond", cursive;
}

html[lang="ar"] {
    --f-name: "Aref Ruqaa", serif;
    --f-head: "Amiri", serif;
    --f-body: "Amiri", serif;
    --f-script: "Aref Ruqaa", serif;
}

html {
    -webkit-text-size-adjust: 100%;
}

body.invite-body {
    font-family: var(--f-body);
    background: var(--cream);
    color: var(--ink);
    line-height: 1.85;
    font-size: 1.02rem;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
body.is-sealed {
    overflow: hidden;
    height: 100vh;
}

img {
    display: block;
    max-width: 100%;
}
a {
    color: inherit;
}

/* ── shared type ─────────────────────────────────────────────────────────── */

.inv-eyebrow {
    font-family: var(--f-body);
    text-transform: uppercase;
    letter-spacing: 0.34em;
    font-size: 0.7rem;
    color: var(--ink-soft);
    margin-bottom: 1.1rem;
}
html[lang="ar"] .inv-eyebrow {
    letter-spacing: 0.18em;
}
.inv-eyebrow--gold {
    color: var(--gold);
}

.inv-h2 {
    font-family: var(--f-head);
    font-weight: 600;
    font-size: clamp(1.7rem, 6.4vw, 2.7rem);
    line-height: 1.25;
    max-width: 20ch;
    margin-inline: auto;
}
.inv-script {
    font-family: var(--f-script);
    font-weight: 400;
    font-size: clamp(2.1rem, 9vw, 3.4rem);
    line-height: 1.3;
    color: var(--gold);
}
html[lang="ar"] .inv-script {
    color: var(--ink);
}

.inv-lead {
    font-family: var(--f-body);
    font-size: clamp(1.02rem, 3.6vw, 1.16rem);
    max-width: 34ch;
    margin: 0.5rem auto 0;
    color: inherit;
}
.inv-signoff {
    font-family: var(--f-script);
    font-size: clamp(1.5rem, 6vw, 2rem);
    color: var(--gold);
    margin-top: 1.4rem;
}
html[lang="ar"] .inv-signoff {
    font-family: var(--f-head);
    font-size: clamp(1.15rem, 4.6vw, 1.5rem);
}

.inv-note {
    font-family: var(--f-body);
    font-style: italic;
    color: var(--ink-soft);
    max-width: 32ch;
    margin: 1.6rem auto 0;
    font-size: 0.98rem;
}
html[lang="ar"] .inv-note {
    font-style: normal;
}
.inv-note--tight {
    margin-top: 0.9rem;
}

.inv-rule {
    width: 68px;
    height: 1px;
    background: var(--gold-soft);
    margin: 1.4rem auto;
    position: relative;
}
.inv-rule::after {
    content: "";
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 50%;
    width: 6px;
    height: 6px;
    background: var(--gold);
    transform: translate(-50%, -50%) rotate(45deg);
}

/* ── fixed controls ─────────────────────────────────────────────────────── */

.inv-controls {
    position: fixed;
    inset-block-start: 14px;
    inset-inline-end: 14px;
    z-index: 60;
    display: flex;
    gap: 8px;
    align-items: center;
}
.inv-ctl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--gold-soft);
    border-radius: 999px;
    background: rgba(255, 252, 247, 0.82);
    backdrop-filter: blur(8px);
    color: var(--ink);
    font-family: var(--f-body);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
}
html[lang="ar"] .inv-ctl {
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.92rem;
}
.inv-ctl--music {
    width: 36px;
    padding: 0;
}
.inv-ctl__icon {
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 0 6px 10px;
    border-color: transparent transparent transparent var(--ink);
}
html[dir="rtl"] .inv-ctl__icon {
    border-width: 6px 10px 6px 0;
    border-color: transparent var(--ink) transparent transparent;
}
.inv-ctl--music.is-playing .inv-ctl__icon {
    width: 10px;
    height: 12px;
    border: 0;
    border-inline-start: 3px solid var(--ink);
    border-inline-end: 3px solid var(--ink);
}

/* ── envelope splash ────────────────────────────────────────────────────── */

.inv-splash {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='120' viewBox='0 0 64 120'%3E%3Cg fill='none' stroke='%23bfa06a' stroke-opacity='.16' stroke-width='1.3' stroke-linecap='round'%3E%3Cpath d='M33 4c2 30-4 68 1 114'/%3E%3Cpath d='M33 24c-9-4-16-2-21 4'/%3E%3Cpath d='M33 40c9-4 16-2 21 4'/%3E%3Cpath d='M33 58c-9-4-16-2-21 4'/%3E%3Cpath d='M33 76c9-4 16-2 21 4'/%3E%3C/g%3E%3Cg fill='%23cdb98f' fill-opacity='.18'%3E%3Ccircle cx='33' cy='5' r='2.6'/%3E%3Cellipse cx='11' cy='29' rx='3.6' ry='2.2' transform='rotate%28-32 11 29%29'/%3E%3Cellipse cx='55' cy='45' rx='3.6' ry='2.2' transform='rotate%2832 55 45%29'/%3E%3Cellipse cx='11' cy='63' rx='3.6' ry='2.2' transform='rotate%28-32 11 63%29'/%3E%3Cellipse cx='55' cy='81' rx='3.6' ry='2.2' transform='rotate%2832 55 81%29'/%3E%3C/g%3E%3C/svg%3E")
            repeat,
        linear-gradient(180deg, #fbf6ec 0%, #f5eede 100%);
    background-size: 128px auto, auto;
    will-change: opacity;
    transition:
        opacity 0.55s ease 0.25s,
        visibility 0s linear 0.8s;
}
.inv-splash.is-open {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.inv-splash__card {
    position: relative;
    text-align: center;
    color: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateZ(0);
}
/* faint gold "ribbon" lines fanning up from the seal */
.inv-splash__card::before,
.inv-splash__card::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 42%;
    width: 1px;
    height: 44vh;
    background: linear-gradient(to top, rgba(184, 149, 84, 0.3), rgba(184, 149, 84, 0));
    transform-origin: bottom center;
    pointer-events: none;
}
.inv-splash__card::before { transform: rotate(18deg); }
.inv-splash__card::after  { transform: rotate(-18deg); }

.inv-seal {
    --size: clamp(178px, 60vw, 244px);
    width: var(--size);
    height: var(--size);
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    will-change: transform;
    animation: sealPulse 3.4s ease-in-out infinite;
}
.inv-seal .wax-seal {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}
.inv-seal:hover { animation-play-state: paused; }

.inv-splash__hint {
    margin-top: 1.5rem;
    font-family: var(--f-body);
    font-size: 0.92rem;
    letter-spacing: 0.14em;
    color: var(--ink-soft);
}
html[lang="ar"] .inv-splash__hint { letter-spacing: 0; }

@keyframes sealPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.035); }
}

/* ── drifting rose petals ──────────────────────────────────────────────── */

.inv-petals {
    position: fixed;
    inset: 0;
    z-index: 6;
    overflow: hidden;
    pointer-events: none;
}
.inv-petal {
    position: absolute;
    top: 0;
    left: var(--x, 50%);
    width: calc(15px * var(--scale, 1));
    height: calc(19px * var(--scale, 1));
    background: center / contain no-repeat;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 30'%3E%3Cdefs%3E%3CradialGradient id='g' cx='40%25' cy='28%25' r='75%25'%3E%3Cstop offset='0' stop-color='%23fbdde3'/%3E%3Cstop offset='.55' stop-color='%23efaabb'/%3E%3Cstop offset='1' stop-color='%23d87f98'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath d='M12 0C4 6 1 16 5 24c2 4 5 6 7 6s5-2 7-6c4-8 1-18-7-24Z' fill='url%28%23g%29'/%3E%3Cpath d='M12 3c-1 9-1 17 0 24' stroke='%23c5718b' stroke-width='.7' fill='none' opacity='.45'/%3E%3C/svg%3E");
    opacity: 0;
    animation: petalFall var(--dur, 16s) linear var(--delay, 0s) infinite;
    will-change: transform, opacity;
}
.inv-petal--2 { filter: brightness(1.06) saturate(0.9); }
.inv-petal--3 { filter: brightness(0.95) hue-rotate(-6deg); }

@keyframes petalFall {
    0%   { transform: translate3d(0, -14vh, 0) rotate(var(--tilt, 0deg)); opacity: 0; }
    7%   { opacity: 0.9; }
    50%  { transform: translate3d(calc(var(--drift, 0px) * -1), 52vh, 0) rotate(calc(var(--tilt, 0deg) + var(--spin, 360deg) * 0.55)); }
    93%  { opacity: 0.9; }
    100% { transform: translate3d(var(--drift, 0px), 116vh, 0) rotate(calc(var(--tilt, 0deg) + var(--spin, 360deg))); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .inv-petals { display: none; }
    .inv-seal { animation: none; }
}

/* ── hero ───────────────────────────────────────────────────────────────── */

.inv-hero {
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 92px 22px 64px;
    text-align: center;
    background:
        radial-gradient(
            58% 40% at 50% 42%,
            rgba(255, 252, 247, 0.7),
            rgba(255, 252, 247, 0.2) 56%,
            transparent 78%
        ),
        var(--cream);
}
.inv-hero__kicker {
    font-family: var(--f-head);
    color: var(--ink-soft);
    font-size: clamp(0.9rem, 3.4vw, 1.05rem);
    line-height: 2;
    margin-bottom: 2rem;
}
.inv-names {
    font-family: var(--f-name);
    font-weight: 400;
    font-size: clamp(2.8rem, 15vw, 5.2rem);
    line-height: 1.05;
    margin: 0.6rem 0 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}
.inv-names__amp {
    font-family: var(--f-script);
    color: var(--gold);
    font-size: 0.5em;
    margin: 0.1em 0;
}
html[lang="ar"] .inv-names__amp {
    font-family: var(--f-name);
}
.inv-hero__date {
    font-family: var(--f-body);
    letter-spacing: 0.3em;
    font-size: clamp(0.9rem, 3.6vw, 1.05rem);
    color: var(--ink);
}
html[lang="ar"] .inv-hero__date {
    letter-spacing: 0.12em;
}
.inv-hero__scroll {
    margin-top: 3rem;
    font-family: var(--f-body);
    font-style: italic;
    color: var(--ink-soft);
    font-size: 0.92rem;
}
html[lang="ar"] .inv-hero__scroll {
    font-style: normal;
}

/* ── sections ───────────────────────────────────────────────────────────── */

.inv-main {
    position: relative;
}
.inv-section {
    padding: 74px 24px;
    text-align: center;
}
.inv-section--wine {
    background: var(--wine-band);
    color: var(--on-dark);
}
.inv-section--wine .inv-lead {
    color: var(--on-dark-soft);
}
.inv-section--wine .inv-eyebrow {
    color: var(--gold);
}
.inv-section--wine .inv-note {
    color: var(--on-dark-soft);
}
.inv-section--wine .inv-rule {
    background: rgba(201, 170, 106, 0.42);
}
.inv-section--wine .inv-script {
    color: var(--gold);
}

@media (min-width: 768px) {
    .inv-section {
        padding: 104px 24px;
    }
}

/* reveal */
[data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition:
        opacity 0.8s ease,
        transform 0.8s ease;
}
[data-reveal].is-visible {
    opacity: 1;
    transform: none;
}
@media (prefers-reduced-motion: reduce) {
    [data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .inv-seal {
        animation: none;
    }
}

/* ── countdown ──────────────────────────────────────────────────────────── */

.inv-countdown {
    display: flex;
    justify-content: center;
    gap: clamp(10px, 4vw, 26px);
    margin-top: 2rem;
}
.inv-countdown__cell {
    min-width: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}
.inv-countdown__num {
    font-family: var(--f-head);
    font-size: clamp(1.9rem, 8vw, 2.9rem);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--on-dark);
}
.inv-countdown__label {
    font-family: var(--f-body);
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--on-dark-soft);
}
html[lang="ar"] .inv-countdown__label {
    letter-spacing: 0.06em;
    text-transform: none;
    font-size: 0.82rem;
}

/* ── details ────────────────────────────────────────────────────────────── */

.inv-details {
    max-width: 380px;
    margin: 1.8rem auto 0;
    text-align: start;
}
.inv-details__row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 0;
    border-bottom: 1px solid var(--rule);
}
.inv-details__label {
    font-family: var(--f-body);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    color: var(--ink-soft);
    padding-top: 0.25rem;
    white-space: nowrap;
}
html[lang="ar"] .inv-details__label {
    letter-spacing: 0;
    text-transform: none;
    font-size: 0.9rem;
}
.inv-details__value {
    font-family: var(--f-head);
    font-size: 1.12rem;
    text-align: end;
}
.inv-details__sub {
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.inv-btn {
    display: inline-block;
    margin-top: 1.8rem;
    padding: 0.8rem 2rem;
    border: 1px solid var(--gold);
    border-radius: 999px;
    font-family: var(--f-body);
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-decoration: none;
    color: inherit;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}
html[lang="ar"] .inv-btn {
    letter-spacing: 0.04em;
    text-transform: none;
    font-size: 0.95rem;
}
.inv-btn:hover {
    background: var(--gold);
    color: var(--wine);
}
.inv-btn--solid {
    background: var(--gold);
    color: var(--wine);
    border-color: var(--gold);
}
.inv-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.inv-notes {
    max-width: 400px;
    margin: 2.6rem auto 0;
    text-align: start;
}
.inv-notes__title {
    font-family: var(--f-head);
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--gold);
}
.inv-notes__item {
    padding: 0.6rem 0;
}
.inv-notes__k {
    display: block;
    font-family: var(--f-body);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 0.68rem;
    color: var(--ink-soft);
    margin-bottom: 0.15rem;
}
html[lang="ar"] .inv-notes__k {
    letter-spacing: 0;
    text-transform: none;
    font-size: 0.88rem;
}
.inv-notes__v {
    font-family: var(--f-body);
    font-size: 0.98rem;
}

/* ── programme ──────────────────────────────────────────────────────────── */

.inv-program {
    list-style: none;
    max-width: 340px;
    margin: 2.2rem auto 0;
}
.inv-program__item {
    display: grid;
    grid-template-columns: 4.5rem 12px 1fr;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 0;
    text-align: start;
}
.inv-program__item + .inv-program__item {
    border-top: 1px solid rgba(201, 170, 106, 0.28);
}
.inv-program__time {
    font-family: var(--f-head);
    font-size: 1rem;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
}
.inv-program__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
}
.inv-program__label {
    font-family: var(--f-head);
    font-size: 1.08rem;
    color: var(--on-dark);
}

/* ── gallery ────────────────────────────────────────────────────────────── */

.inv-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-width: 620px;
    margin: 2.2rem auto 0;
}
.inv-gallery__cell {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 6px;
    background: linear-gradient(150deg, #f0dfd3, #d8b7a8);
}
.inv-gallery__cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.inv-gallery__mark {
    position: absolute;
    inset-block-end: 8px;
    inset-inline-end: 10px;
    font-family: var(--f-script);
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    opacity: 0;
}
.inv-gallery__cell.is-empty .inv-gallery__mark {
    opacity: 1;
}
@media (min-width: 640px) {
    .inv-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── RSVP form ──────────────────────────────────────────────────────────── */

.inv-form {
    max-width: 400px;
    margin: 1.8rem auto 0;
    text-align: start;
}
.inv-field {
    display: block;
    border: 0;
    margin-bottom: 1.3rem;
}
.inv-field__label {
    display: block;
    font-family: var(--f-body);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.7rem;
    color: var(--on-dark-soft);
    margin-bottom: 0.5rem;
}
html[lang="ar"] .inv-field__label {
    letter-spacing: 0;
    text-transform: none;
    font-size: 0.9rem;
}
.inv-form input[type="text"],
.inv-form input[type="tel"],
.inv-form input[type="email"],
.inv-form input[type="number"],
.inv-form textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: rgba(248, 241, 231, 0.08);
    border: 1px solid rgba(201, 170, 106, 0.4);
    border-radius: 8px;
    font-family: var(--f-body);
    font-size: 1rem;
    color: var(--on-dark);
    resize: vertical;
}
.inv-form input[type="number"] { width: 6rem; text-align: center; }
.inv-form input:focus,
.inv-form textarea:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(248, 241, 231, 0.14);
}
.inv-form input::placeholder,
.inv-form textarea::placeholder {
    color: rgba(248, 241, 231, 0.4);
}
.inv-field__hint {
    font-style: italic;
    font-size: 0.85em;
    color: var(--on-dark-soft);
    text-transform: none;
    letter-spacing: 0;
}
html[lang="ar"] .inv-field__hint { font-style: normal; }
.inv-rsvp__guests[hidden] { display: none; }

.inv-form__error {
    margin: 0 auto 1.2rem;
    max-width: 400px;
    padding: 0.7rem 1rem;
    border: 1px solid rgba(201, 170, 106, 0.5);
    border-radius: 8px;
    background: rgba(248, 241, 231, 0.1);
    color: var(--on-dark);
    font-size: 0.9rem;
    text-align: center;
}

.inv-thanks {
    max-width: 34ch;
    margin: 1.4rem auto 0;
}
.inv-thanks__title {
    font-family: var(--f-script);
    font-size: clamp(2rem, 8vw, 3rem);
    color: var(--gold);
    margin-bottom: 0.4rem;
}
html[lang="ar"] .inv-thanks__title {
    font-family: var(--f-head);
    font-size: clamp(1.4rem, 5.4vw, 2rem);
}
.inv-choice {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.inv-choice label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--f-body);
    font-size: 0.98rem;
    color: var(--on-dark);
}
.inv-choice input {
    accent-color: var(--gold);
    width: 16px;
    height: 16px;
}
.inv-form .inv-btn--solid {
    width: 100%;
    margin-top: 0.4rem;
}
.inv-form__demo {
    margin-top: 1rem;
    text-align: center;
    font-family: var(--f-body);
    font-style: italic;
    font-size: 0.86rem;
    color: var(--on-dark-soft);
}
html[lang="ar"] .inv-form__demo {
    font-style: normal;
}

/* ── footer ─────────────────────────────────────────────────────────────── */

.inv-footer {
    background: var(--wine);
    color: var(--on-dark-soft);
    text-align: center;
    padding: 56px 24px 48px;
}
.inv-footer__names {
    font-family: var(--f-name);
    font-size: clamp(1.7rem, 7vw, 2.4rem);
    color: var(--on-dark);
}
.inv-footer__names span {
    color: var(--gold);
    font-family: var(--f-script);
}
html[lang="ar"] .inv-footer__names span {
    font-family: var(--f-name);
}
.inv-footer__line {
    margin-top: 1.4rem;
    font-family: var(--f-body);
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
html[lang="ar"] .inv-footer__line {
    letter-spacing: 0;
    text-transform: none;
    font-size: 0.95rem;
}
.inv-footer__brand {
    display: inline-block;
    margin-top: 0.5rem;
    font-family: var(--f-head);
    font-size: 1.05rem;
    letter-spacing: 0.22em;
    color: var(--gold);
    text-decoration: none;
}
.inv-footer__brand em {
    font-family: var(--f-script);
    font-style: normal;
    letter-spacing: 0;
    font-size: 1.15rem;
}
