/* Comfort & Toby — save the date.
   A dark velvet envelope opens into a bright champagne daylight world:
   warm ivory, real gold, Milan at golden hour. */

:root {
  --room: #0f0b07;         /* the dark room the envelope lives in */
  --room-glow: #241a0f;
  --page: #f6efdd;         /* the bright world inside */
  --page-deep: #eee2c7;
  --ink: #2b2318;
  --ink-soft: #6d6150;
  --gold: #c2a05c;
  --gold-bright: #e8cc8f;
  --gold-deep: #8f6f33;
  --wax: #6e2424;
  --serif: "EB Garamond", Georgia, serif;
  --display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --script: "Pinyon Script", cursive;
  --grain: 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='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.06'/%3E%3C/svg%3E");
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--page); }
body {
  font-family: var(--serif);
  background: var(--grain), var(--page);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; }

/* ==================== the opening: one continuous film ====================
   The idle screen IS frame 0 of the footage (the poster is extracted from it),
   so nothing swaps when it plays — the envelope, the lift, the light and the
   push-in are all one photographed shot. */

.film {
  position: fixed; inset: 0; z-index: 30;
  background: var(--room);
  overflow: hidden;
}
.film__movie {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: var(--room);
}
/* the whole screen is the button — the hint points at the seal */
.film__tap {
  position: absolute; inset: 0;
  -webkit-tap-highlight-color: transparent;
}
.film__tap:focus-visible { outline: 2px solid var(--gold); outline-offset: -6px; }
/* the dissolve: warm light holds the screen while the world changes under it */
.film__wash {
  position: absolute; inset: 0;
  background: radial-gradient(120% 120% at 50% 55%, #fff6e0 0%, #ffe9bd 45%, rgba(255, 233, 189, 0.92) 100%);
  opacity: 0;
  pointer-events: none;
}

.film__hint {
  position: absolute; left: 0; right: 0; bottom: max(7dvh, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.46em;
  text-indent: 0.46em;
  text-transform: uppercase;
  color: #e9d6a8;
  text-shadow: 0 0 14px rgba(255, 214, 140, 0.45), 0 1px 3px rgba(0, 0, 0, 0.7);
  animation: hintBreathe 2.8s ease-in-out infinite;
}
@keyframes hintBreathe { 0%, 100% { opacity: 0.72; } 50% { opacity: 1; } }

/* gold dust in the air — video on black, screen-blended */
.dust {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  mix-blend-mode: screen;
  opacity: 0.5;
  pointer-events: none;
}

/* ==================== the page ==================== */

.page { position: relative; min-height: 100dvh; }

/* ---------- the living hero ---------- */

.hero {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  background: var(--room);
}
.hero__media {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero__shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 13, 5, 0.34) 0%, transparent 30%),
    linear-gradient(0deg, rgba(20, 13, 5, 0.62) 0%, transparent 44%);
}
.hero__content {
  position: absolute; left: 20px; right: 20px; bottom: 15dvh;
  text-align: center;
  color: #fdf6e7;
}
.hero__kicker {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.52em;
  text-indent: 0.52em;
  text-transform: uppercase;
  color: rgba(253, 246, 231, 0.9);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}
.hero__names {
  margin-top: 14px;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(52px, 15vw, 86px);
  line-height: 1.05;
  text-shadow:
    0 0 22px rgba(255, 222, 150, 0.55),
    0 0 54px rgba(255, 200, 110, 0.3),
    0 2px 14px rgba(0, 0, 0, 0.45);
}
.hero__date {
  margin-top: 12px;
  font-size: 17px;
  font-variant: small-caps;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.55);
}
.hero__chev {
  position: absolute; left: 50%; bottom: calc(4dvh + 10px);
  width: 26px; height: 26px;
  transform: translateX(-50%);
  color: rgba(253, 246, 231, 0.85);
  animation: chevDrift 2.4s ease-in-out infinite;
}
@keyframes chevDrift { 0%, 100% { transform: translate(-50%, 0); opacity: 0.7; } 50% { transform: translate(-50%, 7px); opacity: 1; } }
.hero__torn {
  position: absolute; left: -1%; right: -1%; bottom: -2px;
  width: 102%; height: 26px;
  fill: var(--page);
  filter: drop-shadow(0 -4px 8px rgba(0, 0, 0, 0.3));
}
@media (prefers-reduced-motion: reduce) { .hero__chev { animation: none; } }
.page__backdrop {
  position: fixed; inset: 0; z-index: -1;
  background: var(--grain), var(--page);
}

/* ==================== the movements — a bright champagne daylight world ==================== */

.sect {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(52px, 8.5dvh, 86px) 22px;
  text-align: center;
  overflow: hidden;
}
.sect__kicker {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.46em;
  text-indent: 0.46em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* II · the reveal — gold leaf over the two of them */
.sect--reveal {
  background:
    var(--grain),
    radial-gradient(120% 90% at 50% 0%, #fdf8ea 0%, var(--page) 58%, var(--page-deep) 100%);
}
.arch-frame {
  width: min(86vw, 390px);
  margin-top: 5dvh;
  padding: 10px;
  border-radius: 999px 999px 14px 14px;
  background: linear-gradient(175deg, #e7cf9c 0%, #b08c48 40%, #e7cf9c 62%, #99773a 100%);
  box-shadow:
    0 30px 60px rgba(97, 72, 28, 0.28),
    0 4px 14px rgba(97, 72, 28, 0.18),
    inset 0 1px 2px rgba(255, 248, 228, 0.8);
}
.arch {
  position: relative;
  aspect-ratio: 4 / 5.1;
  border-radius: 992px 992px 8px 8px;   /* a cathedral window — the Duomo again */
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(90, 66, 24, 0.5);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
/* the photo waits in shadow: every stroke cuts dark through bright gold,
   then the finished reveal blooms it to full colour */
.arch__photo {
  width: 100%; height: 100%;
  object-fit: cover;
  pointer-events: none;
  filter: brightness(0.42) saturate(0.5);
  transition: filter 1.4s ease;
}
.arch__photo.is-free { filter: brightness(1) saturate(1); }
.arch__video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.1s ease;
  pointer-events: none;
}
.arch__video.is-live { opacity: 1; }
.arch__foil {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  touch-action: none;
  cursor: grab;
  transform: translateZ(0);   /* own compositor layer — strokes blit directly */
}
.arch__foil.is-done { pointer-events: none; }
.reveal__hint {
  margin-top: 24px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  text-transform: uppercase;
  color: var(--gold-deep);
  animation: hintBreathe 2.8s ease-in-out infinite;
  transition: opacity 0.5s ease;
}
.reveal__hint.is-gone { opacity: 0; animation: none; }
.reveal__names {
  margin-top: 18px;
  font-family: var(--script);
  font-size: clamp(34px, 9.5vw, 46px);
  line-height: 1.1;
  color: var(--ink);
}
.reveal__line {
  margin-top: 10px;
  font-style: italic;
  font-size: 16px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

/* the ampersand inherits the script — the clients love it as it is */
.amp { font: inherit; }

/* III · the letter */
.sect--letter {
  background:
    var(--grain),
    linear-gradient(180deg, var(--page-deep) 0%, var(--page) 24%, var(--page) 76%, var(--page-deep) 100%);
}
.crest {
  width: min(70vw, 285px);
  mix-blend-mode: multiply;    /* stamped into the paper, not stuck on it */
  -webkit-mask-image: radial-gradient(circle, #000 52%, transparent 71%);
  mask-image: radial-gradient(circle, #000 52%, transparent 71%);
}
.sect__monogram {
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: 44px;
  line-height: 1;
  letter-spacing: 0.14em;
  background: linear-gradient(170deg, #c8a35c, #8f6f33);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sect--letter .sect__kicker { margin-top: 20px; }
.letter { max-width: 36ch; margin-top: 30px; }
.letter__text {
  font-size: 17.5px;
  line-height: 1.85;
  color: #4a4132;
}
.letter__text .w { display: inline-block; }

/* IV · the date */
.sect--date {
  background:
    var(--grain),
    radial-gradient(120% 90% at 50% 100%, #fdf8ea 0%, var(--page) 55%, var(--page-deep) 100%);
}
.date-big__kicker {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.52em;
  text-indent: 0.52em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.date-big {
  margin-top: 20px;
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(60px, 20vw, 112px);
  line-height: 1;
  letter-spacing: 0.04em;
  background: linear-gradient(100deg, #80622a 0%, #c8a35c 30%, #e9d1a0 50%, #c8a35c 70%, #80622a 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: goldSheen 5.5s ease-in-out infinite;
}
@keyframes goldSheen { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
.date-big__label {
  margin-top: 16px;
  font-size: 17px;
  font-variant: small-caps;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--ink);
}
.date-place {
  margin-top: 10px;
  font-size: 14.5px;
  font-weight: 600;
  font-variant: small-caps;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--gold-deep);
}

.count {
  display: flex; align-items: stretch; justify-content: center;
  width: min(100%, 420px);
  margin-top: 34px; padding: 22px 0;
  border-top: 1px solid rgba(143, 111, 51, 0.4);
  border-bottom: 1px solid rgba(143, 111, 51, 0.4);
}
.count__cell { display: grid; gap: 6px; flex: 1; max-width: 118px; }
.count__cell b {
  font-weight: 500;
  font-size: 44px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.count__cell small { font-size: 10.5px; letter-spacing: 0.34em; text-indent: 0.34em; text-transform: uppercase; color: var(--gold-deep); }
.count__dot { align-self: center; width: 1px; height: 36px; background: rgba(143, 111, 51, 0.35); }

.sect--date .btn { min-width: min(100%, 320px); }
.sect--date .btn--primary { margin-top: 30px; }
.sect--date .btn--ghost { margin-top: 12px; }

/* the close, on the same breath as the date */
.sign-line { margin-top: 44px; font-style: italic; font-size: 16.5px; color: var(--ink-soft); }
.sign-off {
  margin-top: 14px;
  font-family: var(--script);
  font-size: clamp(34px, 9.5vw, 44px);
  color: #6d5220;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 18px;
  border-radius: 999px;
  font-size: 13.5px;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  text-transform: uppercase;
  transition: transform 0.12s ease, filter 0.2s ease, background-color 0.2s ease;
}
.btn:active { transform: scale(0.98); }
.btn--primary {
  color: var(--gold-bright);
  background: linear-gradient(180deg, #352c1f, var(--ink) 70%);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(194, 160, 92, 0.5), inset 0 1px 0 rgba(232, 204, 143, 0.25);
}
.btn--primary:hover { filter: brightness(1.12); }
.btn--ghost { color: var(--ink); box-shadow: inset 0 0 0 1px rgba(109, 97, 80, 0.55); }
.btn--ghost:hover { background: rgba(143, 111, 51, 0.09); }
.ico { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* filmed gold confetti over the whole screen at the reveal —
   white footage, multiplied, so only the gold lands on the bright page */
.fx-burst {
  position: fixed; inset: 0; z-index: 35;
  width: 100%; height: 100%;
  object-fit: cover;
  mix-blend-mode: multiply;
  opacity: 0;
  pointer-events: none;
}
.fx-burst.is-on { opacity: 1; }

/* the music — a quiet floating control, like the reference's pause button */
.music {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 45;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(43, 35, 24, 0.82);
  box-shadow: 0 10px 26px rgba(60, 42, 14, 0.35), inset 0 0 0 1px rgba(194, 160, 92, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  -webkit-tap-highlight-color: transparent;
}
.music svg { width: 21px; height: 21px; }
.music__note { stroke: var(--gold-bright); stroke-width: 1.6; fill: none; }
.music circle.music__note { fill: var(--gold-bright); stroke: none; }
.music__slash { stroke: var(--gold-bright); stroke-width: 1.8; stroke-linecap: round; opacity: 0; }
.music.is-off .music__slash { opacity: 1; }
.music.is-off .music__note { opacity: 0.55; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 40;
  transform: translate(-50%, 16px);
  padding: 13px 22px;
  border-radius: 999px;
  background: var(--ink); color: var(--gold-bright);
  font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 16px 40px rgba(60, 42, 14, 0.4), inset 0 0 0 1px rgba(194, 160, 92, 0.5);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .film__hint, .reveal__hint { animation: none; }
}
