/* Save the Date */

:root {
  color-scheme: light;

  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-script: "Pinyon Script", "Snell Roundhand", cursive;
  --font-label: "Jost", "Helvetica Neue", Arial, sans-serif;
  --font-sign: "Mrs Saint Delafield", "Pinyon Script", cursive;

  /* Ivory + pastel pink (default) */
  --c-bg: #faf5ec;
  --c-paper: #fffdf8;
  --c-card: #fffaf0;
  --c-tint: #f9ece8;
  --c-tint-2: #f3dcdc;
  --c-primary: #ecbcc5;
  --c-primary-deep: #bd6f82;
  --c-btn: #a65a6c;
  --c-ink: #5a3f45;
  --c-ink-soft: #84676d;
  --c-pen: #4f4a64;
  --c-line: #ecd3d3;
  --c-seal-light: #f6d9de;
  --c-seal: #dfa0ae;
  --c-seal-deep: #b0687a;
  --c-alt: #f0c4cc;
  --c-alt-ink: #6b3a47;
  --c-leaf: #cdd8c3;
  --c-leaf-deep: #94a98a;
  --c-petal-light: #fff7f4;
  --c-petal-mid: #f4c6ce;
  --c-petal-deep: #dc92a3;
  --c-env: #f6e6e2;
  --c-env-side: #eed6d3;
  --c-env-bottom: #f9ede9;
  --c-liner: #f3d3d8;

  --shadow-card: 0 1px 1px rgb(94 60 69 / 5%), 0 14px 30px -14px rgb(94 60 69 / 32%);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--c-bg);
  color: var(--c-ink);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: .5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .3 0 0 0 0 .33 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

body.locked { overflow: hidden; }

p { margin: 0; }
button { font: inherit; color: inherit; }
dialog { color: inherit; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.label {
  font-family: var(--font-label);
  font-size: .66rem;
  font-weight: 500;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--c-ink-soft);
}

.script {
  font-family: var(--font-script);
  font-weight: 400;
  line-height: 1;
  color: var(--c-primary-deep);
}

/* ---------- SVG paint (florals, seal) ---------- */

.s-petal-light { stop-color: var(--c-petal-light); }
.s-petal-mid { stop-color: var(--c-petal-mid); }
.s-petal-deep { stop-color: var(--c-petal-deep); }
.s-white { stop-color: #fff; }
.s-leaf { stop-color: var(--c-leaf); }
.s-leaf-deep { stop-color: var(--c-leaf-deep); }
.s-seal-light { stop-color: var(--c-seal-light); }
.s-seal { stop-color: var(--c-seal); }
.s-seal-deep { stop-color: var(--c-seal-deep); }

.petals { stroke: var(--c-petal-deep); stroke-opacity: .3; stroke-width: .6; }
.swirl { fill: none; stroke: var(--c-petal-deep); stroke-width: 1; stroke-opacity: .6; stroke-linecap: round; }
.vein, .stem { fill: none; stroke: var(--c-leaf-deep); stroke-linecap: round; }
.vein { stroke-width: .8; stroke-opacity: .55; }
.stem { stroke-width: 1.4; stroke-opacity: .85; }
.euc { fill: url(#g-leaf-soft); stroke: var(--c-leaf-deep); stroke-opacity: .35; stroke-width: .5; }
.berry { fill: var(--c-petal-deep); }
.leaf-fill { fill: var(--c-leaf-deep); }

.flora {
  display: block;
  position: absolute;
  pointer-events: none;
  overflow: visible;
  height: auto;
  filter: drop-shadow(0 6px 8px rgb(94 60 69 / 18%));
}

/* ---------- Intro: closed envelope on draped fabric ---------- */

.grain { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

.intro {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #efe9df;
  transition: opacity 1s ease, visibility 1s;
}

.intro.is-done { opacity: 0; visibility: hidden; }
.intro.is-done .drape { animation: none; }

/* Drop a real fabric photo at assets/img/drape.jpg and it covers the CSS version */
.drape {
  position: absolute;
  inset: -4%;
  background:
    url("../img/drape.jpg") center / cover no-repeat,
    radial-gradient(60% 40% at 50% -5%, #fffdf8 0%, transparent 70%),
    repeating-linear-gradient(97deg, rgb(255 255 255 / 0%) 0 38px, rgb(255 255 255 / 55%) 70px, rgb(205 195 178 / 35%) 102px, rgb(255 255 255 / 0%) 150px),
    repeating-linear-gradient(83deg, rgb(215 204 186 / 0%) 0 90px, rgb(215 204 186 / 40%) 140px, rgb(255 255 255 / 0%) 210px),
    linear-gradient(180deg, #f6f1e7, #e7dfd0);
  filter: blur(1.2px);
  transform-origin: 50% 0;
  animation: sway 14s ease-in-out infinite alternate;
}

@keyframes sway { to { transform: scale(1.04) skewX(-.8deg); } }

.intro__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 4vh, 40px);
  width: 100%;
  padding: 0 16px;
  transition: opacity .7s ease, transform .9s var(--ease-out);
}

.mail { margin: 0; text-align: center; font-family: var(--font-flow); font-size: clamp(3.6rem, 17vw, 6.4rem); line-height: .95; transform: rotate(-4deg); color: var(--c-deep); text-shadow: 0 1px 0 rgb(255 255 255 / 40%); }

.env2 {
  --w: min(80vw, 400px);
  position: relative;
  width: var(--w);
  aspect-ratio: 3 / 2;
  margin-top: clamp(8px, 4vh, 36px);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  filter: drop-shadow(0 22px 24px rgb(80 40 50 / 30%));
  -webkit-tap-highlight-color: transparent;
  animation: bob 4s ease-in-out infinite;
}

@keyframes bob { 50% { transform: translateY(-7px); } }

.env2:focus-visible { outline: 2px solid var(--c-deep); outline-offset: 10px; }
.env2 > span { position: absolute; display: block; }

.env2__body {
  inset: 0;
  border-radius: 3px;
  background:
    linear-gradient(160deg, rgb(255 255 255 / 10%), transparent 40%),
    #a65468;
}

.env2__body::after, .env2__side::after, .env2__bottom::after, .env2__flap::after {
  content: "";
  position: absolute;
  inset: 0;
  mix-blend-mode: multiply;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .1 0 0 0 0 .15 0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.env2__side { top: 0; bottom: 0; width: 100%; }
.env2__side--l { left: 0; background: linear-gradient(90deg, #8f4256, #a95a6e); clip-path: polygon(0 0, 54% 53%, 0 100%); }
.env2__side--r { right: 0; background: linear-gradient(270deg, #8f4256, #a95a6e); clip-path: polygon(100% 0, 46% 53%, 100% 100%); }
.env2__bottom { inset: 0; background: linear-gradient(0deg, #b46478, #9d4d62); clip-path: polygon(0 100%, 50% 42%, 100% 100%); }

.env2__flap {
  left: 0;
  right: 0;
  top: 0;
  height: 62%;
  background: linear-gradient(180deg, #a85a6e, #96465b);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0;
  transform: perspective(1000px) rotateX(0);
  transition: transform .9s cubic-bezier(.5, 0, .2, 1) .15s, background .3s ease .45s;
}

.env2__seal {
  left: 50%;
  top: 62%;
  z-index: 3;
  width: 11%;
  translate: -50% -50%;
  filter: drop-shadow(0 2px 2px rgb(60 30 30 / 35%));
  transition: transform .5s var(--ease-out), opacity .4s ease;
}

.env2__seal svg { display: block; width: 100%; height: auto; }

.env2__open {
  left: 0;
  right: 0;
  bottom: 9%;
  z-index: 3;
  text-align: center;
  font-family: var(--font-title);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: clamp(.9rem, 3.4vw, 1.15rem);
  color: #f6e4e4;
  transition: opacity .3s ease;
}

.env2.is-open { animation: none; cursor: default; }
.env2.is-open .env2__flap { transform: perspective(1000px) rotateX(180deg); background: #7d3a4d; }
.env2.is-open .env2__seal { transform: scale(1.25) translateY(-30%); opacity: 0; }
.env2.is-open .env2__open { opacity: 0; }
.intro.is-opening .mail { opacity: 0; transition: opacity .5s ease; }

.pm-ring { fill: none; stroke: var(--c-ink-soft); stroke-opacity: .55; stroke-width: 1.4; }
.pm-ring--thin { stroke-width: .8; }
.pm-text { font-family: var(--font-label); font-size: 6.4px; letter-spacing: .12em; fill: var(--c-ink-soft); fill-opacity: .7; }
.pm-date { font-family: var(--font-label); font-size: 8px; font-weight: 500; letter-spacing: .08em; fill: var(--c-ink-soft); fill-opacity: .7; }
.pm-wave { fill: none; stroke: var(--c-ink-soft); stroke-opacity: .3; stroke-width: .9; }

/* ---------- Vintage postcard layout ---------- */

:root {
  --font-title: "Italiana", "Cormorant Garamond", serif;
  --font-flow: "Ballet", "Pinyon Script", cursive;
  --c-band: #b9677b;
  --c-deep: #9d4c61;
}

.site { position: relative; z-index: 1; overflow-x: clip; outline: none; padding-bottom: 80px; }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform 1.1s var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }

.invited, .follow {
  margin: 0;
  text-align: center;
  font-family: var(--font-title);
  font-weight: 400;
  text-transform: uppercase;
  color: var(--c-deep);
  line-height: 1.1;
}

.invited { padding: 40px 16px 8px; font-size: clamp(2rem, 8vw, 3.2rem); letter-spacing: .02em; }
.follow { padding: 48px 16px 64px; font-size: clamp(1.4rem, 5.6vw, 2.2rem); letter-spacing: .03em; }

.scene { position: relative; width: min(100%, 560px); margin: 0 auto; padding: 0 4%; }

/* open envelope */
.oenv { position: relative; aspect-ratio: 1 / .92; margin: 0 6%; }
.oenv span, .oenv p { position: absolute; }
.oenv__back { inset: 36% 0 0; background: linear-gradient(180deg, var(--c-env-side), var(--c-env)); border-radius: 3px; box-shadow: var(--shadow-card); }
.oenv__flap { left: 0; right: 0; top: 4%; height: 48%; background: linear-gradient(180deg, var(--c-env), var(--c-env-side)); clip-path: polygon(0 100%, 50% 0, 100% 100%); filter: drop-shadow(0 -1px 2px rgb(94 60 69 / 15%)); }
.oenv__flap::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(255 255 255 / 35%), transparent); clip-path: polygon(0 100%, 50% 0, 100% 100%); }
.oenv__seal { left: 50%; top: 0; z-index: 3; width: 17%; translate: -50% 0; filter: drop-shadow(0 3px 3px rgb(94 60 69 / 25%)); }
.oenv__to { left: 0; right: 0; top: 24%; z-index: 2; text-align: center; font-family: var(--font-title); text-transform: uppercase; font-size: clamp(1.1rem, 4.6vw, 1.7rem); line-height: 1.12; color: var(--c-deep); }
.oenv__front { left: 0; right: 0; top: 38%; bottom: 0; background: linear-gradient(180deg, var(--c-env-side), var(--c-env)); clip-path: polygon(0 0, 50% 38%, 100% 0, 100% 100%, 0 100%); }

/* photo card overlapping the envelope */
.photo-card {
  position: relative;
  z-index: 4;
  width: 96%;
  margin: -34% 0 0 -2%;
  padding: 3.5%;
  background: var(--c-card);
  box-shadow: var(--shadow-card);
  transform: rotate(-3.5deg);
}

.photo-card__img { position: relative; aspect-ratio: 3 / 2; overflow: hidden; }
.photo-card .ph { position: absolute; inset: 0; background: radial-gradient(70% 60% at 30% 25%, rgb(255 255 255 / 25%), transparent 70%), linear-gradient(160deg, #c8929e, #8d5565 70%, #6e3f4d); }
.photo-card .ph .label { color: #fff; opacity: .6; position: absolute; top: 50%; left: 0; right: 0; text-align: center; }
.photo-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
@font-face { font-family: "Cormorant SC"; src: url("../fonts/Cormorant_SC/CormorantSC-Light.ttf") format("truetype"); font-style: normal; font-weight: 300; font-display: swap; }
.photo-card__date { position: absolute; top: 5%; left: 4%; font-family: "Cormorant SC", serif; font-weight: 300; font-size: clamp(1.3rem, 6vw, 2.2rem); color: #fff; letter-spacing: .02em; text-shadow: 0 1px 10px rgb(94 60 69 / 45%); }
.photo-card__names { position: absolute; left: 4%; bottom: 2%; display: flex; align-items: baseline; font-family: "Cormorant SC", serif; font-weight: 300; text-transform: uppercase; font-size: clamp(1.3rem, 6.4vw, 2.4rem); color: #fff; line-height: 1; text-shadow: 0 1px 12px rgb(94 60 69 / 45%); }
.photo-card__names .script { color: #fff; font-family: "Cormorant SC", serif; font-weight: 300; font-size: 1.15em; margin: 0 .04em; text-transform: none; }

.flora--lily { z-index: 5; width: 36%; right: -3%; top: 19%; transform: rotate(-14deg); }

/* postcard */
.postcard {
  position: relative;
  z-index: 3;
  width: 98%;
  margin: -3% 0 0 3%;
  padding: 7% 6% 6%;
  background: #fbf8f3;
  box-shadow: var(--shadow-card);
  transform: rotate(3.5deg);
}

.postcard__head { text-align: center; padding-right: 16%; padding-left: 16%; }
.postcard__title { margin: 0; font-family: var(--font-title); font-weight: 400; text-transform: uppercase; font-size: clamp(1.5rem, 6.6vw, 2.4rem); line-height: 1; color: var(--c-deep); }
.postcard__title .script { font-family: var(--font-flow); text-transform: none; font-size: 1.1em; margin: 0 .05em; }
.postcard__sub { margin-top: 4px; font-style: italic; font-size: 1.05rem; letter-spacing: .08em; color: var(--c-ink-soft); }

.stamp { position: absolute; top: 5%; right: 4%; width: 13%; padding: 1.2%; background: #fff; box-shadow: 0 1px 3px rgb(94 60 69 / 25%); }
.stamp__img { aspect-ratio: 4 / 5; padding: 14%; background: var(--c-tint-2); }
.stamp__img svg { display: block; width: 100%; height: 100%; }
.postmark { position: absolute; top: 3%; right: 15%; width: 15%; height: auto; transform: rotate(-12deg); }

.postcard__row { display: grid; grid-template-columns: 1fr 1fr; gap: 3%; margin-top: 8%; }
.postcard__row p { display: flex; flex-direction: column; border-bottom: 1px solid rgb(120 100 100 / 30%); }
.postcard__row .label { font-size: .55rem; letter-spacing: .12em; }
.postcard__row .hand, .postcard__msg { font-family: var(--font-sign); color: var(--c-deep); }
.postcard__row .hand { font-family: var(--font-sign); font-size: clamp(1.5rem, 6.4vw, 2.1rem); line-height: 1.2; }
.postcard__msg { margin: 4% 0 0; font-size: clamp(1.7rem, 7.2vw, 2.5rem); line-height: 1.3; }
.postcard__msg > span { display: block; border-bottom: 1px solid rgb(120 100 100 / 30%); text-align: center; }
.postcard__sign { margin-top: 0; padding-bottom: 2px; border-bottom: 1px solid rgb(120 100 100 / 30%); text-align: right; font-size: clamp(1.6rem, 7vw, 2.3rem); color: var(--c-deep); }
.postcard__foot { margin-top: 4%; text-align: center; font-style: italic; font-size: 1rem; letter-spacing: .08em; color: var(--c-ink-soft); }

/* script band */
.band { background: var(--c-band); overflow: hidden; padding: 56px 0; }
.band__text { margin: 0; text-align: center; color: #fff; font-family: var(--font-flow); font-size: clamp(3rem, 14vw, 6rem); line-height: 1; transform: rotate(-8deg); padding: 0 4%; }
.band__text.reveal { transform: translateY(26px) rotate(-8deg); }
.band__text.reveal.is-in { transform: rotate(-8deg); }

/* countdown */
.count { position: relative; padding: 72px 16px 80px; text-align: center; color: #fff; overflow: hidden; }
.count__bg {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(100deg, rgb(255 255 255 / 16%) 0 22px, transparent 22px 60px),
    linear-gradient(180deg, #d9a3b0, #c98a9b);
}
.count__inner { position: relative; }
.count__title { margin: 0 0 18px; font-family: var(--font-title); font-weight: 400; text-transform: uppercase; font-size: clamp(1.5rem, 6vw, 2.3rem); letter-spacing: .02em; }
.count__nums { display: flex; justify-content: center; align-items: flex-start; gap: clamp(4px, 2vw, 14px); }
.count__nums div { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 3ch; }
.count__nums span { font-size: clamp(2.6rem, 12vw, 4.6rem); line-height: 1; font-variant-numeric: lining-nums tabular-nums; font-weight: 500; }
.count__nums b { font-size: clamp(2.2rem, 10vw, 4rem); line-height: 1; font-weight: 400; opacity: .8; }
.count__nums .label { color: rgb(255 255 255 / 85%); font-size: .55rem; font-style: normal; }
.count__nums span.flip { animation: flip .5s var(--ease-out); }

@keyframes flip { from { transform: rotateX(-80deg); opacity: .2; } }

.cal { padding: 56px 16px 0; text-align: center; }
.cal .label { margin-bottom: 16px; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 12px 22px;
  border: 1px solid var(--c-btn); border-radius: 999px;
  background: var(--c-btn); color: #fff;
  font-family: var(--font-label); font-size: .68rem; font-weight: 500;
  letter-spacing: .22em; text-transform: uppercase; text-decoration: none; cursor: pointer;
}

.btn:focus-visible { outline: 2px solid var(--c-btn); outline-offset: 3px; }
.btn--ghost { background: transparent; color: var(--c-btn); }

.foot { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 72px 16px 0; text-align: center; }
.foot__love { font-family: var(--font-title); text-transform: uppercase; letter-spacing: .06em; color: var(--c-deep); font-size: 1.2rem; }
.foot__names { font-family: var(--font-flow); font-size: clamp(2.6rem, 11vw, 4rem); color: var(--c-deep); }

.foot__back {
  margin-top: 28px; min-height: 44px; padding: 0 8px; border: 0; background: none; cursor: pointer;
  font-family: var(--font-label); font-size: .64rem; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--c-ink-soft);
}

.foot__back:hover { color: var(--c-btn); }

@media (min-width: 760px) {
  .scene { width: 600px; }
  .invited { padding-top: 64px; }
}


/* ---------- Scene colours and play-in sequence ---------- */

.scene { --env-back: #8c4357; --env-flap: #a05065; --env-front: #a95d72; }

.oenv__back { background: linear-gradient(180deg, #8a4156, var(--env-back)); }
.oenv__flap { background: linear-gradient(180deg, #a85b70, var(--env-flap)); }
.oenv__flap::after { background: linear-gradient(180deg, rgb(255 255 255 / 12%), transparent); }
.oenv__front { background: linear-gradient(180deg, #a95d72, #98495e); }
.oenv__to { color: #f7e6e3; left: 18%; right: 18%; top: 30%; font-size: clamp(.95rem, 3.8vw, 1.4rem); }
.invited { color: var(--c-deep); }

.site:not(.is-playing) .anim { opacity: 0; }

.is-playing .invited { animation: fade-in .9s ease .1s backwards; }
.is-playing .oenv__flap { transform-origin: 50% 100%; animation: flap-up 1.1s cubic-bezier(.4, 0, .2, 1) .15s backwards; }
.is-playing .oenv__seal { animation: seal-pop .7s var(--ease-out) .95s backwards; }
.is-playing .oenv__to span:nth-child(1) { animation: fade-in 1s ease 1.2s backwards; }
.is-playing .oenv__to span:nth-child(3) { animation: fade-in 1s ease 1.6s backwards; }
.is-playing .photo-card { animation: card-up 1.5s var(--ease-out) 1.5s backwards; }
.is-playing .flora--lily { animation: lily-in 1.2s var(--ease-out) 2.3s backwards; }
.is-playing .postcard { animation: card-up2 1.5s var(--ease-out) 2.1s backwards; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes flap-up { from { transform: perspective(900px) rotateX(-180deg); opacity: .6; } }
@keyframes seal-pop { from { opacity: 0; transform: scale(.2); } }
@keyframes card-up { from { opacity: 0; transform: translateY(70vh) rotate(-12deg); } }
@keyframes card-up2 { from { opacity: 0; transform: translateY(70vh) rotate(9deg); } }
@keyframes lily-in { from { opacity: 0; transform: translateY(-50px) rotate(20deg) scale(.85); } }

.photo-card, .postcard { position: relative; }
.photo-card::after, .postcard::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: multiply;
  opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .3 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Motion preferences ---------- */

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


/* ---------- Real reference graphics (assets/img/ref) ---------- */
.drape { filter: none; background: url("../img/drape.jpg") center / cover no-repeat, linear-gradient(180deg, #f6f1e7, #e7dfd0); }

.env2 { --w: min(82vw, 440px); aspect-ratio: 1078 / 745; filter: drop-shadow(0 22px 22px rgb(60 20 25 / 35%)); }
.env2__img { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .9s cubic-bezier(.5, 0, .2, 1), opacity .7s ease .3s; }
.env2__seal { left: 52%; top: 49%; width: 23%; height: auto; translate: -50% -50%; transform-origin: 50% 50%; filter: drop-shadow(0 4px 4px rgb(40 15 15 / 35%)); }
.env2__open { bottom: 8%; color: #f3dcd6; }
.env2.is-open .env2__img { opacity: 0; transform: translateY(-14px) scale(1.04); }
.env2.is-open .env2__seal { transform: translateY(-40%) scale(1.2); opacity: 0; }

.oenv { aspect-ratio: 1275 / 1330; margin: 0 4%; }
.oenv__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; }
.oenv__seal { top: 4%; left: 52%; width: 19%; height: auto; translate: -50% 0; }
.oenv__to { top: 25%; left: 20%; right: 20%; color: #f3dcd6; }
.is-playing .oenv__img { animation: flap-up 1.1s cubic-bezier(.4, 0, .2, 1) .15s backwards; transform-origin: 50% 100%; }

.flora--calla { width: 20%; right: 1%; top: 6%; transform: rotate(18deg); filter: drop-shadow(0 6px 8px rgb(60 20 25 / 25%)); }

.postcard { background: #fbf8f3 url("../img/ref/paper.png") center / 100% 100% no-repeat; }
.postcard::after, .photo-card::after { opacity: .25; }
.stamp { top: 3%; right: 3%; width: 15%; padding: 0; background: none; box-shadow: none; filter: drop-shadow(0 1px 2px rgb(60 20 25 / 30%)); }
.postmark { top: 3.5%; right: 12%; width: 27%; opacity: .8; transform: rotate(-4deg); }
.oenv__seal { position: absolute; }
.flora--calla { width: 30%; right: -2%; top: 9%; transform: rotate(24deg); }
.postmark { width: 21%; right: 14%; top: 4%; }
.oenv__seal { top: 7%; width: 16%; }
.oenv__to { top: 33%; }
.oenv__to span { position: static; display: inline-block; }

/* ---------- Layout pass: match the reference proportions and burgundy palette ---------- */
:root { --c-deep: #8a2c33; --c-band: #8a2c33; --c-pen: #8a2c33; }

.scene { width: min(100%, 720px); padding: 0 3%; }

/* envelope: larger, seal tucked behind the flap tip */
.oenv { margin: 0 2%; }
.oenv__img { z-index: 1; }
.oenv__seal { z-index: 0; top: -5%; width: 11%; }
.oenv__to { z-index: 2; top: 24%; left: 15%; right: 15%; font-size: clamp(1.5rem, 6vw, 2.8rem); line-height: 1.1; }

/* photo card: thin paper border, big date and names straddling the photo edges */
.photo-card { width: 94%; margin: -40% 0 0 0; padding: 4.5%; background: #fbf9f5 url("../img/ref/paper.png") center / 100% 100% no-repeat; transform: rotate(-4deg); }
.photo-card__img { overflow: visible; aspect-ratio: 3 / 2; }
.photo-card .ph { overflow: hidden; }
.photo-card__date { top: -4%; left: auto; right: 2%; font-size: clamp(1.8rem, 8vw, 3.6rem); text-shadow: 0 1px 12px rgb(0 0 0 / 35%); }
.photo-card__names { left: 1%; bottom: -8%; font-size: clamp(2rem, 9.2vw, 4rem); text-shadow: 0 1px 14px rgb(0 0 0 / 40%); }

/* two calla lilies lying across the photo card corner */
.flora--calla { position: absolute; z-index: 6; height: auto; filter: drop-shadow(0 6px 6px rgb(40 15 15 / 30%)); }
.flora--calla1 { width: 26%; right: 8%; top: 34%; transform: rotate(-78deg); transform-origin: 50% 50%; }
.flora--calla2 { width: 23%; right: 16%; top: 31%; transform: rotate(-88deg); transform-origin: 50% 50%; }
.is-playing .flora--calla1 { animation: lily-in 1.2s var(--ease-out) 2.3s backwards; }
.is-playing .flora--calla2 { animation: lily-in 1.2s var(--ease-out) 2.5s backwards; }

/* postcard */
.postcard { width: 100%; margin: -3% 0 0 0; transform: rotate(3.5deg); }
.postcard__title { font-size: clamp(1.8rem, 7.4vw, 3rem); }
.postcard__head { padding-right: 16%; }
.stamp { width: 12%; right: 3%; top: 4%; }
.postmark { width: 19%; right: 6.5%; top: 3%; }
.scene { width: min(100%, 800px); }
.invited { padding-bottom: 36px; }
.oenv__seal { top: -5%; width: 12%; }
.flora--calla1 { width: 36%; right: 2%; top: 31%; }
.flora--calla2 { width: 32%; right: 11%; top: 27%; }
.photo-card__names { left: 2%; right: 2%; bottom: 0%; font-size: clamp(1.4rem, 7vw, 3.3rem); white-space: nowrap; }

/* ---------- Seal centring and drape countdown ---------- */
.env2__seal { position: absolute; left: 50%; }
.oenv__seal { left: 50%; }

.count { color: var(--c-deep); padding: 96px 16px 104px; }
.count__bg { background: linear-gradient(rgb(250 246 238 / 25%), rgb(250 246 238 / 25%)), url("../img/drape.jpg") center 60% / cover no-repeat !important; opacity: 1 !important; animation: none; }
.count__nums .label { color: var(--c-deep); }
.count__nums span, .count__nums b { text-shadow: 0 1px 14px rgb(255 255 255 / 60%); }

/* open envelope: centre the envelope body (not the whole image incl. back sheet) on the scene axis */
.oenv__img { inset: 0 auto auto 8.8%; width: 94%; height: auto; object-fit: fill; }
.oenv__seal { width: 13%; top: -6%; }

/* ---------- Second reference comparison pass ---------- */
/* landing */
.mail { font-family: "Great Vibes", "Pinyon Script", cursive; font-size: clamp(3.8rem, 19vw, 7rem); transform: rotate(-11deg); line-height: .9; margin-bottom: -4px; }
.env2 { --w: min(74vw, 420px); margin-top: clamp(0px, 1vh, 12px); }
.env2__seal { width: 14%; top: 51%; }
.env2__open { font-size: clamp(1.1rem, 4.4vw, 1.5rem); bottom: 9%; }

/* open envelope text sits higher and smaller, as in the reference */
.oenv__to { top: 17%; font-size: clamp(1.15rem, 4.6vw, 2.1rem); }
.oenv__seal { width: 11%; }

/* photo card tucks higher, calla lilies cross its top edge */
.photo-card { margin-top: -48%; }
.flora--calla1, .flora--calla2 { position: absolute; z-index: 6; }
.flora--calla1 { width: 42%; left: 50%; top: -56%; right: auto; transform: rotate(-80deg); }
.flora--calla2 { width: 38%; left: 58%; top: -66%; right: auto; transform: rotate(-90deg); }

/* postcard handwriting a touch larger */
.postcard__row .hand { font-size: clamp(1.7rem, 7.2vw, 2.6rem); }
.postcard__msg { font-size: clamp(2rem, 8.6vw, 3.2rem); }
.postcard__sign { font-size: clamp(1.5rem, 6.4vw, 2.3rem); }

/* band: deeper red, bolder script, steeper tilt */
:root { --c-band: #6e130c; }
.band { padding: 72px 0 88px; }
.band__text { font-family: "Great Vibes", "Pinyon Script", cursive; font-size: clamp(3.4rem, 17vw, 7.2rem); line-height: 1.02; }
.photo-card { margin-top: -53%; }
.flora--calla1 { left: 57%; top: -36%; }
.flora--calla2 { left: 65%; top: -46%; }
.postcard__row .hand { font-size: clamp(1.5rem, 6.4vw, 2.2rem); }
.flora--calla1 { top: -41%; left: 55%; }
.flora--calla2 { top: -52%; left: 63%; }

/* Couple photo in the photo card: soft vintage grade and a gradient so the white date and names stay legible */
.photo-card__img { overflow: visible; }
.photo-card__img > img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:50% 60%; filter: sepia(.12) saturate(.92) contrast(1.02); }
.photo-card__img::after { content:""; position:absolute; inset:0; pointer-events:none; background: linear-gradient(to bottom, rgba(60,20,20,.28), transparent 28%, transparent 62%, rgba(60,20,20,.42)); }
.photo-card__date, .photo-card__names { z-index:2; text-shadow: 0 1px 8px rgba(40,10,10,.55); }

/* Larger closed envelope and a quicker open and play-in */
.env2 { --w: min(90vw, 600px); }
.env2__img { transition: transform .5s cubic-bezier(.5, 0, .2, 1), opacity .4s ease .1s; }
.env2.is-open .env2__seal { transition-duration: .4s; }
.intro.is-opening .mail { transition-duration: .3s; }
.is-playing .invited { animation-duration: .5s; animation-delay: 0s; }
.is-playing .oenv__img, .is-playing .oenv__flap { animation-duration: .65s; animation-delay: .05s; }
.is-playing .oenv__seal { animation-duration: .45s; animation-delay: .55s; }
.is-playing .oenv__to span:nth-child(1) { animation-duration: .6s; animation-delay: .7s; }
.is-playing .oenv__to span:nth-child(3) { animation-duration: .6s; animation-delay: .9s; }
.is-playing .photo-card { animation-duration: .9s; animation-delay: .8s; }
.is-playing .postcard { animation-duration: .9s; animation-delay: 1.1s; }
.is-playing .flora--calla1 { animation-duration: .7s; animation-delay: 1.3s; }
.is-playing .flora--calla2 { animation-duration: .7s; animation-delay: 1.4s; }
.intro { transition: opacity .6s ease, visibility .6s; }

/* Closed envelope: no page scroll at all */
html:has(body.locked) { overflow: hidden; height: 100%; }
body.locked { overflow: hidden; height: 100%; overscroll-behavior: none; touch-action: none; }

/* "You've got mail" in a high-contrast copperplate script, closer to the reference */
.mail { font-family: "Pinyon Script", "Great Vibes", cursive; font-size: clamp(3.6rem, 17.5vw, 6.4rem); line-height: .95; letter-spacing: 0; }

/* Fixed writing face */
@font-face { font-family: "Slamfight"; src: url("../fonts/slamfight-font/Slamfight-1jMrM.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Amiri"; src: url("../fonts/Amiri/Amiri-Regular.ttf") format("truetype"); font-style: normal; font-weight: 400; font-display: swap; }
.oenv__to { font-family: "Amiri", serif; font-style: normal; font-weight: 400; text-transform: uppercase; top: 17%; left: 20%; right: 20%; font-size: clamp(1.15rem, 4.6vw, 2.1rem); line-height: 1.12; -webkit-text-stroke: 0; }
.postcard__row .hand, .postcard__msg, .postcard__sign { font-family: "Slamfight", var(--font-sign); color: var(--c-deep); }
.postcard__row .hand { font-size: clamp(1.25rem, 5vw, 1.9rem); line-height: 1.15; white-space: nowrap; }
.postcard__msg, .postcard__sign { font-size: clamp(2.05rem, 8.8vw, 3.3rem); }
