/* =====================================================================
   Wedding invitation — styles
   Colours are CSS variables; js/config.js (theme) overrides them.
   ===================================================================== */

:root {
  --blush: #f8e3e1;
  --blush-deep: #efcac8;
  --rose: #d49aa0;
  --rose-deep: #a5606b;
  --ivory: #fffaf3;
  --envelope: #f2d3d1;
  --liner: #cf979c;
  --rose-gold: #c08a7b;
  --rose-gold-light: #efd2c6;
  --rose-gold-deep: #94604f;
  --ink: #573840;
  --ink-soft: #7f5f66;
  --leaf: #b9c0ae;
  --leaf-deep: #8d9884;
  --error: #a3394a;

  --font-script: "Pinyon Script", "Snell Roundhand", "Apple Chancery", cursive;
  --font-serif: "Cormorant Garamond", "Cormorant", Garamond, Georgia, serif;
  --font-sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;

  --ease-out: cubic-bezier(.22, .8, .24, 1);
  --ease-soft: cubic-bezier(.55, .06, .25, 1);
  --ease-flip: cubic-bezier(.45, 0, .55, 1);

  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .27 0 0 0 0 .29 0 0 0 .6 -.24'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --fibres: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .09' numOctaves='2' seed='3'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .34 -.14'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --liner-pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30'%3E%3Cg fill='%23fff7f1' fill-opacity='.5'%3E%3Ccircle cx='8' cy='5' r='1.6'/%3E%3Ccircle cx='11.2' cy='7.4' r='1.6'/%3E%3Ccircle cx='10' cy='11.2' r='1.6'/%3E%3Ccircle cx='6' cy='11.2' r='1.6'/%3E%3Ccircle cx='4.8' cy='7.4' r='1.6'/%3E%3C/g%3E%3Ccircle cx='8' cy='8.4' r='1.1' fill='%23f3d2c4' fill-opacity='.8'/%3E%3Cg fill='%23fff7f1' fill-opacity='.32'%3E%3Ccircle cx='23' cy='22' r='1.1'/%3E%3Ccircle cx='25.5' cy='24.5' r='.8'/%3E%3Ccircle cx='20.6' cy='25' r='.8'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  scroll-behavior: auto;
}
@supports (overflow: clip) { html { overflow-x: clip; } }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.6;
  background: var(--blush);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@supports (overflow: clip) { body { overflow-x: clip; } }

/* Soft pink backdrop with paper grain (fixed layers so nothing repaints while scrolling) */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body::before {
  z-index: -2;
  background:
    radial-gradient(70% 55% at 50% 38%, rgba(255, 249, 245, .95) 0%, rgba(255, 249, 245, 0) 70%),
    radial-gradient(60% 50% at 0% 0%, color-mix(in srgb, var(--blush-deep) 70%, transparent), transparent 70%),
    radial-gradient(55% 45% at 100% 100%, color-mix(in srgb, var(--rose) 32%, transparent), transparent 70%),
    linear-gradient(180deg, var(--blush) 0%, color-mix(in srgb, var(--blush) 85%, var(--blush-deep)) 100%);
}
body::after {
  z-index: -1;
  background-image: var(--noise);
  opacity: .5;
}

h1, h2, h3, p { margin: 0; }
a { color: var(--rose-deep); }
img, svg { display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .85em; background: rgba(192, 138, 123, .14); padding: .05em .35em; border-radius: 4px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: absolute;
  left: 50%;
  top: 10px;
  z-index: 100;
  transform: translate(-50%, -160%);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ivory);
  color: var(--ink);
  font: 600 .8rem/1 var(--font-sans);
  letter-spacing: .08em;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(90, 40, 50, .18);
  transition: transform .25s ease;
}
.skip-link:focus { transform: translate(-50%, 0); outline: 2px solid var(--rose-deep); outline-offset: 2px; }
.no-js .skip-link { display: none; }

:focus-visible { outline: 2px solid var(--rose-deep); outline-offset: 3px; }

.amp {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--rose-gold);
  background: linear-gradient(135deg, var(--rose-gold-deep), var(--rose-gold) 45%, var(--rose-gold-light) 60%, var(--rose-gold) 80%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Unfilled [PLACEHOLDERS] in calligraphy spots: show them in a calm italic serif
   so the preview stays legible. Real names automatically use the script font. */
.opening__names .is-placeholder,
.hero__names .is-placeholder,
.card-names .is-placeholder,
.closing__names .is-placeholder,
.venue__name.is-placeholder {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: .56em;
  letter-spacing: .04em;
  line-height: 1.5;
}
.venue__name.is-placeholder { font-size: clamp(1.35rem, 4vw, 1.7rem); }

/* ---------- Floating petals ---------- */
.petals {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.petal {
  position: absolute;
  top: -40px;
  left: var(--x);
  width: var(--size);
  height: calc(var(--size) * 1.2);
  opacity: var(--alpha, .7);
  animation: petal-fall var(--dur) linear var(--delay) infinite;
  will-change: transform;
}
.petal i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 100% 12% 100% 40%;
  background:
    radial-gradient(120% 100% at 12% 92%, var(--rose-deep) 0%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(110% 100% at 70% 22%, #fff7f4 0%, var(--blush-deep) 45%, var(--rose) 100%);
  box-shadow:
    inset -1px -1px 2px rgba(165, 96, 107, .3),
    inset 1px 1px 1px rgba(255, 255, 255, .6),
    0 2px 4px rgba(120, 55, 65, .14);
  animation: petal-tumble var(--spin) ease-in-out infinite alternate;
}
/* depth: distant petals are smaller, paler and softer; near ones crisper */
.petal--far i { box-shadow: inset -1px -1px 1px rgba(165, 96, 107, .2); }
.petal--near i { box-shadow: inset -1px -1px 3px rgba(165, 96, 107, .35), inset 1px 1px 2px rgba(255, 255, 255, .7), 0 4px 8px rgba(120, 55, 65, .16); }
@keyframes petal-fall {
  0%   { transform: translate3d(0, 0, 0); }
  25%  { transform: translate3d(var(--sway), 28vh, 0); }
  50%  { transform: translate3d(calc(var(--sway) * -.6), 56vh, 0); }
  75%  { transform: translate3d(var(--sway), 84vh, 0); }
  100% { transform: translate3d(var(--drift), calc(100vh + 80px), 0); }
}
@keyframes petal-tumble {
  /* flutter without ever turning fully edge-on, so petals stay visible */
  0%   { transform: rotate3d(1, .4, .2, -42deg) rotate(var(--r0)); }
  100% { transform: rotate3d(1, .4, .2, 42deg) rotate(calc(var(--r0) + 150deg)); }
}

/* =====================================================================
   Opening scene
   ===================================================================== */
.opening {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: max(20px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
}
.no-js .opening { display: none; }

.opening__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, 3.6vh, 40px);
  width: 100%;
}

.opening__names {
  max-width: min(92vw, 640px);
  text-align: center;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(1.9rem, 6.4vw, 3.3rem);
  line-height: 1.12;
  color: var(--ink);
  overflow-wrap: anywhere;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
}
.opening__names .amp { margin: 0 .12em; }

.opening__prompt { text-align: center; }
.prompt-line {
  font-style: italic;
  font-size: clamp(1.15rem, 3.6vw, 1.4rem);
  color: var(--ink);
}
.prompt-tap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  font: 600 .76rem/1 var(--font-sans);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--rose-deep);
}
.tap-dot {
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--rose-gold);
}
.tap-dot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--rose-gold);
  animation: ping 2.4s var(--ease-out) infinite;
}
@keyframes ping {
  0% { transform: scale(.4); opacity: .9; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Entrance: names and prompt follow the envelope in */
.js .opening__names,
.js .opening__prompt { opacity: 0; }
.is-ready .opening__names { animation: rise-in 1.2s var(--ease-out) 1.6s both; }
.is-ready .opening__prompt { animation: rise-in 1.2s var(--ease-out) 2.1s both; }
@keyframes rise-in {
  from { opacity: 0; transform: translateY(14px); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}
/* fade out on children so it never fights the entrance animation */
.opening__names > *, .opening__prompt > * { transition: opacity .55s ease; }
.is-opening .opening__names > *, .is-opening .opening__prompt > * { opacity: 0; }

/* ---------- Scene / envelope geometry ---------- */
.scene {
  --env-w: clamp(250px, min(86vw, calc((100vh - 300px) * 1.45)), 480px);
  position: relative;
  width: var(--env-w);
  aspect-ratio: 1.45;
  perspective: 1600px;
  perspective-origin: 50% 35%;
  transition: opacity .45s ease;
}
@supports (height: 100svh) {
  .scene { --env-w: clamp(250px, min(86vw, calc((100svh - 300px) * 1.45)), 480px); }
}

.env-ground {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -9%;
  height: 16%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(120, 55, 65, .32), rgba(120, 55, 65, 0));
  filter: blur(6px);
  opacity: 0;
  transition: opacity .8s ease, transform .9s var(--ease-soft);
}

.flight, .float {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.js .flight { opacity: 0; }

.is-ready .flight { animation: fly-in 2.9s both; }
.is-ready .env-ground { animation: ground-in 2.9s both; }

@keyframes fly-in {
  0%   { opacity: 0; transform: translate3d(-34vw, -46vh, -1900px) rotateX(58deg) rotateY(-42deg) rotateZ(-30deg);
         animation-timing-function: cubic-bezier(.3, .25, .45, 1); }
  14%  { opacity: 1; }
  52%  { transform: translate3d(7vw, -7vh, -320px) rotateX(20deg) rotateY(16deg) rotateZ(7deg);
         animation-timing-function: cubic-bezier(.35, .1, .4, 1); }
  78%  { transform: translate3d(-1vw, 1.2vh, 26px) rotateX(-5deg) rotateY(-4deg) rotateZ(-1.6deg);
         animation-timing-function: cubic-bezier(.4, 0, .3, 1); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) rotateX(0) rotateY(0) rotateZ(0); }
}
@keyframes ground-in {
  0%, 30% { opacity: 0; transform: scale(.3); }
  78% { opacity: .9; transform: scale(1.04); }
  100% { opacity: 1; transform: scale(1); }
}
.is-ready .env-ground { opacity: 1; }

/* Gentle idle float once landed */
.is-landed:not(.is-opening) .float { animation: hover-float 6.5s ease-in-out infinite; }
@keyframes hover-float {
  0%, 100% { transform: translate3d(0, 0, 0) rotateX(0) rotateZ(0); }
  33% { transform: translate3d(0, -7px, 0) rotateX(3deg) rotateZ(-.6deg); }
  66% { transform: translate3d(0, -3px, 0) rotateX(-1.5deg) rotateZ(.5deg); }
}

/* The envelope itself is one clickable button */
.envelope {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 1100px;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  text-align: center;
}
.envelope:focus-visible { outline: none; }
.envelope:focus-visible .env-back {
  box-shadow: 0 0 0 3px var(--ivory), 0 0 0 6px var(--rose-deep), 0 18px 40px -12px rgba(110, 50, 60, .45);
}
.is-opening .envelope { cursor: default; }
.is-opened .envelope { pointer-events: none; }

.env-part {
  position: absolute;
  inset: 0;
  transition: transform 1s var(--ease-soft), opacity .8s ease;
}

/* Inside of the envelope, lined */
.env-back {
  z-index: 1;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(90, 35, 45, .28) 0%, rgba(90, 35, 45, 0) 38%),
    var(--liner-pattern),
    linear-gradient(160deg, color-mix(in srgb, var(--liner) 88%, white), var(--liner));
  box-shadow:
    0 1px 1px rgba(110, 50, 60, .12),
    0 14px 26px -8px rgba(110, 50, 60, .32),
    0 30px 60px -24px rgba(110, 50, 60, .35);
}
.env-back::after {
  /* paper margin around the liner */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  box-shadow: inset 0 0 0 5px var(--envelope), inset 0 0 0 6px rgba(120, 60, 70, .12);
}

/* Pocket: two side folds and the bottom fold */
.env-sides { z-index: 4; filter: drop-shadow(0 1px 1.5px rgba(110, 50, 60, .22)); }
.env-side {
  position: absolute;
  inset: 0;
  background-image: var(--noise), var(--fibres);
}
.env-side--left {
  clip-path: polygon(0 0, 47% 49%, 51% 54%, 47% 59%, 0 100%);
  background-color: var(--envelope);
  background-image: var(--noise), var(--fibres),
    linear-gradient(98deg, color-mix(in srgb, var(--envelope) 70%, white) 0%, var(--envelope) 55%, color-mix(in srgb, var(--envelope) 90%, #b67b80) 100%);
}
.env-side--right {
  clip-path: polygon(100% 0, 53% 49%, 49% 54%, 53% 59%, 100% 100%);
  background-color: var(--envelope);
  background-image: var(--noise), var(--fibres),
    linear-gradient(262deg, color-mix(in srgb, var(--envelope) 96%, #b67b80) 0%, color-mix(in srgb, var(--envelope) 92%, #b67b80) 60%, color-mix(in srgb, var(--envelope) 82%, #a46c72) 100%);
}

.env-bottom-wrap {
  z-index: 5;
  filter:
    drop-shadow(0 -1px 0 rgba(255, 255, 255, .55))
    drop-shadow(0 -3px 4px rgba(110, 50, 60, .16));
}
.env-bottom {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 100%, 0 97%, 38% 56%, 44% 51%, 50% 49%, 56% 51%, 62% 56%, 100% 97%, 100% 100%);
  border-radius: 0 0 6px 6px;
  background-color: var(--envelope);
  background-image: var(--noise), var(--fibres),
    linear-gradient(180deg, color-mix(in srgb, var(--envelope) 82%, white) 40%, var(--envelope) 75%, color-mix(in srgb, var(--envelope) 94%, #b67b80) 100%);
}

/* Shadow cast by the top flap */
.flap-shadow-wrap { z-index: 6; filter: blur(3px); transition: opacity .35s ease, transform 1s var(--ease-soft); }
.flap-shadow {
  position: absolute;
  inset: 0;
  transform: translateY(4px);
  background: rgba(100, 40, 52, .3);
  clip-path: polygon(0 0, 100% 0, 100% 2%, 57% 55%, 53% 59.5%, 50% 60.5%, 47% 59.5%, 43% 55%, 0 2%);
}
.is-flap-open .flap-shadow-wrap { opacity: 0; }

/* Top flap: front (paper) + back (liner) */
.env-flap { z-index: 7; perspective: 1100px; perspective-origin: 50% 50%; }
.is-flap-behind .env-flap { z-index: 2; }

.flap-rotor {
  position: absolute;
  inset: 0;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  transition: transform .95s var(--ease-flip);
}
.flap-face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.flap-front {
  clip-path: polygon(0 0, 100% 0, 100% 2%, 57% 55%, 53% 59.5%, 50% 60.5%, 47% 59.5%, 43% 55%, 0 2%);
  border-radius: 6px 6px 0 0;
  background-color: var(--envelope);
  background-image: var(--noise), var(--fibres),
    radial-gradient(70% 90% at 50% 0%, color-mix(in srgb, var(--envelope) 65%, white) 0%, transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--envelope) 85%, white) 0%, var(--envelope) 55%, color-mix(in srgb, var(--envelope) 92%, #b07379) 100%);
}
.flap-back {
  transform: rotateX(180deg);
  clip-path: polygon(0 100%, 0 98%, 43% 45%, 47% 40.5%, 50% 39.5%, 53% 40.5%, 57% 45%, 100% 98%, 100% 100%);
  background-color: var(--envelope);
  background-image: var(--noise), linear-gradient(0deg, color-mix(in srgb, var(--envelope) 90%, #a96e74), var(--envelope));
}
.flap-back::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(3% 100%, 46% 46%, 50% 42.5%, 54% 46%, 97% 100%);
  background:
    linear-gradient(0deg, rgba(90, 35, 45, .2), rgba(90, 35, 45, 0) 50%),
    var(--liner-pattern),
    linear-gradient(20deg, var(--liner), color-mix(in srgb, var(--liner) 82%, white));
}

/* Hover: the flap lifts a touch to invite a tap */
@media (hover: hover) and (pointer: fine) {
  .is-landed:not(.is-opening) .envelope:hover .flap-rotor { transform: rotateX(14deg); }
  .is-landed:not(.is-opening) .envelope:hover .seal { transform: translate(-50%, -50%) scale(1.05); }
}

/* ---------- Rose-gold wax seal ---------- */
.seal {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 57%;
  width: 21%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 47% 53% 49% 51% / 52% 46% 54% 48%;
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 244, 238, .85) 0%, rgba(255, 244, 238, 0) 34%),
    conic-gradient(from 200deg, #b8737a, #e7b7a7, #c28376, #f2cdbd, #a8636b, #d79f92, #b8737a);
  box-shadow:
    0 2px 2px rgba(80, 30, 40, .25),
    0 6px 12px -2px rgba(80, 30, 40, .35),
    inset 0 -3px 6px rgba(90, 30, 40, .35),
    inset 0 2px 3px rgba(255, 238, 230, .75);
  transition: transform .5s var(--ease-out);
}
.seal::before {
  /* wax spill at the edge */
  content: "";
  position: absolute;
  inset: -5%;
  z-index: -1;
  border-radius: 55% 45% 58% 42% / 44% 58% 42% 56%;
  background: conic-gradient(from 40deg, #b8737a, #d9a295, #a9656c, #e3b2a3, #b8737a);
  box-shadow: 0 3px 6px rgba(80, 30, 40, .28);
}
.seal::after {
  /* soft invitation pulse */
  content: "";
  position: absolute;
  inset: -16%;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--rose-gold) 70%, white);
  opacity: 0;
}
.is-landed:not(.is-opening) .seal::after { animation: seal-pulse 2.8s var(--ease-out) 1s infinite; }
@keyframes seal-pulse {
  0% { transform: scale(.85); opacity: .85; }
  100% { transform: scale(1.35); opacity: 0; }
}
.seal-core {
  position: absolute;
  inset: 15%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 32%, #f3cbbb 0%, #d39a8c 55%, #b9787a 100%);
  box-shadow:
    inset 0 2px 4px rgba(90, 30, 40, .4),
    inset 0 -1px 2px rgba(255, 236, 228, .6),
    0 1px 0 rgba(255, 236, 228, .55);
}
.seal-core::before {
  content: "";
  position: absolute;
  inset: 7%;
  border-radius: 50%;
  border: 1px dotted rgba(110, 45, 55, .35);
}
.seal-letters {
  font-family: var(--font-script);
  font-size: calc(var(--env-w) * .0483); /* 23% of the seal width */
  line-height: 1;
  white-space: nowrap;
  color: rgba(112, 46, 56, .78);
  text-shadow: 0 1px 0 rgba(255, 236, 228, .75), 0 -1px 0 rgba(80, 25, 35, .3);
  transform: translateY(4%);
}

.is-seal-off .seal { animation: seal-release .8s var(--ease-soft) forwards; }
@keyframes seal-release {
  0%   { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 1; }
  28%  { transform: translate(-50%, -56%) scale(1.1) rotate(-5deg); opacity: 1; }
  100% { transform: translate(-50%, 30%) scale(.82) rotate(-22deg); opacity: 0; }
}

/* ---------- The invitation card ---------- */
.card {
  position: absolute;
  z-index: 3;
  left: 5%;
  top: 6%;
  width: 90%;
  height: 86%;
  display: block;
  /* card-relative units (card = 90% × 59.3% of the envelope width); works on older iPhones too */
  --cqw: calc(var(--env-w) * .009);
  --cqh: calc(var(--env-w) * .005931);
  perspective: 1500px;
  transition: transform 1s var(--ease-soft);
  will-change: transform;
}
.is-card-out .card { transform: translateY(-114%); transition-duration: 1s; }
.is-card-front .card { z-index: 20; }
.is-env-away .card {
  transform: translateY(var(--card-shift, 0px)) scale(var(--card-scale, 1.1));
  transition-duration: 1.05s;
}
.is-card-open .card {
  transform: translateY(calc(var(--card-shift, 0px) + var(--card-scale, 1.1) * 50%)) scale(var(--card-scale, 1.1));
  transition-duration: 1.15s;
}

.card-panel,
.card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: calc(var(--cqh) * 7) calc(var(--cqw) * 9);
  border-radius: 3px;
  color: var(--ink);
  background-color: var(--ivory);
  background-image: var(--noise),
    radial-gradient(90% 70% at 50% 40%, rgba(255, 255, 255, .7), transparent 75%),
    linear-gradient(165deg, #fffdf9, var(--ivory) 55%, color-mix(in srgb, var(--ivory) 92%, var(--blush-deep)));
  box-shadow: 0 1px 1px rgba(110, 50, 60, .12), 0 10px 26px -10px rgba(110, 50, 60, .35);
}
.card-panel::before,
.card-face::before {
  content: "";
  position: absolute;
  inset: calc(var(--cqw) * 3.4);
  pointer-events: none;
  border: 1px solid color-mix(in srgb, var(--rose-gold) 65%, transparent);
  box-shadow: inset 0 0 0 3px var(--ivory), inset 0 0 0 4px color-mix(in srgb, var(--rose-gold) 35%, transparent);
}
.card-panel::after,
.card-face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 1.15s var(--ease-flip);
}
/* light & shadow while the card opens */
.card-panel::after { background: linear-gradient(180deg, rgba(90, 35, 45, .26), rgba(90, 35, 45, 0) 45%); opacity: 1; }
.is-card-open .card-panel::after { opacity: 0; }
.card-front::after { background: linear-gradient(0deg, rgba(90, 35, 45, .3), rgba(90, 35, 45, .05)); opacity: 0; }
.is-card-open .card-front::after { opacity: 1; }
.card-back::after { background: linear-gradient(0deg, rgba(90, 35, 45, .28), rgba(90, 35, 45, 0) 60%); opacity: 1; }
.is-card-open .card-back::after { opacity: 0; }

.card-cover {
  position: absolute;
  inset: 0;
  display: block;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  transition: transform 1.15s var(--ease-flip);
}
.is-card-open .card-cover { transform: rotateX(180deg); }
.card-face {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.card-back { transform: rotateX(180deg); }

.card-spray {
  position: absolute;
  width: calc(var(--cqw) * 40);
  height: calc(var(--cqw) * 30);
  pointer-events: none;
}
.card-spray--tl { left: calc(var(--cqw) * -3); top: calc(var(--cqw) * -3); }
.card-spray--br { right: calc(var(--cqw) * -3); bottom: calc(var(--cqw) * -3); transform: rotate(180deg); }
.card-spray--top { left: calc(var(--cqw) * -2); top: calc(var(--cqw) * -4); width: calc(var(--cqw) * 46); height: calc(var(--cqw) * 34); }

.monogram {
  position: relative;
  display: grid;
  place-items: center;
  width: calc(var(--cqh) * 40);
  aspect-ratio: 1;
}
.monogram__wreath { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.monogram__letters {
  position: relative;
  font-family: var(--font-script);
  font-size: calc(var(--cqh) * 9.5);
  line-height: 1;
  white-space: nowrap;
  color: var(--rose-deep);
  transform: translateY(-4%);
}
.card-caption {
  margin-top: calc(var(--cqh) * 4);
  font: 600 calc(var(--cqw) * 3.3)/1.2 var(--font-sans);
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--rose-gold-deep);
}

.card-headline {
  position: relative;
  font-family: var(--font-script);
  font-size: calc(var(--cqw) * 10);
  line-height: 1.1;
  color: var(--rose-deep);
  margin-top: calc(var(--cqh) * 6);
}
.card-divider { width: calc(var(--cqw) * 42); height: calc(var(--cqw) * 4.4); margin-top: calc(var(--cqh) * 4); }

.card-kicker {
  font: 600 calc(var(--cqw) * 2.9)/1.2 var(--font-sans);
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--rose-gold-deep);
}
.card-names {
  display: block;
  margin: calc(var(--cqh) * 3) 0 calc(var(--cqh) * 3.5);
  font-family: var(--font-script);
  font-size: calc(var(--cqw) * 7.6);
  line-height: 1.12;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.card-text {
  display: block;
  max-width: 64ch;
  font-style: italic;
  font-size: calc(var(--cqw) * 3.7);
  line-height: 1.38;
  color: var(--ink-soft);
}
.card-date {
  display: block;
  margin-top: calc(var(--cqh) * 3.5);
  font: 600 calc(var(--cqw) * 3)/1.2 var(--font-sans);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--rose-deep);
}

/* Leaving the envelope behind */
.is-env-away .env-part {
  transform: translateY(70%) scale(.92);
  opacity: 0;
  transition: transform 1s var(--ease-soft), opacity .4s ease;
}
.is-env-away .env-ground { opacity: 0; transform: scale(.6); }

/* Scroll cue (visible after opening) */
.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  padding: 6px 16px;
  border: 0;
  background: none;
  color: var(--rose-deep);
  font: 600 .7rem/1 var(--font-sans);
  letter-spacing: .24em;
  text-transform: uppercase;
  cursor: pointer;
  animation: cue-in 1s var(--ease-out) both;
}
.scroll-cue svg { width: 22px; height: 22px; animation: cue-bob 2.2s ease-in-out infinite; }
@keyframes cue-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes cue-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* =====================================================================
   Invitation content
   ===================================================================== */
.invitation {
  position: relative;
  z-index: 1;
  outline: none;
}
.js:not(.is-open) .invitation { display: none; }

.section {
  position: relative;
  padding: clamp(56px, 10vw, 112px) 16px;
}
.hero { padding-top: clamp(40px, 8vw, 96px); }

.paper-card {
  position: relative;
  margin: 0 auto;
  background-color: var(--ivory);
  background-image: var(--noise),
    radial-gradient(100% 60% at 50% 0%, rgba(255, 255, 255, .8), transparent 70%),
    linear-gradient(170deg, #fffdf9, var(--ivory) 50%, color-mix(in srgb, var(--ivory) 90%, var(--blush-deep)));
  border-radius: 4px;
  box-shadow:
    0 1px 1px rgba(110, 50, 60, .1),
    0 22px 50px -24px rgba(110, 50, 60, .38),
    0 50px 90px -50px rgba(110, 50, 60, .35);
}
.paper-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px solid color-mix(in srgb, var(--rose-gold) 60%, transparent);
  box-shadow: inset 0 0 0 4px var(--ivory), inset 0 0 0 5px color-mix(in srgb, var(--rose-gold) 30%, transparent);
}

.spray {
  position: absolute;
  width: clamp(150px, 34vw, 280px);
  aspect-ratio: 320 / 240;
  height: auto;
  pointer-events: none;
  overflow: visible;
}
.spray--tl { left: clamp(-34px, -3vw, -14px); top: clamp(-30px, -3vw, -12px); }
.spray--br { right: clamp(-34px, -3vw, -14px); bottom: clamp(-30px, -3vw, -12px); transform: rotate(180deg); }

/* Hero */
.hero-card {
  max-width: 760px;
  padding: clamp(96px, 16vw, 132px) clamp(24px, 7vw, 80px) clamp(84px, 14vw, 120px);
  text-align: center;
}
.hero__headline {
  position: relative;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.35rem, 4.2vw, 1.85rem);
  color: var(--rose-deep);
}
.hero__names {
  position: relative;
  margin: clamp(10px, 2vw, 18px) 0 clamp(14px, 3vw, 24px);
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.6rem, 9.5vw, 5rem);
  line-height: 1.08;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.hero__names .name, .hero__names .amp { display: block; }
.hero__names .amp { font-size: .7em; line-height: 1.2; }
.divider { width: min(240px, 66%); height: auto; aspect-ratio: 10 / 1; margin: 0 auto; overflow: visible; }
.hero__lead {
  position: relative;
  max-width: 34ch;
  margin: clamp(18px, 3vw, 26px) auto 0;
  font-size: clamp(1.18rem, 3.4vw, 1.42rem);
  line-height: 1.6;
  color: var(--ink-soft);
}
.hero__date {
  position: relative;
  display: inline-block;
  margin-top: clamp(22px, 4vw, 32px);
  padding: 12px 22px;
  border-top: 1px solid color-mix(in srgb, var(--rose-gold) 55%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--rose-gold) 55%, transparent);
  font: 600 clamp(.82rem, 2.4vw, .95rem)/1.4 var(--font-sans);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--rose-deep);
  overflow-wrap: anywhere;
}

/* Countdown */
.countdown { position: relative; margin-top: clamp(30px, 5vw, 44px); }
.countdown__label {
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.countdown__units {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 2.6vw, 18px);
}
.cd-unit {
  display: grid;
  place-items: center;
  align-content: center;
  width: clamp(64px, 18vw, 92px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--rose-gold) 60%, transparent);
  box-shadow: inset 0 0 0 4px var(--ivory), inset 0 0 0 5px color-mix(in srgb, var(--rose-gold) 28%, transparent);
  background: radial-gradient(circle at 50% 30%, #fff, color-mix(in srgb, var(--blush) 60%, var(--ivory)));
}
.cd-num {
  font-size: clamp(1.55rem, 5.4vw, 2.2rem);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--ink);
}
.cd-name {
  margin-top: 4px;
  font: 600 clamp(.52rem, 1.6vw, .62rem)/1 var(--font-sans);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--rose-gold-deep);
}
.countdown__today {
  font-family: var(--font-script);
  font-size: clamp(2rem, 6vw, 2.8rem);
  color: var(--rose-deep);
}

/* Section headings */
.section-head { text-align: center; margin-bottom: clamp(28px, 5vw, 48px); position: relative; }
.eyebrow {
  font: 600 .74rem/1 var(--font-sans);
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--rose-gold-deep);
}
.section-title {
  margin: 10px 0 14px;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.6rem, 8vw, 3.8rem);
  line-height: 1.1;
  color: var(--ink);
}

/* Detail cards */
.details-grid {
  display: grid;
  gap: 14px;
  max-width: 1000px;
  margin: 0 auto;
}
@media (min-width: 760px) {
  .details-grid { grid-template-columns: repeat(3, 1fr); gap: 22px; }
}
.detail {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  padding: 26px 20px 28px;
  text-align: center;
  border-radius: 4px;
  background-color: color-mix(in srgb, var(--ivory) 88%, transparent);
  background-image: var(--noise);
  border: 1px solid color-mix(in srgb, var(--rose-gold) 28%, transparent);
  box-shadow: 0 16px 36px -26px rgba(110, 50, 60, .5);
}
.detail::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid color-mix(in srgb, var(--rose-gold) 22%, transparent);
  pointer-events: none;
}
.detail__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 6px;
  border-radius: 50%;
  color: var(--rose-gold-deep);
  background: radial-gradient(circle at 50% 35%, #fff, color-mix(in srgb, var(--blush) 70%, var(--ivory)));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rose-gold) 55%, transparent), 0 0 0 4px color-mix(in srgb, var(--ivory) 70%, transparent), 0 0 0 5px color-mix(in srgb, var(--rose-gold) 25%, transparent);
}
.detail__icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.detail__label {
  font: 600 .74rem/1.3 var(--font-sans);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--rose-gold-deep);
}
.detail__value {
  font-size: clamp(1.3rem, 3.6vw, 1.5rem);
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.text-link {
  margin-top: 4px;
  font: 600 .74rem/1 var(--font-sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--rose-deep);
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
}

/* Venue */
.venue {
  max-width: 1000px;
  margin: clamp(14px, 2.6vw, 22px) auto;
  padding: clamp(44px, 7vw, 64px) clamp(24px, 6vw, 64px);
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
  overflow: hidden;
}
.spray--venue-l { width: clamp(130px, 24vw, 220px); left: -30px; top: -20px; opacity: .9; }
.spray--venue-r { width: clamp(130px, 24vw, 220px); right: -30px; bottom: -20px; transform: rotate(180deg); opacity: .9; }
.venue__name {
  position: relative;
  font-family: var(--font-script);
  font-size: clamp(2.1rem, 6.4vw, 3rem);
  line-height: 1.15;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.venue__address {
  position: relative;
  max-width: 40ch;
  font-style: normal;
  font-size: clamp(1.15rem, 3.2vw, 1.3rem);
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
.venue__actions { position: relative; margin-top: 14px; }

.config-note {
  position: relative;
  max-width: 46ch;
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--ink);
  background: color-mix(in srgb, var(--blush) 70%, white);
  border: 1px dashed color-mix(in srgb, var(--rose-gold) 70%, transparent);
}
.config-note__dev { display: block; margin-top: 4px; font-size: .92rem; color: var(--ink-soft); }

/* Contact */
.contact-phone { font-variant-numeric: lining-nums; }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 30px;
  border: 0;
  border-radius: 999px;
  font: 600 .78rem/1 var(--font-sans);
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform .25s var(--ease-out), box-shadow .25s ease, background-color .25s ease, color .25s ease;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.btn--primary {
  color: #fff;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, .28) 48%, rgba(255, 255, 255, 0) 62%) 0 0 / 250% 100% no-repeat,
    linear-gradient(135deg, var(--rose-gold-deep), color-mix(in srgb, var(--rose-deep) 70%, var(--rose-gold)) 55%, var(--rose-gold-deep));
  box-shadow: 0 10px 24px -10px rgba(110, 50, 60, .55), inset 0 1px 0 rgba(255, 255, 255, .3);
  text-shadow: 0 1px 1px rgba(70, 25, 30, .3);
}
@media (hover: hover) {
  .btn--primary:hover { transform: translateY(-2px); box-shadow: 0 16px 30px -12px rgba(110, 50, 60, .6), inset 0 1px 0 rgba(255, 255, 255, .3); background-position: 100% 0, 0 0; transition: transform .25s var(--ease-out), box-shadow .25s ease, background-position 1s ease; }
  .btn--ghost:hover { background: color-mix(in srgb, var(--blush) 70%, white); }
}
.btn--primary:active { transform: translateY(0) scale(.98); }
.btn--ghost {
  color: var(--rose-deep);
  background: rgba(255, 255, 255, .5);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rose-gold) 70%, transparent);
}
.btn--small { min-height: 44px; padding: 0 20px; font-size: .7rem; }

/* =====================================================================
   RSVP
   ===================================================================== */
.rsvp-card {
  max-width: 820px;
  padding: clamp(56px, 9vw, 84px) clamp(22px, 6vw, 64px) clamp(44px, 7vw, 64px);
  overflow: hidden;
}
.spray--rsvp { width: clamp(150px, 30vw, 250px); right: -36px; top: -26px; transform: scaleX(-1); }
.rsvp__deadline { font-size: 1.15rem; color: var(--ink-soft); }
.rsvp__deadline strong { font-weight: 600; color: var(--ink); }

.rsvp-form { position: relative; display: grid; gap: 22px; }

.choice-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.field-label {
  display: block;
  margin-bottom: 10px;
  padding: 0;
  font: 600 .74rem/1.4 var(--font-sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.req { color: var(--rose-deep); }
.optional {
  margin-left: 6px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: none;
  font-style: italic;
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--ink-soft);
}

.choices { display: grid; gap: 12px; }
@media (min-width: 680px) { .choices { grid-template-columns: repeat(3, 1fr); } }

.choice { position: relative; display: block; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.choice input {
  position: absolute;
  opacity: 0;
  width: 1px; height: 1px;
  margin: 0;
}
.choice__card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  height: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .6);
  border: 1.5px solid color-mix(in srgb, var(--rose-gold) 32%, transparent);
  transition: border-color .25s ease, background .3s ease, box-shadow .3s ease, transform .25s var(--ease-out);
}
@media (min-width: 680px) {
  .choice__card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 10px;
    padding: 24px 14px 22px;
  }
  .choice__check { position: absolute; top: 12px; right: 12px; }
}
@media (hover: hover) {
  .choice:hover .choice__card { border-color: color-mix(in srgb, var(--rose-gold) 70%, transparent); transform: translateY(-2px); }
}
.choice__icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  color: var(--rose-gold-deep);
  background: color-mix(in srgb, var(--blush) 70%, white);
  transition: background .3s ease, color .3s ease;
}
.choice__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.choice__text { display: grid; gap: 2px; }
.choice__title { font-size: 1.28rem; font-weight: 600; line-height: 1.2; color: var(--ink); }
.choice__sub { font-style: italic; font-size: 1.05rem; color: var(--ink-soft); }
.choice__check {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--rose-gold) 55%, transparent);
  background: #fff;
  transition: background .25s ease, border-color .25s ease, transform .3s var(--ease-out);
}
.choice__check::after {
  content: "";
  display: block;
  width: 7px; height: 12px;
  margin: 3px auto 0;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform .3s var(--ease-out);
}
.choice input:checked + .choice__card {
  border-color: var(--rose-deep);
  background: linear-gradient(145deg, #fff, color-mix(in srgb, var(--blush) 80%, white));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--rose) 30%, transparent), 0 14px 28px -16px rgba(110, 50, 60, .55);
}
.choice input:checked + .choice__card .choice__icon { color: #fff; background: linear-gradient(135deg, var(--rose-gold), var(--rose-deep)); }
.choice input:checked + .choice__card .choice__check { background: var(--rose-deep); border-color: var(--rose-deep); }
.choice input:checked + .choice__card .choice__check::after { transform: rotate(45deg) scale(1); }
.choice input:focus-visible + .choice__card { outline: 2px solid var(--rose-deep); outline-offset: 3px; }
.choice-group[aria-invalid="true"] .choice__card { border-color: color-mix(in srgb, var(--error) 55%, transparent); }

.field { display: grid; min-width: 0; }
.input {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--rose-gold) 50%, transparent);
  background: rgba(255, 255, 255, .72);
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder { color: color-mix(in srgb, var(--ink-soft) 70%, transparent); font-style: italic; }
.input:focus { outline: none; border-color: var(--rose-deep); background: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--rose) 28%, transparent); }
.input[aria-invalid="true"] { border-color: var(--error); box-shadow: 0 0 0 3px color-mix(in srgb, var(--error) 14%, transparent); }
textarea.input { resize: vertical; min-height: 120px; }

.field-hint { margin-top: 6px; font-size: 1rem; font-style: italic; color: var(--ink-soft); }
.field-hint--right { text-align: right; font-style: normal; font-family: var(--font-sans); font-size: .72rem; letter-spacing: .08em; }
.field-error {
  font-size: 1.02rem;
  line-height: 1.4;
  color: var(--error);
}
.field-error:not(:empty) { margin-top: 8px; }
.field-error:not(:empty)::before { content: "♡ "; }

/* Attending-only fields slide open */
.attending-only {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin-top: -22px;
  transition: grid-template-rows .5s var(--ease-out), opacity .4s ease, margin-top .5s var(--ease-out);
}
.attending-only.is-shown { grid-template-rows: 1fr; opacity: 1; margin-top: 0; }
.attending-only__inner { overflow: hidden; display: grid; gap: 22px; min-height: 0; padding: 2px; margin: -2px; }

.stepper { display: flex; align-items: stretch; gap: 8px; max-width: 220px; }
.stepper__btn {
  flex: 0 0 52px;
  min-height: 52px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--rose-gold) 50%, transparent);
  background: color-mix(in srgb, var(--blush) 60%, white);
  color: var(--rose-deep);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: background .2s ease;
}
.stepper__btn:disabled { opacity: .4; cursor: default; }
@media (hover: hover) { .stepper__btn:not(:disabled):hover { background: color-mix(in srgb, var(--blush-deep) 70%, white); } }
.stepper__input { text-align: center; font-weight: 600; -moz-appearance: textfield; }
.stepper__input::-webkit-outer-spin-button,
.stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.demo-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--blush) 65%, white);
  border: 1px dashed color-mix(in srgb, var(--rose-gold) 80%, transparent);
  font-size: 1.02rem;
  line-height: 1.5;
}
.demo-note__badge {
  flex: none;
  margin-top: 2px;
  padding: 5px 9px;
  border-radius: 999px;
  font: 600 .62rem/1 var(--font-sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #fff;
  background: var(--rose-gold-deep);
}

.form-actions { display: grid; justify-items: center; gap: 12px; margin-top: 4px; }
.btn--send { min-width: min(100%, 260px); min-height: 56px; font-size: .82rem; }
.btn__spinner {
  display: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  animation: spin .8s linear infinite;
}
.btn--send.is-busy { pointer-events: none; opacity: .92; }
.btn--send.is-busy .btn__spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-status { max-width: 46ch; text-align: center; font-size: 1.05rem; color: var(--error); }
.form-status:empty { display: none; }

/* Confirmation */
.rsvp-done {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 10px 0 6px;
  text-align: center;
  outline: none;
  animation: rise-in .9s var(--ease-out) both;
}
.rsvp-done__seal {
  display: grid;
  place-items: center;
  width: 76px; height: 76px;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 244, 238, .8), transparent 38%),
    conic-gradient(from 200deg, #b8737a, #e7b7a7, #c28376, #f2cdbd, #a8636b, #d79f92, #b8737a);
  box-shadow: 0 8px 18px -6px rgba(90, 30, 40, .45), inset 0 -3px 6px rgba(90, 30, 40, .3);
}
.rsvp-done__seal svg { width: 32px; height: 32px; fill: rgba(255, 255, 255, .92); stroke: none; }
.rsvp-done__badge {
  padding: 6px 12px;
  border-radius: 999px;
  font: 600 .66rem/1 var(--font-sans);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #fff;
  background: var(--rose-gold-deep);
}
.rsvp-done__title {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.3rem, 7vw, 3.2rem);
  line-height: 1.15;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.rsvp-done__text { max-width: 40ch; font-size: 1.25rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.rsvp-done__status {
  max-width: 46ch;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 1.02rem;
  line-height: 1.5;
  background: color-mix(in srgb, var(--blush) 60%, white);
}
.rsvp-done__status.is-demo { border: 1px dashed color-mix(in srgb, var(--rose-gold) 80%, transparent); }
.rsvp-done .btn { margin-top: 8px; }

/* =====================================================================
   Closing
   ===================================================================== */
.closing { padding-bottom: max(clamp(80px, 12vw, 140px), env(safe-area-inset-bottom)); }
.closing__inner {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  display: grid;
  justify-items: center;
  text-align: center;
}
.closing__florals {
  display: flex;
  justify-content: center;
  width: min(100%, 520px);
  margin-bottom: 18px;
}
.spray--closing { position: relative; flex: 0 1 50%; width: 50%; margin: 0 -6%; }
.spray--mirror { transform: scaleX(-1); }
.closing__line {
  max-width: 26ch;
  font-style: italic;
  font-size: clamp(1.5rem, 4.6vw, 2.1rem);
  line-height: 1.4;
  color: var(--ink);
}
.closing__names {
  margin-top: clamp(18px, 3vw, 28px);
  font-family: var(--font-script);
  font-size: clamp(2.3rem, 8vw, 3.8rem);
  line-height: 1.15;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.closing__names .amp { margin: 0 .1em; }
.monogram--closing { width: 110px; margin-top: 26px; }
.monogram--closing .monogram__letters { font-size: 1.4rem; }

/* =====================================================================
   Background music button
   ===================================================================== */
.music-btn {
  position: fixed;
  z-index: 50;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--rose-gold-deep);
  background: rgba(255, 250, 244, .9);
  box-shadow:
    inset 0 0 0 1px rgba(192, 138, 123, .55),
    inset 0 0 0 4px rgba(255, 250, 244, .9),
    inset 0 0 0 5px rgba(192, 138, 123, .22),
    0 8px 22px -8px rgba(110, 50, 60, .45);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  animation: fade-in .6s ease both;
  transition: opacity .25s ease, transform .25s var(--ease-out), padding .3s var(--ease-out), background .25s ease;
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .music-btn { background: rgba(255, 250, 244, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
}
@media (hover: hover) { .music-btn:hover { transform: translateY(-2px); } }
.music-btn:active { transform: scale(.95); }
.music-btn__icon { position: relative; display: grid; place-items: center; width: 22px; height: 22px; }
.music-btn__note { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.music-btn__bars { display: none; align-items: flex-end; gap: 2px; height: 16px; }
.music-btn__bars i { display: block; width: 3px; height: 100%; border-radius: 2px; background: currentColor; transform-origin: bottom; animation: eq 1.1s ease-in-out infinite; }
.music-btn__bars i:nth-child(2) { animation-delay: -.45s; animation-duration: .9s; }
.music-btn__bars i:nth-child(3) { animation-delay: -.2s; animation-duration: 1.3s; }
.music-btn__bars i:nth-child(4) { animation-delay: -.7s; animation-duration: 1s; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

.music-btn[data-state="playing"] .music-btn__note { display: none; }
.music-btn[data-state="playing"] .music-btn__bars { display: flex; }
/* "Music off": note with a soft strike */
.music-btn[data-state="paused"] .music-btn__icon::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 1.6px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(-45deg);
  box-shadow: 0 0 0 1.5px rgba(255, 250, 244, .9);
}
.music-btn[data-state="loading"] .music-btn__icon { animation: music-pulse 1.2s ease-in-out infinite; }
@keyframes music-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.music-btn__text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* Blocked or failed: a clear, labelled "Play music" pill */
.music-btn.is-expanded {
  padding: 0 20px 0 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--rose-gold-deep), var(--rose-deep));
  box-shadow: 0 10px 24px -10px rgba(110, 50, 60, .6), inset 0 1px 0 rgba(255, 255, 255, .3);
  animation: fade-in .4s ease both, pill-glow 2.6s ease-in-out 1s infinite;
}
.music-btn.is-expanded .music-btn__text {
  position: static;
  width: auto; height: auto;
  clip: auto;
  font: 600 .74rem/1 var(--font-sans);
  letter-spacing: .16em;
  text-transform: uppercase;
}
@keyframes pill-glow {
  0%, 100% { box-shadow: 0 10px 24px -10px rgba(110, 50, 60, .6), 0 0 0 0 rgba(165, 96, 107, .35); }
  50% { box-shadow: 0 10px 24px -10px rgba(110, 50, 60, .6), 0 0 0 8px rgba(165, 96, 107, 0); }
}
@media (max-width: 759px) {
  .is-typing .music-btn:not(.is-expanded) { opacity: 0; pointer-events: none; }
}

/* =====================================================================
   Scroll reveals
   ===================================================================== */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s ease var(--reveal-delay, 0s), transform 1.2s var(--ease-out) var(--reveal-delay, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* =====================================================================
   Small screens
   ===================================================================== */
@media (max-width: 759px) {
  .details-grid .detail {
    grid-template-columns: auto 1fr;
    justify-items: start;
    text-align: left;
    column-gap: 16px;
    row-gap: 2px;
    padding: 20px 20px 20px 18px;
  }
  .details-grid .detail .detail__icon { grid-row: span 3; margin: 0; align-self: center; }
  .details-grid .detail .contact-actions { justify-content: flex-start; }
  .details-grid .detail .text-link { padding-left: 0; }
}
@media (max-width: 380px) {
  .hero-card { padding-left: 20px; padding-right: 20px; }
  .countdown__units { gap: 6px; }
}

/* Landscape phones: keep the envelope comfortably in view */
@media (max-height: 520px) and (orientation: landscape) {
  .opening__inner { gap: 10px; }
  .opening__names { font-size: 1.6rem; }
  .scene { --env-w: clamp(230px, calc((100vh - 170px) * 1.45), 420px); }
}

/* =====================================================================
   Reduced motion: no flight, no petals, a simple cross-fade to open
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  .is-ready .flight { animation: fade-in .6s ease both; }
  .is-ready .env-ground { animation: fade-in .6s ease both; }
  .is-ready .opening__names, .is-ready .opening__prompt { animation: fade-in .6s ease both; }
  .float, .seal::after, .tap-dot::after, .scroll-cue, .scroll-cue svg { animation: none !important; }
  .opening *:not(.scene) { transition-duration: 0s !important; }
  .is-seal-off .seal { animation: none; opacity: 0; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .choice__card, .attending-only { transition: none; }
  .petals { display: none; }
  .music-btn, .music-btn.is-expanded, .music-btn__bars i, .music-btn[data-state="loading"] .music-btn__icon { animation: none; }
  .music-btn__bars i:nth-child(odd) { transform: scaleY(.6); }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
