:root {
    --ivory: #fbf8f3;
    --cream: #f6efe4;
    --beige: #efe4d4;
    --champagne: #e7d3b3;
    --sage: #9aa98a;
    --sage-dark: #7f8f6d;
    --gold: #c9a86a;
    --gold-dark: #ad8c4d;
    --ink: #3d362c;
    --muted: #7d7466;
    --white: #ffffff;
    --shadow: 0 18px 50px -24px rgba(61, 54, 44, 0.35);
    --radius: 18px;
    --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --sans: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.invitation {
    margin: 0;
    font-family: var(--sans);
    font-weight: 300;
    color: var(--ink);
    background: var(--ivory);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

body.invitation.noscroll { overflow: hidden; height: 100vh; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0 0 .4em; }

p { margin: 0 0 1rem; }

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

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

.muted { color: var(--muted); }
.tiny { font-size: .78rem; }
.amp { display: inline-block; color: var(--gold-dark); font-style: italic; margin: 0 .2em; }
.req { color: #b5533f; }

.container { width: min(1120px, 92vw); margin: 0 auto; }
.container--narrow { width: min(720px, 92vw); }

.section { padding: clamp(3.5rem, 8vw, 7rem) 0; text-align: center; }
.section__title { font-size: clamp(2rem, 5vw, 3.1rem); margin-bottom: 1.6rem; }
.section__subtitle { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 2.5rem 0 1rem; }
.eyebrow {
    text-transform: uppercase;
    letter-spacing: .38em;
    font-size: .72rem;
    color: var(--sage-dark);
    margin-bottom: .6rem;
    padding-left: .38em;
}

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .85rem 2rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--sans);
    font-size: .82rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--gold); color: #fff; box-shadow: 0 12px 30px -12px rgba(173, 140, 77, .8); }
.btn-primary:hover { background: var(--gold-dark); }
.btn-outline { background: transparent; border-color: var(--gold); color: var(--gold-dark); }
.btn-outline:hover { background: var(--gold); color: #fff; }
.btn-open { background: #fff; color: var(--ink); border: 1px solid rgba(201,168,106,.5); }
.btn-block { width: 100%; }

/* ---------------- Alerts ---------------- */
.alert {
    padding: .9rem 1.2rem;
    border-radius: 12px;
    margin: 1rem 0;
    font-size: .92rem;
    border: 1px solid transparent;
}
.alert-success { background: #eef4e8; border-color: #c6dbaf; color: #4a5f34; }
.alert-error { background: #fbeee9; border-color: #e8c3b6; color: #8a3f2b; }
.alert-info { background: #eef2f6; border-color: #c8d6e2; color: #355268; }
.alert-warn { background: #fbf4e4; border-color: #ecd9a6; color: #7a5f1e; }

/* ---------------- Envelope ---------------- */
.envelope {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    background:
        radial-gradient(120% 100% at 50% 0%, #fffaf1 0%, var(--cream) 45%, #e6d6bd 100%);
    transition: opacity .9s ease, visibility .9s ease;
}
.envelope.is-open { opacity: 0; visibility: hidden; pointer-events: none; }
.envelope__flap {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(154,169,138,.14) 0%, transparent 40%),
        linear-gradient(315deg, rgba(201,168,106,.16) 0%, transparent 40%);
}
.envelope__card {
    position: relative;
    text-align: center;
    padding: 3rem 2rem;
    max-width: 640px;
    animation: rise 1.2s ease both;
}
.envelope__kicker { text-transform: uppercase; letter-spacing: .34em; font-size: .7rem; color: var(--sage-dark); }
.envelope__label { font-family: var(--serif); font-size: 1rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted); margin: .6rem 0 0; }
.envelope__names { font-size: clamp(2.4rem, 9vw, 4.6rem); margin: .3rem 0 .5rem; line-height: 1.05; }
.envelope__names .amp { font-size: .7em; }
.envelope__date { font-family: var(--serif); font-size: 1.3rem; letter-spacing: .1em; color: var(--gold-dark); }
.envelope__guest { color: var(--muted); margin-top: .8rem; }
#openInvitation { margin-top: 1.8rem; }

/* ---------------- Music toggle ---------------- */
.music-toggle {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 60;
    width: 46px; height: 46px;
    border-radius: 50%;
    border: 1px solid var(--gold);
    background: rgba(255,255,255,.92);
    color: var(--gold-dark);
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform .2s ease;
}
.music-toggle:hover { transform: scale(1.08); }
.music-toggle.is-playing { background: var(--gold); color: #fff; }

/* ---------------- Top nav ---------------- */
.topnav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    display: flex;
    justify-content: center;
    gap: clamp(.8rem, 3vw, 2.4rem);
    padding: .9rem 1rem;
    background: rgba(251, 248, 243, .82);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(201,168,106,.22);
    transform: translateY(-100%);
    transition: transform .45s ease;
    overflow-x: auto;
}
.topnav.is-visible { transform: translateY(0); }
.topnav a {
    color: var(--ink);
    text-decoration: none;
    font-size: .74rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    white-space: nowrap;
    padding: .3rem 0;
    border-bottom: 1px solid transparent;
    transition: color .2s ease, border-color .2s ease;
}
.topnav a:hover { color: var(--gold-dark); border-color: var(--gold-dark); }

/* ---------------- Hero ---------------- */
.hero {
    position: relative;
    min-height: 100svh;
    display: grid;
    place-items: center;
    text-align: center;
    overflow: hidden;
    color: #fff;
}
.hero__bg {
    position: absolute; inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.05);
    animation: slowzoom 22s ease-in-out infinite alternate;
}
.hero__overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(45,39,31,.34) 0%, rgba(45,39,31,.5) 60%, rgba(45,39,31,.72) 100%);
}
.hero__content { position: relative; padding: 6rem 1.5rem 4rem; max-width: 760px; }
.hero__kicker { text-transform: uppercase; letter-spacing: .4em; font-size: .74rem; opacity: .92; }
.hero__names { font-size: clamp(2.8rem, 11vw, 6rem); margin: .4rem 0; line-height: 1; text-shadow: 0 4px 30px rgba(0,0,0,.3); }
.hero__names .amp { color: var(--champagne); font-size: .62em; }
.hero__names span { display: block; }
.hero__date { font-family: var(--serif); font-size: clamp(1.15rem, 3.4vw, 1.7rem); letter-spacing: .12em; }
.hero__venue { letter-spacing: .2em; text-transform: uppercase; font-size: .78rem; opacity: .92; }
.hero__guest { margin-top: 1rem; font-family: var(--serif); font-size: 1.25rem; }
.hero .btn { margin-top: 1.4rem; }
.scroll-hint {
    position: absolute; bottom: 1.4rem; left: 50%; transform: translateX(-50%);
    color: #fff; font-size: 1.6rem; text-decoration: none; opacity: .8;
    animation: bob 2s ease-in-out infinite;
}

/* ---------------- Countdown ---------------- */
.countdown { background: linear-gradient(180deg, var(--ivory), var(--cream)); }
.countdown__grid { display: flex; justify-content: center; gap: clamp(.6rem, 3vw, 2rem); margin: 1.6rem 0 1rem; flex-wrap: wrap; }
.countdown__unit {
    min-width: clamp(66px, 20vw, 120px);
    padding: 1.1rem .6rem;
    background: #fff;
    border: 1px solid rgba(201,168,106,.35);
    border-radius: 14px;
    box-shadow: 0 12px 30px -22px rgba(61,54,44,.5);
}
.countdown__unit span { display: block; font-family: var(--serif); font-size: clamp(1.8rem, 6vw, 2.8rem); color: var(--gold-dark); line-height: 1; }
.countdown__unit small { text-transform: uppercase; letter-spacing: .2em; font-size: .62rem; color: var(--muted); }
.countdown__date { font-family: var(--serif); font-size: 1.15rem; letter-spacing: .08em; }

/* ---------------- Couple ---------------- */
.couple__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(1.2rem, 4vw, 3rem); max-width: 820px; margin: 1.5rem auto 2.5rem; }
.couple__card h3 { font-size: 1.7rem; margin-top: 1rem; margin-bottom: 0; }
.couple__photo {
    aspect-ratio: 4 / 5;
    background-size: cover;
    background-position: center top;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: relative;
}
.couple__photo::after {
    content: '';
    position: absolute; inset: 0;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: var(--radius);
    margin: 10px;
}
.story { max-width: 680px; margin: 0 auto; }
.divider { display: block; font-size: 1.6rem; color: var(--gold); margin-bottom: 1rem; }
.story p { font-size: 1.06rem; color: #554c3f; }

/* ---------------- Details ---------------- */
.details { background: var(--cream); }
.details__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 1.4rem; margin-top: 1rem; }
.detail-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 2.2rem 1.6rem;
    box-shadow: 0 14px 40px -30px rgba(61,54,44,.6);
    border: 1px solid rgba(201,168,106,.25);
}
.detail-card h3 { color: var(--sage-dark); text-transform: uppercase; letter-spacing: .2em; font-size: .82rem; font-family: var(--sans); }
.detail-card__time { font-family: var(--serif); font-size: 1.35rem; margin-bottom: .4rem; }
.detail-card__venue { font-weight: 400; margin-bottom: .2rem; }
.detail-card .btn { margin-top: 1rem; }
.swatches { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin: 1rem 0; }
.swatch {
    display: inline-block;
    padding: .4rem .9rem;
    border-radius: 999px;
    background: var(--beige);
    border: 1px solid rgba(201,168,106,.4);
    font-size: .72rem;
    letter-spacing: .06em;
}
.reminders { max-width: 680px; margin: 2.6rem auto 0; background: #fff; border-radius: var(--radius); padding: 2rem; border: 1px dashed rgba(201,168,106,.5); }
.reminders h3 { color: var(--gold-dark); }
.entourage__list { list-style: none; padding: 0; max-width: 620px; margin: 0 auto; }
.entourage__list li { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem .4rem; border-bottom: 1px solid rgba(201,168,106,.22); text-align: left; }
.entourage__list span { color: var(--muted); text-transform: uppercase; letter-spacing: .12em; font-size: .7rem; }
.entourage__list strong { font-weight: 400; font-family: var(--serif); font-size: 1.15rem; }

/* ---------------- Timeline ---------------- */
.timeline__list { list-style: none; padding: 0; max-width: 720px; margin: 1.5rem auto 0; text-align: left; position: relative; }
.timeline__list::before {
    content: ''; position: absolute; left: 82px; top: 0; bottom: 0; width: 1px;
    background: linear-gradient(180deg, transparent, rgba(201,168,106,.6), transparent);
}
.timeline__item { display: flex; gap: 1.4rem; padding: 1rem 0; align-items: flex-start; }
.timeline__time { width: 70px; flex: none; text-align: right; font-family: var(--serif); font-size: 1.1rem; color: var(--gold-dark); padding-top: .1rem; }
.timeline__body { position: relative; padding-left: 1.6rem; }
.timeline__body::before {
    content: ''; position: absolute; left: -6px; top: .5rem; width: 11px; height: 11px; border-radius: 50%;
    background: var(--ivory); border: 2px solid var(--gold);
}
.timeline__body h3 { margin-bottom: .15rem; font-size: 1.35rem; }
.timeline__body p { margin: 0; color: var(--muted); }

/* ---------------- Gallery ---------------- */
.gallery { background: var(--cream); }
.gallery__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1rem; margin-top: 1.5rem; }
.gallery__item { border: 0; padding: 0; background: none; cursor: pointer; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); position: relative; }
.gallery__item img { aspect-ratio: 1 / 1; object-fit: cover; width: 100%; transition: transform .5s ease; }
.gallery__item:hover img { transform: scale(1.06); }

/* ---------------- RSVP ---------------- */
.rsvp { background: linear-gradient(180deg, var(--ivory), var(--cream)); }
.rsvp__deadline { color: var(--muted); margin-bottom: 1.6rem; }
.rsvp__deadline--closed { color: #8a3f2b; }
.rsvp__panel { background: #fff; border-radius: var(--radius); padding: clamp(1.4rem, 4vw, 2.6rem); box-shadow: var(--shadow); border: 1px solid rgba(201,168,106,.28); text-align: left; }
.rsvp__greeting { text-align: center; font-size: 1.8rem; }
.rsvp-confirm { border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: 1.4rem; }
.rsvp-confirm.is-attending { background: #eef4e8; border: 1px solid #c6dbaf; }
.rsvp-confirm.is-declined { background: #fbeee9; border: 1px solid #e8c3b6; }
.rsvp-confirm p { margin: 0; }
.rsvp__note { font-size: .8rem; color: var(--muted); margin-top: 1rem; }

.rsvp-form .field { margin-bottom: 1.1rem; }
.rsvp-form label { display: block; font-size: .82rem; letter-spacing: .04em; margin-bottom: .35rem; color: #5a5143; }
.rsvp-form input[type=text], .rsvp-form input[type=email], .rsvp-form input[type=tel],
.rsvp-form select, .rsvp-form textarea {
    width: 100%;
    padding: .75rem .9rem;
    border: 1px solid rgba(201,168,106,.45);
    border-radius: 10px;
    background: #fffdf9;
    font-family: var(--sans);
    font-size: .95rem;
    color: var(--ink);
    transition: border-color .2s ease, box-shadow .2s ease;
}
.rsvp-form input:focus, .rsvp-form select:focus, .rsvp-form textarea:focus {
    outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,106,.18);
}
.rsvp-choice { border: 0; padding: 0; margin: 0 0 1.4rem; }
.rsvp-choice legend { font-size: .82rem; margin-bottom: .6rem; color: #5a5143; }
.choice { display: flex; align-items: center; gap: .9rem; padding: 1rem; border: 1px solid rgba(201,168,106,.4); border-radius: 12px; cursor: pointer; margin-bottom: .7rem; transition: border-color .2s ease, background .2s ease; }
.choice.is-checked { border-color: var(--gold); background: #fffdf6; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice__icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--beige); color: var(--gold-dark); font-size: 1rem; flex: none; }
.choice.is-checked .choice__icon { background: var(--gold); color: #fff; }
.choice__text { display: flex; flex-direction: column; }
.choice__text small { color: var(--muted); }
.rsvp-contact { border: 1px dashed rgba(201,168,106,.5); border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: 1.2rem; }
.rsvp-contact legend { font-size: .78rem; text-transform: uppercase; letter-spacing: .18em; color: var(--sage-dark); padding: 0 .4rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.companions__list .companion-row { margin-bottom: .6rem; }
.hint { font-size: .76rem; color: var(--muted); margin: .3rem 0 0; }
.rsvp-submit { margin-top: 1rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
[hidden] { display: none !important; }

/* ---------------- Closing ---------------- */
.closing__message { font-size: 1.12rem; color: #554c3f; }
.closing__signature { font-family: var(--serif); font-style: italic; font-size: 1.6rem; color: var(--gold-dark); margin-top: 1.5rem; }
.gift { max-width: 600px; margin: 2rem auto 0; background: #fff; border-radius: var(--radius); padding: 1.8rem; border: 1px solid rgba(201,168,106,.3); }
.gift h3 { color: var(--gold-dark); }

/* ---------------- Footer ---------------- */
.site-footer { background: #2f2a23; color: #e9e2d6; text-align: center; padding: 3rem 0 2.4rem; }
.site-footer a { color: var(--champagne); }
.footer__couple { font-family: var(--serif); font-size: 1.7rem; color: #fff; }
.site-footer .muted { color: #b3a897; }

/* ---------------- Lightbox ---------------- */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(28,24,19,.94); display: grid; grid-template-columns: auto 1fr auto; align-items: center; }
.lightbox figure { margin: 0; text-align: center; max-height: 90vh; }
.lightbox img { max-height: 80vh; width: auto; margin: 0 auto; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox figcaption { color: #ddd3c2; margin-top: 1rem; font-family: var(--serif); font-size: 1.2rem; }
.lightbox__close, .lightbox__nav { background: none; border: 0; color: #fff; font-size: 2.4rem; cursor: pointer; padding: 1rem; line-height: 1; opacity: .85; }
.lightbox__close { position: absolute; top: .6rem; right: 1rem; }
.lightbox__close:hover, .lightbox__nav:hover { opacity: 1; }

/* ---------------- Share sheet ---------------- */
.sharesheet { position: fixed; inset: 0; z-index: 210; background: rgba(28,24,19,.55); display: grid; place-items: center; padding: 1rem; }
.sharesheet__inner { background: #fff; padding: 1.8rem; max-width: 480px; width: 100%; text-align: left; }
.sharesheet input { width: 100%; padding: .7rem; border: 1px solid rgba(201,168,106,.5); border-radius: 8px; margin: .6rem 0 1rem; font-size: .85rem; }
.sharesheet__links { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.sharesheet__links a { font-size: .8rem; padding: .5rem .9rem; border: 1px solid var(--gold); border-radius: 999px; text-decoration: none; }

.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------------- Reveal animation ---------------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

@keyframes rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }
@keyframes slowzoom { from { transform: scale(1.05); } to { transform: scale(1.15); } }

@media (prefers-reduced-motion: reduce) {
    .reveal, .hero__bg, .scroll-hint, .envelope__card { animation: none !important; transition: none !important; opacity: 1 !important; transform: none !important; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 640px) {
    .couple__grid { grid-template-columns: 1fr; max-width: 380px; }
    .grid-2 { grid-template-columns: 1fr; }
    .timeline__list::before { left: 58px; }
    .timeline__time { width: 48px; font-size: 1rem; }
    .topnav { justify-content: flex-start; }
    .envelope__card { padding: 2rem 1.4rem; }
}
