/*
 * Melayu Emas: a Malay (Riau / Deli) wedding with a royal pelaminan feel. Cream panels and royal
 * bands with gold; ornaments inspired by Malay wood carving (inline SVG symbols in sections/_defs):
 * awan larat, itik pulang petang, pucuk rebung (CSS triangles), bunga tanjung, tepak sirih and the
 * house gable with selembayung horns. Cormorant Garamond + Lora + Pinyon Script names.
 * Sections are cream by default; .me-section--royal (and the cover/hero) switch the context tokens.
 * Colors from the variant: --inv-primary, --inv-accent, --inv-background, --inv-text,
 * --inv-surface, --inv-deep, --inv-label, --inv-onprimary. All classes start with "me-".
 */

:root {
    --inv-primary: #dca514;
    --inv-accent: #b8860b;
    --inv-background: #fdf7e6;
    --inv-text: #3a280c;
    --inv-surface: #fffbf1;
    --inv-deep: #5a3906;
    --inv-label: #855d05;
    --inv-onprimary: #3a2304;
    --inv-radius: 14px;

    --me-w: 460px;
    --me-display: 'Cormorant Garamond', 'Garamond', Georgia, serif;
    --me-script: 'Pinyon Script', 'Brush Script MT', cursive;
    --me-serif: 'Lora', Georgia, 'Times New Roman', serif;
    --me-mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;

    /* polished gold, as a background */
    --me-gold-bg: linear-gradient(120deg, color-mix(in srgb, var(--inv-accent) 55%, #fff) 0%, var(--inv-accent) 32%, color-mix(in srgb, var(--inv-accent) 75%, #3a2200) 55%, color-mix(in srgb, var(--inv-accent) 62%, #fff) 80%, var(--inv-accent) 100%);
    --me-royal-deep: color-mix(in srgb, var(--inv-primary) 74%, var(--inv-deep));

    /* context tokens: cream by default, redefined for royal bands */
    --me-bg: var(--inv-background);
    --me-fg: var(--inv-text);
    --me-muted: color-mix(in srgb, var(--inv-text) 80%, transparent);
    --me-gold: var(--inv-label);
    --me-line: color-mix(in srgb, var(--inv-accent) 62%, transparent);
    --me-line-soft: color-mix(in srgb, var(--inv-accent) 28%, transparent);
    --me-btn-bg: linear-gradient(140deg, color-mix(in srgb, var(--inv-deep) 82%, #fff 10%), var(--inv-deep));
    --me-btn-fg: color-mix(in srgb, var(--inv-accent) 35%, #fff);
    --me-card-bg: var(--inv-surface);
    --me-field-bg: #fff;
}

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

html { background: var(--inv-background); scroll-behavior: smooth; }

body.me-body {
    margin: 0;
    background: var(--inv-background);
    color: var(--inv-text);
    font: 400 1rem/1.7 var(--me-serif);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

img { max-width: 100%; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: inherit; }

.me-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.me-icon { width: 1.1em; height: 1.1em; flex: none; }

/* royal context: the cover, the hero and the royal bands */
.me-cover, .me-hero, .me-section--royal {
    --me-bg: var(--inv-primary);
    --me-fg: var(--inv-onprimary);
    --me-muted: color-mix(in srgb, var(--inv-onprimary) 86%, transparent);
    --me-gold: color-mix(in srgb, var(--inv-accent) 40%, var(--inv-onprimary));
    --me-line: color-mix(in srgb, color-mix(in srgb, var(--inv-accent) 45%, var(--inv-onprimary)) 60%, transparent);
    --me-line-soft: color-mix(in srgb, color-mix(in srgb, var(--inv-accent) 45%, var(--inv-onprimary)) 28%, transparent);
    --me-btn-bg: var(--inv-onprimary);
    --me-btn-fg: var(--inv-primary);
    --me-card-bg: color-mix(in srgb, var(--inv-onprimary) 9%, var(--inv-primary));
    --me-field-bg: color-mix(in srgb, var(--inv-onprimary) 12%, var(--inv-primary));
}

/* the songket lattice: gold diamonds woven into the royal cloth */
.me-section.me-section--royal, .me-hero {
    background:
        repeating-linear-gradient(45deg, color-mix(in srgb, var(--inv-accent) 14%, transparent) 0 1px, transparent 1px 18px),
        repeating-linear-gradient(-45deg, color-mix(in srgb, var(--inv-accent) 14%, transparent) 0 1px, transparent 1px 18px),
        radial-gradient(110% 60% at 50% 0%, color-mix(in srgb, var(--inv-primary) 88%, #fff 12%), transparent 75%),
        linear-gradient(180deg, var(--inv-primary), var(--me-royal-deep));
}

/* ---------- backdrop (wide screens) and the column ---------- */

.me-backdrop { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--inv-deep); }
.me-backdrop::before {
    content: ''; position: absolute; inset: -60px;
    background: var(--me-photo, none) center / cover no-repeat;
    filter: blur(26px) saturate(.8) brightness(.55);
}
.me-backdrop::after {
    content: ''; position: absolute; inset: 0;
    background:
        repeating-linear-gradient(45deg, color-mix(in srgb, var(--inv-accent) 22%, transparent) 0 1px, transparent 1px 26px),
        repeating-linear-gradient(-45deg, color-mix(in srgb, var(--inv-accent) 22%, transparent) 0 1px, transparent 1px 26px),
        radial-gradient(ellipse at center, color-mix(in srgb, var(--inv-primary) 45%, transparent) 10%, color-mix(in srgb, var(--inv-deep) 90%, transparent) 100%);
}

.me-page {
    position: relative; z-index: 1;
    width: min(100%, var(--me-w)); min-height: 100vh; margin: 0 auto; padding-bottom: 5.5rem;
    background: var(--inv-background);
    overflow-x: clip;
}
@media (min-width: 520px) {
    .me-page { box-shadow: 0 0 0 1px var(--me-line-soft), 0 0 0 7px color-mix(in srgb, var(--inv-deep) 70%, transparent), 0 0 0 8px var(--me-line), 0 0 90px rgb(0 0 0 / .55); }
}
@media (max-width: 519px) { .me-backdrop { display: none; } }

.me-preview {
    position: fixed; z-index: 60; top: 0; left: 0; right: 0;
    width: min(100%, var(--me-w)); margin: 0 auto; padding: .35rem .75rem;
    background: var(--me-gold-bg); color: var(--inv-deep);
    font: 500 .68rem/1.3 var(--me-serif); text-align: center; letter-spacing: .03em;
}

/* ---------- ornaments ---------- */

.me-corners { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.me-corner { position: absolute; width: clamp(100px, 28vw, 126px); aspect-ratio: 1; opacity: .85; }
.me-corner svg {
    overflow: visible; display: block; width: 100%; height: 100%;
    transform-origin: 8% 8%;
    animation: me-sway 7s ease-in-out infinite alternate;
    will-change: transform;
}
.me-corner--tl { top: 0; left: 0; }
.me-corner--tr { top: 0; right: 0; transform: scaleX(-1); }
.me-corner--bl { bottom: 0; left: 0; transform: scaleY(-1); }
.me-corner--br { bottom: 0; right: 0; transform: scale(-1, -1); }
.me-corner--tr svg { animation-delay: -2.4s; animation-duration: 8s; }
.me-corner--bl svg { animation-delay: -4s; animation-duration: 7.5s; }
.me-corner--br svg { animation-delay: -1.3s; animation-duration: 8.5s; }
@keyframes me-sway {
    from { transform: rotate(-1.6deg) scale(1); }
    to { transform: rotate(1.6deg) scale(1.03); }
}

/* the pelaminan drapes: a scalloped valance with a gold fringe, pleated side drapes tied back */
.me-tabir { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.me-tabir__valance {
    position: absolute; top: 0; left: 0; right: 0; height: 2.6rem;
    background:
        radial-gradient(ellipse 50% 100% at 50% 0, transparent 92%, var(--inv-accent) 93% 100%, transparent 0) 0 .9rem / 52px 1.4rem repeat-x,
        radial-gradient(ellipse 50% 100% at 50% 0, var(--me-royal-deep) 92%, transparent 93%) 0 .9rem / 52px 1.4rem repeat-x,
        linear-gradient(180deg, var(--inv-deep), var(--me-royal-deep)) 0 0 / 100% .95rem no-repeat;
    filter: drop-shadow(0 4px 5px rgb(0 0 0 / .25));
}
/* the gold fringe line at the foot of the valance's band */
.me-tabir__valance::after {
    content: ''; position: absolute; left: 0; right: 0; top: .85rem; height: 2px;
    background: var(--me-gold-bg);
}
.me-tabir__side {
    position: absolute; top: 0; bottom: 0; width: 19%;
    background:
        repeating-linear-gradient(90deg, rgb(0 0 0 / .16) 0 2px, transparent 2px 8px, rgb(255 255 255 / .1) 8px 10px, transparent 10px 13px),
        linear-gradient(90deg, var(--inv-deep) 10%, var(--me-royal-deep) 70%, color-mix(in srgb, var(--me-royal-deep) 70%, #fff 10%));
    clip-path: polygon(0 0, 100% 0, 88% 14%, 52% 36%, 26% 45%, 30% 60%, 44% 100%, 0 100%);
    opacity: .92;
}
.me-tabir__side--right { right: 0; transform: scaleX(-1); }
.me-tabir__side--left { left: 0; }
/* the gold tie-back of each drape */
.me-tabir__side::after {
    content: ''; position: absolute; left: 0; top: 44%; width: 34%; height: 6px;
    background: var(--me-gold-bg); border-radius: 3px;
}

/* the itik pulang petang border: ducks between gold rules over a row of rebung teeth */
.me-itik {
    position: relative; height: 34px; padding: 6px 0;
    background: var(--inv-deep);
    border-top: 2px solid var(--inv-accent);
    border-bottom: 2px solid var(--inv-accent);
}
.me-itik::before {
    content: ''; position: absolute; left: 0; right: 0; top: 2px; bottom: 2px;
    border-top: 1px solid color-mix(in srgb, var(--inv-accent) 45%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--inv-accent) 45%, transparent);
}
.me-itik::after {
    content: ''; position: absolute; z-index: 3; left: 0; right: 0; top: 100%; height: 9px;
    background: conic-gradient(from -21deg at 50% 100%, var(--inv-accent) 42deg, transparent 0) 0 0 / 12px 9px repeat-x;
}
.me-itik__row { display: block; width: 100%; height: 18px; }

/* pucuk rebung: tall gold triangles with a royal heart */
.me-rebung {
    display: block; height: 16px;
    background:
        conic-gradient(from 159deg at 50% 45%, var(--inv-primary) 42deg, transparent 0) 0 0 / 14px 16px repeat-x,
        conic-gradient(from 159deg at 50% 0, var(--inv-accent) 42deg, transparent 0) 0 0 / 14px 16px repeat-x;
}
.me-rebung--flip { transform: scaleY(-1); }

/* the house gable */
.me-gable { position: relative; z-index: 2; }
.me-gable__svg { display: block; width: 100%; aspect-ratio: 320 / 172; overflow: visible; filter: drop-shadow(0 8px 10px rgb(0 0 0 / .3)); }
.me-gable__mono {
    position: absolute; left: 50%; top: 61%; transform: translate(-50%, -50%);
    display: inline-flex; align-items: center; gap: .35rem; padding: .1rem .7rem .15rem;
    border-radius: 999px; background: var(--inv-primary); color: var(--inv-onprimary);
    box-shadow: 0 0 0 1.5px var(--inv-accent), 0 0 0 4px var(--inv-primary);
    font: 700 1.15rem/1.2 var(--me-display); letter-spacing: .04em;
}
.me-gable__sep { width: 5px; height: 5px; background: var(--inv-accent); transform: rotate(45deg); }

.me-divider { display: flex; align-items: center; justify-content: center; gap: .3rem; margin: .7rem auto 0; color: var(--me-gold); }
.me-divider__line { width: 2.6rem; height: 1px; background: linear-gradient(90deg, transparent, var(--me-gold)); }
.me-divider__line--end { transform: scaleX(-1); }
.me-divider__awan { width: 2.6rem; height: 1.4rem; overflow: visible; stroke-width: 3.4; transform: scaleX(-1); }
.me-divider__awan--end { transform: none; }
.me-divider__flower { width: 1rem; height: 1rem; overflow: visible; }

.me-kicker {
    position: relative; z-index: 2;
    font: 500 .72rem/1.4 var(--me-serif); letter-spacing: .38em; text-transform: uppercase;
    color: var(--me-gold);
}

/* ---------- buttons (shared components) ---------- */

.inv-button {
    gap: .5rem; padding: .8rem 1.4rem; border-radius: 999px;
    background: var(--me-btn-bg); color: var(--me-btn-fg);
    font: 600 .74rem/1.2 var(--me-serif); letter-spacing: .12em; text-transform: uppercase;
    box-shadow: 0 10px 22px -12px rgb(0 0 0 / .55), inset 0 0 0 1px color-mix(in srgb, var(--inv-accent) 55%, transparent);
}
.inv-button--outline {
    background: transparent; color: var(--me-gold);
    box-shadow: inset 0 0 0 1px var(--me-line);
}
.inv-button--outline:hover { background: color-mix(in srgb, var(--inv-accent) 12%, transparent); }
.inv-button .me-icon { width: 1.1rem; height: 1.1rem; }

.me-pill {
    display: inline-flex; align-items: center; gap: .4rem; margin-top: .7rem; padding: .45rem .95rem;
    border-radius: 999px; color: var(--me-gold); text-decoration: none;
    box-shadow: inset 0 0 0 1px var(--me-line);
    font: 500 .78rem/1 var(--me-serif);
    transition: background .25s ease;
}
.me-pill:hover { background: color-mix(in srgb, var(--inv-accent) 12%, transparent); }

/* ---------- cover ---------- */

.me-cover {
    position: fixed; inset: 0; z-index: 30;
    width: min(100%, var(--me-w)); margin: 0 auto;
    display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto;
    background: var(--inv-primary); color: var(--me-fg);
}
.me-cover__photo { position: absolute; inset: 0; background: var(--me-photo, none) center 30% / cover no-repeat; }
.me-cover__photo::after {
    content: ''; position: absolute; inset: 0;
    background:
        repeating-linear-gradient(45deg, color-mix(in srgb, var(--inv-accent) 16%, transparent) 0 1px, transparent 1px 18px),
        repeating-linear-gradient(-45deg, color-mix(in srgb, var(--inv-accent) 16%, transparent) 0 1px, transparent 1px 18px),
        linear-gradient(180deg, color-mix(in srgb, var(--inv-primary) 82%, transparent), color-mix(in srgb, var(--me-royal-deep) 92%, transparent));
}
.me-cover__inner {
    position: relative; z-index: 2;
    width: min(100% - 3.4rem, 21.5rem); margin: auto; padding: 2.4rem 0 3.4rem;
}
.me-cover__crown { width: 116%; margin: 0 -8% -4.6%; position: relative; z-index: 3; }
.me-panel {
    position: relative; z-index: 2;
    display: flex; flex-direction: column; align-items: center; gap: .55rem;
    padding: 2.1rem 1.25rem 1.6rem; text-align: center;
    background:
        radial-gradient(120% 60% at 50% 0%, #fff, transparent 70%),
        var(--inv-surface);
    color: var(--inv-text);
    border: 1.5px solid var(--inv-accent);
    box-shadow: inset 0 0 0 5px var(--inv-surface), inset 0 0 0 6px color-mix(in srgb, var(--inv-accent) 55%, transparent), 0 26px 50px -24px rgb(0 0 0 / .6);
    /* inside the panel the cream tokens apply */
    --me-fg: var(--inv-text);
    --me-muted: color-mix(in srgb, var(--inv-text) 80%, transparent);
    --me-gold: var(--inv-label);
    --me-line: color-mix(in srgb, var(--inv-accent) 62%, transparent);
    --me-line-soft: color-mix(in srgb, var(--inv-accent) 28%, transparent);
    --me-btn-bg: linear-gradient(140deg, color-mix(in srgb, var(--inv-deep) 82%, #fff 10%), var(--inv-deep));
    --me-btn-fg: color-mix(in srgb, var(--inv-accent) 35%, #fff);
}
.me-panel__arch {
    position: absolute; left: 0; right: 0; top: 14px; width: 100%; height: 3.2rem; pointer-events: none;
    fill: none; stroke: var(--me-line); stroke-width: 1;
}
.me-panel > :not(.me-panel__arch) { position: relative; }
.me-panel .me-kicker { margin-top: .9rem; }

.me-cover__names {
    display: flex; flex-direction: column; align-items: center;
    font: 400 clamp(2.5rem, 12vw, 3.1rem)/1.15 var(--me-script); color: var(--inv-deep);
}
.me-cover__names > span { overflow-wrap: anywhere; }
.me-cover__amp { font: 600 .5em/1.2 var(--me-display); color: var(--me-gold); }
.me-cover__date {
    display: flex; align-items: center; gap: .6rem;
    font: 600 .72rem/1.4 var(--me-serif); letter-spacing: .18em; text-transform: uppercase; color: var(--me-fg);
}
.me-cover__date::before, .me-cover__date::after {
    content: ''; width: 6px; height: 6px; background: var(--inv-accent); transform: rotate(45deg);
}
.me-cover__quote { max-width: 18rem; font: italic 400 .88rem/1.5 var(--me-serif); color: var(--me-muted); }

.me-guest {
    position: relative; width: 100%; margin-top: .35rem; padding: .85rem 1rem .8rem;
    border: 1px solid var(--me-line);
    outline: 1px solid var(--me-line-soft); outline-offset: -5px;
    background: color-mix(in srgb, var(--inv-primary) 9%, #fff);
}
.me-guest::before, .me-guest::after {
    content: ''; position: absolute; top: -5px; width: 9px; height: 9px;
    background: var(--inv-accent); transform: rotate(45deg);
}
.me-guest::before { left: -5px; }
.me-guest::after { right: -5px; }
.me-guest__label { font: 500 .64rem/1.4 var(--me-serif); letter-spacing: .3em; text-transform: uppercase; color: var(--me-gold); }
.me-guest__name { margin-top: .25rem; font: 700 1.3rem/1.25 var(--me-display); color: var(--inv-deep); overflow-wrap: anywhere; }
.me-guest__note { margin-top: .3rem; font: 400 .78rem/1.5 var(--me-serif); color: var(--me-muted); }
.me-open { margin-top: .35rem; }

.me-cover__foot { position: relative; z-index: 2; margin-top: auto; }

/* short screens: the panel tightens so the guest box and "Buka Undangan" stay above the itik border */
@media (max-height: 760px) {
    .me-cover__inner { padding: .5rem 0 .75rem; }
    .me-panel { gap: .35rem; padding: 1.5rem 1.1rem 1rem; }
    .me-panel__arch { top: 10px; height: 2.6rem; }
    .me-panel .me-kicker { margin-top: .5rem; }
    .me-cover__names { font-size: clamp(2.2rem, 10.5vw, 2.6rem); line-height: 1.05; }
    .me-cover__quote { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden; font-size: .84rem; line-height: 1.45; }
    .me-guest { margin-top: .1rem; padding: .6rem .9rem; }
    .me-guest__name { margin-top: .15rem; font-size: 1.12rem; }
    .me-guest__note { margin-top: .2rem; font-size: .74rem; line-height: 1.4; }
    .me-open { margin-top: .1rem; }
}
@media (max-height: 660px) {
    .me-cover__crown { width: 100%; margin: 0 0 -4%; }
    .me-panel { padding: 1.3rem 1rem .85rem; gap: .3rem; }
    .me-cover__names { font-size: clamp(2rem, 9.5vw, 2.3rem); }
    .me-cover__quote { font-size: .8rem; }
    .me-guest__note { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden; }
}
.me-cover > .me-tabir { z-index: 1; }

.me-cover--leave { transition: transform 1.1s cubic-bezier(.7, 0, .3, 1), opacity 1.1s ease; }
.me-cover--gone { transform: translateY(-100%); opacity: 0; }

/* ---------- hero (top of the page after opening) ---------- */

.me-hero {
    position: relative; overflow: hidden;
    min-height: min(100vh, 860px); min-height: min(100svh, 860px); padding: 4rem 1.5rem 3rem;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; color: var(--me-fg);
}
.me-hero > :not(.me-tabir):not(.me-corners) { position: relative; z-index: 2; }

/* the house: the gable over the photo in a gold frame */
.me-house { position: relative; width: min(62%, 240px); margin: 1rem auto 1.2rem; }
.me-house .me-gable { width: 130%; margin: 0 -15% -6.4%; }
.me-house__photo {
    position: relative; display: grid; place-items: center; aspect-ratio: 4 / 4.8;
    border: 3px solid transparent;
    background:
        var(--me-photo, none) center 25% / cover no-repeat padding-box,
        linear-gradient(160deg, var(--inv-primary), var(--inv-deep)) padding-box,
        var(--me-gold-bg) border-box;
    box-shadow: 0 0 0 6px var(--me-bg), 0 0 0 7px var(--me-line), 0 28px 50px -24px rgb(0 0 0 / .7);
}
/* the house posts under the photo */
.me-house__photo::after {
    content: ''; position: absolute; left: 8%; right: 8%; top: 100%; height: 1rem; margin-top: 9px;
    background: repeating-linear-gradient(90deg, var(--me-line) 0 3px, transparent 3px 23%);
}
.me-house__mono { display: flex; gap: .3rem; font: 400 4rem/1 var(--me-script); color: var(--inv-onprimary); }

.me-hero .me-kicker { margin-bottom: .3rem; }
.me-hero__names {
    margin-top: 1.4rem;
    display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 .45rem;
    font: 400 clamp(2.6rem, 12vw, 3.2rem)/1.2 var(--me-script); color: var(--me-fg);
}
.me-hero__amp { font: 600 .5em/1 var(--me-display); color: var(--me-gold); }
.me-hero__date { margin-top: .3rem; font: 600 .74rem/1.4 var(--me-serif); letter-spacing: .22em; text-transform: uppercase; color: var(--me-muted); }
.me-scroll { width: 1px; height: 2.8rem; margin-top: 1.4rem; background: var(--me-line-soft); overflow: hidden; }
.me-scroll span { position: absolute; left: 0; top: -1rem; width: 1px; height: 1rem; background: var(--me-fg); animation: me-drip 2.2s ease-in-out infinite; }
@keyframes me-drip { to { transform: translateY(4rem); } }

/* ---------- sections ---------- */

.me-main { position: relative; background: var(--inv-background); }

.me-section {
    position: relative; overflow: hidden;
    padding: 4.5rem 1.4rem;
    text-align: center; color: var(--me-fg);
    background:
        radial-gradient(100% 45% at 50% 0%, color-mix(in srgb, var(--inv-primary) 10%, transparent), transparent 75%),
        var(--inv-background);
}
.me-section > * { position: relative; z-index: 1; }
.me-section > .me-corners, .me-section > .me-tabir { position: absolute; z-index: 0; }
.me-section > .me-tabir + * { margin-top: 1.2rem; }

.me-heading { margin-bottom: 2rem; }
.me-heading__label { font: 500 .68rem/1.4 var(--me-serif); letter-spacing: .36em; text-transform: uppercase; color: var(--me-gold); }
.me-heading__title { margin-top: .2rem; font: 400 clamp(2.3rem, 10.5vw, 2.7rem)/1.25 var(--me-script); color: var(--me-fg); }

.me-lead { max-width: 24rem; margin: -.6rem auto 1.8rem; color: var(--me-muted); font-size: .95rem; }

.me-card {
    position: relative; overflow: hidden;
    background: var(--me-card-bg);
    border: 1px solid var(--me-line-soft); border-radius: 14px;
    box-shadow: 0 22px 40px -30px rgb(0 0 0 / .55);
}

/* opening */
.me-arabic { font: 400 1.75rem/1.8 'Amiri', serif; color: var(--me-gold); margin-bottom: .4rem; }
.me-opening__tepak { display: block; width: 5.4rem; height: 4rem; margin: 0 auto 1rem; overflow: visible; filter: drop-shadow(0 6px 8px rgb(0 0 0 / .18)); }
.me-opening__greeting { font: 600 1.3rem/1.4 var(--me-display); color: var(--me-fg); }
.me-opening__message { max-width: 24rem; margin: .9rem auto 0; color: var(--me-muted); }
.me-quote {
    max-width: 24rem; margin: 2.4rem auto 0; padding: 0; overflow: hidden;
    background: var(--inv-surface); border: 1px solid var(--me-line-soft); border-radius: 4px;
    box-shadow: 0 22px 40px -30px rgb(0 0 0 / .5);
}
.me-quote blockquote { margin: 0; padding: 1.5rem 1.4rem .3rem; font: italic 400 .98rem/1.7 var(--me-serif); color: var(--me-fg); }
.me-quote figcaption { padding: .6rem 1.4rem 1.4rem; font: 600 .68rem/1.4 var(--me-serif); letter-spacing: .24em; text-transform: uppercase; color: var(--me-gold); }
.me-quote:not(:has(figcaption)) blockquote { padding-bottom: 1.4rem; }

/* couple: zig-zag (R3) */
.me-person {
    display: grid; grid-template-columns: 7.6rem minmax(0, 1fr); align-items: center; gap: 1rem;
    max-width: 25rem; margin: 0 auto; text-align: left;
}
.me-person--right { grid-template-columns: minmax(0, 1fr) 7.6rem; text-align: right; }
.me-person--right .me-person__frame { order: 2; }
.me-person__frame { position: relative; aspect-ratio: 1; padding: 3px; border-radius: 50%; background: var(--me-gold-bg); box-shadow: 0 0 0 5px var(--me-bg), 0 0 0 6px var(--me-line), 0 18px 30px -14px rgb(0 0 0 / .5); }
.me-person__photo { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.me-person__photo--empty {
    display: grid; place-items: center;
    background: linear-gradient(160deg, var(--inv-primary), var(--inv-deep));
    font: 400 3.6rem/1 var(--me-script); color: var(--inv-onprimary);
}
.me-person__flower {
    position: absolute; left: 50%; bottom: -.7rem; width: 1.5rem; height: 1.5rem; transform: translateX(-50%);
    overflow: visible; color: var(--inv-accent);
    filter: drop-shadow(0 0 2px var(--me-bg)) drop-shadow(0 0 2px var(--me-bg));
}
.me-person__role { font: 500 .62rem/1.4 var(--me-serif); letter-spacing: .3em; text-transform: uppercase; color: var(--me-gold); }
.me-person__nick { font: 400 2.3rem/1.2 var(--me-script); color: var(--inv-deep); }
.me-person__name { margin-top: .1rem; font: 700 1.08rem/1.3 var(--me-display); color: var(--me-fg); overflow-wrap: anywhere; }
.me-person__parents { margin-top: .4rem; font-size: .84rem; line-height: 1.5; color: var(--me-muted); }
.me-person__parents strong { color: var(--me-fg); font-weight: 600; }

.me-amp { display: flex; align-items: center; justify-content: center; gap: .5rem; margin: 1.6rem 0 1.8rem; color: var(--me-gold); }
.me-amp svg { width: 3.2rem; height: 1.7rem; overflow: visible; stroke-width: 3; transform: scaleX(-1); }
.me-amp svg.me-amp__end { transform: none; }
.me-amp span { font: italic 500 3rem/1 var(--me-display); color: var(--inv-deep); }

/* countdown: cream tiles with a gold rim on the royal band */
.me-countdown__date { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1.4rem; font: 600 .78rem/1.4 var(--me-serif); letter-spacing: .1em; text-transform: uppercase; }
.me-countdown__date .me-icon { width: 1.2rem; height: 1.2rem; }
.inv-countdown { gap: .5rem; }
.inv-countdown__item {
    position: relative; overflow: hidden;
    flex: 1; max-width: 5rem; min-width: 0; padding: .95rem .25rem 1.2rem;
    border-radius: 2.5rem 2.5rem 8px 8px; color: var(--inv-text);
    background: var(--inv-surface);
    box-shadow: inset 0 0 0 1.5px var(--inv-accent), inset 0 0 0 4px var(--inv-surface), inset 0 0 0 5px color-mix(in srgb, var(--inv-accent) 40%, transparent), 0 14px 24px -14px rgb(0 0 0 / .55);
}
.inv-countdown__item::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 8px;
    background: conic-gradient(from 159deg at 50% 0, var(--inv-accent) 42deg, transparent 0) 0 0 / 8px 8px repeat-x;
    transform: scaleY(-1);
}
.inv-countdown__value { font: 700 1.9rem/1.1 var(--me-display); color: var(--inv-deep); }
.inv-countdown__label { margin-top: .2rem; font: 500 .6rem/1.2 var(--me-serif); letter-spacing: .14em; text-transform: uppercase; color: var(--inv-label); }
.inv-countdown__done { font-style: italic; color: var(--me-muted); }
.inv-countdown__actions { margin-top: 1.5rem; }
.inv-countdown__actions .inv-button { padding: .65rem 1rem; font-size: .62rem; letter-spacing: .08em; }

/* events: centered (R2) */
.me-events__list { max-width: 24rem; margin: 0 auto; }
.me-event { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.me-event__photo {
    width: min(62%, 13rem); aspect-ratio: 4 / 4.6; margin-bottom: .8rem;
    border: 3px solid transparent; border-radius: 999px 999px 10px 10px;
    background: var(--me-photo) center 30% / cover no-repeat padding-box, var(--me-gold-bg) border-box;
    box-shadow: 0 0 0 5px var(--me-bg), 0 0 0 6px var(--me-line), 0 22px 36px -20px rgb(0 0 0 / .55);
}
.me-event__name { font: 400 2.3rem/1.2 var(--me-script); color: var(--inv-deep); overflow-wrap: anywhere; }
.me-event p { display: flex; align-items: flex-start; justify-content: center; gap: .4rem; max-width: 100%; overflow-wrap: anywhere; }
.me-event .me-icon { margin-top: .22em; width: 1.05rem; height: 1.05rem; color: var(--me-gold); }
.me-event__date { font: 700 1.15rem/1.35 var(--me-display); color: var(--me-fg); }
.me-event__time { font: 600 .9rem/1.4 var(--me-serif); color: var(--me-gold); letter-spacing: .03em; }
.me-event__venue { margin-top: .4rem; font: 700 1.08rem/1.35 var(--me-display); color: var(--me-fg); }
.me-event__address { font-size: .88rem; line-height: 1.55; color: var(--me-muted); }
.me-event__dress { font-size: .86rem; color: var(--me-fg); font-style: italic; }
.me-event__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; width: 100%; margin-top: 1.1rem; }
.me-event__actions .inv-button { padding: .72rem .5rem; font-size: .64rem; letter-spacing: .06em; }
.me-events__sep {
    display: flex; align-items: center; gap: .7rem; margin: 2.2rem 0; color: var(--me-gold);
}
.me-events__sep::before, .me-events__sep::after { content: ''; flex: 1; border-top: 1.5px dashed var(--me-line); }
.me-events__sep svg { width: 1.2rem; height: 1.2rem; overflow: visible; }

/* love story: a vertical timeline on the royal band */
.me-timeline { position: relative; max-width: 25rem; margin: 0 auto; padding: 0; list-style: none; text-align: left; }
.me-timeline::before {
    content: ''; position: absolute; left: .8rem; top: .4rem; bottom: .4rem; width: 1.5px;
    background: linear-gradient(180deg, transparent, var(--me-gold) 5%, var(--me-gold) 95%, transparent);
}
.me-timeline__item { position: relative; padding-left: 2.4rem; }
.me-timeline__item + .me-timeline__item { margin-top: 1.6rem; }
.me-timeline__dot {
    position: absolute; left: .8rem; top: .9rem; width: 1.5rem; height: 1.5rem; transform: translateX(-50%);
    overflow: visible; color: var(--inv-accent);
    border-radius: 50%; background: var(--me-bg); box-shadow: 0 0 0 4px var(--me-bg);
}
.me-timeline__card {
    overflow: hidden; border-radius: 12px;
    background: var(--me-card-bg);
    box-shadow: inset 0 0 0 1px var(--me-line-soft), 0 18px 32px -22px rgb(0 0 0 / .6);
}
.me-timeline__photo { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-bottom: 2px solid var(--inv-accent); }
.me-timeline__body { padding: 1rem 1.1rem 1.15rem; }
.me-timeline__date { font: 600 .68rem/1.4 var(--me-serif); letter-spacing: .22em; text-transform: uppercase; color: var(--me-gold); }
.me-timeline__title { margin-top: .15rem; font: 700 1.2rem/1.3 var(--me-display); color: var(--me-fg); overflow-wrap: anywhere; }
.me-timeline__story { margin-top: .35rem; font-size: .88rem; line-height: 1.6; color: var(--me-muted); overflow-wrap: anywhere; }

/* gallery: the first photo wide; a lonely last photo is wide too */
.inv-gallery { gap: .55rem; }
.inv-gallery__item { border-radius: 10px; box-shadow: 0 0 0 1px var(--me-line), 0 16px 26px -20px rgb(0 0 0 / .7); }
.inv-gallery__item:first-child,
.inv-gallery__item:first-child ~ .inv-gallery__item:last-child:nth-child(even) { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
.inv-gallery__item:first-child { border-radius: 999px 999px 10px 10px / 160px 160px 10px 10px; }
.inv-gallery__play { background: color-mix(in srgb, var(--inv-deep) 70%, transparent); color: var(--inv-surface); }

/* live streaming */
.me-live__card { max-width: 24rem; margin: 0 auto; padding: 1.6rem 1.3rem; }
.me-live__badge {
    display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .75rem;
    border-radius: 999px; background: var(--inv-deep); color: #fff;
    font: 600 .66rem/1 var(--me-serif); letter-spacing: .2em;
}
.me-live__badge span { width: .45rem; height: .45rem; border-radius: 50%; background: #ff6b5e; animation: me-blink 1.4s ease-in-out infinite; }
@keyframes me-blink { 50% { opacity: .25; } }
.me-live__text { margin: 1rem 0 .5rem; }
.me-live__note { margin-bottom: 1.1rem; font: 600 1rem/1.5 var(--me-display); color: var(--me-gold); }
.me-live__card .inv-button { margin-top: .5rem; }

/* gift: accounts as royal bank cards, two per row (a lonely last card spans both) */
.inv-gift { display: grid; gap: .9rem; max-width: 22rem; margin: 0 auto; }
.inv-gift__accounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.inv-gift__account:last-child:nth-child(odd) { grid-column: 1 / -1; }
.inv-gift__account {
    position: relative; overflow: hidden; isolation: isolate; min-width: 0;
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: .45rem;
    grid-template-areas: "chip bank" "number number" "holder holder" "button button";
    margin: 0; padding: .8rem .8rem 1.2rem;
    border-radius: 16px; text-align: left; color: var(--inv-surface);
    background:
        linear-gradient(118deg, transparent 22%, rgb(255 255 255 / .09) 36%, transparent 50%),
        radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--inv-accent) 30%, transparent), transparent 70%),
        linear-gradient(150deg, color-mix(in srgb, var(--inv-primary) 30%, var(--inv-deep)), color-mix(in srgb, var(--inv-deep) 82%, #000) 80%);
    box-shadow: 0 18px 30px -18px rgb(0 0 0 / .75), inset 0 0 0 1px color-mix(in srgb, var(--inv-accent) 55%, transparent);
}
.inv-gift__account + .inv-gift__account { margin-top: 0; }
.inv-gift__account::before {
    content: ''; grid-area: chip; width: 1.7rem; height: 1.3rem; border-radius: .3rem;
    background:
        linear-gradient(90deg, transparent 31%, rgb(0 0 0 / .25) 31% 33%, transparent 33% 67%, rgb(0 0 0 / .25) 67% 69%, transparent 69%),
        linear-gradient(0deg, transparent 47%, rgb(0 0 0 / .25) 47% 53%, transparent 53%),
        linear-gradient(135deg, #f6e6c4, #c9a160 55%, #ead3a2);
    box-shadow: inset 0 0 0 1px rgb(0 0 0 / .2);
}
/* a rebung hem along the card's foot */
.inv-gift__account::after {
    content: ''; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: .55rem;
    background: conic-gradient(from 159deg at 50% 0, color-mix(in srgb, var(--inv-accent) 70%, transparent) 42deg, transparent 0) 0 0 / 9px 100% repeat-x;
    transform: scaleY(-1);
}
.inv-gift__bank {
    grid-area: bank; justify-self: end; min-width: 0; max-width: 100%; margin: 0;
    font: 600 .66rem/1.2 var(--me-serif); letter-spacing: .06em; text-transform: uppercase; text-align: right; overflow-wrap: anywhere;
}
.inv-gift__logo { height: 1.5rem; max-width: 100%; padding: .2rem .45rem; border-radius: .35rem; }
.inv-gift__logo img { max-width: 4.6rem; }
.inv-gift__number { grid-area: number; margin: .75rem 0 .15rem; font: 500 .98rem/1.25 var(--me-mono); letter-spacing: .03em; color: var(--inv-surface); overflow-wrap: anywhere; }
.inv-gift__holder { grid-area: holder; margin: 0; font: 600 .58rem/1.35 var(--me-serif); letter-spacing: .1em; text-transform: uppercase; color: color-mix(in srgb, var(--inv-surface) 85%, transparent); overflow-wrap: anywhere; }
.inv-gift__account .inv-button {
    grid-area: button; justify-self: start; margin-top: .6rem; padding: .35rem .7rem; border-radius: 999px;
    font-size: .6rem; letter-spacing: .06em; color: color-mix(in srgb, var(--inv-accent) 40%, #fff); background: rgb(255 255 255 / .07);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--inv-accent) 65%, transparent);
}
/* the gift address stays a plain card */
.inv-gift__account.inv-gift__address {
    display: block; min-height: 0; padding: 1.4rem 1.2rem; text-align: center; color: var(--inv-text);
    background: var(--inv-surface);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--inv-accent) 40%, transparent), 0 20px 40px -28px rgb(0 0 0 / .7);
}
.inv-gift__address::before, .inv-gift__address::after { content: none; }
.inv-gift__address .inv-gift__bank { justify-self: auto; text-align: center; font: 500 .68rem/1.4 var(--me-serif); letter-spacing: .3em; color: var(--inv-label); }
.inv-gift__address .inv-gift__holder { margin: .6rem 0 .2rem; font: 700 1.1rem/1.3 var(--me-display); letter-spacing: .02em; text-transform: none; color: var(--inv-text); }
.inv-gift__address p:not([class]) { color: color-mix(in srgb, var(--inv-text) 80%, transparent); }
.inv-gift__address .inv-button { margin-top: 1rem; color: var(--inv-label); background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--inv-accent) 60%, transparent); }

/* rsvp & wishes forms */
.me-form { max-width: 24rem; margin: 0 auto; padding: 0 1.2rem 1.4rem; text-align: left; }
.me-form > .me-rebung { margin: 0 -1.2rem 1.3rem; }
.inv-form { gap: .9rem; }
.inv-form label, .inv-form__choices legend { font: 500 .78rem/1.4 var(--me-serif); letter-spacing: .03em; color: var(--me-muted); }
.inv-form input:not([type=radio]):not([type=checkbox]), .inv-form select, .inv-form textarea {
    padding: .7rem .85rem; border-radius: 8px;
    border: 1px solid var(--me-line);
    background: var(--me-field-bg); color: var(--me-fg);
    font: 400 1rem/1.4 var(--me-serif);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.inv-form input::placeholder, .inv-form textarea::placeholder { color: color-mix(in srgb, var(--me-fg) 45%, transparent); }
.inv-form input:focus, .inv-form select:focus, .inv-form textarea:focus {
    outline: none; border-color: var(--me-gold);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--inv-accent) 25%, transparent);
}
.inv-form option { background: #fff; color: var(--inv-text); }
.inv-form input[type=radio], .inv-form input[type=checkbox] { accent-color: var(--inv-deep); }
.inv-form__choices label { color: var(--me-fg); font-size: .92rem; }
.inv-form__notice { color: var(--me-fg); background: color-mix(in srgb, var(--inv-accent) 14%, transparent); border: 1px solid var(--me-line-soft); }
.inv-form .inv-button { justify-self: stretch; margin-top: .3rem; }
.inv-rsvp__deadline { font-style: italic; color: var(--me-gold); }

/* wishes: compact cards in a scroll box of about three */
.inv-wishes { --inv-wishes-height: 20rem; }
.inv-wishes__list { gap: .6rem; margin-top: 1.4rem; }
.inv-wishes:not(.inv-wishes--paged) .inv-wishes__list {
    padding: .5rem .45rem .5rem .5rem; border-radius: 10px;
    background: color-mix(in srgb, var(--inv-primary) 7%, var(--inv-background));
    box-shadow: inset 0 0 0 1px var(--me-line-soft), inset 0 -14px 16px -14px rgb(0 0 0 / .25);
    scrollbar-color: color-mix(in srgb, var(--inv-accent) 55%, transparent) transparent;
}
.inv-wishes__empty { text-align: center; font-style: italic; }
.inv-wish {
    padding: .65rem .8rem; border-radius: 8px;
    background: #fff;
    border: 1px solid var(--me-line-soft); border-left: 3px solid var(--inv-accent);
}
.inv-wish__name { font: 700 .98rem/1.3 var(--me-display); color: var(--inv-deep); }
.inv-wish__message { font-size: .88rem; line-height: 1.5; }
.inv-wish__time { margin-top: .25rem; font: 400 .68rem/1.3 var(--me-serif); letter-spacing: .03em; }
.inv-wish__reply { margin-top: .5rem; padding: .45rem .65rem; background: color-mix(in srgb, var(--inv-accent) 12%, transparent); }
.inv-wish__reply-text { font-size: .85rem; }
.inv-wishes__page-button { color: var(--me-gold); }

/* closing */
.me-closing { padding-top: 4.4rem; padding-bottom: .5rem; }
.me-house--closing { width: min(56%, 215px); margin: .6rem auto 2.4rem; }
.me-closing__label { font: 500 .7rem/1.4 var(--me-serif); letter-spacing: .4em; text-transform: uppercase; color: var(--me-gold); }
.me-closing__thanks { margin-top: .1rem; font: 400 3rem/1.2 var(--me-script); color: var(--me-fg); }
.me-closing__message { max-width: 24rem; margin: .8rem auto 0; color: var(--me-muted); }
.me-closing__sign { margin-top: 1.5rem; font: 600 .7rem/1.4 var(--me-serif); letter-spacing: .28em; text-transform: uppercase; color: var(--me-gold); }
.me-closing__names { margin-top: .3rem; font: 400 clamp(2.4rem, 11vw, 3rem)/1.25 var(--me-script); color: var(--me-fg); }
.me-closing__names span { font: 600 .45em/1 var(--me-display); color: var(--me-gold); }
.me-closing .me-divider { margin-top: .5rem; }

/* ---------- shared components: nav, music, to-top, branding, check-in ---------- */

.inv-nav {
    --inv-nav-bg: color-mix(in srgb, var(--inv-deep) 94%, transparent);
    --inv-nav-text: color-mix(in srgb, var(--inv-surface) 80%, transparent);
    --inv-nav-active: var(--me-gold-bg);
    border-color: color-mix(in srgb, var(--inv-accent) 45%, transparent);
    box-shadow: 0 14px 34px -12px rgb(0 0 0 / .6), inset 0 -2px 0 color-mix(in srgb, var(--inv-accent) 60%, transparent);
    font-family: var(--me-serif);
}
.inv-nav__item.is-active { color: var(--inv-deep); font-weight: 600; }

.inv-music { right: max(1rem, calc((100vw - var(--me-w)) / 2 + 1rem)); }
.inv-music__button { background: var(--me-gold-bg); color: var(--inv-deep); box-shadow: 0 8px 22px -8px rgb(0 0 0 / .6), 0 0 0 3px color-mix(in srgb, var(--inv-deep) 50%, transparent); }

.inv-to-top {
    left: max(1rem, calc((100vw - var(--me-w)) / 2 + 1rem));
    background: var(--inv-deep); color: color-mix(in srgb, var(--inv-accent) 45%, #fff);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--inv-accent) 55%, transparent), 0 6px 16px -6px rgb(0 0 0 / .5);
}

.me-page > .me-itik { margin-top: 0; }
/* the music player's spacer already keeps the closing clear of the menu */
body:has(> .inv-music__space) .me-page { padding-bottom: 0; }
.me-branding { position: relative; z-index: 1; margin-top: 9px; color: var(--inv-text); font-family: var(--me-serif); }

.inv-checkin { color: var(--inv-text); }
.inv-checkin__title { color: var(--inv-deep); }

/* ---------- motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .me-corner svg, .me-scroll span, .me-live__badge span { animation: none; }
    .me-cover--leave { transition: opacity .3s ease; }
    .me-cover--gone { transform: none; }
}

/* sections with drapes: slimmer drapes, the text kept clear of them */
.me-section > .me-tabir .me-tabir__side { width: 12%; }
.me-closing { padding-left: 2.6rem; padding-right: 2.6rem; }
