:root {
  color-scheme: dark;
  --night: #080808;
  --night-soft: #11100f;
  --ivory: #f4efe6;
  --paper: #eee9df;
  --ink: #27231f;
  --steel-light: #f3f4f4;
  --steel-mid: #9c9e9f;
  --steel-dark: #333536;
  --burgundy: #4a080d;
  --burgundy-alt: #5d1016;
  --burgundy-dark: #270406;
  --invite-ivory: #efe5d5;
  --aged-paper: #dcccb5;
  --antique-gold: #b38a55;
  --paper-ink: #3a2721;
  --font-display: Baskerville, "Iowan Old Style", Didot, "Bodoni 72", Georgia, serif;
  --font-script: "Snell Roundhand", "Apple Chancery", "Segoe Script", cursive;
  --font-body: "Iowan Old Style", Baskerville, Georgia, serif;
  --font-label: "Avenir Next", Avenir, "Helvetica Neue", sans-serif;
  --reveal-duration: 2300ms;
  --open-duration: 2100ms;
  --physical-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

html[data-state="opening"],
html[data-state="opened"] {
  background: var(--burgundy-dark);
}

body {
  background: var(--night);
  color: var(--ivory);
  font-family: var(--font-label);
}

button {
  font: inherit;
}

.intro {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 47%, rgba(91, 77, 57, 0.1), transparent 35%),
    linear-gradient(160deg, #0c0c0c 0%, #070707 56%, #0b0a09 100%);
  isolation: isolate;
  transition: background-color var(--open-duration) ease, opacity var(--open-duration) ease;
}

.ambient {
  position: absolute;
  inset: 18% 4% 12%;
  background: radial-gradient(ellipse, rgba(171, 139, 94, 0.12), rgba(85, 73, 57, 0.04) 38%, transparent 70%);
  filter: blur(20px);
  opacity: 0.8;
  transform: scale(0.94);
  transition: opacity var(--open-duration) ease, transform var(--open-duration) ease;
}

.experience {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-rows: 1fr auto;
  width: 100%;
  min-height: 100dvh;
  padding:
    max(18px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(26px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  border: 0;
  outline: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  user-select: none;
}

.experience:focus-visible::after {
  content: "";
  position: absolute;
  inset: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 4px;
}

.intro-title {
  position: absolute;
  z-index: 9;
  top: max(11.5dvh, calc(env(safe-area-inset-top) + 64px));
  left: 50%;
  width: min(88%, 430px);
  color: rgba(246, 241, 232, 0.92);
  font-family: var(--font-script);
  font-size: clamp(27px, 7.8vw, 38px);
  font-weight: 400;
  letter-spacing: .015em;
  line-height: 1.1;
  text-align: center;
  text-shadow: 0 3px 16px rgba(0, 0, 0, .72);
  transform: translateX(-50%);
  transition: opacity 700ms ease, transform 900ms cubic-bezier(.22,1,.36,1);
}

/* INTRO */
.object-stage {
  position: relative;
  align-self: center;
  justify-self: center;
  width: clamp(204px, 56vw, 252px);
  height: clamp(520px, 78dvh, 660px);
  max-height: calc(100dvh - 88px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  transform-origin: 50% 48%;
  transition:
    transform var(--open-duration) cubic-bezier(.3, 0, .2, 1),
    opacity 1600ms ease-in-out 400ms,
    filter 1950ms ease-in-out;
  will-change: transform, opacity, filter;
}

.case-shadow {
  position: absolute;
  z-index: 0;
  left: 50%;
  bottom: 3.8%;
  width: 88%;
  height: 8%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  filter: blur(17px);
  transform: translateX(-50%);
  transition: transform var(--reveal-duration) var(--physical-ease), opacity var(--reveal-duration) ease;
}

.frame {
  position: absolute;
  left: 4%;
  top: 20%;
  width: 92%;
  height: 68%;
  transition: opacity 520ms ease, filter 700ms ease;
}

.frame-glass {
  position: absolute;
  z-index: 1;
  inset: 12px;
  overflow: hidden;
  border: 1px solid rgba(236, 238, 238, 0.2);
  border-radius: 2px;
  background:
    linear-gradient(112deg, transparent 0 23%, rgba(255, 255, 255, 0.08) 24%, transparent 38%),
    linear-gradient(160deg, rgba(44, 47, 48, 0.78), rgba(12, 13, 13, 0.68) 55%, rgba(48, 47, 44, 0.72));
  box-shadow:
    inset 0 0 22px rgba(0, 0, 0, 0.88),
    inset 0 1px 1px rgba(255, 255, 255, 0.16);
}

.frame-glass::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 9%, transparent 87%, rgba(255, 255, 255, 0.03));
  pointer-events: none;
}

.rail,
.corner {
  position: absolute;
  z-index: 4;
  display: block;
}

.rail--left,
.rail--right {
  top: 8px;
  bottom: 8px;
  width: 14px;
  background:
    linear-gradient(90deg, #252728 0%, #737678 17%, #e8e9e9 42%, #888b8d 61%, #303233 100%);
  box-shadow:
    inset 1px 0 rgba(255, 255, 255, 0.5),
    inset -2px 0 rgba(0, 0, 0, 0.58),
    0 4px 10px rgba(0, 0, 0, 0.5);
}

.rail--left { left: 0; }
.rail--right { right: 0; transform: scaleX(-1); }

.rail--top,
.rail--bottom {
  left: 8px;
  right: 8px;
  height: 14px;
  background:
    linear-gradient(180deg, #292b2c 0%, #777a7b 15%, #ececec 39%, #9a9c9d 57%, #353738 100%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.55),
    inset 0 -2px rgba(0, 0, 0, 0.52),
    0 4px 12px rgba(0, 0, 0, 0.46);
}

.rail--top { top: 0; }
.rail--bottom { bottom: 0; transform: scaleY(-1); }

.rail::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 1px solid rgba(255, 255, 255, 0.13);
}

.corner {
  width: 22px;
  height: 22px;
  border-radius: 2px;
  background: radial-gradient(circle at 38% 34%, #f4f4f3 0, #9b9d9e 28%, #4a4c4d 58%, #1d1f20 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), 0 2px 5px rgba(0, 0, 0, 0.5);
}

.corner--tl { top: 0; left: 0; }
.corner--tr { top: 0; right: 0; }
.corner--br { right: 0; bottom: 0; }
.corner--bl { left: 0; bottom: 0; }

.photo-strip-clip {
  position: absolute;
  z-index: 3;
  top: calc(20% + 15px);
  left: 50%;
  width: 72%;
  height: calc(68% - 30px);
  overflow: hidden;
  transform: translateX(-50%);
}

.photo-strip {
  position: absolute;
  inset: 0 auto auto 50%;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: clamp(5px, 0.75dvh, 7px);
  width: 78%;
  height: calc(100% - 14px);
  padding: clamp(7px, 1.1dvh, 10px);
  border: 1px solid rgba(93, 85, 75, 0.13);
  background: var(--paper);
  box-shadow: 0 7px 12px rgba(0, 0, 0, 0.28);
  transform: translate3d(-50%, -92%, 0);
  transform-origin: 50% 0;
  will-change: transform;
  transition:
    transform var(--open-duration) cubic-bezier(.3, 0, .2, 1),
    opacity 1500ms ease-in-out 420ms,
    filter 1900ms ease-in-out;
}

.paper-grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.22;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(96deg, transparent 0 3px, rgba(95, 82, 64, 0.035) 4px, transparent 5px),
    repeating-linear-gradient(4deg, transparent 0 5px, rgba(255, 255, 255, 0.23) 6px, transparent 7px);
  mix-blend-mode: multiply;
}

.photo-slot {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #aaa8a2;
  box-shadow: inset 0 0 0 1px rgba(20, 18, 15, 0.11);
}

.photo-slot img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) sepia(0.13) saturate(0.72) contrast(1.08);
  pointer-events: none;
  -webkit-user-drag: none;
}

.photo-slot img.is-missing {
  display: none;
}

.photo-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(242, 239, 232, 0.72);
  background:
    radial-gradient(circle at 54% 28%, rgba(221, 218, 211, 0.42), transparent 20%),
    linear-gradient(142deg, #858785 0%, #b7b2aa 42%, #626563 100%);
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.24em;
}

.photo-slot:nth-of-type(3) .photo-fallback {
  background:
    radial-gradient(circle at 40% 31%, rgba(231, 225, 214, 0.34), transparent 22%),
    linear-gradient(35deg, #595b59, #aaa49a 54%, #74716c);
}

.photo-slot:nth-of-type(4) .photo-fallback {
  background:
    radial-gradient(circle at 60% 32%, rgba(231, 226, 215, 0.38), transparent 19%),
    linear-gradient(150deg, #9a958e, #686b69 57%, #b8b1a7);
}

.photo-slot:nth-of-type(5) .photo-fallback {
  background:
    radial-gradient(circle at 46% 26%, rgba(226, 221, 210, 0.4), transparent 21%),
    linear-gradient(27deg, #727471, #b9b3aa 48%, #5b5d5b);
}

.front-lip {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: calc(20% + 7px);
  width: 76%;
  height: 20px;
  border-radius: 2px;
  background:
    linear-gradient(180deg, #242627 0%, #86898a 13%, #ededec 31%, #929495 49%, #414344 72%, #202223 100%);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.44),
    inset 0 -3px 4px rgba(0, 0, 0, 0.6),
    0 6px 10px rgba(0, 0, 0, 0.48);
  transform: translateX(-50%);
  transition: opacity 520ms ease, filter 700ms ease;
}

.front-lip__slot {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 3px;
  height: 5px;
  border-radius: 50%;
  background: #101112;
  box-shadow: inset 0 2px 2px #000, 0 1px rgba(255, 255, 255, 0.22);
}

.front-lip__shine {
  position: absolute;
  left: 19%;
  bottom: 4px;
  width: 33%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
}

.instruction {
  position: relative;
  z-index: 8;
  align-self: end;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  min-height: 30px;
  color: rgba(244, 239, 230, 0.62);
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(9px, 2.5vw, 11px);
  font-weight: 400;
  letter-spacing: 0.2em;
  line-height: 1;
  text-transform: uppercase;
  transition: opacity 300ms ease, transform 300ms ease;
}

.tap-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid rgba(244, 239, 230, 0.32);
  border-radius: 50%;
}

.tap-mark::before {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid rgba(244, 239, 230, 0.26);
  border-radius: inherit;
  animation: tap-pulse 2.2s ease-out infinite;
}

.tap-mark span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

@keyframes tap-pulse {
  0%, 32% { opacity: 0; transform: scale(0.72); }
  42% { opacity: 0.8; }
  80%, 100% { opacity: 0; transform: scale(1.72); }
}

body[data-state="revealing"] .photo-strip {
  animation: strip-feed-down var(--reveal-duration) var(--physical-ease) both;
}

body[data-state="revealed"] .photo-strip,
body[data-state="opening"] .photo-strip,
body[data-state="opened"] .photo-strip {
  transform: translate3d(-50%, 0, 0);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.42), 0 3px 7px rgba(0, 0, 0, 0.24);
}

@keyframes strip-feed-down {
  0% {
    transform: translate3d(-50%, -92%, 0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.24);
    animation-timing-function: var(--physical-ease);
  }
  18% {
    transform: translate3d(-50%, -69%, 0);
    animation-timing-function: linear;
  }
  26% {
    transform: translate3d(-50%, -69%, 0);
    animation-timing-function: var(--physical-ease);
  }
  44% {
    transform: translate3d(-50%, -46%, 0);
    animation-timing-function: linear;
  }
  52% {
    transform: translate3d(-50%, -46%, 0);
    animation-timing-function: var(--physical-ease);
  }
  70% {
    transform: translate3d(-50%, -23%, 0);
    animation-timing-function: linear;
  }
  78% {
    transform: translate3d(-50%, -23%, 0);
    animation-timing-function: var(--physical-ease);
  }
  94% {
    transform: translate3d(-50%, 8px, 0);
    box-shadow: 0 14px 24px rgba(0, 0, 0, 0.44), 0 3px 7px rgba(0, 0, 0, 0.24);
    animation-timing-function: ease-out;
  }
  100% {
    transform: translate3d(-50%, 0, 0);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.42), 0 3px 7px rgba(0, 0, 0, 0.24);
  }
}

body[data-state="revealing"] .instruction {
  opacity: 0;
  transform: translateY(4px);
}

/* PHOTO STRIP TO INVITATION TRANSITION */
body[data-state="opening"] .object-stage,
body[data-state="opened"] .object-stage {
  opacity: 0;
  filter: blur(6px);
  transform: scale(1.06);
}

body[data-state="opening"] .photo-strip-clip {
  overflow: visible;
}

body[data-state="opening"] .photo-strip {
  opacity: 0;
  filter: blur(2px);
  transform: translate3d(-50%, 0, 0) scale(1.36);
}

body[data-state="opening"] :is(.frame, .front-lip, .case-shadow) {
  opacity: 0;
  filter: blur(5px);
  transition: opacity 1250ms ease-in-out, filter 1450ms ease-in-out;
}

body[data-state="opening"] .instruction,
body[data-state="opened"] .instruction {
  opacity: 0;
  transform: translateY(4px);
}

body[data-state="opening"] .intro-title,
body[data-state="opened"] .intro-title {
  opacity: 0;
  transform: translateX(-50%) translateY(-8px);
}

body[data-state="opening"] .ambient,
body[data-state="opened"] .ambient {
  opacity: 0;
  transform: scale(1.25);
}

body[data-state="opening"] .intro,
body[data-state="opened"] .intro {
  background: var(--burgundy-dark);
}

.invitation-world {
  position: fixed;
  inset: 0;
  z-index: 10;
  width: 100%;
  max-width: 470px;
  min-height: 100dvh;
  margin-inline: auto;
  overflow-x: clip;
  color: var(--invite-ivory);
  background-color: var(--burgundy-dark);
  background-image: linear-gradient(rgba(39, 4, 6, 0.12), rgba(39, 4, 6, 0.2)), url("assets/generated/bg-burgundy.webp");
  background-size: 640px auto;
  opacity: 0;
  visibility: hidden;
  transform: translateZ(0);
  transition: opacity 1900ms ease-in-out 180ms, visibility 0s linear 2080ms;
}

body[data-state="opened"] .intro {
  opacity: 0;
  pointer-events: none;
  display: none;
}

body[data-state="opening"] .invitation-world,
body[data-state="opened"] .invitation-world {
  opacity: 1;
  visibility: visible;
  transition: opacity 1900ms ease-in-out 180ms, visibility 0s;
}

body[data-state="opening"],
body[data-state="opened"] {
  background: var(--burgundy-dark);
}

body[data-state="opening"] .invitation-world,
body[data-state="opened"] .invitation-world {
  position: relative;
  inset: auto;
  transform: none;
}

/* INVITATION BASE */
.invitation-world *,
.invitation-world *::before,
.invitation-world *::after { box-sizing: border-box; }

.invitation-world button,
.invitation-world input,
.invitation-world textarea { font: inherit; }

.invitation-world button {
  -webkit-tap-highlight-color: transparent;
}

.invitation-world {
  font-family: var(--font-body);
}

.invitation-world :is(button, a, input, textarea, [tabindex]):focus-visible {
  outline: 2px solid #d2ae79;
  outline-offset: 4px;
  box-shadow: 0 0 0 5px rgba(74, 8, 13, 0.6);
}

.composition-area {
  position: relative;
  width: 100%;
}

.composition-area img {
  max-width: none;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.paper-surface {
  color: var(--paper-ink);
  background-color: var(--invite-ivory);
  background-image: url("assets/generated/paper-texture.webp");
  background-size: 460px auto;
  box-shadow: 0 18px 34px rgba(25, 0, 2, 0.34), 0 2px 5px rgba(25, 0, 2, 0.2);
}

.kicker {
  margin: 0;
  font-family: var(--font-label);
  font-size: clamp(10px, 2.4vw, 11px);
  letter-spacing: 0.22em;
  line-height: 1.5;
  text-transform: uppercase;
}

.tactile { cursor: pointer; }
.tactile:active { transform: scale(0.985); }

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

/* HERO */
.invite-hero {
  min-height: max(735px, 92dvh);
  padding-top: env(safe-area-inset-top);
}

.hero-lace {
  position: absolute;
  z-index: 1;
  top: 11%;
  left: -13%;
  width: 116%;
  opacity: 0.82;
  transform: rotate(-4deg);
}

.hero-ribbon {
  position: absolute;
  z-index: 2;
  top: 3%;
  right: -19%;
  width: 43%;
  height: 86%;
  object-fit: contain;
  transform: rotate(9deg);
  opacity: 0.88;
}

.hero-envelope-stack {
  position: absolute;
  z-index: 2;
  top: 10%;
  left: -9%;
  width: 116%;
  height: 71%;
  object-fit: contain;
  transform: rotate(-2.2deg);
  filter: drop-shadow(0 18px 18px rgba(23, 0, 2, 0.3));
}

.hero-memory-strip {
  position: absolute;
  z-index: 4;
  top: 17%;
  right: -1%;
  display: grid;
  gap: 5px;
  width: 112px;
  margin: 0;
  padding: 7px 7px 17px;
  background: #eee8dd url("assets/generated/paper-texture.webp") center / 320px auto;
  box-shadow: 0 16px 22px rgba(31, 1, 4, 0.38);
  transform: rotate(7deg);
}

.hero-memory-strip span {
  display: block;
  aspect-ratio: 1.08;
  overflow: hidden;
  background: #59443c;
}

.hero-memory-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(.3) sepia(.08) saturate(.82) contrast(1.04);
}

.hero-paper {
  position: absolute;
  z-index: 5;
  top: 18%;
  left: 50%;
  width: min(76%, 340px);
  min-height: 430px;
  padding: 78px 28px 54px;
  text-align: center;
  clip-path: polygon(2% 1%, 97% 0, 100% 96%, 96% 100%, 3% 99%, 0 4%);
  transform: translateX(-50%) rotate(-0.7deg);
}

.hero-paper::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(179, 138, 85, 0.48);
  clip-path: inherit;
  pointer-events: none;
}

.hero-paper > * {
  opacity: 0;
  clip-path: inset(0 0 100% 0);
  transform: translateY(14px);
}

body[data-state="opening"] .hero-paper > *,
body[data-state="opened"] .hero-paper > * {
  animation: hero-copy-reveal 880ms cubic-bezier(.22, 1, .36, 1) both;
}

body[data-state="opening"] .hero-paper > .kicker,
body[data-state="opened"] .hero-paper > .kicker { animation-delay: 850ms; }
body[data-state="opening"] .hero-paper > h1,
body[data-state="opened"] .hero-paper > h1 { animation-delay: 980ms; }
body[data-state="opening"] .hero-paper > .hero-invite,
body[data-state="opened"] .hero-paper > .hero-invite { animation-delay: 1180ms; }
body[data-state="opening"] .hero-paper > .hero-date,
body[data-state="opened"] .hero-paper > .hero-date { animation-delay: 1320ms; }
body[data-state="opening"] .hero-paper > .hero-day,
body[data-state="opened"] .hero-paper > .hero-day { animation-delay: 1420ms; }

@keyframes hero-copy-reveal {
  from {
    opacity: 0;
    clip-path: inset(0 0 100% 0);
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    clip-path: inset(0);
    transform: translateY(0);
  }
}

.hero-paper h1 {
  display: grid;
  gap: 4px;
  width: 100%;
  margin: 30px 0 24px;
  color: var(--burgundy);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: clamp(32px, 9vw, 45px);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 0.95;
  text-transform: none;
}

.hero-paper h1 span {
  display: block;
  max-width: 100%;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.hero-paper h1 b {
  color: var(--antique-gold);
  font-family: var(--font-script);
  font-size: 0.48em;
  font-weight: 400;
  line-height: 1.2;
}

.hero-invite {
  margin: 0;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
}

.hero-date {
  margin: 30px 0 5px;
  color: var(--burgundy-alt);
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: 0.13em;
}

.hero-day {
  margin: 0;
  font-family: var(--font-label);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.hero-floral {
  position: absolute;
  z-index: 7;
  object-fit: contain;
  filter: drop-shadow(0 14px 14px rgba(24, 0, 2, 0.3));
}

.hero-floral--left {
  bottom: 1%;
  left: -25%;
  width: 74%;
  transform: rotate(4deg);
}

.hero-floral--right {
  top: 7%;
  right: -22%;
  width: 55%;
  transform: rotate(-12deg);
}

.hero-stamp {
  position: absolute;
  z-index: 7;
  right: 7%;
  bottom: 18%;
  width: 74px;
  transform: rotate(7deg);
  filter: drop-shadow(0 5px 5px rgba(33, 3, 4, 0.25));
}

.hero-key {
  position: absolute;
  z-index: 9;
  right: 22%;
  bottom: 8.5%;
  width: 43px;
  transform-origin: 50% 0;
  animation: key-settle 1.1s 1.4s ease-out both;
}

@keyframes key-settle {
  0% { opacity: 0; transform: rotate(8deg); }
  55% { opacity: 1; transform: rotate(-2deg); }
  100% { opacity: 1; transform: rotate(0); }
}

.wax-seal {
  position: absolute;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: #65451f;
  background: transparent;
  pointer-events: none;
}

.wax-seal img { grid-area: 1 / 1; width: 100%; }
.wax-seal span {
  z-index: 1;
  grid-area: 1 / 1;
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.wax-seal--hero { top: 13.5%; left: 42%; width: 78px; }

/* MUSIC */
.music-object {
  position: absolute;
  z-index: 9;
  top: calc(88px + env(safe-area-inset-top));
  left: 20px;
  display: block;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 0;
  color: var(--invite-ivory);
  background: transparent;
}

.music-record { width: 64px; height: 64px; filter: drop-shadow(0 8px 9px rgba(25,0,2,.36)); }
.music-object.is-playing .music-record { animation: record-spin 7s linear infinite; }
@keyframes record-spin { to { transform: rotate(360deg); } }

.scroll-cue {
  position: absolute;
  z-index: 12;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transform: translateX(-50%);
  transition: opacity 300ms ease;
}
.scroll-cue span { font-family: var(--font-label); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; white-space: nowrap; }
.scroll-cue i { width: 15px; height: 15px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); }
.scroll-cue.is-hidden { opacity: 0; }

/* EVENT DETAILS */
.event-composition { min-height: 710px; margin-top: -35px; }
.event-lace { position: absolute; z-index: 1; top: 5%; left: -12%; width: 128%; transform: rotate(3deg); opacity: 0.72; }
.event-ribbon { position: absolute; z-index: 2; top: -9%; left: 40%; width: 36%; height: 72%; object-fit: contain; transform: rotate(-4deg); }
.event-sprig { position: absolute; z-index: 8; right: -8%; bottom: 1%; width: 41%; transform: rotate(-14deg); }
.event-tag { position: absolute; z-index: 6; top: 0; left: 50%; width: min(82%, 350px); height: 630px; transform: translateX(-50%); transition: transform 560ms cubic-bezier(.22,1,.36,1); }
.event-tag > img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 22px 23px rgba(26,0,2,.34)); }
.event-tag__copy { position: absolute; inset: 27% 17% 13%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--paper-ink); text-align: center; }
.event-tag__copy h2 { margin: 7px 0 18px; color: var(--burgundy); font-family: var(--font-script); font-size: 40px; font-weight: 400; line-height: 1; }
.event-pair { display: grid; width: 100%; gap: 18px; }
.event-pair div { display: grid; gap: 3px; }
.event-pair strong { color: var(--burgundy-alt); font-family: var(--font-display); font-size: 14px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; }
.event-pair time { font-size: 13px; letter-spacing: .08em; }
.event-pair span { font-family: var(--font-body); font-size: 13px; }
.event-tag__copy button { margin-top: 24px; padding: 10px 8px; border: 0; color: var(--paper-ink); background: transparent; font-family: var(--font-label); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.event-tag__copy button b { display: inline-grid; place-items: center; width: 19px; height: 19px; margin-left: 8px; border: 1px solid currentColor; border-radius: 50%; font-size: 13px; font-weight: 400; transition: transform 300ms ease; }
.event-slips { position: absolute; z-index: 4; top: 11%; left: 50%; width: 96%; height: 540px; transform: translateX(-50%); pointer-events: none; }
.event-slip { position: absolute; width: 51%; min-height: 132px; padding: 22px 18px; opacity: 0; transition: transform 600ms cubic-bezier(.22,1,.36,1), opacity 360ms ease; }
.event-slip span { color: var(--burgundy); font-family: var(--font-display); font-size: 13px; text-transform: uppercase; }
.event-slip p { margin: 8px 0 12px; font-size: 12px; line-height: 1.5; }
.event-slip a { color: var(--burgundy-alt); font-family: var(--font-label); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.event-slip--ceremony { left: 5%; top: 2%; transform: translate(42%, 68%) rotate(-2deg); }
.event-slip--reception { right: 5%; bottom: 2%; transform: translate(-42%, -68%) rotate(2deg); }
.event-composition.is-expanded .event-tag { transform: translate(-50%, -8px) scale(.91); }
.event-composition.is-expanded .event-slip--ceremony { transform: translate(0, -28px) rotate(-5deg); }
.event-composition.is-expanded .event-slip--reception { transform: translate(0, 28px) rotate(5deg); }
.event-composition.is-expanded .event-slip { opacity: .96; }
.event-composition.is-expanded .event-tag__copy button b { transform: rotate(45deg); }
.event-composition.is-expanded .event-slips { pointer-events: auto; }

/* GALLERY */
.gallery-composition { min-height: 680px; margin-top: -55px; }
.gallery-paper { position: absolute; z-index: 1; top: 4%; left: -12%; width: 124%; opacity: .96; transform: rotate(2deg); filter: drop-shadow(0 20px 20px rgba(25,0,2,.3)); }
.section-heading { position: relative; z-index: 4; padding-top: 75px; color: var(--paper-ink); text-align: center; }
.section-heading h2 { margin: 5px 0 0; font-family: var(--font-body); font-size: 17px; font-weight: 400; font-style: italic; }
.polaroid-stack { position: absolute; z-index: 7; top: 25%; left: 50%; width: 69%; height: 420px; transform: translateX(-50%); }
.polaroid-stack:focus-visible { border-radius: 4px; }
.polaroid-card { --offset: 0; --rot: 0deg; position: absolute; inset: 0; margin: 0; cursor: grab; transform: translate3d(calc(var(--offset) * 27px), calc(abs(var(--offset)) * 5px), 0) rotate(calc(var(--offset) * 3.2deg)); transform-origin: 50% 90%; transition: transform 480ms cubic-bezier(.22,1,.36,1), opacity 350ms ease; }
.polaroid-card.is-dragging { cursor: grabbing; transition: none; }
.polaroid-card.is-hidden-left { opacity: 0; pointer-events: none; transform: translate3d(-130%, 15px, 0) rotate(-14deg); }
.polaroid-frame { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 18px 17px rgba(34,4,5,.32)); }
.memory-photo { position: absolute; z-index: 1; top: 7.3%; left: 9.4%; width: 81.2%; height: 71.5%; overflow: hidden; background: linear-gradient(135deg, #927d68, #3c2925); }
.memory-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.memory-photo img.is-missing { display: none; }
.gallery-arrow { position: absolute; z-index: 10; top: 51%; display: grid; place-items: center; width: 34px; height: 34px; padding: 0 0 4px; border: 1px solid rgba(74,8,13,.38); border-radius: 50%; color: var(--burgundy); background: rgba(239,229,213,.88); box-shadow: 0 7px 14px rgba(34,4,5,.2); font-family: Georgia, serif; font-size: 27px; line-height: 1; cursor: pointer; }
.gallery-arrow--previous { left: 7%; }
.gallery-arrow--next { right: 7%; }
.gallery-hint { position: absolute; z-index: 8; bottom: 10%; left: 50%; margin: 0; transform: translateX(-50%); color: var(--paper-ink); font-family: var(--font-label); font-size: 9px; letter-spacing: .13em; text-transform: uppercase; white-space: nowrap; }
.gallery-sprig { position: absolute; z-index: 9; right: -12%; bottom: 1%; width: 46%; transform: rotate(15deg); }

/* SCRATCH REVEAL */
.scratch-composition { min-height: 590px; margin-top: -35px; }
.scratch-envelope-body { position: absolute; z-index: 2; top: 23%; left: -6%; width: 112%; filter: drop-shadow(0 24px 24px rgba(24,0,2,.38)); }
.scratch-envelope-flap { position: absolute; z-index: 3; top: 17%; left: -6%; width: 112%; transform-origin: 50% 93%; transform: perspective(800px) rotateX(12deg); }
.scratch-heading { position: absolute; z-index: 5; top: 16%; left: 0; width: 100%; text-align: center; text-transform: uppercase; }
.scratch-heading p { margin: 0; font-family: var(--font-label); font-size: 10px; letter-spacing: .18em; }
.scratch-heading h2 { margin: 6px 0; font-family: var(--font-display); font-size: 19px; font-weight: 400; letter-spacing: .08em; }
.scratch-note { position: absolute; z-index: 6; top: 48%; left: 50%; display: grid; place-items: center; width: 74%; height: 150px; padding: 20px; transform: translateX(-50%) rotate(-1deg); text-align: center; }
.scratch-note p { margin: 0; font-family: var(--font-body); font-size: 15px; font-style: italic; line-height: 1.55; }
#scratchCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  transition: opacity 500ms ease;
}
#scratchCanvas.is-cleared { opacity: 0; pointer-events: none; }
.wax-seal--scratch { z-index: 8; top: 32%; left: 50%; width: 88px; transform: translateX(-50%); }

/* WEDDING DETAILS */
.details-composition { min-height: 660px; margin-top: -70px; }
.flower-details { position: absolute; z-index: 6; top: 20%; left: 50%; display: grid; place-items: center; width: 75%; aspect-ratio: 1; padding: 0; border: 0; color: var(--paper-ink); background: transparent; transform: translateX(-50%); cursor: pointer; }
.flower-shape { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 22px 20px rgba(24,0,2,.36)); transition: transform 650ms cubic-bezier(.22,1,.36,1); }
.flower-details__copy { z-index: 1; display: grid; gap: 9px; text-transform: uppercase; }
.flower-details__copy small { font-family: var(--font-display); font-size: 18px; letter-spacing: .12em; }
.flower-details__copy strong { font-family: var(--font-label); font-size: 10px; font-weight: 500; letter-spacing: .16em; }
.detail-slips { position: absolute; z-index: 4; top: 25%; left: 50%; width: 88%; height: 390px; transform: translateX(-50%); }
.detail-slips article { position: absolute; display: grid; gap: 4px; width: 48%; padding: 17px 14px; color: var(--paper-ink); background: var(--aged-paper) url("assets/generated/paper-texture.webp") center / 350px auto; box-shadow: 0 12px 20px rgba(28,0,2,.27); opacity: 0; transition: transform 650ms cubic-bezier(.22,1,.36,1), opacity 340ms ease; }
.detail-slips b { color: var(--burgundy); font-family: var(--font-display); font-size: 12px; font-weight: 500; text-transform: uppercase; }
.detail-slips span { font-size: 11px; line-height: 1.45; }
.detail-slips article:nth-child(1) { top: 10%; left: 18%; transform: translate(25%, 75%) rotate(-4deg); }
.detail-slips article:nth-child(2) { top: 8%; right: 18%; transform: translate(-25%, 75%) rotate(4deg); }
.detail-slips article:nth-child(3) { top: 40%; left: 14%; transform: translate(35%, 15%) rotate(-3deg); }
.detail-slips article:nth-child(4) { top: 40%; right: 14%; transform: translate(-35%, 15%) rotate(3deg); }
.detail-slips article:nth-child(5) { bottom: 2%; left: 17%; transform: translate(26%, -45%) rotate(-2deg); }
.detail-slips article:nth-child(6) { right: 17%; bottom: 2%; transform: translate(-26%, -45%) rotate(2deg); }
.details-composition.is-expanded .flower-shape { transform: rotate(3deg); }
.details-composition.is-expanded .flower-details.reveal-object.is-visible { transform: translateX(-50%) translateY(-82px) scale(.76); }
.details-composition.is-expanded .flower-details { z-index: 10; }
.details-composition.is-expanded .detail-slips { z-index: 7; }
.details-composition.is-expanded .detail-slips article:nth-child(1) { transform: translate(-25%, -150%) rotate(-8deg); }
.details-composition.is-expanded .detail-slips article:nth-child(2) { transform: translate(25%, -150%) rotate(8deg); }
.details-composition.is-expanded .detail-slips article:nth-child(3) { transform: translate(-18%, 40%) rotate(-7deg); }
.details-composition.is-expanded .detail-slips article:nth-child(4) { transform: translate(18%, 40%) rotate(7deg); }
.details-composition.is-expanded .detail-slips article:nth-child(5) { transform: translate(-18%, 128%) rotate(-5deg); }
.details-composition.is-expanded .detail-slips article:nth-child(6) { transform: translate(18%, 128%) rotate(5deg); }
.details-composition.is-expanded .detail-slips article { opacity: 1; }
.details-doves { position: absolute; z-index: 7; top: 11%; left: 50%; width: 48%; color: var(--antique-gold); transform: translateX(-50%); opacity: .75; }
.details-floral { position: absolute; z-index: 8; right: -10%; bottom: 0; width: 44%; transform: rotate(-6deg); }

/* RSVP */
.rsvp-composition { min-height: 730px; margin-top: -45px; }
.rsvp-card { position: absolute; z-index: 4; top: 6%; left: 50%; width: 82%; height: 530px; transform: translateX(-50%) rotate(-1deg); }
.scalloped-shape { position: absolute; inset: 0; color: var(--invite-ivory); background: currentColor url("assets/generated/paper-texture.webp") center / 420px auto; -webkit-mask: url("assets/generated/scalloped-card.svg") center / 100% 100% no-repeat; mask: url("assets/generated/scalloped-card.svg") center / 100% 100% no-repeat; filter: drop-shadow(0 24px 24px rgba(25,0,2,.34)); }
.rsvp-card__content { position: relative; z-index: 1; display: grid; place-items: center; height: 100%; padding: 60px 40px 70px; color: var(--paper-ink); text-align: center; }
.rsvp-card h2 { margin: 9px 0 21px; color: var(--burgundy); font-family: var(--font-display); font-size: 60px; font-weight: 400; letter-spacing: .09em; }
.rsvp-card p { margin: 0; font-family: var(--font-body); font-size: 13px; line-height: 1.7; }
.rsvp-card__content > button { margin-top: 42px; padding: 13px 26px; border: 0; border-radius: 999px; color: var(--invite-ivory); background: var(--burgundy-alt); box-shadow: 0 7px 12px rgba(50,5,8,.24); font-family: var(--font-label); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.rsvp-paper { position: absolute; z-index: 12; top: 5%; left: 50%; width: min(88%, 390px); min-height: 560px; padding: 64px 34px 34px; transform: translate(-50%, 16px) scale(.96); opacity: 0; pointer-events: none; transition: transform 420ms cubic-bezier(.22,1,.36,1), opacity 260ms ease; }
.rsvp-composition.is-open .rsvp-paper { transform: translate(-50%, 0) scale(1); opacity: 1; pointer-events: auto; }
.rsvp-composition.is-open::after { content: ""; position: absolute; z-index: 11; inset: 0; background: rgba(39,4,6,.52); backdrop-filter: blur(3px); }
.rsvp-close { position: absolute; top: 20px; right: 22px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0 0 3px; border: 1px solid rgba(74,8,13,.34); border-radius: 50%; color: var(--burgundy); background: transparent; font-family: Georgia, serif; font-size: 25px; line-height: 1; cursor: pointer; }
.rsvp-paper label { display: grid; gap: 5px; margin-bottom: 20px; color: var(--burgundy); font-family: var(--font-label); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.rsvp-paper input:not([type="radio"]), .rsvp-paper textarea { width: 100%; padding: 8px 2px; border: 0; border-bottom: 1px solid rgba(74,8,13,.42); outline: none; color: var(--paper-ink); background: transparent; font-family: var(--font-body); font-size: 16px; text-transform: none; }
.rsvp-paper fieldset { display: flex; gap: 25px; margin: 0 0 20px; padding: 0; border: 0; }
.rsvp-paper legend { width: 100%; margin-bottom: 8px; color: var(--burgundy); font-family: var(--font-label); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.rsvp-paper fieldset label { display: inline-flex; grid: none; align-items: center; gap: 6px; margin: 0; color: var(--paper-ink); font-family: Georgia, serif; font-size: 12px; letter-spacing: 0; text-transform: none; }
.rsvp-paper button[type="submit"] { display: block; margin: 28px auto 0; padding: 12px 22px; border: 0; color: var(--invite-ivory); background: var(--burgundy); font-family: var(--font-label); font-size: 10px; letter-spacing: .15em; text-transform: uppercase; cursor: pointer; }
.rsvp-success { min-height: 22px; margin: 15px 0 0; color: var(--burgundy); font-family: Georgia, serif; font-size: 13px; font-style: italic; text-align: center; }
.rsvp-stamp { position: absolute; z-index: 7; top: 3%; right: 3%; width: 82px; transform: rotate(8deg); }
.rsvp-floral { position: absolute; z-index: 7; left: -10%; bottom: 0; width: 48%; transform: rotate(9deg); }
.rsvp-polaroid { position: absolute; z-index: 2; right: -8%; bottom: 8%; width: 138px; height: 205px; margin: 0; transform: rotate(9deg); }
.rsvp-polaroid span { position: absolute; z-index: 1; top: 7.3%; left: 9.4%; width: 81.2%; height: 71.5%; overflow: hidden; background: #4b302d; }
.rsvp-polaroid span img { width: 100%; height: 100%; object-fit: cover; }
.rsvp-polaroid img { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.wax-seal--rsvp { z-index: 8; top: 51%; right: 3%; width: 66px; }

/* COUNTDOWN */
.countdown-composition { min-height: 300px; margin-top: -85px; }
.countdown-strip { position: absolute; z-index: 3; top: 20px; left: -3%; width: 106%; padding: 53px 24px 45px; text-align: center; clip-path: polygon(0 4%, 10% 1%, 23% 3%, 39% 0, 55% 3%, 70% 1%, 86% 4%, 100% 1%, 99% 96%, 86% 99%, 72% 97%, 56% 100%, 42% 97%, 25% 100%, 11% 97%, 0 99%); }
.countdown-strip h2 { margin: 0 0 30px; color: var(--burgundy); font-family: var(--font-display); font-size: 16px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); }
.countdown span { display: grid; gap: 5px; border-right: 1px solid rgba(74,8,13,.22); }
.countdown span:last-child { border-right: 0; }
.countdown b { font-family: var(--font-display); font-size: 32px; font-weight: 400; line-height: 1; }
.countdown small { font-family: var(--font-label); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }

/* FINAL NOTE */
.final-composition { min-height: 650px; margin-top: -35px; padding-bottom: max(24px, env(safe-area-inset-bottom)); overflow: visible; }
.final-paper-back { position: absolute; z-index: 1; top: 0; left: -3%; width: 106%; transform: rotate(2deg); opacity: .72; }
.final-note { position: absolute; z-index: 4; top: 21%; left: 50%; width: 77%; min-height: 400px; padding: 95px 30px 55px; transform: translateX(-50%) rotate(-1deg); text-align: center; clip-path: polygon(2% 1%, 98% 0, 100% 95%, 95% 100%, 3% 98%, 0 5%); }
.final-note > p { margin: 0 0 48px; color: var(--burgundy); font-family: var(--font-display); font-size: 18px; letter-spacing: .1em; line-height: 1.5; text-transform: uppercase; }
.final-note > span { font-family: var(--font-body); font-size: 14px; font-style: italic; }
.final-note h2 { margin: 9px 0 52px; color: var(--burgundy-alt); font-family: var(--font-script); font-size: 31px; font-weight: 400; }
.final-note small { font-family: var(--font-label); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.final-floral { position: absolute; z-index: 6; right: -11%; bottom: 3%; width: 53%; }
.final-stamp { position: absolute; z-index: 6; top: 12%; right: 5%; width: 75px; transform: rotate(9deg); }
.wax-seal--final { z-index: 7; top: 68%; left: 12%; width: 67px; }

/* AMBIENT BOTANICAL MOTION */
:is(.hero-floral--left, .hero-floral--right, .event-sprig, .gallery-sprig, .details-floral, .rsvp-floral, .final-floral) {
  animation: botanical-drift var(--botanical-duration, 12s) ease-in-out var(--botanical-delay, 0s) infinite;
  transform-origin: 50% 78%;
  will-change: translate, rotate;
}

.hero-floral--left { --botanical-x: 2px; --botanical-y: -4px; --botanical-r: .75deg; --botanical-duration: 11.5s; --botanical-delay: -2.4s; }
.hero-floral--right { --botanical-x: -2px; --botanical-y: -3px; --botanical-r: -.6deg; --botanical-duration: 13.2s; --botanical-delay: -7.1s; }
.event-sprig { --botanical-x: -2px; --botanical-y: -4px; --botanical-r: -.7deg; --botanical-duration: 10.8s; --botanical-delay: -4.8s; }
.gallery-sprig { --botanical-x: 2px; --botanical-y: -5px; --botanical-r: .7deg; --botanical-duration: 12.6s; --botanical-delay: -8.2s; }
.details-floral { --botanical-x: -2px; --botanical-y: -4px; --botanical-r: -.65deg; --botanical-duration: 11.8s; --botanical-delay: -1.6s; }
.rsvp-floral { --botanical-x: 2px; --botanical-y: -3px; --botanical-r: .55deg; --botanical-duration: 13.6s; --botanical-delay: -9.4s; }
.final-floral { --botanical-x: -2px; --botanical-y: -4px; --botanical-r: -.5deg; --botanical-duration: 12.2s; --botanical-delay: -5.5s; }

.flower-shape {
  animation: flower-breathe 9.5s ease-in-out -3s infinite;
  transform-origin: 50% 58%;
  will-change: scale, rotate;
}

@keyframes botanical-drift {
  0%, 100% { translate: 0 0; rotate: 0deg; }
  50% { translate: var(--botanical-x, 2px) var(--botanical-y, -4px); rotate: var(--botanical-r, .6deg); }
}

@keyframes flower-breathe {
  0%, 100% { scale: 1; rotate: 0deg; }
  50% { scale: 1.012; rotate: .35deg; }
}

/* SCROLL ANIMATIONS */
.reveal-object { opacity: 0; transform: translateY(12px); transition: opacity 700ms ease, transform 800ms cubic-bezier(.22,1,.36,1); }
.reveal-object.is-visible { opacity: 1; }
.hero-paper.reveal-object.is-visible { transform: translateX(-50%) rotate(-.7deg); }
.event-tag.reveal-object.is-visible { transform: translateX(-50%); }
.section-heading.reveal-object.is-visible { transform: translateY(0); }
.scratch-heading.reveal-object.is-visible { transform: translateY(0); }
.flower-details.reveal-object.is-visible { transform: translateX(-50%); }
.rsvp-card.reveal-object.is-visible { transform: translateX(-50%) rotate(-1deg); }
.countdown-strip.reveal-object.is-visible { transform: translateY(0); }
.final-note.reveal-object.is-visible { transform: translateX(-50%) rotate(-1deg); }
.event-composition.is-expanded .event-tag.reveal-object.is-visible { transform: translate(-50%, -8px) scale(.91); }

/* RESPONSIVE */
@media (min-width: 471px) {
  body[data-state="opened"] { background: #170204; }
  .invitation-world { box-shadow: 0 0 70px rgba(0,0,0,.55); }
}

@media (max-width: 600px), (hover: none), (pointer: coarse) {
  .invitation-world { display: block; }

  .event-composition { margin-top: -15px; }
  .gallery-composition { margin-top: -20px; }
  .scratch-composition { margin-top: -15px; }
  .details-composition { margin-top: -20px; }
  .rsvp-composition { margin-top: -15px; }
  .countdown-composition { margin-top: -25px; }
  .final-composition { margin-top: -15px; }

  .reveal-object,
  .reveal-object.is-visible {
    opacity: 1;
    transition: none;
  }

  .polaroid-stack { pointer-events: none; }

  .rsvp-composition.is-open::after {
    backdrop-filter: none;
  }

  .event-composition {
    min-height: 700px;
    transition: min-height 420ms ease;
  }

  .event-composition.is-expanded {
    min-height: 810px;
  }

  .event-composition.is-expanded .event-tag,
  .event-composition.is-expanded .event-tag.reveal-object.is-visible {
    transform: translate(-50%, -35px) scale(.86);
    transform-origin: 50% 0;
  }

  .event-composition.is-expanded .event-slips {
    top: 500px;
    z-index: 9;
    display: grid;
    gap: 11px;
    width: 84%;
    height: auto;
  }

  .event-composition.is-expanded .event-slip,
  .event-composition.is-expanded .event-slip--ceremony,
  .event-composition.is-expanded .event-slip--reception {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 0;
    padding: 17px 20px;
    opacity: 1;
    transform: none;
  }

  .event-composition.is-expanded .event-sprig {
    z-index: 2;
    opacity: .18;
  }

  .details-composition {
    min-height: 620px;
    transition: min-height 420ms ease;
  }

  .details-composition.is-expanded {
    min-height: 780px;
  }

  .details-composition.is-expanded .flower-details,
  .details-composition.is-expanded .flower-details.reveal-object.is-visible {
    top: 1%;
    z-index: 10;
    width: 46%;
    transform: translateX(-50%) scale(.88);
  }

  .details-composition.is-expanded .detail-slips {
    top: 205px;
    left: 14%;
    z-index: 7;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 72%;
    height: auto;
    transform: none;
  }

  .details-composition.is-expanded .detail-slips article {
    position: relative;
    inset: auto !important;
    width: 100%;
    min-height: 76px;
    padding: 14px 17px;
    opacity: 1;
    transform: none !important;
  }

  .details-composition.is-expanded :is(.details-doves, .details-floral) {
    z-index: 2;
    opacity: .18;
  }
}

@media (max-width: 375px) {
  .hero-paper { min-height: 405px; padding-top: 66px; }
  .hero-paper h1 {
  font-size: 32px;
  line-height: 1;
}
  .event-tag { width: 79%; }
  .event-tag__copy { inset-inline: 15%; }
  .gallery-arrow--previous { left: 5%; }
  .gallery-arrow--next { right: 5%; }
  .rsvp-card__content { padding-inline: 32px; }
  .rsvp-paper { width: 90%; padding-inline: 28px; }
  .countdown b { font-size: 28px; }
}

.reset-control {
  position: fixed;
  right: 18px;
  bottom: 16px;
  z-index: 20;
  display: none;
  padding: 8px;
  border: 0;
  color: rgba(255, 255, 255, 0.4);
  background: transparent;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

body[data-state="opened"] .reset-control {
  color: rgba(39, 35, 31, 0.44);
}

.reset-control:hover,
.reset-control:focus-visible {
  color: currentColor;
  text-decoration: underline;
  text-underline-offset: 4px;
}

@media (min-width: 768px) and (hover: hover) {
  .reset-control { display: block; }
}

@media (max-height: 680px) {
  .object-stage {
    width: clamp(178px, 48vw, 216px);
    height: calc(100dvh - 76px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .instruction {
    transform: translateY(3px);
  }
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
  :root {
    --reveal-duration: 180ms;
    --open-duration: 180ms;
  }

  .tap-mark::before {
    animation: none;
    opacity: 0.4;
  }

  body[data-state="revealing"] .photo-strip {
    animation: none;
    transform: translate3d(-50%, 0, 0);
  }

  body[data-state="revealed"] .instruction {
    animation-duration: 180ms;
  }

  .reveal-object {
    opacity: 1;
    transition: none;
  }

  .hero-paper > * {
    opacity: 1;
    clip-path: none;
    transform: none;
    animation: none !important;
  }

  :is(.hero-floral--left, .hero-floral--right, .event-sprig, .gallery-sprig, .details-floral, .rsvp-floral, .final-floral, .flower-shape) {
    animation: none !important;
    translate: none;
    rotate: none;
    scale: none;
  }
}



/* ==================== WEDSMINT OVERLAY ==================== */
.wedsmint-demo-badge {
  position: fixed !important;
  top: 18px !important;
  left: 18px !important;
  z-index: 99999 !important;
  padding: 8px 14px !important;
  border-radius: 999px !important;
  background: rgba(20, 20, 20, 0.75) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  color: #ffffff !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  pointer-events: none !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
  display: block !important;
}

.wedsmint-preview-cta {
  position: fixed !important;
  right: 20px !important;
  bottom: 20px !important;
  z-index: 99999 !important;
  border: none !important;
  border-radius: 999px !important;
  padding: 14px 22px !important;
  background: #111111 !important;
  color: #ffffff !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em !important;
  cursor: pointer !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25) !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease !important;
  display: block !important;
}

.wedsmint-preview-cta:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35) !important;
}

.wedsmint-cta-modal {
  opacity: 0 !important;
  visibility: hidden !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 100000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px !important;
  transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

.wedsmint-cta-modal.is-open {
  opacity: 1 !important;
  visibility: visible !important;
}

.wedsmint-cta-backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
}

.wedsmint-cta-card {
  position: relative !important;
  z-index: 1 !important;
  background: #ffffff !important;
  color: #111111 !important;
  padding: 36px 28px 28px !important;
  border-radius: 20px !important;
  max-width: 420px !important;
  width: 100% !important;
  text-align: center !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3) !important;
  transform: translateY(15px) scale(0.97) !important;
  transition: transform 0.3s ease !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
}

.wedsmint-cta-modal.is-open .wedsmint-cta-card {
  transform: translateY(0) scale(1) !important;
}

.wedsmint-cta-close {
  position: absolute !important;
  top: 12px !important;
  right: 15px !important;
  width: 34px !important;
  height: 34px !important;
  border: none !important;
  background: transparent !important;
  color: #222222 !important;
  font-size: 25px !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

.wedsmint-cta-eyebrow {
  display: block !important;
  margin-bottom: 12px !important;
  font-family: Arial, sans-serif !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  letter-spacing: 0.22em !important;
  color: #888888 !important;
}

.wedsmint-cta-card h3 {
  margin: 0 0 12px !important;
  font-size: 28px !important;
  font-weight: 500 !important;
  color: #111111 !important;
}

.wedsmint-cta-card p {
  margin: 0 auto 25px !important;
  max-width: 310px !important;
  font-family: Arial, sans-serif !important;
  font-size: 13px !important;
  line-height: 1.65 !important;
  color: #666666 !important;
}

.wedsmint-instagram-btn {
  display: block !important;
  padding: 14px 20px !important;
  border-radius: 999px !important;
  background: #111111 !important;
  color: #ffffff !important;
  font-family: Arial, sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  transition: transform 0.2s ease !important;
}

.wedsmint-instagram-btn:hover {
  transform: translateY(-1px) !important;
}
