/* ---------- Guest invitation (mobile-first) ---------- */

body { background-color: var(--paper); }
.page { max-width: 600px; margin: 0 auto; padding: 0 20px 80px; }
.center { text-align: center; }

/* Entrance + scroll reveal */
.rise { opacity: 0; transform: translateY(14px); animation: rise 1.1s var(--ease) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.fade { opacity: 0; animation: fade 1.6s var(--ease) forwards; }
@keyframes fade { to { opacity: 1; } }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.draw { transform: scaleX(0); animation: draw 1.4s var(--ease) forwards; }
@keyframes draw { to { transform: scaleX(1); } }

/* Ornaments */
.rule { height: 1px; background: var(--line-strong); width: 64px; margin: 28px auto; transform-origin: center; }
.rule.long { width: 100%; background: var(--line); }
.diamond { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 30px auto; color: var(--bronze-2); }
.diamond::before, .diamond::after { content: ''; height: 1px; width: 56px; background: var(--line-strong); }
.diamond span { width: 5px; height: 5px; border: 1px solid currentColor; transform: rotate(45deg); }

/* Buttons */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 26px; border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper-2); font-size: 13px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  cursor: pointer; text-decoration: none; transition: background .3s var(--ease), color .3s var(--ease), border-color .3s, transform .2s;
}
.btn:hover { background: #33302b; }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { border-color: var(--ink); background: rgba(255, 255, 255, .5); }
.btn.bronze { background: var(--bronze); border-color: var(--bronze); }
.btn.bronze:hover { background: #876940; }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 11px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--bronze); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- Opening ---------- */
.opening { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding: 28px 0 40px; }
.letter {
  position: relative; background: var(--card); background-image: var(--grain);
  border: 1px solid var(--line); border-radius: 4px; padding: 44px 26px 40px; box-shadow: var(--shadow);
  text-align: center;
}
.letter::before { content: ''; position: absolute; inset: 7px; border: 1px solid var(--line); border-radius: 2px; pointer-events: none; }
.corner { position: absolute; width: 18px; height: 18px; border-color: var(--bronze-2); border-style: solid; opacity: .8; }
.corner.tl { top: 14px; left: 14px; border-width: 1px 0 0 1px; }
.corner.tr { top: 14px; right: 14px; border-width: 1px 1px 0 0; }
.corner.bl { bottom: 14px; left: 14px; border-width: 0 0 1px 1px; }
.corner.br { bottom: 14px; right: 14px; border-width: 0 1px 1px 0; }

.monogram {
  width: 84px; height: 84px; margin: 0 auto 22px; border-radius: 50%; border: 1px solid var(--bronze-2);
  display: flex; align-items: center; justify-content: center; position: relative;
  font-family: var(--serif); font-size: 30px; font-style: italic; color: var(--ink); letter-spacing: .02em;
}
.monogram::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; border: 1px solid var(--line); }
.monogram i { color: var(--bronze); font-size: 18px; margin: 0 3px; }
.couple { font-size: clamp(46px, 13vw, 68px); font-weight: 400; line-height: 1; margin: 14px 0 18px; }
.couple .amp { display: block; font-style: italic; color: var(--bronze); font-size: .55em; margin: 6px 0 4px; }
.quote { font-family: var(--serif); font-style: italic; font-size: 20px; line-height: 1.45; color: var(--ink-2); max-width: 380px; margin: 0 auto; }
.dear { font-family: var(--serif); font-size: 26px; margin-bottom: 10px; }
.lead { color: var(--ink-2); max-width: 400px; margin: 0 auto; }
.reserved { display: flex; flex-direction: column; align-items: center; margin: 26px auto 30px; color: var(--ink-2); }
.reserved b { font-family: var(--serif); font-size: 54px; line-height: 1; font-weight: 400; color: var(--bronze); }
.reserved span { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; margin-top: 8px; }
.status-note { margin-top: 18px; font-size: 13px; color: var(--muted); }
.status-note b { color: var(--ok); font-weight: 500; }
.scroll-cue { margin-top: 26px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }
.scroll-cue::after { content: ''; display: block; width: 1px; height: 28px; background: var(--line-strong); margin: 10px auto 0; animation: cue 2.4s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); opacity: 1; } 60% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }

.preview-bar {
  position: sticky; top: 0; z-index: 40; margin: 0 -20px; padding: 8px 16px; background: var(--ink); color: var(--paper-2);
  font-size: 12px; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap;
}
.preview-bar select { background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.3); border-radius: 6px; padding: 2px 6px; }
.preview-bar option { color: var(--ink); }

/* ---------- Sections ---------- */
.sec { padding: 56px 0 8px; }
.sec-head { text-align: center; margin-bottom: 30px; }
.sec-head h2 { font-size: 34px; margin-top: 10px; }
.sec-head p { color: var(--muted); margin-top: 8px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 26px 22px;
}
.card + .card { margin-top: 14px; }

.dedication {
  font-family: var(--serif); font-size: 22px; line-height: 1.55; color: var(--ink-2); text-align: center;
  padding: 36px 26px; position: relative;
}
.dedication p + p { margin-top: 14px; }
.dedication strong { font-weight: 600; color: var(--ink); }
.dedication::before { content: '“'; display: block; font-size: 64px; line-height: .6; color: var(--bronze-2); margin-bottom: 10px; }
.signature { font-family: var(--serif); font-style: italic; font-size: 20px; margin-top: 18px; color: var(--bronze); }

/* Details */
.details { padding: 0; overflow: hidden; }
.detail { display: grid; grid-template-columns: 92px 1fr; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); align-items: baseline; }
.detail:last-child { border-bottom: 0; }
.detail .k { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.detail .v { font-family: var(--serif); font-size: 21px; line-height: 1.3; }
.detail .v small { display: block; font-family: var(--sans); font-size: 13px; color: var(--muted); margin-top: 3px; }
.detail .tbc { font-style: italic; color: var(--muted); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.menu { position: relative; }
.menu-pop {
  position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow-lg); overflow: hidden; z-index: 5; animation: rise .35s var(--ease) forwards;
}
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 13px 16px; font-size: 14px; background: none; border: 0; border-bottom: 1px solid var(--line); text-decoration: none; cursor: pointer; }
.menu-pop a:last-child { border-bottom: 0; }
.menu-pop a:hover { background: var(--paper-2); }
.info-note { font-size: 14px; color: var(--ink-2); padding: 14px 16px; border-left: 2px solid var(--bronze-2); background: rgba(255,255,255,.45); margin-top: 14px; }

/* Countdown */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
.countdown .unit { padding: 18px 4px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.countdown .num { font-family: var(--serif); font-size: clamp(34px, 10vw, 46px); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.countdown .lbl { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.countdown-note { text-align: center; font-size: 13px; color: var(--muted); margin-top: 14px; font-style: italic; font-family: var(--serif); font-size: 17px; }

/* Timeline */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 1px; background: var(--line-strong); }
.t-item { position: relative; padding-bottom: 28px; }
.t-item:last-child { padding-bottom: 0; }
.t-item::before {
  content: ''; position: absolute; left: -27px; top: 7px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--bronze);
}
.t-item .when { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--bronze); }
.t-item h3 { font-size: 24px; margin: 4px 0 2px; }
.t-item p { color: var(--muted); font-size: 14px; }

/* Allocation */
.allocation { text-align: center; padding: 34px 24px; }
.allocation .name { font-family: var(--serif); font-size: 30px; margin: 10px 0 6px; }
.allocation .places { color: var(--ink-2); }
.seats { display: flex; justify-content: center; gap: 8px; margin: 20px 0 6px; flex-wrap: wrap; }
.seat { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 11px; color: var(--muted); transition: all .4s var(--ease); }
.seat.filled { background: var(--ink); border-color: var(--ink); color: var(--paper-2); }
.attendees { list-style: none; padding: 0; margin: 20px 0 0; text-align: left; border-top: 1px solid var(--line); }
.attendees li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.attendees .meta { font-size: 12px; color: var(--muted); text-align: right; }
.bring { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.bring h3 { font-size: 22px; margin-bottom: 4px; }
.bring p { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 500; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }

/* Arrangement cards */
.arrange { display: grid; gap: 14px; }
.arrange .card h3 { font-size: 24px; margin: 6px 0 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; margin-top: 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; word-break: break-word; }
.slot { font-family: var(--serif); font-size: 44px; line-height: 1; margin: 6px 0; }

/* Today (wedding day) */
.today { text-align: center; padding: 34px 22px; background: var(--ink); color: var(--paper-2); border-color: var(--ink); }
.today .eyebrow { color: var(--bronze-2); }
.today h2 { font-size: 38px; margin: 10px 0 6px; }
.today p { color: #cfc6b8; }
.today .btn { background: var(--paper-2); color: var(--ink); border-color: var(--paper-2); }
.today .btn.ghost { background: transparent; color: var(--paper-2); border-color: rgba(255,255,255,.3); }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }

/* Message */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip {
  border: 1px solid var(--line-strong); background: transparent; border-radius: 999px; padding: 8px 15px; font-size: 13px; cursor: pointer;
  transition: all .25s var(--ease); color: var(--ink-2);
}
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed='true'] { background: var(--ink); color: var(--paper-2); border-color: var(--ink); }
textarea.paper, input.paper, select.paper {
  width: 100%; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper-2);
  padding: 14px 16px; font-size: 16px; transition: border-color .2s, background .2s;
}
textarea.paper { min-height: 130px; resize: vertical; font-family: var(--serif); font-size: 19px; line-height: 1.5; }
textarea.paper:focus, input.paper:focus, select.paper:focus { outline: none; border-color: var(--bronze-2); background: #fff; }
.saved { font-size: 13px; color: var(--ok); text-align: center; margin-top: 10px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.photos figure { margin: 0; position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; background: var(--bronze-soft); }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.photos button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(29,27,24,.7); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.upload { display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 18px; cursor: pointer; color: var(--ink-2); font-size: 14px; }
.upload input { display: none; }

/* Closing */
.closing { text-align: center; padding: 70px 0 30px; }
.closing .big { font-family: var(--serif); font-size: 28px; line-height: 1.35; max-width: 460px; margin: 0 auto; }
.closing .small { color: var(--muted); margin-top: 16px; font-family: var(--serif); font-style: italic; font-size: 19px; }
.closing .love { margin-top: 34px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.closing .sig { font-family: var(--serif); font-size: 40px; margin-top: 6px; }
.closing .sig i { color: var(--bronze); }
.closing .tiny { font-family: var(--serif); font-style: italic; color: var(--ink-2); font-size: 18px; margin-top: 30px; }
.footer-note { text-align: center; color: var(--faint); font-size: 11px; letter-spacing: .1em; margin-top: 40px; }

/* ---------- Gate / states ---------- */
.gate { min-height: 100svh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.gate .letter { width: 100%; max-width: 420px; }
.gate h1 { font-size: 40px; margin: 8px 0 6px; }
.gate form { margin-top: 26px; display: grid; gap: 12px; }
.gate input { text-align: center; letter-spacing: .2em; text-transform: uppercase; }
.err { color: var(--bad); font-size: 13px; min-height: 18px; }

/* ---------- RSVP sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(29, 27, 24, .38); z-index: 50; animation: fade .4s var(--ease) forwards; backdrop-filter: blur(2px); }
.sheet {
  position: fixed; inset: 0; z-index: 51; background: var(--paper); background-image: var(--grain);
  display: flex; flex-direction: column; animation: sheetIn .55s var(--ease);
}
@keyframes sheetIn { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 720px) {
  .sheet { inset: 4vh auto; left: 50%; width: 600px; margin-left: -300px; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); border: 1px solid var(--line); overflow: hidden; }
}
.sheet-top { padding: 14px 20px 0; }
.sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-bar .step-of { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; cursor: pointer; font-size: 18px; color: var(--ink-2); }
.icon-btn:hover { border-color: var(--line-strong); }
.progress { height: 1px; background: var(--line); margin-top: 14px; position: relative; overflow: hidden; }
.progress i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bronze); transition: width .6s var(--ease); }
.sheet-body { flex: 1; overflow-y: auto; padding: 30px 22px 30px; -webkit-overflow-scrolling: touch; }
.step { animation: stepIn .5s var(--ease); max-width: 480px; margin: 0 auto; }
@keyframes stepIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.step h2 { font-size: 34px; text-align: center; margin: 8px 0 8px; }
.step .sub { text-align: center; color: var(--muted); margin-bottom: 26px; }
.sheet-foot { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(251, 248, 242, .92); display: flex; gap: 10px; }
.sheet-foot .btn { flex: 1; }
.sheet-foot .btn.ghost { flex: 0 0 auto; }

.choice-list { display: grid; gap: 10px; }
.choice {
  display: flex; gap: 14px; align-items: flex-start; text-align: left; width: 100%; padding: 18px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--card); cursor: pointer; transition: border-color .25s, box-shadow .25s, background .25s;
}
.choice:hover { border-color: var(--line-strong); }
.choice[aria-checked='true'] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice .dot { flex: 0 0 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 1px solid var(--line-strong); position: relative; }
.choice[aria-checked='true'] .dot { border-color: var(--ink); }
.choice[aria-checked='true'] .dot::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--ink); }
.choice.check .dot { border-radius: 4px; }
.choice.check[aria-checked='true'] .dot { background: var(--ink); }
.choice.check[aria-checked='true'] .dot::after { inset: 3px 5px 5px; border-radius: 0; background: none; border: solid var(--paper-2); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.choice .t { font-family: var(--serif); font-size: 21px; line-height: 1.2; }
.choice .d { font-size: 13px; color: var(--muted); margin-top: 2px; }
.choice.big { padding: 24px 20px; }
.choice.big .t { font-size: 25px; }

.field { display: grid; gap: 6px; margin-top: 14px; }
.field > span { font-size: 12px; font-weight: 500; color: var(--ink-2); letter-spacing: .02em; }
.field > span em { font-style: normal; color: var(--muted); font-weight: 400; }
.field input.paper, .field select.paper { padding: 12px 14px; }
.field textarea.paper { min-height: 84px; font-family: var(--sans); font-size: 15px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.seg button[aria-pressed='true'] { background: var(--ink); color: var(--paper-2); border-color: var(--ink); }

.guest-card { border: 1px solid var(--line); background: var(--card); border-radius: var(--r); padding: 18px; margin-bottom: 12px; animation: rise .5s var(--ease) forwards; opacity: 0; }
.guest-card header { display: flex; justify-content: space-between; align-items: center; }
.guest-card header .eyebrow { color: var(--muted); }
.add-guest { width: 100%; padding: 16px; border: 1px dashed var(--line-strong); background: transparent; border-radius: var(--r); cursor: pointer; font-size: 14px; color: var(--ink-2); transition: all .2s; }
.add-guest:hover { border-color: var(--ink); color: var(--ink); background: rgba(255,255,255,.5); }
.counter { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 10px 0 6px; }
.counter button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--card); font-size: 22px; cursor: pointer; }
.counter button:disabled { opacity: .35; cursor: default; }
.counter output { font-family: var(--serif); font-size: 56px; min-width: 60px; text-align: center; line-height: 1; }
.places-left { text-align: center; font-size: 13px; color: var(--muted); margin: 6px 0 16px; }
.reveal-block { animation: rise .5s var(--ease) forwards; opacity: 0; }

.review { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.review section { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.review section:last-child { border-bottom: 0; }
.review header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.review h4 { font-family: var(--sans); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.review p, .review li { font-size: 15px; }
.review ul { margin: 0; padding-left: 18px; }

.done { text-align: center; padding-top: 6vh; }
.done .seal { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 26px; border: 1px solid var(--bronze); display: grid; place-items: center; color: var(--bronze); font-size: 28px; animation: rise 1s var(--ease) forwards; opacity: 0; }
.done h2 { font-size: 44px; }
.done .q { font-family: var(--serif); font-style: italic; font-size: 21px; color: var(--ink-2); margin: 12px 0 26px; }
.done .arrange { text-align: left; margin-top: 24px; }

@media (min-width: 560px) {
  .letter { padding: 60px 50px 52px; }
  .card { padding: 30px 30px; }
  .detail { grid-template-columns: 110px 1fr; padding: 20px 28px; }
}
