/* ==========================================================================
   Digital Invitations — the guest-facing invitation
   ========================================================================== */

/* ==========================================================================
   Themes — generated to match app/js/design-library.js
   ========================================================================== */
:root,
[data-theme="gold"] {
    --bg: #fffdfa;
    --panel: #ffffff;
    --ink: #16130f;
    --body: #787572;
    --accent: #BD945A;
    --accent-dark: #937346;
    --soft: #f6eee4;
    --line: #ebdeca;
    --on-accent: #ffffff;
}
[data-theme="noir"] {
    --bg: #14120f;
    --panel: #242320;
    --ink: #f6f1e8;
    --body: #97938d;
    --accent: #d8bc85;
    --accent-dark: #a89368;
    --soft: #2f2a20;
    --line: #4f4532;
    --on-accent: #f6f1e8;
}
[data-theme="blush"] {
    --bg: #fdf5f3;
    --panel: #ffffff;
    --ink: #43302c;
    --body: #918380;
    --accent: #c08981;
    --accent-dark: #966b65;
    --soft: #f4e6e3;
    --line: #ebd5d1;
    --on-accent: #ffffff;
}
[data-theme="evergreen"] {
    --bg: #f3f7f3;
    --panel: #ffffff;
    --ink: #1f3327;
    --body: #78857d;
    --accent: #3f6b4d;
    --accent-dark: #31533c;
    --soft: #dae3dc;
    --line: #bdcdc1;
    --on-accent: #ffffff;
}
[data-theme="midnight"] {
    --bg: #0d1522;
    --panel: #1e2531;
    --ink: #eaf0fa;
    --body: #8d949f;
    --accent: #a8bedd;
    --accent-dark: #8394ac;
    --soft: #232d3c;
    --line: #3c485a;
    --on-accent: #eaf0fa;
}
[data-theme="sand"] {
    --bg: #faf6ee;
    --panel: #ffffff;
    --ink: #35301f;
    --body: #888376;
    --accent: #9a8464;
    --accent-dark: #78674e;
    --soft: #ede6db;
    --line: #ddd4c5;
    --on-accent: #ffffff;
}
[data-theme="burgundy"] {
    --bg: #f9f4f2;
    --panel: #ffffff;
    --ink: #3d1420;
    --body: #8c7278;
    --accent: #7b2233;
    --accent-dark: #601b28;
    --soft: #e7d7d7;
    --line: #d3b5b9;
    --on-accent: #ffffff;
}
[data-theme="marble"] {
    --bg: #f6f7f8;
    --panel: #ffffff;
    --ink: #23272b;
    --body: #7c7e81;
    --accent: #8b959e;
    --accent-dark: #6c747b;
    --soft: #e7e9eb;
    --line: #d6dadd;
    --on-accent: #ffffff;
}
[data-theme="olive"] {
    --bg: #f7f7f0;
    --panel: #ffffff;
    --ink: #2e3120;
    --body: #828477;
    --accent: #6b6f3d;
    --accent-dark: #535730;
    --soft: #e3e4d7;
    --line: #cdceba;
    --on-accent: #ffffff;
}
[data-theme="lavender"] {
    --bg: #f8f6fb;
    --panel: #ffffff;
    --ink: #2e2440;
    --body: #837c8f;
    --accent: #7c6ba8;
    --accent-dark: #615383;
    --soft: #e7e3ef;
    --line: #d3cce2;
    --on-accent: #ffffff;
}
[data-theme="terracotta"] {
    --bg: #fdf6f1;
    --panel: #ffffff;
    --ink: #40251b;
    --body: #8f7d75;
    --accent: #b56a4a;
    --accent-dark: #8d533a;
    --soft: #f3e2da;
    --line: #e7ccbf;
    --on-accent: #ffffff;
}
[data-theme="slate"] {
    --bg: #f5f6f7;
    --panel: #ffffff;
    --ink: #1f2429;
    --body: #797c80;
    --accent: #4d6273;
    --accent-dark: #3c4c5a;
    --soft: #dde1e5;
    --line: #c3cacf;
    --on-accent: #ffffff;
}
[data-theme="ocean"] {
    --bg: #f2f8fa;
    --panel: #ffffff;
    --ink: #12303a;
    --body: #70848b;
    --accent: #2b7089;
    --accent-dark: #22576b;
    --soft: #d6e5ea;
    --line: #b6cfd8;
    --on-accent: #ffffff;
}
[data-theme="champagne"] {
    --bg: #fdfaf4;
    --panel: #ffffff;
    --ink: #3a3225;
    --body: #8c867c;
    --accent: #c9ab6d;
    --accent-dark: #9d8555;
    --soft: #f6efe1;
    --line: #ede2cc;
    --on-accent: #3a3225;
}
[data-theme="ink"] {
    --bg: #fbfbfb;
    --panel: #ffffff;
    --ink: #111214;
    --body: #737475;
    --accent: #2f3437;
    --accent-dark: #25292b;
    --soft: #dedfe0;
    --line: #bebfc0;
    --on-accent: #ffffff;
}
[data-theme="forest"] {
    --bg: #101a15;
    --panel: #212a25;
    --ink: #e9f2ea;
    --body: #8e9791;
    --accent: #7fae8b;
    --accent-dark: #63886c;
    --soft: #202f26;
    --line: #314638;
    --on-accent: #ffffff;
}
[data-theme="dusk"] {
    --bg: #fbf4f6;
    --panel: #ffffff;
    --ink: #33222c;
    --body: #877a81;
    --accent: #9c5f77;
    --accent-dark: #7a4a5d;
    --soft: #eedfe4;
    --line: #dec7d0;
    --on-accent: #ffffff;
}
[data-theme="coral"] {
    --bg: #fff6f3;
    --panel: #ffffff;
    --ink: #42241d;
    --body: #917c77;
    --accent: #e0674f;
    --accent-dark: #af503e;
    --soft: #fbe2dc;
    --line: #f6cbc2;
    --on-accent: #ffffff;
}
[data-theme="moss"] {
    --bg: #f5f7f2;
    --panel: #ffffff;
    --ink: #242c1c;
    --body: #7c8176;
    --accent: #5c7346;
    --accent-dark: #485a37;
    --soft: #e0e5da;
    --line: #c7cfbe;
    --on-accent: #ffffff;
}
[data-theme="plum"] {
    --bg: #faf5f9;
    --panel: #ffffff;
    --ink: #331c31;
    --body: #877785;
    --accent: #7a3f6d;
    --accent-dark: #5f3155;
    --soft: #e8dce5;
    --line: #d4becf;
    --on-accent: #ffffff;
}

/* ----- heading typography ----- */
[data-font="classic"] { --display: 'Cormorant Garamond', serif; --display-weight: 500; }
[data-font="script"] { --display: 'Alex Brush', cursive; --display-weight: 400; }
[data-font="modern"] { --display: 'Nunito Sans', sans-serif; --display-weight: 300; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--body);
    font-family: 'Nunito Sans', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
    font-family: var(--display, 'Cormorant Garamond', serif);
    font-weight: var(--display-weight, 500);
    color: var(--ink);
    line-height: 1.15;
    margin: 0 0 16px;
}

p { margin: 0 0 16px; }

a { color: var(--accent-dark); }

.wrap { width: 100%; max-width: 660px; margin: 0 auto; padding: 0 22px; }

.center { text-align: center; }
.muted { color: var(--body); opacity: .8; }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.hidden { display: none !important; }
.mb-0 { margin-bottom: 0; }
.mt-24 { margin-top: 24px; }

.eyebrow {
    font-size: 11px;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
    margin: 0 0 14px;
}

.rule { width: 54px; height: 1px; background: var(--accent); margin: 0 auto 22px; opacity: .7; }

/* ==========================================================================
   Cover
   ========================================================================== */
.cover {
    position: relative;
    padding: clamp(64px, 12vw, 110px) 0 clamp(48px, 9vw, 84px);
    text-align: center;
    overflow: hidden;
}

.cover.has-photo { color: #fff; }

.cover .photo {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.cover .photo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 8, 6, .62), rgba(10, 8, 6, .78));
}

.cover .inner { position: relative; z-index: 2; }

.cover.has-photo h1,
.cover.has-photo .monogram,
.cover.has-photo .date-line { color: #fff; }

.cover.has-photo .eyebrow,
.cover.has-photo .host { color: rgba(255, 255, 255, .85); }

.monogram {
    display: inline-block;
    font-family: 'Alex Brush', cursive;
    font-size: clamp(34px, 6vw, 50px);
    color: var(--accent);
    margin-bottom: 10px;
}

.host {
    font-size: 14px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--body);
    margin: 0 0 18px;
}

.cover h1 {
    font-size: clamp(40px, 9vw, 74px);
    margin: 0 0 18px;
}

.date-line {
    font-family: var(--display, 'Cormorant Garamond', serif);
    font-size: clamp(19px, 3.4vw, 26px);
    color: var(--ink);
    letter-spacing: .04em;
}

.date-line span { display: block; }

/* ==========================================================================
   Panels
   ========================================================================== */
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: clamp(24px, 4.5vw, 40px);
    margin: 0 0 24px;
}

.panel h2 { font-size: clamp(26px, 4.5vw, 34px); }
.panel h3 { font-size: 20px; margin-bottom: 10px; }

.section { padding: clamp(36px, 7vw, 62px) 0; }

.detail-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.detail .label {
    font-size: 11px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 6px;
}

.detail p { margin: 0; color: var(--ink); }
.detail .sub { color: var(--body); font-size: 14px; }

.message { white-space: pre-line; font-size: 17px; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    border: 1px solid var(--accent);
    border-radius: 3px;
    background: var(--accent);
    color: var(--on-accent);
    font-family: 'Nunito Sans', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: .25s;
}

.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--on-accent); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn.ghost { background: transparent; color: var(--accent-dark); }
.btn.ghost:hover { background: var(--soft); color: var(--accent-dark); }

.btn.big { padding: 16px 34px; font-size: 13px; }
.btn.block { width: 100%; }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ==========================================================================
   RSVP form
   ========================================================================== */
.rsvp { background: var(--soft); }

label, .label {
    display: block;
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 7px;
}

.field { margin-bottom: 20px; }

.hint {
    font-size: 13px;
    color: var(--body);
    margin-top: 6px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

input[type=text], input[type=email], input[type=tel], input[type=number], select, textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--panel);
    font-family: inherit;
    font-size: 16px;
    color: var(--ink);
    transition: border-color .2s, box-shadow .2s;
}

input:focus, select:focus, textarea:focus {
    outline: 0;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

textarea { min-height: 96px; resize: vertical; }

select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 19px) calc(50% + 1px), calc(100% - 14px) calc(50% + 1px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 38px;
}

/* attendance choice */
.choices { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }

.choice .box {
    display: block;
    padding: 20px 12px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--panel);
    font-family: var(--display, 'Cormorant Garamond', serif);
    font-size: clamp(17px, 4vw, 21px);
    line-height: 1.25;
    /* "Regretfully declines" is the longest of these and must not touch
       the box edge on a narrow phone. */
    overflow-wrap: break-word;
    hyphens: auto;
    color: var(--ink);
    transition: .2s;
}

.choice:hover .box { border-color: var(--accent); }

.choice input:checked + .box {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.choice input:focus-visible + .box { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }

/* attendee blocks */
.attendee {
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 20px;
    margin-bottom: 16px;
    background: var(--panel);
}

.attendee .head {
    font-size: 11px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 14px;
}

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; margin-bottom: 4px; }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--accent); flex: 0 0 auto; }
.check span { font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--body); }

.two { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* notices */
.notice {
    border-left: 3px solid var(--accent);
    background: var(--soft);
    padding: 15px 18px;
    border-radius: 0 3px 3px 0;
    font-size: 14.5px;
    margin-bottom: 22px;
}

.notice.warn { border-left-color: #b5852a; }
.notice p:last-child { margin-bottom: 0; }
.notice strong { color: var(--ink); }

.code-box {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    word-break: break-all;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 3px;
    padding: 14px;
    max-height: 150px;
    overflow-y: auto;
    color: var(--body);
}

/* preview ribbon */
.preview-flag {
    background: var(--ink);
    color: var(--bg);
    text-align: center;
    padding: 9px 16px;
    font-size: 11px;
    letter-spacing: .22em;
    text-transform: uppercase;
    font-weight: 700;
}

/* thank you state */
.done { text-align: center; padding: clamp(40px, 8vw, 70px) 0; }
.done .mark {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin: 0 auto 22px;
}
.done h2 { font-size: clamp(30px, 5.5vw, 42px); }

/* footer */
.invite-foot {
    text-align: center;
    padding: 34px 0 44px;
    font-size: 12.5px;
    color: var(--body);
    opacity: .75;
}

.invite-foot a { color: var(--accent-dark); text-decoration: none; }
.invite-foot a:hover { text-decoration: underline; }

.error-state { padding: 90px 0; text-align: center; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ==========================================================================
   Motion
   ========================================================================== */
/* entrance: the invitation composes itself when it opens */
.inv-ready .cover .monogram { animation: inv-fade .9s ease both; }
.inv-ready .cover .host { animation: inv-rise .7s ease .25s both; }
.inv-ready .cover h1 { animation: inv-title 1s cubic-bezier(.2, .7, .3, 1) .35s both; }
.inv-ready .cover .date-line { animation: inv-rise .7s ease .65s both; }
.inv-ready .cover .photo { animation: inv-photo 7s ease-out both; }

@keyframes inv-fade { from { opacity: 0; } to { opacity: 1; } }

@keyframes inv-rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@keyframes inv-title {
    from { opacity: 0; transform: translateY(18px) scale(.985); letter-spacing: .06em; }
    to { opacity: 1; transform: none; letter-spacing: normal; }
}

@keyframes inv-photo {
    from { transform: scale(1.07); }
    to { transform: scale(1); }
}

/* scroll reveals */
[data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .7s ease, transform .7s cubic-bezier(.2, .7, .3, 1);
}

[data-reveal].revealed { opacity: 1; transform: none; }

[data-reveal="2"].revealed { transition-delay: .1s; }
[data-reveal="3"].revealed { transition-delay: .2s; }

/* choices + fields feel alive */
.choice .box { transition: .25s cubic-bezier(.2, .7, .3, 1); }
.choice:hover .box { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, .07); }
.choice input:checked + .box { animation: choice-pop .3s cubic-bezier(.2, .9, .3, 1.2); }

@keyframes choice-pop {
    0% { transform: scale(.97); }
    60% { transform: scale(1.015); }
    100% { transform: scale(1); }
}

.attendee { transition: border-color .25s, box-shadow .25s; }
.attendee:focus-within { border-color: var(--accent); box-shadow: 0 6px 22px rgba(0, 0, 0, .05); }

.btn { transition: .25s cubic-bezier(.2, .7, .3, 1); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.985); }

/* the success mark draws itself */
.done .mark { animation: mark-pop .5s cubic-bezier(.2, .9, .3, 1.25) both; }

.done .mark svg { width: 30px; height: 30px; }

.done .mark svg path {
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 34;
    stroke-dashoffset: 34;
    animation: mark-draw .5s ease-out .25s forwards;
}

@keyframes mark-pop {
    from { opacity: 0; transform: scale(.5); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes mark-draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
    .inv-ready .cover .monogram, .inv-ready .cover .host, .inv-ready .cover h1,
    .inv-ready .cover .date-line, .inv-ready .cover .photo,
    .choice input:checked + .box, .done .mark { animation: none; }
    [data-reveal] { opacity: 1; transform: none; transition: none; }
    .done .mark svg path { stroke-dashoffset: 0; animation: none; }
}

/* ==========================================================================
   Envelope reveal (Pro)
   ========================================================================== */
.envelope-stage {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 26px;
    background: var(--bg);
    transition: opacity .7s ease .55s, visibility 0s 1.3s;
}

.envelope-stage.opened { opacity: 0; visibility: hidden; }

.envelope {
    position: relative;
    width: min(420px, 86vw);
    aspect-ratio: 8 / 5;
    cursor: pointer;
    perspective: 900px;
    filter: drop-shadow(0 18px 34px rgba(0, 0, 0, .16));
    animation: env-arrive .8s cubic-bezier(.2, .8, .3, 1.1) both;
    -webkit-tap-highlight-color: transparent;
}

@keyframes env-arrive {
    from { opacity: 0; transform: translateY(34px) rotate(-1.5deg); }
    to { opacity: 1; transform: none; }
}

.envelope .pocket,
.envelope .flap,
.envelope .card-peek { position: absolute; }

.envelope .pocket {
    inset: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
}

/* the V of the pocket */
.envelope .pocket::before,
.envelope .pocket::after {
    content: '';
    position: absolute;
    top: 0;
    width: 71%;
    height: 100%;
    background: color-mix(in srgb, var(--panel) 88%, var(--accent));
    z-index: 2;
}

.envelope .pocket::before { left: -21%; transform: skewX(32deg); border-right: 1px solid var(--line); }
.envelope .pocket::after { right: -21%; transform: skewX(-32deg); border-left: 1px solid var(--line); }

.envelope .addressee {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-direction: column;
    gap: 2px;
    padding: 0 12% 7%;
    text-align: center;
}

.envelope .addressee .to {
    font-size: 10px;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--body);
}

.envelope .addressee .name {
    font-family: 'Alex Brush', cursive;
    font-size: clamp(24px, 6vw, 36px);
    color: var(--ink);
    line-height: 1.15;
    max-width: 100%;
    overflow-wrap: break-word;
}

.envelope .flap {
    top: 0;
    left: 0;
    right: 0;
    height: 55%;
    z-index: 4;
    background: color-mix(in srgb, var(--panel) 80%, var(--accent));
    border: 1px solid var(--line);
    border-radius: 6px 6px 0 0;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    transform-origin: top center;
    transition: transform .8s cubic-bezier(.6, 0, .3, 1);
    backface-visibility: hidden;
}

.envelope .seal {
    position: absolute;
    left: 50%;
    top: 52%;
    z-index: 5;
    width: 64px;
    height: 64px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, color-mix(in srgb, var(--accent) 78%, #fff), var(--accent) 58%, var(--accent-dark));
    color: var(--on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Alex Brush', cursive;
    font-size: 26px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25), inset 0 0 0 3px color-mix(in srgb, var(--accent-dark) 60%, transparent);
    transition: transform .45s cubic-bezier(.5, 0, .7, .4), opacity .45s;
}

.envelope .card-peek {
    left: 6%;
    right: 6%;
    top: 8%;
    bottom: 10%;
    z-index: 1;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    font-family: var(--display, 'Cormorant Garamond', serif);
    font-size: clamp(18px, 4vw, 26px);
    color: var(--ink);
    transition: transform .9s cubic-bezier(.2, .7, .2, 1) .5s;
}

.envelope-hint {
    font-size: 11px;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--body);
    animation: hint-pulse 2.4s ease-in-out 1s infinite;
}

@keyframes hint-pulse {
    0%, 100% { opacity: .55; }
    50% { opacity: 1; }
}

/* opening sequence */
.envelope-stage.opening .seal { transform: translate(-50%, -50%) scale(.4) rotate(-18deg); opacity: 0; }
.envelope-stage.opening .flap { transform: rotateX(168deg); }
.envelope-stage.opening .card-peek { transform: translateY(-46%) scale(1.04); z-index: 6; }
.envelope-stage.opening .envelope { cursor: default; }
.envelope-stage.opening .envelope-hint { opacity: 0; animation: none; transition: opacity .3s; }

@media (prefers-reduced-motion: reduce) {
    .envelope, .envelope-hint { animation: none; }
    .envelope-stage, .envelope .flap, .envelope .seal, .envelope .card-peek { transition: none; }
}

/* ==========================================================================
   Wedding-site sections
   ========================================================================== */
.countdown {
    margin: 14px 0 0;
    font-size: 12px;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}

.cover.has-photo .countdown { color: var(--on-accent, #fff); opacity: .85; }

/* sticky section nav */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    gap: 4px;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 10px 16px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
}

.site-nav::-webkit-scrollbar { display: none; }

.site-nav a {
    flex: 0 0 auto;
    padding: 6px 12px;
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--body);
    text-decoration: none;
    border-radius: 20px;
    transition: .2s;
    white-space: nowrap;
}

.site-nav a:hover { color: var(--accent-dark); background: var(--soft); }

/* schedule */
.sched-day { margin-bottom: 26px; }

.sched-day h3 {
    font-size: 15px;
    font-family: 'Nunito Sans', sans-serif;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.sched-item {
    display: flex;
    gap: 18px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.sched-item:last-child { border-bottom: 0; }

.sched-item .when {
    flex: 0 0 84px;
    font-family: var(--display, 'Cormorant Garamond', serif);
    font-size: 19px;
    color: var(--ink);
    line-height: 1.3;
}

.sched-item .what { flex: 1; min-width: 0; }
.sched-item .what strong { display: block; color: var(--ink); font-size: 17px; }
.sched-item .what .where { font-size: 14px; color: var(--body); }
.sched-item .what .desc { font-size: 14px; color: var(--body); margin-top: 4px; }
.sched-item .what .attire { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-top: 6px; }

/* story */
#storyBody h3 { margin-top: 22px; }
#storyBody h3:first-child { margin-top: 0; }
#storyBody .prose { white-space: pre-line; font-size: 16.5px; }

/* wedding party */
.party-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.party-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 22px 16px;
    text-align: center;
}

.party-card .role {
    font-size: 10px;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 6px;
}

.party-card .name {
    font-family: var(--display, 'Cormorant Garamond', serif);
    font-size: 21px;
    color: var(--ink);
}

.party-card .note { font-size: 13px; color: var(--body); margin-top: 4px; }

/* travel */
.hotel-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 12px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.hotel-card .info { flex: 1; min-width: 200px; }
.hotel-card .info strong { display: block; color: var(--ink); font-size: 17px; }
.hotel-card .info .meta { font-size: 14px; color: var(--body); margin-top: 3px; }
.hotel-card .info .deadline { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-top: 6px; }

.travel-block { margin-bottom: 24px; }
.travel-block h3 { font-size: 20px; }
.travel-block .prose { white-space: pre-line; font-size: 15.5px; color: var(--body); }

/* registry */
.registry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

.registry-card {
    display: block;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 24px 20px;
    text-align: center;
    text-decoration: none;
    transition: .25s;
}

.registry-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.registry-card strong { display: block; font-family: var(--display, 'Cormorant Garamond', serif); font-size: 21px; color: var(--ink); }
.registry-card span { font-size: 13px; color: var(--body); }

/* gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }

.gallery-grid img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 3px;
    display: block;
}

/* faqs */
.faq-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq-item:last-child { border-bottom: 0; }
.faq-item .q { font-family: var(--display, 'Cormorant Garamond', serif); font-size: 19px; color: var(--ink); margin-bottom: 6px; }
.faq-item .a { font-size: 15px; color: var(--body); white-space: pre-line; }

/* per-event RSVP rows */
.event-reply {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--panel);
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.event-reply .ev-name { flex: 1; min-width: 140px; }
.event-reply .ev-name strong { color: var(--ink); display: block; }
.event-reply .ev-name span { font-size: 12.5px; color: var(--body); }

.event-reply .seg { display: flex; gap: 6px; }

.event-reply .seg button {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--body);
    border-radius: 3px;
    padding: 7px 14px;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: .2s;
}

.event-reply .seg button.on {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

/* ==========================================================================
   Extended effects
   ========================================================================== */
:root {
    --ease-spring: cubic-bezier(.2, .9, .3, 1.2);
    --ease-out-expo: cubic-bezier(.16, 1, .3, 1);
}

/* the monogram catches the light, once, slowly */
.monogram {
    position: relative;
    background: linear-gradient(100deg,
        var(--accent) 0%, var(--accent) 38%,
        color-mix(in srgb, var(--accent) 35%, #fff) 48%,
        #fff 51%,
        color-mix(in srgb, var(--accent) 35%, #fff) 54%,
        var(--accent) 64%, var(--accent) 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: foil 7s ease-in-out 1.4s infinite;
}

.cover.has-photo .monogram {
    background: linear-gradient(100deg, #fff 0%, #fff 40%, #ffeec9 50%, #fff 60%, #fff 100%);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes foil {
    0%, 62% { background-position: 130% 0; }
    82%, 100% { background-position: -30% 0; }
}

/* the cover photo drifts as you scroll (set by motion.js) */
.cover .photo { will-change: transform; }

/* headline letters rise in sequence */
.inv-ready .cover h1 .ch {
    display: inline-block;
    animation: ch-rise .8s var(--ease-out-expo) both;
}

@keyframes ch-rise {
    from { opacity: 0; transform: translateY(28px) rotate(4deg); filter: blur(5px); }
    to { opacity: 1; transform: none; filter: blur(0); }
}

/* section headings unveil behind a wipe */
.section .rule { transform-origin: center; animation: rule-draw .9s var(--ease-out-expo) both; }

@keyframes rule-draw {
    from { transform: scaleX(0); opacity: 0; }
    to { transform: scaleX(1); opacity: .7; }
}

/* the schedule draws a timeline down the day */
.sched-day { position: relative; }

.sched-day::before {
    content: '';
    position: absolute;
    left: 41px;
    top: 34px;
    bottom: 12px;
    width: 1px;
    background: linear-gradient(var(--line), transparent);
    transform-origin: top;
    transform: scaleY(0);
    transition: transform 1.1s var(--ease-out-expo) .15s;
}

.sched-day.revealed::before,
#scheduleSection.revealed .sched-day::before { transform: scaleY(1); }

.sched-item { position: relative; }

.sched-item::before {
    content: '';
    position: absolute;
    left: -23px;
    top: 24px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--bg);
    opacity: 0;
    transform: scale(0);
    transition: opacity .4s, transform .5s var(--ease-spring);
}

@media (min-width: 480px) {
    .sched-item .what { padding-left: 6px; }
    .sched-item::before { left: 78px; }
}

#scheduleSection.revealed .sched-item::before { opacity: 1; transform: scale(1); }
#scheduleSection.revealed .sched-item:nth-child(2)::before { transition-delay: .1s; }
#scheduleSection.revealed .sched-item:nth-child(3)::before { transition-delay: .2s; }
#scheduleSection.revealed .sched-item:nth-child(4)::before { transition-delay: .3s; }

.sched-item { transition: background .3s, transform .3s var(--ease-out-expo); border-radius: 4px; }
.sched-item:hover { background: var(--soft); transform: translateX(4px); }

/* cards lift */
.party-card, .hotel-card, .registry-card {
    transition: transform .4s var(--ease-out-expo), box-shadow .4s, border-color .3s;
}

.party-card:hover, .hotel-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .09);
    border-color: var(--accent);
}

.registry-card:hover { transform: translateY(-4px) scale(1.015); box-shadow: 0 16px 34px rgba(0, 0, 0, .1); }

/* gallery tiles bloom */
.gallery-grid img {
    transition: transform .5s var(--ease-out-expo), filter .5s;
    filter: saturate(.92);
}

.gallery-grid img:hover { transform: scale(1.05); filter: saturate(1.08); z-index: 2; position: relative; }

/* FAQ rows */
.faq-item { transition: padding-left .3s var(--ease-out-expo); }
.faq-item:hover { padding-left: 8px; }

/* per-event answer buttons */
.event-reply .seg button { position: relative; overflow: hidden; transition: .25s var(--ease-spring); }
.event-reply .seg button:hover { transform: translateY(-1px); }
.event-reply .seg button.on { animation: seg-pick .45s var(--ease-spring); }

@keyframes seg-pick {
    0% { transform: scale(.9); }
    58% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

.event-reply { transition: border-color .3s, box-shadow .3s, transform .3s var(--ease-out-expo); }
.event-reply:hover { border-color: var(--accent); transform: translateX(3px); }

/* the sticky nav gains a hairline as you scroll past the cover */
.site-nav { transition: box-shadow .3s, background .3s; }
.site-nav.stuck { box-shadow: 0 6px 22px rgba(0, 0, 0, .08); }

.site-nav a { position: relative; }

.site-nav a::after {
    content: '';
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 2px;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .3s var(--ease-out-expo);
}

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

/* smooth in-page jumps clear the sticky bar */
html { scroll-behavior: smooth; }
.section { scroll-margin-top: 58px; }

/* the reply button pulses gently when the form is complete */
#submitBtn { position: relative; overflow: hidden; }

#submitBtn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 38%, rgba(255, 255, 255, .3) 50%, transparent 62%);
    transform: translateX(-120%);
    animation: btn-sheen 4s ease-in-out 2s infinite;
}

@keyframes btn-sheen {
    0% { transform: translateX(-120%); }
    26% { transform: translateX(120%); }
    100% { transform: translateX(120%); }
}

/* drifting petals — ambient, behind everything */
.petals {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.petals i {
    position: absolute;
    top: -8vh;
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 60% 10% 60% 10%;
    background: color-mix(in srgb, var(--accent) 55%, #fff);
    opacity: .45;
    animation: petal-fall linear infinite;
}

@keyframes petal-fall {
    from { transform: translate3d(0, -10vh, 0) rotate(0deg); }
    to { transform: translate3d(var(--drift, 40px), 112vh, 0) rotate(var(--spin, 420deg)); }
}

@media (prefers-reduced-motion: reduce) {
    .monogram { animation: none; }
    .inv-ready .cover h1 .ch { animation: none; }
    .section .rule { animation: none; transform: none; opacity: .7; }
    .sched-day::before { transform: scaleY(1); transition: none; }
    .sched-item::before { opacity: 1; transform: scale(1); transition: none; }
    #submitBtn::after, .petals { display: none !important; }
    html { scroll-behavior: auto; }
    .event-reply .seg button.on { animation: none; }
}

/* ==========================================================================
   Background textures — pure CSS, nothing to download
   ========================================================================== */
body[data-pattern] { position: relative; }

body[data-pattern]::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .5;
}

body[data-pattern="none"]::before { display: none; }

body[data-pattern="linen"]::before {
    background-image:
        repeating-linear-gradient(45deg, color-mix(in srgb, var(--accent) 7%, transparent) 0 1px, transparent 1px 4px),
        repeating-linear-gradient(-45deg, color-mix(in srgb, var(--accent) 5%, transparent) 0 1px, transparent 1px 4px);
}

body[data-pattern="dots"]::before {
    background-image: radial-gradient(color-mix(in srgb, var(--accent) 22%, transparent) 1.2px, transparent 1.2px);
    background-size: 20px 20px;
}

body[data-pattern="grid"]::before {
    background-image:
        linear-gradient(color-mix(in srgb, var(--accent) 11%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--accent) 11%, transparent) 1px, transparent 1px);
    background-size: 34px 34px;
}

body[data-pattern="damask"]::before {
    background-image:
        radial-gradient(circle at 50% 0, transparent 12px, color-mix(in srgb, var(--accent) 11%, transparent) 13px, transparent 14px),
        radial-gradient(circle at 0 50%, transparent 12px, color-mix(in srgb, var(--accent) 9%, transparent) 13px, transparent 14px);
    background-size: 54px 54px;
}

body[data-pattern="arches"]::before {
    background-image: radial-gradient(circle at 50% 100%,
        transparent 22px, color-mix(in srgb, var(--accent) 13%, transparent) 23px, transparent 24px);
    background-size: 56px 46px;
}

body[data-pattern="waves"]::before {
    background-image: repeating-radial-gradient(circle at 0 100%,
        transparent 0 18px, color-mix(in srgb, var(--accent) 10%, transparent) 18px 19px);
    background-size: 70px 70px;
}

body[data-pattern="stars"]::before {
    background-image:
        radial-gradient(color-mix(in srgb, var(--accent) 30%, transparent) 1px, transparent 1px),
        radial-gradient(color-mix(in srgb, var(--accent) 18%, transparent) 1px, transparent 1px);
    background-size: 64px 64px, 39px 39px;
    background-position: 0 0, 22px 31px;
}

body[data-pattern="petals"]::before {
    background-image:
        radial-gradient(ellipse 8px 4px at 20% 30%, color-mix(in srgb, var(--accent) 20%, transparent) 60%, transparent 61%),
        radial-gradient(ellipse 4px 8px at 70% 65%, color-mix(in srgb, var(--accent) 14%, transparent) 60%, transparent 61%);
    background-size: 88px 88px;
}

/* Page content is lifted over the background texture — but the floating
   controls are left alone, so they keep both the corners they belong in
   and the stacking order that puts them above the page. */
body[data-pattern] > *:not(.music-toggle):not(.lang-switch):not(.install-bar):not(.lock-stage):not(.envelope-stage) {
    position: relative;
    z-index: 1;
}

body[data-pattern] .envelope-stage { z-index: 40; }

/* ==========================================================================
   Envelope liners and seals
   ========================================================================== */
.envelope[data-liner="floral"] .flap {
    background-image:
        radial-gradient(circle at 30% 40%, color-mix(in srgb, var(--accent) 26%, transparent) 4px, transparent 5px),
        radial-gradient(circle at 68% 62%, color-mix(in srgb, var(--accent) 20%, transparent) 3px, transparent 4px);
    background-size: 34px 34px;
}

.envelope[data-liner="marbled"] .flap {
    background-image: repeating-linear-gradient(115deg,
        color-mix(in srgb, var(--accent) 16%, transparent) 0 6px,
        transparent 6px 16px,
        color-mix(in srgb, var(--ink) 7%, transparent) 16px 19px,
        transparent 19px 34px);
}

.envelope[data-liner="striped"] .flap {
    background-image: repeating-linear-gradient(90deg,
        color-mix(in srgb, var(--accent) 20%, transparent) 0 5px, transparent 5px 14px);
}

.envelope[data-liner="gilded"] .flap {
    background-image: linear-gradient(135deg,
        color-mix(in srgb, var(--accent) 42%, transparent),
        transparent 38%, color-mix(in srgb, #fff 55%, transparent) 50%, transparent 62%,
        color-mix(in srgb, var(--accent) 42%, transparent));
}

.envelope[data-liner="confetti"] .flap {
    background-image:
        radial-gradient(circle at 22% 28%, color-mix(in srgb, var(--accent) 45%, transparent) 2px, transparent 3px),
        radial-gradient(circle at 62% 52%, color-mix(in srgb, var(--ink) 22%, transparent) 2px, transparent 3px),
        radial-gradient(circle at 84% 24%, color-mix(in srgb, var(--accent) 32%, transparent) 2px, transparent 3px);
    background-size: 40px 40px;
}

/* seals */
.envelope[data-stamp="none"] .seal { display: none; }

.envelope[data-stamp="postage"] .seal {
    width: 54px;
    height: 66px;
    border-radius: 3px;
    background: var(--panel);
    color: var(--accent-dark);
    border: 1px dashed var(--accent);
    font-family: var(--display, serif);
    font-size: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
    top: 26%;
    left: 78%;
}

.envelope[data-stamp="ribbon"] .seal {
    width: 100px;
    height: 22px;
    border-radius: 2px;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--accent) 80%, #fff), var(--accent) 55%, var(--accent-dark));
    font-size: 13px;
    letter-spacing: .2em;
    text-transform: uppercase;
    font-family: 'Nunito Sans', sans-serif;
    box-shadow: 0 3px 9px rgba(0, 0, 0, .22);
}

.envelope[data-stamp="sprig"] .seal {
    background: none;
    box-shadow: none;
    color: var(--accent);
    font-size: 34px;
    width: 52px;
    height: 52px;
}

/* ==========================================================================
   Music
   ========================================================================== */
.music-toggle {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 44;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .14);
    transition: transform .3s var(--ease-spring), border-color .25s;
}

.music-toggle:hover { transform: scale(1.08); border-color: var(--accent); }

.music-toggle .bars { display: flex; align-items: flex-end; gap: 3px; height: 16px; }

.music-toggle .bars i {
    display: block;
    width: 3px;
    height: 6px;
    border-radius: 2px;
    background: currentColor;
    transition: height .3s;
}

.music-toggle.playing .bars i { animation: eq .9s ease-in-out infinite; }
.music-toggle.playing .bars i:nth-child(2) { animation-delay: .15s; }
.music-toggle.playing .bars i:nth-child(3) { animation-delay: .3s; }

@keyframes eq {
    0%, 100% { height: 5px; }
    50% { height: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .music-toggle.playing .bars i { animation: none; height: 11px; }
}

/* ==========================================================================
   Stationery cards
   ========================================================================== */
.card-stage {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(20px, 5vw, 54px) 18px;
    gap: 22px;
}

.stationery {
    position: relative;
    width: 100%;
    max-width: 560px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 28px 70px rgba(0, 0, 0, .14);
    animation: card-arrive .9s var(--ease-out-expo) both;
}

@keyframes card-arrive {
    from { opacity: 0; transform: translateY(38px) scale(.96) rotate(-.6deg); }
    to { opacity: 1; transform: none; }
}

.stationery::after {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
    border-radius: 3px;
    pointer-events: none;
}

.stationery-photo {
    height: 200px;
    background-size: cover;
    background-position: center;
}

.stationery-inner { padding: clamp(30px, 6vw, 52px) clamp(24px, 6vw, 48px); text-align: center; }

.stationery .monogram { font-size: clamp(30px, 6vw, 44px); margin-bottom: 6px; }
.stationery .eyebrow { margin-bottom: 14px; }
.stationery h1 { font-size: clamp(32px, 7vw, 52px); margin: 0 0 18px; }

.card-message {
    white-space: pre-line;
    font-size: 16.5px;
    max-width: 40ch;
    margin: 0 auto 26px;
}

.card-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 18px;
    padding: 22px 0;
    margin-bottom: 22px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.card-details .detail p { margin: 0; }

.card-stage .btn-row { justify-content: center; }
.card-stage .invite-foot { padding: 0; }

/* branded registry cards and fund progress */
.registry-card.branded { border-top: 3px solid var(--brand, var(--accent)); }
.registry-card.branded:hover { border-color: var(--brand, var(--accent)); }

.registry-card .fund { display: block; margin-top: 12px; }

.registry-card .fund-bar {
    display: block;
    height: 6px;
    border-radius: 6px;
    background: var(--soft);
    overflow: hidden;
}

.registry-card .fund-bar i {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: var(--brand, var(--accent));
    transition: width .9s var(--ease-out-expo);
}

.registry-card .fund-text { display: block; margin-top: 6px; font-size: 12.5px; color: var(--body); }

/* ==========================================================================
   Password gate
   ========================================================================== */
.lock-stage {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
    transition: opacity .4s ease, visibility 0s .4s;
}

.lock-stage.unlocked { opacity: 0; visibility: hidden; }

.lock-card {
    width: 100%;
    max-width: 380px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 5px;
    padding: 38px 30px 32px;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .16);
    animation: card-arrive .7s var(--ease-out-expo) both;
}

.lock-card .lock-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--soft);
    color: var(--accent);
    font-size: 22px;
    margin-bottom: 18px;
}

.lock-card h2 { font-size: clamp(24px, 5vw, 32px); margin-bottom: 8px; }
.lock-card .field { text-align: left; margin-top: 22px; }
.lock-card .notice { text-align: left; }

@media (prefers-reduced-motion: reduce) {
    .lock-card { animation: none; }
    .lock-stage { transition: none; }
}

/* ==========================================================================
   A second language
   ========================================================================== */
.lang-switch {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 44;
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .1);
}

.lang-btn {
    border: none;
    background: none;
    color: var(--body);
    font-family: inherit;
    font-size: 12px;
    letter-spacing: .04em;
    padding: 6px 13px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .25s ease, color .25s ease;
}

.lang-btn:hover { color: var(--ink); }
.lang-btn.active { background: var(--accent); color: var(--on-accent, #fff); }

[dir="rtl"] .lang-switch { right: auto; left: 16px; }
[dir="rtl"] .music-toggle { right: auto; left: 16px; }

/* Right-to-left languages read the other way round. */
[dir="rtl"] .detail-grid,
[dir="rtl"] .prose,
[dir="rtl"] .field,
[dir="rtl"] .attendee { text-align: right; }

[dir="rtl"] .choice .box { text-align: right; }

@media (max-width: 560px) {
    .lang-switch { top: 10px; right: 10px; }
    .lang-btn { padding: 5px 10px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    .lang-btn { transition: none; }
}

/* ==========================================================================
   Keeping the invitation on the home screen
   ========================================================================== */
.install-bar {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 46;
    width: min(440px, calc(100vw - 32px));
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px 13px 17px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .22);
    transform: translate(-50%, 140%);
    opacity: 0;
    transition: transform .55s cubic-bezier(.2, .9, .25, 1), opacity .4s ease;
}

.install-bar.shown { transform: translate(-50%, 0); opacity: 1; }

.install-text { flex: 1; min-width: 0; }
.install-text strong { display: block; font-size: 14px; color: var(--ink); }
.install-text span { display: block; font-size: 12px; line-height: 1.45; color: var(--body); margin-top: 2px; }

.install-go {
    flex: 0 0 auto;
    border: none;
    border-radius: 999px;
    padding: 9px 18px;
    background: var(--accent);
    color: var(--on-accent, #fff);
    font-family: inherit;
    font-size: 13px;
    letter-spacing: .04em;
    cursor: pointer;
    transition: transform .2s ease, filter .2s ease;
}

.install-go:hover { transform: translateY(-1px); filter: brightness(1.06); }

.install-close {
    flex: 0 0 auto;
    border: none;
    background: none;
    color: var(--body);
    font-size: 22px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
    opacity: .55;
}

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

/* Opened from the home screen: no browser chrome, so keep clear of the
   status bar and the home indicator. */
@media (display-mode: standalone) {
    .cover { padding-top: max(48px, env(safe-area-inset-top)); }
    .lang-switch { top: max(16px, calc(env(safe-area-inset-top) + 8px)); }
    .music-toggle { bottom: max(16px, calc(env(safe-area-inset-bottom) + 8px)); }
    .invite-foot { padding-bottom: max(28px, env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
    .install-bar { transition: opacity .2s ease; transform: translate(-50%, 0); }
    .install-go:hover { transform: none; }
}

/* Captions and the album invitation under the gallery */
.gallery-grid figure { margin: 0; position: relative; }
.gallery-grid figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 22px 12px 10px;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .6));
    opacity: 0;
    transition: opacity .3s ease;
}
.gallery-grid figure:hover figcaption { opacity: 1; }
.album-call { margin-top: 26px; }

@media (prefers-reduced-motion: reduce) {
    .gallery-grid figcaption { transition: none; opacity: 1; }
}
