/* ============================================================
   WEDDING INVITATION: STYLES
   Colours and fonts are set once in :root. Change them there
   and the whole site follows.
   Layout: one column of full-width "bands" (sections). Each band
   holds a centred card: envelope, invitation, date, venue, RSVP,
   wishes, thank-you.
   ============================================================ */

:root {
  /* Colours */
  --burgundy: #6d1424;
  --burgundy-deep: #4a0b17;
  --burgundy-night: #2c060e;
  --rose: #b8404f;
  --rose-soft: #e7a3ad;
  --ivory: #fbf6ee;
  --ivory-warm: #f4ebde;
  --paper: #fffdf8;
  --line: #eadbc6;
  --champagne: #c9a96e;
  --champagne-light: #e8d6ae;
  --champagne-deep: #9c7b45;
  --ink: #3b1018;
  --ink-soft: #75525a;
  --error: #a3203a;

  /* Fonts */
  --script: "Pinyon Script", "Snell Roundhand", "Apple Chancery", cursive;
  --serif: "Cormorant Garamond", Garamond, "Times New Roman", serif;
  --sans: "Jost", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;

  --radius: 16px;
  --shadow: 0 1px 2px rgba(74, 11, 23, .06), 0 28px 50px -30px rgba(74, 11, 23, .5);
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img, svg, canvas { max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--champagne); outline-offset: 3px; }
.is-locked, .is-locked body { overflow: hidden; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Layout ---------- */
.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 680px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.band { position: relative; overflow: hidden; padding-block: clamp(72px, 14vw, 128px); }
.band--ivory { background: var(--ivory); }
.band--warm {
  background:
    radial-gradient(circle at 12% 8%, rgba(231, 163, 173, .2), transparent 45%),
    radial-gradient(circle at 88% 92%, rgba(201, 169, 110, .18), transparent 45%),
    var(--ivory-warm);
}
.band--burgundy {
  color: var(--ivory);
  background: radial-gradient(ellipse at 50% 0%, #86203a 0%, var(--burgundy) 45%, var(--burgundy-deep) 100%);
}
.band--night {
  color: var(--ivory);
  background: radial-gradient(ellipse at 50% 30%, #5e1222 0%, var(--burgundy-deep) 55%, var(--burgundy-night) 100%);
}
.band--burgundy::before, .band--night::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(232, 214, 174, .12) 1px, transparent 1.6px) 0 0 / 34px 34px;
  pointer-events: none;
}

/* ---------- Type ---------- */
.eyebrow {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--champagne-deep);
}
.band--burgundy .eyebrow, .band--night .eyebrow { color: var(--champagne-light); }
.script-title {
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(2.6rem, 10vw, 3.8rem);
  line-height: 1.1;
  color: var(--burgundy);
  text-wrap: balance;
  padding-inline: .1em;
}
.band--burgundy .script-title, .band--night .script-title { color: var(--ivory); }
.section-head { display: grid; justify-items: center; gap: 10px; text-align: center; margin-bottom: clamp(28px, 6vw, 44px); }
.lede { margin: 0; max-width: 40ch; font-family: var(--serif); font-size: 1.2rem; font-style: italic; line-height: 1.5; color: var(--ink-soft); }
.band--burgundy .lede { color: var(--champagne-light); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 13px 28px;
  border: 1px solid var(--champagne);
  border-radius: 999px;
  background: linear-gradient(180deg, #8a1d31, var(--burgundy));
  color: var(--ivory);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 24px -14px rgba(74, 11, 23, .85);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -14px rgba(74, 11, 23, .9); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .7; cursor: progress; transform: none; }
.btn--light { background: transparent; color: var(--champagne-light); box-shadow: none; }
.btn--light:hover { background: rgba(232, 214, 174, .1); box-shadow: none; }
.btn--ghost { background: transparent; color: var(--burgundy); box-shadow: none; }
.btn--ghost:hover { background: rgba(184, 64, 79, .06); box-shadow: none; }
.btn--block { width: 100%; }
.btn.is-loading .btn__label::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 10px;
  vertical-align: -2px;
  border: 2px solid rgba(251, 246, 238, .4);
  border-top-color: var(--ivory);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ============================================================
   1. OPENING SCREEN AND ENVELOPE
   ============================================================ */
.opening {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 22px;
  padding-top: max(24px, env(safe-area-inset-top, 0px));
  padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  overflow: hidden;
  text-align: center;
  color: var(--champagne-light);
  background:
    radial-gradient(circle, rgba(232, 214, 174, .1) 1px, transparent 1.6px) 0 0 / 30px 30px,
    radial-gradient(ellipse at 50% 45%, #5e1222 0%, var(--burgundy-deep) 50%, var(--burgundy-night) 100%);
  transition: opacity .9s ease, visibility 0s linear .9s;
}
.opening.to-main { opacity: 0; visibility: hidden; }
.opening__to { margin: 0; font-family: var(--script); font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1.1; color: var(--ivory); transition: opacity .6s ease; }
.opening__hint { margin: 0; font-size: 12px; letter-spacing: .32em; text-transform: uppercase; transition: opacity .6s ease; }
.opening.is-opening .opening__to, .opening.is-opening .opening__hint { opacity: 0; }

.stage {
  --w: min(360px, 84vw);
  position: relative;
  width: var(--w);
  margin-top: 36px;
  transition: transform 1s cubic-bezier(.6, 0, .3, 1), opacity .9s ease;
}
.opening.to-main .stage { transform: translateY(6vh) scale(1.5); opacity: 0; }
.stage__flora { position: absolute; z-index: 0; width: 62%; pointer-events: none; transition: transform 1.4s cubic-bezier(.2, .8, .3, 1); }
.stage__flora--tl { top: -32%; left: -22%; }
.stage__flora--br { bottom: -32%; right: -22%; transform: rotate(180deg); }
.stage__flora--tr { top: -26%; right: -18%; width: 42%; transform: scaleX(-1); }
.stage__flora--bl { bottom: -26%; left: -18%; width: 42%; transform: scaleY(-1); }
.opening.is-opening .stage__flora--tl { transform: translate(-10%, -8%) rotate(-6deg); }
.opening.is-opening .stage__flora--br { transform: rotate(180deg) translate(-10%, -8%) rotate(-6deg); }
.opening.is-opening .stage__flora--tr { transform: scaleX(-1) translate(-10%, -8%) rotate(-6deg); }
.opening.is-opening .stage__flora--bl { transform: scaleY(-1) translate(-10%, -8%) rotate(-6deg); }

.envelope {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 1400px;
  -webkit-tap-highlight-color: transparent;
}
.envelope:focus-visible { outline-offset: 14px; border-radius: 10px; }
.env__back {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  background: linear-gradient(160deg, #5e1020, #3f0914);
  box-shadow: 0 34px 60px -26px rgba(0, 0, 0, .85);
}
.env__card {
  position: absolute;
  left: 6%;
  right: 6%;
  top: 5%;
  height: 90%;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 6px;
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .2);
  transition: transform 1.2s cubic-bezier(.2, .8, .25, 1) .8s;
}
.env__card::before { content: ""; position: absolute; inset: 7px; border: 1px solid var(--champagne); border-radius: 2px; }
.mini-eyebrow { font-size: 9px; letter-spacing: .3em; text-transform: uppercase; color: var(--champagne-deep); }
.mini-names { font-family: var(--script); font-size: clamp(1.5rem, 6.4vw, 2.1rem); line-height: 1.15; color: var(--burgundy); }
.env__pocket {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 8px;
  background: linear-gradient(180deg, #8f2036 0%, var(--burgundy) 50%, #55101d 100%);
  clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%);
}
.env__lines, .env__decor { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; pointer-events: none; }
.env__flap {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 60%;
  z-index: 5;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  transition: transform .9s cubic-bezier(.5, 0, .3, 1), z-index 0s linear .45s;
}
.env__flap-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.env__flap-front { background: linear-gradient(180deg, #9a2840, var(--burgundy) 85%); }
.env__flap-front svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.env__flap-liner {
  transform: rotateX(180deg);
  background:
    radial-gradient(circle, rgba(184, 64, 79, .35) 1.2px, transparent 1.8px) 0 0 / 12px 12px,
    linear-gradient(0deg, var(--ivory), #f1e4d2);
}
.env__seal {
  position: absolute;
  left: 50%;
  top: 60%;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  margin: -35px 0 0 -35px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f5e3b5, var(--champagne) 45%, var(--champagne-deep) 100%);
  box-shadow: 0 5px 12px rgba(0, 0, 0, .45), inset 0 0 0 4px rgba(156, 123, 69, .55), inset 0 0 0 7px rgba(255, 244, 214, .4);
  font-family: var(--script);
  font-size: 23px;
  line-height: 1;
  color: var(--burgundy-deep);
  transition: transform .45s ease, opacity .45s ease;
}
.env__burst { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.burst-item {
  position: absolute;
  left: 50%;
  top: 40%;
  width: 46px;
  height: 46px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.2);
  transition: transform 1.2s cubic-bezier(.2, .9, .25, 1.15), opacity .5s ease;
  transition-delay: calc(.6s + var(--n) * 60ms);
}
.envelope.is-open { cursor: default; }
.envelope.is-open .env__flap { transform: rotateX(180deg); z-index: 0; }
.envelope.is-open .env__seal { transform: scale(.4) rotate(-25deg); opacity: 0; }
.envelope.is-open .env__card { transform: translateY(-64%); }
.envelope.is-open .burst-item {
  opacity: 1;
  transform: translate(calc(-50% + var(--x) * var(--w)), calc(-50% + var(--y) * var(--w))) rotate(var(--r)) scale(var(--s));
}
.envelope:not(.is-open):hover .env__seal { transform: scale(1.07); }

/* ============================================================
   2. INVITATION CARD
   ============================================================ */
.invite-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: clamp(44px, 9vw, 68px) clamp(22px, 6vw, 56px);
  overflow: hidden;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.invite-card::before, .venue-card::before, .form-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--champagne);
  border-radius: calc(var(--radius) - 6px);
  pointer-events: none;
}
.invite-card::after {
  content: "";
  position: absolute;
  inset: 17px;
  border: 1px solid rgba(201, 169, 110, .4);
  border-radius: calc(var(--radius) - 9px);
  pointer-events: none;
}
.invite-card > *:not(.corner-spray) { position: relative; z-index: 1; }
.corner-spray { position: absolute; z-index: 0; width: clamp(96px, 28vw, 170px); pointer-events: none; }
.corner-spray.tl { top: 0; left: 0; }
.corner-spray.br { right: 0; bottom: 0; transform: rotate(180deg); }
.invite-art { width: min(270px, 78%); height: auto; }.greet { margin: 0; font-family: var(--script); font-size: clamp(1.9rem, 7vw, 2.4rem); line-height: 1.1; color: var(--rose); }
.invite-title { margin: 0; font-family: var(--script); font-weight: 400; font-size: clamp(2.2rem, 8.6vw, 3.2rem); line-height: 1.15; color: var(--burgundy); text-wrap: balance; }
.invite-title:focus { outline: none; }
.invite-msg { margin: 0; max-width: 36ch; font-family: var(--serif); font-size: clamp(1.15rem, 4.4vw, 1.3rem); font-style: italic; line-height: 1.5; color: var(--ink-soft); }
.couple-names { display: grid; justify-items: center; gap: 10px; margin-block: 6px; }
.person { display: grid; justify-items: center; }
.name {
  margin: 0;
  padding: 0 .12em;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(3.4rem, 16vw, 5.4rem);
  line-height: 1.12;
  color: var(--burgundy);
  white-space: nowrap;
}
.name .ch { display: inline-block; }
.parents { margin: 2px 0 0; font-family: var(--serif); font-size: 1.12rem; font-style: italic; color: var(--ink-soft); }
.parents span { font-style: normal; font-weight: 600; color: var(--ink); }
.amp { display: flex; align-items: center; gap: 14px; font-family: var(--script); font-size: 2.6rem; line-height: 1; color: var(--champagne-deep); }
.amp span { width: 56px; height: 1px; background: linear-gradient(90deg, transparent, var(--champagne)); }
.amp span:last-child { transform: scaleX(-1); }
.invite-close { margin: 0; max-width: 34ch; color: var(--ink-soft); }
.scroll-cue {
  display: inline-grid;
  justify-items: center;
  gap: 2px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--champagne-deep);
}
.scroll-cue svg { width: 20px; height: 20px; }

/* ============================================================
   3. DATE CARD (scratch and flip)
   ============================================================ */
.date-stage { position: relative; display: grid; place-items: center; padding-block: 36px; }
.date-flora { position: absolute; z-index: 0; width: clamp(130px, 38vw, 200px); pointer-events: none; }
.date-flora.tl { top: 0; left: calc(50% - 230px); }
.date-flora.br { bottom: 0; right: calc(50% - 230px); transform: rotate(180deg); }
.flip { position: relative; z-index: 1; width: min(320px, 100%); max-width: 100%; aspect-ratio: 4 / 5; perspective: 1400px; }
.flip__inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1.2s cubic-bezier(.3, .7, .2, 1); }
.flip.is-flipped .flip__inner { transform: rotateY(180deg); }
.flip__face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 30px 26px;
  overflow: hidden;
  text-align: center;
  color: var(--ink);
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 34px 60px -30px rgba(0, 0, 0, .7);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flip__face::before { content: ""; position: absolute; inset: 10px; border: 1px solid var(--champagne); border-radius: calc(var(--radius) - 6px); pointer-events: none; }
.flip__back { transform: rotateY(180deg); }
.front-date { display: grid; gap: 4px; font-family: var(--serif); }
.front-weekday, .front-my { font-size: 1.2rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.front-day { font-size: 5rem; font-weight: 600; line-height: 1; color: var(--burgundy); }
.scratch { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; border-radius: var(--radius); cursor: grab; touch-action: none; transition: opacity .7s ease; }
.scratch:active { cursor: grabbing; }
.scratch.is-done { opacity: 0; pointer-events: none; }
.back-garland { width: 92%; height: auto; margin-top: -6px; }
.back-weekday { margin: 0; font-family: var(--script); font-size: 2.7rem; line-height: 1.1; color: var(--burgundy); }
.back-date { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; width: 100%; }
.back-side { padding-block: 8px; border-block: 1px solid var(--champagne); font-size: 12px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; overflow-wrap: anywhere; }
.back-day { font-family: var(--serif); font-size: 4.6rem; font-weight: 600; line-height: 1; color: var(--burgundy); }
.back-time { margin: 0; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.date-actions { display: flex; justify-content: center; margin-top: 4px; }

/* ============================================================
   4. VENUE
   ============================================================ */
.venue-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: clamp(40px, 8vw, 60px) clamp(22px, 6vw, 48px);
  overflow: hidden;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.venue-card > *:not(.corner-spray) { position: relative; z-index: 1; }
.pin { position: relative; display: grid; justify-items: center; width: 70px; height: 84px; }
.pin__icon { position: relative; z-index: 1; width: 46px; height: 60px; filter: drop-shadow(0 10px 8px rgba(74, 11, 23, .3)); }
.pin__pulse { position: absolute; bottom: 4px; left: 50%; width: 46px; height: 14px; margin-left: -23px; border: 1.5px solid var(--rose); border-radius: 50%; opacity: .5; }
.venue-name { margin: 0; font-family: var(--serif); font-size: clamp(1.7rem, 6.4vw, 2.2rem); font-weight: 600; line-height: 1.2; color: var(--burgundy); }
.venue-address { margin: 0; max-width: 36ch; color: var(--ink-soft); }
.venue-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; width: 100%; margin-block: 4px 8px; padding-block: 14px; border-block: 1px solid var(--line); }
.venue-meta div { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.venue-meta svg { flex: none; width: 19px; height: 19px; color: var(--rose); }

/* ============================================================
   5 & 6. FORMS (RSVP and wishes)
   ============================================================ */
.form-card {
  position: relative;
  padding: clamp(32px, 7vw, 48px) clamp(20px, 5.5vw, 42px);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.form-card > * { position: relative; }
form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field > label, .field > legend { padding: 0; font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.field > legend { margin-bottom: 8px; }
.opt { font-weight: 400; letter-spacing: 0; text-transform: none; }
input[type="text"], input[type="number"], textarea {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  background: var(--ivory);
  border: 1px solid #e3d2bb;
  border-radius: 10px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus, textarea:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(184, 64, 79, .15); }
textarea { min-height: 100px; resize: vertical; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.choice__box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 12px 16px;
  background: var(--ivory);
  border: 1px solid #e3d2bb;
  border-radius: 12px;
  font-weight: 500;
  transition: background .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.choice__box svg { flex: none; width: 20px; height: 20px; color: var(--rose); }
.choice input:checked + .choice__box { background: var(--burgundy); border-color: var(--burgundy); color: var(--ivory); box-shadow: 0 12px 22px -14px rgba(74, 11, 23, .9); }
.choice input:checked + .choice__box svg { color: var(--champagne-light); }
.choice input:focus-visible + .choice__box { outline: 2px solid var(--champagne); outline-offset: 2px; }
.stepper { display: inline-flex; align-items: center; width: max-content; background: var(--ivory); border: 1px solid #e3d2bb; border-radius: 999px; }
.stepper button { width: 46px; height: 46px; border: 0; border-radius: 50%; background: none; font-size: 22px; line-height: 1; color: var(--burgundy); cursor: pointer; }
.stepper button:hover { background: rgba(184, 64, 79, .08); }
.stepper input { width: 56px; padding: 10px 0; text-align: center; background: none; border: 0; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { box-shadow: none; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.counter { justify-self: end; font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.form-error { margin: 0; font-size: 14px; color: var(--error); }
.proto-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 22px;
  padding: 11px 14px;
  font-size: 14px;
  line-height: 1.5;
  background: #fbefe9;
  border: 1px dashed var(--rose);
  border-radius: 10px;
}
.proto-note svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--rose); }

/* Result after submitting */
.result { position: relative; display: grid; justify-items: center; gap: 12px; padding-block: 8px; text-align: center; }
.result:focus { outline: none; }
.tick { width: 88px; height: 88px; }
.tick__ring { fill: none; stroke: var(--champagne); stroke-width: 2.5; stroke-dasharray: 1; stroke-dashoffset: 0; }
.tick__mark { fill: none; stroke: var(--burgundy); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.result__icon { width: 60px; height: 60px; color: var(--rose); }
.result__title { margin: 0; font-family: var(--script); font-size: 2.5rem; font-weight: 400; line-height: 1.1; color: var(--burgundy); }
.result--preview .result__title { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; }
.result__text { margin: 0; max-width: 38ch; color: var(--ink-soft); }
.result__summary { width: 100%; margin: 4px 0 0; padding: 12px 16px; text-align: left; background: var(--ivory); border: 1px dashed var(--line); border-radius: 10px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.burst-heart { position: absolute; left: 50%; top: 44px; width: 16px; height: 16px; color: var(--rose); pointer-events: none; }

/* Wishes wall */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 26px 22px; margin-top: 44px; }
.wall__empty { grid-column: 1 / -1; margin: 0; text-align: center; font-family: var(--serif); font-size: 1.15rem; font-style: italic; color: var(--champagne-light); }
.note {
  position: relative;
  margin: 0;
  padding: 28px 22px 20px;
  color: var(--ink);
  background: repeating-linear-gradient(180deg, transparent 0 31px, rgba(184, 64, 79, .12) 31px 32px) 0 22px / 100% calc(100% - 44px) no-repeat, var(--paper);
  border-radius: 6px;
  box-shadow: 0 20px 30px -18px rgba(0, 0, 0, .65);
  transform: rotate(var(--tilt, 0deg));
}
.note::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 86px;
  height: 22px;
  background: rgba(232, 214, 174, .78);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .15);
  transform: translateX(-50%) rotate(-3deg);
}
.note blockquote { margin: 0; font-family: var(--hand); font-size: 1.45rem; line-height: 1.33; overflow-wrap: anywhere; }
.note figcaption { margin-top: 12px; padding-right: 30px; font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--rose); overflow-wrap: anywhere; }
.note__rose { position: absolute; right: 10px; bottom: 10px; width: 26px; height: 26px; }
.note__badge { position: absolute; top: 8px; right: 10px; padding: 1px 8px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--rose); background: #fbefe9; border: 1px dashed var(--rose); border-radius: 999px; }

/* ============================================================
   7. THANK YOU
   ============================================================ */
.thanks { padding-bottom: 32px; text-align: center; }
.thanks__inner { display: grid; justify-items: center; gap: 18px; }
.couple-art { width: min(270px, 74%); height: auto; }
.thanks .script-title { max-width: 14ch; font-size: clamp(2.3rem, 9vw, 3.4rem); }
.thanks__msg { margin: 0; max-width: 38ch; font-family: var(--serif); font-size: 1.25rem; font-style: italic; line-height: 1.55; color: var(--champagne-light); }
.thanks__names { margin: 8px 0 0; font-family: var(--script); font-size: clamp(2.6rem, 11vw, 3.8rem); line-height: 1.15; color: var(--champagne-light); padding-inline: .1em; }
.thanks__names .amp-s { font-size: .7em; color: var(--rose-soft); }
.thanks__date { margin: 0; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; color: var(--champagne); }
.thanks-flora { position: absolute; top: 0; z-index: 0; width: clamp(120px, 32vw, 220px); pointer-events: none; }
.thanks-flora.tl { left: 0; }
.thanks-flora.tr { right: 0; transform: scaleX(-1); }
.site-foot {
  position: relative;
  z-index: 1;
  margin-top: 64px;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(232, 214, 174, .65);
}
.arch-line { stroke-dasharray: 1; stroke-dashoffset: 0; }

/* ============================================================
   FLOATING ELEMENTS: petals, butterflies, music
   ============================================================ */
.petals { position: fixed; inset: 0; z-index: 70; width: 100%; height: 100%; pointer-events: none; }
.butterfly { position: absolute; top: var(--top); left: var(--left); z-index: 2; width: var(--size, 34px); pointer-events: none; }
.butterfly svg { display: block; width: 100%; height: auto; overflow: visible; }
.wing { transform-box: fill-box; }
.wing-l { transform-origin: 100% 50%; }
.wing-r { transform-origin: 0% 50%; }
.music {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 55;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 1px solid var(--champagne);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #a12a40, var(--burgundy-deep));
  color: var(--champagne-light);
  cursor: pointer;
  box-shadow: 0 12px 24px -10px rgba(44, 6, 14, .85);
}
.music svg { grid-area: 1 / 1; width: 22px; height: 22px; }
.music .i-pause { display: none; }
.music.is-playing .i-pause { display: block; }
.music.is-playing .i-play { display: none; }
.music::before, .music::after { content: ""; position: absolute; inset: -1px; border: 1px solid var(--champagne); border-radius: 50%; opacity: 0; pointer-events: none; }

/* ============================================================
   ANIMATIONS (switched off for visitors who prefer less motion)
   ============================================================ */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes envFloat { 50% { transform: translateY(-7px); } }
@keyframes hintPulse { 50% { opacity: .45; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(40px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes bloom { from { opacity: 0; scale: .5; } to { opacity: 1; scale: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes letterIn { from { opacity: 0; transform: translateY(.35em); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes bob { 50% { transform: translateY(5px); } }
@keyframes pinBounce { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-12px); } 60% { transform: translateY(0); } 70% { transform: translateY(-4px); } }
@keyframes pulse { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.9); opacity: 0; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes resultIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes heartUp { from { opacity: 1; transform: translate(-50%, 0) scale(.4); } to { opacity: 0; transform: translate(calc(-50% + var(--dx)), var(--dy)) scale(1.1); } }
@keyframes noteIn { from { opacity: 0; transform: translateY(26px) rotate(0deg); } to { opacity: 1; transform: rotate(var(--tilt, 0deg)); } }
@keyframes flap { to { transform: scaleX(.3); } }
@keyframes flutter {
  0%, 100% { transform: translate(0, 0) rotate(-8deg); }
  25% { transform: translate(40px, -26px) rotate(6deg); }
  50% { transform: translate(12px, -52px) rotate(-4deg); }
  75% { transform: translate(-30px, -20px) rotate(8deg); }
}
@keyframes ring { from { transform: scale(1); opacity: .8; } to { transform: scale(1.75); opacity: 0; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

@media (prefers-reduced-motion: no-preference) {
  .envelope:not(.is-open) { animation: envFloat 3.4s ease-in-out infinite; }
  .opening__hint { animation: hintPulse 2.4s ease-in-out infinite; }

  /* Invitation card reveal after the envelope opens */
  body.is-open .invite-card { animation: cardIn 1.2s cubic-bezier(.2, .7, .2, 1) both; }
  body.is-open .invite-card .invite-art, body.is-open .invite-card .corner-spray { animation: bloom 1.6s cubic-bezier(.2, .8, .3, 1.1) .3s both; }
  body.is-open .invite-card .reveal-line { animation: fadeUp 1s ease both; animation-delay: var(--d, 0s); }
  body.is-open .name .ch { animation: letterIn .8s cubic-bezier(.2, .7, .3, 1) both; animation-delay: calc(var(--base, .9s) + var(--i) * 70ms); }
  .scroll-cue svg { animation: bob 1.8s ease-in-out infinite; }

  /* Scroll reveals: sections below the first screen rise in from a faint state */
  [data-reveal] { transition: opacity 1s ease, transform 1s cubic-bezier(.2, .7, .3, 1); }
  [data-reveal].pending { opacity: .12; transform: translateY(30px); }
  [data-reveal] .script-title { transition: clip-path 1.6s cubic-bezier(.4, 0, .2, 1) .2s; clip-path: inset(-30% -5% -30% 0); }
  [data-reveal].pending .script-title { clip-path: inset(-30% 100% -30% 0); }
  .thanks[data-reveal].pending { opacity: 1; transform: none; }

  /* Venue pin */
  .pin__icon { animation: pinBounce 2.6s ease-in-out infinite; }
  .pin__pulse { opacity: 0; animation: pulse 2.6s ease-out infinite; }
  .pin__pulse--late { animation-delay: 1.3s; }

  /* Form results */
  .result { animation: resultIn .6s ease both; }
  .tick__ring { animation: draw .8s ease both; }
  .tick__mark { animation: draw .5s ease .7s both; }
  .burst-heart { animation: heartUp 1.5s ease-out forwards; }
  .note { animation: noteIn .8s cubic-bezier(.2, .8, .3, 1.2) both; animation-delay: var(--d, 0ms); }

  /* Thank-you closing animation */
  .arch-line { transition: stroke-dashoffset 2.4s ease; }
  .couple-art .figures { transition: opacity 1.2s ease .7s, transform 1.2s ease .7s; }
  .couple-art .arch-flowers { transition: opacity 1.2s ease 1.6s; }
  .thanks__inner > :not(.couple-art) { transition: opacity 1s ease, transform 1s ease; }
  .thanks__inner > :nth-child(2) { transition-delay: .9s; }
  .thanks__inner > :nth-child(3) { transition-delay: 1.2s; }
  .thanks__inner > :nth-child(4) { transition-delay: 1.5s; }
  .thanks__inner > :nth-child(5) { transition-delay: 1.8s; }
  .thanks.pending .arch-line { stroke-dashoffset: 1; }
  .thanks.pending .couple-art .figures { opacity: .12; transform: translateY(16px); }
  .thanks.pending .couple-art .arch-flowers { opacity: .12; }
  .thanks.pending .thanks__inner > :not(.couple-art) { opacity: .12; transform: translateY(18px); }

  /* Butterflies and music */
  .butterfly { animation: flutter var(--dur, 12s) ease-in-out infinite; }
  .wing { animation: flap .26s ease-in-out infinite alternate; }
  .music.is-playing::before { animation: ring 2.4s ease-out infinite; }
  .music.is-playing::after { animation: ring 2.4s ease-out 1.2s infinite; }
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  @media (prefers-reduced-motion: no-preference) {
    .thanks.is-in .thanks__names {
      background: linear-gradient(100deg, var(--champagne-light) 40%, #fff6dc 50%, var(--champagne-light) 60%) 100% 0 / 260% 100% no-repeat;
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      animation: shimmer 2.8s ease-in-out 2.2s both;
    }
    .thanks.is-in .thanks__names .amp-s { color: var(--rose-soft); }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* ---------- Larger screens ---------- */
@media (min-width: 720px) {
  .name { font-size: 5rem; }
}
