/* ══════════════════════════════════════════════════════════
   F & B · 21.01.2027
   Ivory damask, a champagne ribbon, a gold seal; a living
   portrait; an envelope that carries you to the card.
   ══════════════════════════════════════════════════════════ */

@property --px { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --py { syntax: '<number>'; inherits: true; initial-value: 0; }

:root {
  --ivory: #f5f0e6;
  --paper: #fbf8f1;
  --ink: #2a2622;
  --ink-soft: #564e45;
  --muted: #6b6258;
  --line: rgba(42, 38, 34, 0.14);
  --burgundy: #8a6c39;
  --olive: #7d6334;
  --olive-deep: #66502a;
  --charcoal: #2b2926;
  --champagne: #d9c39a;
  --velvet: #4a3d31;

  --serif: "Cormorant Garamond", "Cormorant", Garamond, Georgia, serif;
  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --script: "Pinyon Script", "Snell Roundhand", cursive;
  --ui: "Jost", "Avenir Next", "Helvetica Neue", Arial, sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; accent-color: var(--olive); }
body {
  margin: 0; min-height: 100vh; overflow: hidden;
  background: var(--ivory); color: var(--ink);
  font: 400 1.0625rem/1.6 var(--serif);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--champagne); color: var(--ink); }
input, textarea { caret-color: var(--olive); }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Seals ─────────────────────────────────── */
.seal {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 0; border: 0;
  border-radius: 48% 52% 50% 50% / 52% 47% 53% 48%;
}
.seal::before { content: ""; position: absolute; inset: 14%; border-radius: 50%; }
.seal span { position: relative; font: 500 1.4rem/1 var(--display); letter-spacing: 0.02em; }
.seal span i { font: 400 1.05em/1 var(--script); padding: 0 0.05em; }
.seal--gold {
  background: radial-gradient(circle at 34% 28%, #fff3cc 0%, #e8c77f 20%, #bf9244 52%, #8d6627 80%, #6a4a1b 100%);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45), inset 0 2px 3px rgba(255, 246, 214, 0.75), inset 0 -6px 10px rgba(80, 52, 12, 0.5);
}
.seal--gold::before { box-shadow: inset 0 2px 5px rgba(95, 64, 18, 0.6), 0 1px 0 rgba(255, 240, 200, 0.5); }
.seal--gold span { color: #7b5a22; text-shadow: 0 1px 0 rgba(255, 238, 190, 0.8), 0 -1px 0 rgba(80, 52, 12, 0.5); }
.seal--red {
  background: radial-gradient(circle at 34% 28%, #c8454e 0%, #9f2330 34%, #7a1622 68%, #5a0e17 100%);
  box-shadow: 0 6px 14px rgba(60, 10, 14, 0.4), inset 0 2px 3px rgba(255, 190, 190, 0.35), inset 0 -5px 9px rgba(40, 0, 6, 0.5);
}
.seal--red::before { box-shadow: inset 0 2px 5px rgba(50, 0, 6, 0.55), 0 1px 0 rgba(255, 190, 190, 0.2); }
.seal--red span { color: #64101a; text-shadow: 0 1px 0 rgba(255, 170, 170, 0.35), 0 -1px 0 rgba(30, 0, 4, 0.5); }

/* ── Buttons & links ───────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px;
  padding: 0 22px; border-radius: 999px; border: 1px solid var(--ink); background: transparent; cursor: pointer;
  font: 500 0.86rem/1 var(--ui); letter-spacing: 0.02em; color: var(--ink);
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.2s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: scale(0.98); }
.btn--olive { background: var(--olive); border-color: var(--olive); color: #fff; }
.btn--olive:hover { background: var(--olive-deep); border-color: var(--olive-deep); color: #fff; }
.btn--wide { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.link { font: 500 0.8rem/1.4 var(--ui); color: var(--olive-deep); text-underline-offset: 0.25em; }
.link:hover { color: var(--ink); }

/* ══════════ Before the invitation ══════════ */
.screen {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse 90% 70% at 50% 40%, var(--paper), var(--ivory) 70%, #ebe3d5);
}
.mark { font: 400 2.6rem/1 var(--display); margin: 0; letter-spacing: 0.02em; }
.mark span { font: 400 1em/1 var(--script); color: var(--burgundy); padding: 0 0.08em; }
.mark--sm { font-size: 1.9rem; margin-bottom: 1.2rem; }
.loader { display: block; width: 120px; height: 1px; margin-top: 22px; background: var(--line); position: relative; overflow: hidden; }
.loader::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--burgundy); animation: load 1.4s var(--ease) infinite; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.screen--loading { align-content: center; justify-items: center; gap: 0; }
.notice {
  width: min(100%, 440px); text-align: center; padding: 44px 32px 38px; background: var(--paper);
  border-radius: 4px; box-shadow: 0 30px 60px -30px rgba(60, 45, 30, 0.35), inset 0 0 0 1px var(--line);
}
.notice h1 { font: 400 1.75rem/1.2 var(--display); margin: 0 0 0.8rem; }
.notice p { margin: 0 0 1rem; color: var(--ink-soft); }
.notice .btn { margin-top: 0.4rem; }

/* ── The cover ─────────────────────────────── */
.cover { position: fixed; inset: 0; z-index: 50; overflow: hidden; background: #4a3d31; }
.cover.is-leaving { background: transparent; pointer-events: none; }
.cover-panel { position: absolute; inset: 0; }
/* Two sliding doors meeting in the middle. The left one carries the ribbon and the seal. */
.door {
  position: absolute; top: 0; bottom: 0; width: 50%;
  background-color: #ece2d0; background-size: auto, auto, 132px 176px;
  transition: transform 1.7s cubic-bezier(0.62, 0, 0.24, 1), box-shadow 0.6s ease;
}
.door--l {
  left: 0; z-index: 2;
  background-image:
    radial-gradient(ellipse 180% 70% at 100% 42%, rgba(255, 251, 242, 0.62), rgba(255, 251, 242, 0) 60%),
    linear-gradient(90deg, rgba(110, 84, 52, 0.22), transparent 44%),
    url("/art/damask.svg");
  background-position: center, center, right 0 center;
  transition-delay: 0.14s;
}
.door--r {
  right: 0; z-index: 1;
  background-image:
    radial-gradient(ellipse 180% 70% at 0% 42%, rgba(255, 251, 242, 0.62), rgba(255, 251, 242, 0) 60%),
    linear-gradient(270deg, rgba(110, 84, 52, 0.22), transparent 44%),
    url("/art/damask.svg");
  background-position: center, center, left 0 center;
}
/* the champagne ribbon rides on the left door's edge, over the join */
.door--l::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: -17px; width: 34px; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, #a88a58 0%, #d9c39a 20%, #f7ecd2 46%, #fff8e8 54%, #dcc79e 76%, #9c7f50 100%);
  box-shadow: 0 0 16px rgba(80, 58, 30, 0.35);
}
.door--l::before {
  content: ""; position: absolute; top: 0; bottom: 0; right: -13px; width: 26px; z-index: 2; pointer-events: none;
  border-left: 1px solid rgba(255, 250, 232, 0.75); border-right: 1px solid rgba(255, 250, 232, 0.75);
}
/* they part: the right door first, then the left with its seal */
.cover.is-leaving .door--l { transform: translateX(calc(-100% - 90px)); box-shadow: 16px 0 34px rgba(30, 20, 10, 0.45); }
.cover.is-leaving .door--r { transform: translateX(calc(100% + 10px)); box-shadow: -16px 0 34px rgba(30, 20, 10, 0.45); }
.cover-for {
  position: absolute; z-index: 3; left: 100%; top: calc(var(--safe-t) + 10svh); width: min(82vw, 330px); margin: 0;
  transform: translateX(-50%); padding: 18px 18px 14px; text-align: center;
  background: linear-gradient(170deg, #fffcf6, #f6efe2); border-radius: 3px;
  box-shadow: 0 16px 30px -14px rgba(80, 58, 30, 0.55), inset 0 0 0 5px #fbf6ec, inset 0 0 0 6px rgba(191, 160, 104, 0.6);
  font: 500 0.64rem/1.6 var(--ui); letter-spacing: 0.3em; padding-left: calc(18px + 0.3em); text-transform: uppercase; color: var(--muted);
}
.cover-name { display: block; margin-top: 0.35rem; font: 400 clamp(2.2rem, 10vw, 3.1rem)/1.15 var(--script); letter-spacing: 0; text-transform: none; color: var(--ink); }
.cover-seal {
  position: absolute; z-index: 3; left: 100%; top: 52%; width: clamp(98px, 27vw, 128px); cursor: pointer;
  transform: translate(-50%, -50%);
  animation: seal-glow 2.8s var(--ease) infinite;
}
.cover-seal span { font-size: clamp(1.5rem, 6vw, 1.9rem); }
.cover-seal:hover { transform: translate(-50%, -50%) scale(1.05) rotate(-3deg); }
@keyframes seal-glow {
  0%, 100% { box-shadow: 0 10px 22px rgba(80, 56, 24, 0.45), 0 0 0 0 rgba(170, 134, 76, 0.5), inset 0 2px 3px rgba(255, 246, 214, 0.75), inset 0 -6px 10px rgba(80, 52, 12, 0.5); }
  60% { box-shadow: 0 10px 22px rgba(80, 56, 24, 0.45), 0 0 0 18px rgba(170, 134, 76, 0), inset 0 2px 3px rgba(255, 246, 214, 0.75), inset 0 -6px 10px rgba(80, 52, 12, 0.5); }
}
.cover.is-pressed .cover-seal { transform: translate(-50%, -50%) scale(0.92); animation: none; }
.cover-hint, .cover-fine {
  position: absolute; z-index: 3; left: 100%; margin: 0; transform: translateX(-50%); text-align: center;
  background: rgba(255, 251, 243, 0.94); color: var(--ink); box-shadow: 0 8px 18px -10px rgba(80, 58, 30, 0.6), 0 0 0 1px rgba(191, 160, 104, 0.5);
}
.cover-hint { top: calc(52% + clamp(70px, 18vw, 88px)); padding: 7px 18px; border-radius: 999px; white-space: nowrap; font: italic 500 1.1rem/1.3 var(--serif); }
.cover-fine { bottom: calc(var(--safe-b) + 5svh); width: min(86vw, 310px); padding: 10px 16px; border-radius: 12px; font: italic 400 0.95rem/1.45 var(--serif); color: var(--ink-soft); }

/* ══════════ The living portrait ══════════ */
.site { position: fixed; inset: 0; }
.scene {
  --vh: 100vh; --vh: 100svh;
  /* Phones: the tall photograph, full width, resting on the bottom of the screen. */
  --W: 100vw; --H: calc(var(--W) * 1.7917);
  position: absolute; inset: 0; overflow: hidden; background: #3b3027; isolation: isolate;
}
/* Laptops, monitors and sideways tablets: the wide photograph fills the whole screen. */
.scene.is-wide { --W: max(calc(100vw + 16px), calc((var(--vh) + 10px) * 1.7917)); --H: calc(var(--W) * 0.5581); }
/* The frame keeps the photograph's shape, so the envelope is always where we expect it. */
.frame {
  position: absolute; left: calc((100vw - var(--W)) / 2); width: var(--W); height: var(--H);
  /* rest on the bottom when it fits; otherwise trim a little more from the top than the foot */
  top: max(calc(var(--vh) - var(--H)), calc((var(--vh) - var(--H)) * 0.55));
  translate: calc(var(--px, 0) * -7px) calc(var(--py, 0) * -4px); transition: --px 0.9s ease-out, --py 0.9s ease-out;
}
.scene.is-wide .frame { top: calc((var(--vh) - var(--H)) / 2); }
.cam { position: absolute; inset: 0; transform-origin: 0 0; opacity: 0; transition: opacity 0.9s var(--ease), filter 0.9s var(--ease); }
.scene.is-ready .cam { opacity: 1; }
.cam.cam-intro { transition: transform 4s cubic-bezier(0.2, 0.64, 0.14, 1), opacity 0.9s var(--ease); }
.cam.cam-travel { transition: transform 1.6s cubic-bezier(0.62, 0, 0.22, 1), filter 0.9s var(--ease) 0.5s; }
.cam.cam-return { transition: transform 1.3s cubic-bezier(0.5, 0, 0.2, 1), filter 0.7s var(--ease); }
.cam.cam-instant { transition: opacity 0.9s var(--ease); }
.hero-photo, .hero-live {
  position: absolute; inset: 0; width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%); mask-image: linear-gradient(to bottom, transparent 0, #000 9%);
}
.scene.is-wide .hero-photo, .scene.is-wide .hero-live { -webkit-mask-image: none; mask-image: none; }
/* Waiting at the envelope: the room falls slightly out of focus, as a lens would, and the envelope stays sharp. */
.hero-photo, .hero-live { transition: filter 0.8s var(--ease); }
.scene.is-await .hero-photo, .scene.is-await .hero-live { filter: blur(var(--dof, 1px)); }
.hero-live { opacity: 0; }
.scene.is-live .hero-live { opacity: 1; }
.scene.is-live .hero-photo { visibility: hidden; }
/* The envelope on the side table: lifted out of the photograph so it can bounce. */
.env-photo {
  position: absolute; left: var(--ex); top: var(--ey); width: var(--ew); height: var(--eh);
  padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.env-photo img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
/* its shadow on the table, which tightens and darkens as it lands */
.env-photo::before {
  content: ""; position: absolute; left: 6%; right: 6%; bottom: 8%; height: 16%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(52, 36, 18, 0.5), rgba(52, 36, 18, 0)); opacity: 0;
}
/* a soft ring at the seal says "tap me" */
.env-photo::after {
  content: ""; position: absolute; left: 50%; top: 56%; width: 18%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  border: 1px solid rgba(255, 236, 190, 0.95); animation: ring 2.4s var(--ease) infinite;
}
.scene.is-travel .env-photo::after { display: none; }
.scene.is-await .env-photo img { animation: env-bounce 1.3s cubic-bezier(0.3, 0.8, 0.4, 1) infinite; }
.scene.is-await .env-photo::before { animation: env-shadow 1.3s cubic-bezier(0.3, 0.8, 0.4, 1) infinite; }
@keyframes env-bounce {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  30% { translate: 0 -30%; rotate: -2deg; }
  50% { translate: 0 0; rotate: 0deg; }
  64% { translate: 0 -12%; rotate: 1deg; }
  78% { translate: 0 0; rotate: 0deg; }
}
@keyframes env-shadow {
  0%, 100% { opacity: 0; scale: 1; }
  30% { opacity: 1; scale: 0.8; }
  50% { opacity: 0; scale: 1; }
  64% { opacity: 0.6; scale: 0.9; }
  78% { opacity: 0; scale: 1; }
}
.env-photo.is-taken { visibility: hidden; }
.env-photo:focus-visible { outline: none; }
.env-photo:focus-visible img { outline: 1px solid #fff3d6; outline-offset: 2px; }

.scene.is-close .cam { filter: blur(9px) brightness(0.9); }

/* A soft dusk at the top so the names can glow, and at the foot for the button. */
.scene-shade {
  position: absolute; inset: 0; pointer-events: none; transition: opacity 0.8s var(--ease);
  background:
    linear-gradient(to bottom, rgba(40, 29, 19, 0.82) 0%, rgba(40, 29, 19, 0.6) 17%, rgba(40, 29, 19, 0) 38%),
    linear-gradient(to top, rgba(40, 29, 19, 0.66), rgba(40, 29, 19, 0) 22%);
}

.names { position: absolute; left: 0; right: 0; top: calc(var(--safe-t) + 3.6svh); text-align: center; pointer-events: none; transition: opacity 0.5s var(--ease); }
.names h1 { margin: 0; font: 400 clamp(3rem, min(15vw, 8.4svh), 5.6rem)/0.86 "Sacramento", var(--script); color: #fff6e2; }
.names h1 > span { display: block; padding: 0 0.12em; }
.names h1 .neon-amp { font-size: 0.56em; line-height: 0.95; }
.neon { text-shadow: 0 0 2px #fff7e6, 0 0 9px rgba(255, 228, 176, 0.95), 0 0 22px rgba(242, 200, 128, 0.85), 0 0 46px rgba(214, 164, 92, 0.65), 0 2px 5px rgba(50, 32, 12, 0.55); animation: hum 5.5s ease-in-out infinite; }
@keyframes hum { 0%, 100% { filter: brightness(1); } 47% { filter: brightness(1.07); } 50% { filter: brightness(0.9); } 53% { filter: brightness(1.05); } }
.names-date { margin: 1.1rem 0 0; font: 500 0.72rem/1 var(--ui); letter-spacing: 0.46em; padding-left: 0.46em; color: #f4e3bd; text-shadow: 0 1px 6px rgba(40, 24, 8, 0.85); }

.view-btn {
  position: absolute; left: 50%; bottom: calc(var(--safe-b) + 3svh); transform: translateX(-50%);
  display: grid; justify-items: center; gap: 10px; padding: 0; border: 0; background: none; cursor: pointer; transition: opacity 0.4s var(--ease);
}
.view-ico {
  position: relative; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%;
  background: linear-gradient(150deg, #fff6e0, #dfc795 70%, #c5a66d); color: #3d2f1c; box-shadow: 0 10px 24px -8px rgba(30, 20, 8, 0.75);
  transition: transform 0.3s var(--ease);
}
.view-ico::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 1px solid rgba(247, 231, 198, 0.9); animation: ring 2.6s var(--ease) infinite; }
@keyframes ring { 0% { transform: scale(0.9); opacity: 0.95; } 100% { transform: scale(1.4); opacity: 0; } }
.view-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; }
.view-btn:hover .view-ico { transform: translateY(-2px); }
.view-btn:focus-visible { outline: none; }
.view-btn:focus-visible .view-ico { outline: 2px solid #fff3d6; outline-offset: 5px; }
.view-label { font: 500 0.88rem/1 var(--ui); letter-spacing: 0.04em; color: #fff6e4; text-shadow: 0 1px 8px rgba(30, 18, 6, 0.95); }

/* The names write themselves in, like a sign being lit. */
.names h1 > span, .names-date, .view-btn { opacity: 1; }
.scene.is-intro .names h1 > span { animation: light-up 1.5s var(--ease) both, hum 5.5s ease-in-out 3.6s infinite; }
.scene.is-intro .names h1 > span:nth-child(1) { animation-delay: 0.7s, 3.6s; }
.scene.is-intro .names h1 > span:nth-child(2) { animation-delay: 1.4s, 3.8s; }
.scene.is-intro .names h1 > span:nth-child(3) { animation-delay: 1.8s, 4s; }
@keyframes light-up { from { clip-path: inset(-40% 100% -40% -10%); opacity: 0.2; } to { clip-path: inset(-40% -10% -40% -10%); opacity: 1; } }
.scene.is-intro .names-date { animation: arrive 1.1s var(--ease) 2.7s both; }
.scene.is-intro .view-btn { animation: arrive-btn 1.1s var(--ease) 3s both; }
.scene:not(.is-ready) .names, .scene:not(.is-ready) .view-btn { opacity: 0; }
@keyframes arrive { from { opacity: 0; translate: 0 14px; } }
@keyframes arrive-btn { from { opacity: 0; transform: translate(-50%, 14px); } }
.scene.is-travel .names, .scene.is-travel .view-btn, .scene.is-close .names, .scene.is-close .view-btn { opacity: 0; pointer-events: none; }
.scene.is-travel .scene-shade, .scene.is-close .scene-shade { opacity: 0.35; }
.scene.is-await .scene-shade { opacity: 0; }

/* Waiting at the envelope: a hint, and a way back. */
.scene-back {
  position: absolute; z-index: 3; top: calc(var(--safe-t) + 14px); left: 50%; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 500 0.66rem/1 var(--ui); letter-spacing: 0.14em; text-transform: uppercase; color: #fff8ea; text-shadow: 0 1px 8px rgba(30, 18, 6, 0.9);
  opacity: 0; pointer-events: none; transition: opacity 0.4s var(--ease);
}
.scene-back svg {
  width: 40px; height: 40px; padding: 10px; border-radius: 50%; fill: none; stroke: var(--ink); stroke-width: 1.4;
  background: rgba(251, 248, 241, 0.85); box-shadow: 0 4px 12px -4px rgba(40, 30, 20, 0.45);
}
.scene-back:focus-visible { outline: none; }
.scene-back:focus-visible svg { outline: 2px solid #fff3d6; outline-offset: 3px; }
.env-hint {
  position: absolute; z-index: 3; left: 50%; bottom: calc(var(--safe-b) + 6svh); transform: translateX(-50%); margin: 0; padding: 9px 20px; border-radius: 999px;
  background: rgba(255, 251, 243, 0.95); color: var(--ink); font: italic 500 1.05rem/1.3 var(--serif); white-space: nowrap; box-shadow: 0 10px 22px -12px rgba(40, 26, 12, 0.7);
  opacity: 0; pointer-events: none; transition: opacity 0.4s var(--ease);
}
.scene.is-await .scene-back { opacity: 1; pointer-events: auto; }
.scene.is-await .env-hint { opacity: 1; transition-delay: 0.3s; }

/* ══════════ The close-up ══════════ */
.closeup {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: transparent; color: var(--ink); overflow: hidden;
}
.closeup::backdrop { background: transparent; }
.closeup[open] { animation: fade-in 0.5s var(--ease) both; }
.closeup.is-leaving { animation: fade-out 0.4s var(--ease) both; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }

.close-invite {
  position: absolute; z-index: 4; top: calc(var(--safe-t) + 14px); left: 50%; transform: translateX(-50%);
  display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer;
  font: 500 0.66rem/1 var(--ui); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink);
  text-shadow: 0 0 8px rgba(255, 252, 245, 0.9);
}
.close-invite svg {
  width: 40px; height: 40px; padding: 10px; border-radius: 50%; fill: none; stroke: currentColor; stroke-width: 1.4;
  background: rgba(251, 248, 241, 0.75); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px -4px rgba(40, 30, 20, 0.35);
}
.close-invite:focus-visible { outline: none; }
.close-invite:focus-visible svg { outline: 2px solid var(--olive); outline-offset: 3px; }
.hold-hint {
  position: absolute; z-index: 4; top: calc(var(--safe-t) + 78px); left: 50%; width: max-content; max-width: calc(100% - 28px); margin: 0; transform: translateX(-50%);
  padding: 5px 14px; border-radius: 999px; background: rgba(255, 251, 243, 0.94); text-align: center;
  font: italic 500 0.95rem/1.3 var(--serif); color: var(--ink); opacity: 0; pointer-events: none;
}
.closeup.is-card .hold-hint { animation: hint 6s var(--ease) 1.4s both; }
@keyframes hint { 0% { opacity: 0; } 12%, 80% { opacity: 1; } 100% { opacity: 0; } }

.cu-stage {
  position: absolute; left: 0; right: 0; top: calc(var(--safe-t) + 106px); bottom: calc(var(--safe-b) + 150px);
  display: grid; justify-items: center; align-content: center; align-content: safe center;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 10px;
}
.cu-stage > * { grid-area: 1 / 1; }

/* The photograph's own envelope, carried from the side table to the centre. */
.env-face {
  position: fixed; z-index: 3; margin: 0; transform-origin: 50% 50%; pointer-events: none;
  transition: transform 0.9s cubic-bezier(0.5, 0, 0.2, 1), opacity 0.38s var(--ease);
  filter: drop-shadow(0 18px 22px rgba(40, 26, 12, 0.4));
  opacity: 0;
}
.closeup.is-env .env-face { opacity: 1; }
.closeup.is-swap .env-face { opacity: 0; }

/* The envelope that opens */
.envelope {
  position: relative; width: min(80vw, 360px); aspect-ratio: 1.42; align-self: center; opacity: 0;
  transition: opacity 0.38s var(--ease);
  filter: drop-shadow(0 22px 26px rgba(40, 26, 12, 0.45)) drop-shadow(0 3px 5px rgba(40, 26, 12, 0.25));
}
.closeup.is-swap .envelope { opacity: 1; }
.closeup.is-card .envelope { opacity: 0; transform: translateY(14%) scale(0.94); transition: opacity 0.6s var(--ease), transform 0.8s var(--ease); }
.env-back, .env-card, .env-pocket, .env-flap { position: absolute; }
.env-back { inset: 0; border-radius: 3px; background: #c9b084; box-shadow: inset 0 0 0 6px #c9b084, inset 0 0 0 7px rgba(255, 244, 214, 0.65); }
.env-card { left: 6%; right: 6%; top: 7%; height: 86%; z-index: 2; border-radius: 2px; background: var(--paper); box-shadow: 0 -2px 8px rgba(50, 38, 26, 0.18); display: grid; justify-items: center; padding-top: 10%; transition: transform 1.2s var(--ease) 0.7s; }
.env-card-names { display: grid; justify-items: center; font: 400 clamp(1.5rem, 7vw, 2rem)/0.9 "Sacramento", var(--script); color: var(--ink); }
.env-card-names i { font: 400 0.7em/1 var(--script); color: #9a7b46; }
.env-pocket { inset: 0; width: 100%; height: 100%; z-index: 3; }
.env-pocket polygon { stroke: rgba(120, 94, 56, 0.2); stroke-width: 0.35; vector-effect: non-scaling-stroke; }
.pk-l { fill: #f3ead9; } .pk-r { fill: #efe5d2; } .pk-b { fill: #f9f2e5; }
.env-flap { left: 0; right: 0; top: 0; height: 56%; z-index: 4; transform-origin: 50% 0; transform-style: preserve-3d; transition: transform 0.9s var(--ease) 0.3s, z-index 0s linear 0.75s; }
.flap-front, .flap-back { position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 50% 100%); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flap-front { background: linear-gradient(180deg, #efe5d2, #f7f0e2 75%, #f1e7d4); }
.flap-back { transform: rotateX(180deg); background: #c9b084; }
.env-seal { position: absolute; left: 50%; top: 56%; z-index: 6; width: 20%; transform: translate(-50%, -50%); transition: transform 0.6s var(--ease), opacity 0.5s var(--ease); }
.env-seal span { font-size: clamp(0.75rem, 3.4vw, 1rem); }
.envelope.is-open .env-seal { transform: translate(-50%, -30%) scale(0.6) rotate(-24deg); opacity: 0; }
.envelope.is-open .env-flap { transform: rotateX(180deg); z-index: 1; }
.envelope.is-open .env-card { transform: translateY(-56%); }

/* The card */
.card-wrap { width: min(86vw, 400px); visibility: hidden; opacity: 0; }
.closeup.is-card .card-wrap { visibility: visible; opacity: 1; animation: card-rise 1.05s cubic-bezier(0.2, 0.78, 0.2, 1) both; }
@keyframes card-rise { from { opacity: 0; transform: translateY(14vh) scale(0.62); } }
.card {
  position: relative; container-type: inline-size; aspect-ratio: 5 / 7.3; overflow: hidden; display: grid; align-content: center;
  padding: 9% 10%; border-radius: 2px; text-align: center; color: var(--ink);
  background: radial-gradient(ellipse 120% 80% at 50% 18%, #fffdf8, #faf5ea 62%, #f1e8d6);
  box-shadow: 0 34px 60px -26px rgba(40, 26, 12, 0.65), 0 2px 6px rgba(40, 26, 12, 0.18);
  cursor: zoom-in; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: transform 0.5s var(--ease);
}
.card.is-close { transform: scale(1.7); transform-origin: var(--ox, 50%) var(--oy, 40%); cursor: zoom-out; transition-duration: 0.4s; }
.card-frame { position: absolute; inset: 4%; border: 1px solid rgba(179, 146, 90, 0.8); box-shadow: 0 0 0 3px #faf5ea, 0 0 0 4px rgba(179, 146, 90, 0.4); border-radius: 50% 50% 2px 2px / 24% 24% 2px 2px; pointer-events: none; }
.card-body { position: relative; }
.c-save { margin: 0 0 3cqw; font: 600 3.7cqw/1.4 var(--serif); letter-spacing: 0.32em; padding-left: 0.32em; text-transform: uppercase; color: #8a6c39; }
.c-caps { margin: 0; font: 600 3.1cqw/1.65 var(--serif); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); }
.c-caps--sm { font-size: 2.9cqw; max-width: 86%; margin: 0 auto; }
.c-names { margin: 3cqw 0; font: 400 18cqw/0.86 "Sacramento", var(--script); color: var(--ink); }
.c-names > span { display: block; }
.c-names .c-and { font: 400 9cqw/1.05 var(--script); color: #9a7b46; }
.c-rule { display: block; width: 14cqw; height: 1px; margin: 3.8cqw auto; background: var(--champagne); }
.c-date { margin: 0; font: 600 3.05cqw/1.6 var(--serif); letter-spacing: 0.14em; text-transform: uppercase; }
.c-venue { margin: 3.4cqw 0 0; font: 600 4.2cqw/1.3 var(--serif); letter-spacing: 0.1em; text-transform: uppercase; }
.c-addr { margin: 0.6cqw 0 0; font: 500 3cqw/1.5 var(--serif); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.c-script { margin: 3cqw 0 0; font: 400 6.4cqw/1.2 var(--script); color: var(--ink-soft); }
.c-for { margin: 3cqw 0 0; font: italic 400 3.5cqw/1.3 var(--serif); color: var(--muted); }
.c-for span { display: block; font: normal 400 5.6cqw/1.3 var(--script); color: var(--ink); }

/* The dock */
.cu-dock {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: grid; justify-items: center; gap: 14px;
  padding: 26px 16px calc(var(--safe-b) + 14px);
  background: linear-gradient(to top, rgba(245, 240, 230, 0.96) 58%, rgba(245, 240, 230, 0));
}
.cu-dock { opacity: 0; pointer-events: none; }
.closeup.is-card .cu-dock { opacity: 1; pointer-events: auto; animation: dock-in 0.8s var(--ease) 0.2s both; }
@keyframes dock-in { from { opacity: 0; transform: translateY(16px); } }
.pill {
  padding: 13px 24px; border: 0; border-radius: 999px; cursor: pointer; background: var(--olive); color: #fff;
  font: 500 0.84rem/1 var(--ui); letter-spacing: 0.02em; box-shadow: 0 10px 20px -10px rgba(90, 68, 30, 0.75);
  transition: background 0.3s var(--ease), transform 0.2s;
}
.pill:hover { background: var(--olive-deep); }
.pill:active { transform: scale(0.98); }
.dock { display: flex; align-items: flex-end; justify-content: center; gap: clamp(28px, 10vw, 46px); }
.dock-btn { display: grid; justify-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; font: 500 0.72rem/1.2 var(--ui); color: var(--ink); }
.dock-btn i { position: relative; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--charcoal); color: #f6efe2; transition: transform 0.25s var(--ease); }
.dock-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.dock-btn--main i { width: 54px; height: 54px; }
.dock-btn--main svg { width: 24px; height: 24px; }
.dock-btn:hover i { transform: translateY(-2px); }
.dock-btn:focus-visible { outline: none; }
.dock-btn:focus-visible i { outline: 2px solid var(--olive); outline-offset: 4px; }
.dock-badge {
  position: absolute; right: -2px; top: -2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--olive) center / 11px no-repeat; box-shadow: 0 0 0 2px var(--ivory);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3L9.5 3.6' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ══════════ Sheets ══════════ */
.sheet {
  width: min(100%, 560px); max-width: none; max-height: 92svh; margin: auto auto 0; padding: 0; border: 0;
  border-radius: 20px 20px 0 0; background: var(--paper); color: var(--ink); overflow: hidden;
  box-shadow: 0 -24px 60px -24px rgba(40, 30, 20, 0.4);
}
.sheet::backdrop { background: rgba(35, 28, 20, 0.32); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet[open] { animation: sheet-up 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.sheet.is-out { animation: sheet-down 0.3s ease-in both; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
.sheet--wide { width: min(100%, 880px); }
.sheet-inner { max-height: 92svh; overflow-y: auto; overscroll-behavior: contain; padding: 0 24px calc(var(--safe-b) + 30px); }
.sheet-inner::before { content: ""; display: block; width: 40px; height: 4px; margin: 10px auto 0; border-radius: 4px; background: rgba(42, 38, 34, 0.18); }
.sheet-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0 12px; background: var(--paper); border-bottom: 1px solid var(--line); margin-bottom: 18px;
}
.sheet-head h2 { margin: 0; font: 400 clamp(1.35rem, 5vw, 1.7rem)/1.2 var(--display); }
.sheet-head .sheet-x { margin-left: auto; }
.sheet-x { flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: none; cursor: pointer; }
.sheet-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.sheet-x:hover { background: rgba(42, 38, 34, 0.06); }
@media (min-width: 760px) {
  .sheet { margin: auto; border-radius: 18px; max-height: 86svh; }
  .sheet-inner { max-height: 86svh; }
  .sheet-inner::before { display: none; }
  @keyframes sheet-up { from { transform: translateY(30px); opacity: 0; } }
  @keyframes sheet-down { to { transform: translateY(20px); opacity: 0; } }
}

/* Details */
.d-roman { margin: 0; font: 500 0.72rem/1 var(--ui); letter-spacing: 0.4em; color: var(--muted); }
.d-count { margin: 10px 0 0; font: italic 400 1.4rem/1.35 var(--serif); color: var(--ink); text-wrap: balance; }
.d-done { margin: 10px 0 0; font: italic 400 1.5rem/1.3 var(--serif); }
.d-event { display: grid; grid-template-columns: 112px 1fr; gap: 18px; align-items: start; padding: 22px 0; border-bottom: 1px solid var(--line); }
.d-event:first-of-type { margin-top: 18px; border-top: 1px solid var(--line); }
.d-event--text { grid-template-columns: 1fr; }
.d-photo { margin: 0; aspect-ratio: 3 / 4; border-radius: 999px 999px 4px 4px; overflow: hidden; background: #e8e1d5; }
.d-photo img { width: 100%; height: 100%; object-fit: cover; }
.d-event h3 { margin: 0; font: 400 1.4rem/1.2 var(--display); }
.d-time { margin: 4px 0 10px; font: italic 500 1.08rem/1.3 var(--serif); color: var(--burgundy); }
.d-venue { margin: 0; font: 600 1.05rem/1.4 var(--serif); }
.d-addr { margin: 0 0 8px; font: 400 1.05rem/1.45 var(--serif); }
.d-note { margin: 0 0 10px; font: italic 400 1rem/1.5 var(--serif); color: var(--ink-soft); }
.d-lock { display: flex; gap: 10px; align-items: center; margin: 0; padding: 12px 14px; border-radius: 10px; background: rgba(125, 99, 52, 0.09); font: italic 400 1rem/1.4 var(--serif); color: var(--ink-soft); }
.d-lock svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--olive-deep); stroke-width: 1.3; }
.d-season { margin: 22px 0 0; padding: 16px 18px; border-radius: 10px; background: #f1ebdf; font: italic 400 1.02rem/1.5 var(--serif); color: var(--ink-soft); }
.d-reply { display: grid; justify-items: center; gap: 12px; margin-top: 26px; text-align: center; }
.d-reply p { margin: 0; font: italic 400 1.05rem/1.4 var(--serif); }

/* RSVP */
.r-sub { margin: 0 0 14px; font: italic 400 1.05rem/1.4 var(--serif); color: var(--ink-soft); }
.r-name { margin: 0 0 18px; padding-bottom: 6px; border-bottom: 1px solid var(--line); font: 400 2rem/1.25 var(--script); }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.choices { display: grid; gap: 4px; margin: 0 0 18px; }
.choices legend { margin: 0 0 8px; padding: 0; font: 500 0.78rem/1.2 var(--ui); color: var(--muted); }
.choice { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font: 400 1.2rem/1.3 var(--serif); }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice i { position: relative; flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--ink-soft); transition: border-color 0.2s; }
.choice input[type="checkbox"] + i { border-radius: 5px; }
.choice i::after { content: ""; position: absolute; inset: 3.5px; border-radius: inherit; background: var(--olive); transform: scale(0); transition: transform 0.25s var(--ease); }
.choice input:checked + i { border-color: var(--olive); }
.choice input:checked + i::after { transform: scale(1); }
.choice input:focus-visible + i { outline: 2px solid var(--olive); outline-offset: 3px; }
.field { display: grid; gap: 4px; margin: 0 0 16px; }
.field > span { font: 500 0.78rem/1.2 var(--ui); color: var(--ink-soft); }
.field em { font-style: normal; color: var(--muted); font-weight: 400; }
.field input, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid rgba(42, 38, 34, 0.22); border-radius: 10px; background: #fffdf9;
  font: 400 1.08rem/1.4 var(--serif); color: var(--ink); transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--olive); box-shadow: 0 0 0 3px rgba(125, 99, 52, 0.2); }
.form-error { margin: 0 0 14px; color: #8c2f24; font: italic 500 1rem/1.4 var(--serif); }
#rsvp-form { transition: opacity 0.4s var(--ease), filter 0.4s var(--ease); }
#sheet-rsvp.is-sealing #rsvp-form { opacity: 0; filter: blur(3px); }
.r-done { display: grid; justify-items: center; text-align: center; padding: 8px 0 6px; }
.r-seal { width: 84px; margin: 6px 0 20px; transform: rotate(-6deg); }
.r-done h3 { margin: 0 0 8px; font: 400 1.55rem/1.25 var(--display); text-wrap: balance; }
.r-done h3:focus { outline: none; }
.r-done > p { margin: 0 0 18px; max-width: 34ch; font: italic 400 1.08rem/1.5 var(--serif); color: var(--ink-soft); }
.r-home { width: 100%; margin: 0 0 18px; padding: 16px; border-radius: 12px; background: #f1ebdf; }
.r-home-label { margin: 0 0 4px; font: 500 0.78rem/1.2 var(--ui); color: var(--muted); }
.r-done.is-fresh .r-seal { animation: seal-press 1.15s cubic-bezier(0.2, 0.75, 0.25, 1) both; }
.r-done.is-fresh > :not(.r-seal) { animation: arrive 0.9s var(--ease) 0.75s both; }
@keyframes seal-press {
  0% { opacity: 0; transform: translateY(-70px) scale(1.9) rotate(-20deg); filter: blur(2px); }
  55% { opacity: 1; transform: translateY(0) scale(0.92) rotate(-5deg); filter: blur(0); }
  70% { transform: scale(1.07, 0.94) rotate(-6deg); }
  100% { transform: scale(1) rotate(-6deg); }
}

/* Gifts */
.g-intro { margin: 0 0 18px; font: italic 400 1.1rem/1.55 var(--serif); color: var(--ink-soft); }
.g-card { display: grid; justify-items: center; gap: 10px; padding: 22px 18px; border-radius: 14px; background: #f1ebdf; text-align: center; }
.g-label { margin: 0; font: 500 0.78rem/1.2 var(--ui); color: var(--muted); }
.g-email { margin: 0 0 4px; font: 500 1.2rem/1.3 var(--serif); word-break: break-all; }
.g-note { margin: 16px 0 0; font: italic 400 1rem/1.5 var(--serif); color: var(--muted); }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
.g-item { display: block; padding: 0; border: 0; background: #e8e1d5; border-radius: 8px; overflow: hidden; cursor: zoom-in; }
.g-item img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform 0.6s var(--ease); }
.g-item:hover img { transform: scale(1.03); }

/* Photo viewer */
.viewer {
  width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(20, 16, 12, 0.94); color: #f4eee3;
}
.viewer::backdrop { background: transparent; }
.viewer[open] { display: grid; place-items: center; animation: fade-in 0.35s var(--ease); }
.viewer img { max-width: 92vw; max-height: 80svh; width: auto; height: auto; border-radius: 4px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.viewer-cap { position: absolute; left: 20px; right: 20px; bottom: calc(var(--safe-b) + 22px); margin: 0; text-align: center; font: italic 400 1.05rem/1.4 var(--serif); color: rgba(244, 238, 227, 0.85); }
.viewer-btn, .viewer-x {
  position: absolute; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(244, 238, 227, 0.35); background: rgba(20, 16, 12, 0.4); color: inherit; cursor: pointer;
}
.viewer-btn svg, .viewer-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.viewer-btn--prev { left: 14px; top: 50%; transform: translateY(-50%); }
.viewer-btn--next { right: 14px; top: 50%; transform: translateY(-50%); }
.viewer-x { top: calc(var(--safe-t) + 14px); right: 14px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-b) + 24px); z-index: 90; transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: 999px; white-space: pre-line; text-align: center;
  background: var(--charcoal); color: #f6efe2; font: 500 0.86rem/1.4 var(--ui); box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.5);
  animation: arrive 0.4s var(--ease);
}
.toast--mono { border-radius: 10px; font: 400 0.8rem/1.6 ui-monospace, "SF Mono", Menlo, monospace; text-align: left; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .neon { animation: none !important; }
  .scene.is-await .env-photo img, .scene.is-await .env-photo::before { animation: none; }
}
