/* =====================================================
   YUVAL & NAOR — Wedding Invitation
   Palette inspired by hero.jpg (golden-hour sunset)
===================================================== */

:root{
  --ivory: #F7F2EA;
  --cream: #EFE5D6;
  --sand: #DCC7A9;
  --warm-brown: #5A4636;
  --dark-brown: #2E241D;
  --gold: #B69A6A;
  --gold-light: #D8C39B;
  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.65, 0, 0.35, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* subtle woven-linen crosshatch — layered on top of paper gradients/noise
     across the envelope and invitation surfaces for a tactile fabric feel */
  --linen-weave:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.06) 0px, rgba(255,255,255,0.06) 1px, transparent 1px, transparent 3px),
    repeating-linear-gradient(0deg, rgba(90,70,54,0.05) 0px, rgba(90,70,54,0.05) 1px, transparent 1px, transparent 3px);
}

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

html{
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body{
  margin: 0;
  min-height: 100vh;
  background: var(--ivory);
  color: var(--warm-brown);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.intro-active{
  height: 100vh;
  overflow: hidden;
}

img{ max-width: 100%; display: block; }

a{ color: inherit; }

h1,h2,h3{ font-family: 'Playfair Display', serif; margin: 0; font-weight: 600; }

.paper-texture{
  background-image:
    radial-gradient(circle at 20% 10%, rgba(182,154,106,0.06), transparent 60%),
    radial-gradient(circle at 80% 90%, rgba(90,70,54,0.05), transparent 60%);
}

/* subtle noise via inline svg */
.paper-card{
  position: relative;
  background-color: var(--cream);
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/></svg>"),
    radial-gradient(circle at 15% 0%, rgba(255,255,255,0.5), transparent 55%);
  border-radius: 14px;
  box-shadow: 0 18px 40px -18px rgba(46,36,29,0.35), 0 2px 8px rgba(46,36,29,0.08);
  border: 1px solid rgba(182,154,106,0.25);
}

.deco-line{
  display: block;
  width: 54px;
  height: 1px;
  margin: 14px auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.eyebrow{
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--gold);
  margin: 0 0 6px;
}
.eyebrow-light{ color: var(--gold-light); }

.section-eyebrow{
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  font-size: 0.95rem;
  margin: 0 0 28px;
}

/* ---------- Buttons ---------- */
.btn{
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 24px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--warm-brown);
  cursor: pointer;
  transition: transform 0.25s var(--ease-soft), background 0.25s, box-shadow 0.25s, color .25s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}
.btn:hover{ background: rgba(182,154,106,0.12); }
.btn:active{ transform: scale(0.97); }
.btn:focus-visible{ outline: 2px solid var(--gold); outline-offset: 3px; }

.btn-solid{
  background: var(--warm-brown);
  color: var(--ivory);
  border-color: var(--warm-brown);
}
.btn-solid:hover{ background: var(--dark-brown); }

.btn-outline{ background: rgba(255,255,255,0.35); }

.btn-ghost{
  border-color: transparent;
  background: transparent;
  color: var(--warm-brown);
}
.btn-ghost:hover{ background: rgba(182,154,106,0.1); }

.btn-small{ padding: 9px 18px; font-size: 0.78rem; }

/* =====================================================
   INTRO OVERLAY
===================================================== */
#intro-overlay{
  position: fixed;
  inset: 0;
  z-index: 500;
  background:
    radial-gradient(ellipse 120% 90% at 50% 28%, #3d3122 0%, #2E241D 55%, #1c140d 100%);
}

.intro-step{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(24px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s var(--ease-soft);
  pointer-events: none;
}

.intro-step.is-active{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ---------- 1. Loading ---------- */
.monogram-loading{
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 8vw, 3rem);
  letter-spacing: 0.12em;
  color: var(--ivory);
}
.monogram-loading span{ color: var(--gold); font-style: italic; }

/* ---------- 2. Envelope ---------- */
.envelope-wrap{
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(28px, 4.5vh, 44px);
  perspective: 1800px;
  width: 100%;
}

/* cinematic spotlight glow behind the envelope */
.envelope-wrap::before{
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(150vw, 980px);
  height: min(150vw, 980px);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(214,182,128,0.26) 0%, rgba(182,154,106,0.08) 45%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.envelope{
  position: relative;
  z-index: 1;
  width: min(90vw, 640px, 74vh);
  aspect-ratio: 3 / 2;
  cursor: pointer;
  animation: envelopeFloat 5s ease-in-out infinite;
  transform-style: preserve-3d;
  filter: drop-shadow(0 2px 1px rgba(0,0,0,0.15));
  /* solid linen paper backing: the flap and pocket clip-path shapes don't
     perfectly meet at the centre, so this shows through any hairline gap
     instead of the dark backdrop, keeping the closed envelope reading as
     one solid, tactile object */
  background:
    var(--linen-weave),
    linear-gradient(165deg, var(--sand), var(--cream));
  border-radius: 10px;
}

@keyframes envelopeFloat{
  0%,100%{ transform: translateY(0); }
  50%{ transform: translateY(-9px); }
}

/* soft ground shadow — narrows and lightens as the envelope lifts */
.envelope-shadow{
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -7%;
  height: 14%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.22) 45%, transparent 75%);
  filter: blur(6px);
  animation: envelopeShadow 5s ease-in-out infinite;
}
@keyframes envelopeShadow{
  0%,100%{ transform: scale(1); opacity: 1; }
  50%{ transform: scale(0.88); opacity: 0.75; }
}

.envelope-card{
  position: absolute;
  left: 10%;
  right: 10%;
  top: 13%;
  bottom: 13%;
  background-color: var(--ivory);
  background-image:
    var(--linen-weave),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/></svg>"),
    radial-gradient(circle at 15% 0%, rgba(255,255,255,0.7), transparent 55%);
  border-radius: 3px;
  box-shadow:
    0 14px 30px rgba(0,0,0,0.42),
    inset 0 0 0 1px rgba(182,154,106,0.4),
    inset 0 0 0 6px rgba(182,154,106,0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4%;
  opacity: 0;
  transform: translateY(4%) scale(0.94);
  transition: transform 1.35s var(--ease-premium) 0.32s, opacity 0.55s ease 0.32s;
  z-index: 2;
}
.envelope-card-label{
  font-size: clamp(0.62rem, 1.6vw, 0.78rem);
  letter-spacing: 0.28em;
  color: var(--gold);
  margin: 0 0 8px;
  text-transform: uppercase;
}
.envelope-card-names{
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.3rem, 5.2vw, 2.1rem);
  color: var(--dark-brown);
  margin: 0;
}
.envelope-card-date{
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1rem, 3vw, 1.3rem);
  font-style: italic;
  color: var(--warm-brown);
  margin: 8px 0 0;
}

.envelope-body{
  position: absolute;
  background: var(--cream);
}

/* front pocket — thick ivory paper with a fine champagne edge and inner fold shading.
   The gold trim uses drop-shadow() rather than box-shadow/pseudo-elements because
   drop-shadow renders against the element's actual clipped silhouette, so it traces
   the folded polygon edge precisely instead of the invisible rectangular box. */
.envelope-pocket-front{
  left: 0; right: 0; bottom: 0;
  height: 63%;
  z-index: 3;
  border-radius: 0 0 16px 16px;
  clip-path: polygon(0 100%, 0 21%, 50% 58%, 100% 21%, 100% 100%);
  box-shadow: 0 14px 30px rgba(0,0,0,0.4), inset 0 12px 16px -9px rgba(46,36,29,0.35);
  background:
    var(--linen-weave),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/></svg>"),
    linear-gradient(160deg, var(--ivory) 0%, var(--cream) 45%, var(--sand) 100%);
  filter:
    drop-shadow(1.4px 0 0 var(--gold))
    drop-shadow(-1.4px 0 0 var(--gold))
    drop-shadow(0 1.4px 0 var(--gold))
    drop-shadow(1px 1px 0 var(--gold))
    drop-shadow(-1px 1px 0 var(--gold));
}

.envelope-pocket-left, .envelope-pocket-right{
  display: none; /* the front pocket's clipped silhouette already reads as folded side flaps */
}

/* inner lining — sits directly behind the flap, same silhouette. Invisible
   at rest (the opaque flap covers it completely); revealed the moment the
   flap rotates far enough that its backface (hidden) stops rendering. */
.envelope-flap-lining{
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 59%;
  z-index: 4;
  clip-path: polygon(0 0, 100% 0, 50% 85%);
  background-color: #EADFC4;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><g fill='none' stroke='%23B69A6A' stroke-width='1' opacity='0.4'><path d='M10 90 Q 35 60 20 30 Q 45 45 50 15'/><ellipse cx='22' cy='34' rx='5' ry='2.5' transform='rotate(40 22 34)'/><ellipse cx='36' cy='50' rx='5' ry='2.5' transform='rotate(-20 36 50)'/><path d='M100 120 Q 120 95 108 70 Q 128 82 132 58'/><ellipse cx='110' cy='74' rx='5' ry='2.5' transform='rotate(35 110 74)'/><ellipse cx='120' cy='92' rx='5' ry='2.5' transform='rotate(-25 120 92)'/></g></svg>"),
    linear-gradient(200deg, #E6D9B8 0%, #EFE5D0 55%, #F3EADA 100%);
  background-size: auto, 140px 140px, auto;
}

/* top flap — same premium linen paper, with a fine gold trim and a soft
   inner fold shadow. Its point reaches the envelope's vertical centre,
   where the wax seal sits. backface-visibility:hidden is what makes the
   lining above become visible once this rotates past 90deg. */
.envelope-flap-top{
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 59%;
  background:
    var(--linen-weave),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/></svg>"),
    linear-gradient(200deg, var(--sand) 0%, var(--cream) 55%, var(--ivory) 100%);
  clip-path: polygon(0 0, 100% 0, 50% 85%);
  transform-origin: top center;
  transform: rotateX(0deg);
  transition: transform 1.05s var(--ease-soft);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  z-index: 5;
  box-shadow: 0 8px 20px rgba(0,0,0,0.28), inset 0 -14px 18px -10px rgba(46,36,29,0.35);
  filter:
    drop-shadow(1.4px 0 0 var(--gold))
    drop-shadow(-1.4px 0 0 var(--gold))
    drop-shadow(0 -1.4px 0 var(--gold))
    drop-shadow(1px -1px 0 var(--gold))
    drop-shadow(-1px -1px 0 var(--gold));
}

/* ---------- Luxury wax seal ----------
   Deliberately a SIBLING of the flap/pocket (not nested inside either), pinned to
   the exact center of the envelope. Both paper layers use clip-path triangles that
   taper to a point, so anything nested inside them gets cropped near that point —
   keeping the seal independent guarantees it always renders as a full, crisp circle
   exactly where the flap and pocket visually meet. */
.wax-seal{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(66px, 10vw, 108px);
  height: clamp(66px, 10vw, 108px);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #e7c98d 0%, #cda05e 38%, #a97f45 68%, #7c5c34 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.3) inset,
    0 -8px 14px rgba(0,0,0,0.35) inset,
    0 0 0 3px rgba(28,20,13,0.28),
    0 12px 24px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 6;
  transition: transform 0.3s var(--ease-soft);
}
/* fine engraved ring — subtle coin-edge texture */
.wax-seal::before{
  content: '';
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255,255,255,0.22) 0deg 2.5deg, rgba(0,0,0,0.16) 2.5deg 5deg);
  opacity: 0.55;
  mix-blend-mode: overlay;
}
/* polished highlight sweep */
.wax-seal::after{
  content: '';
  position: absolute;
  inset: 20%;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, rgba(255,255,255,0.55), transparent 62%);
  pointer-events: none;
}
/* ornamental ring — a fine metallic double-ring with a ticked coin-edge,
   framing the monogram like a custom embossed stamp rather than a plain dot */
.wax-seal-ring{
  position: absolute;
  inset: -14%;
  border-radius: 50%;
  border: 1px solid rgba(255,244,220,0.5);
  box-shadow:
    0 0 0 1px rgba(60,40,20,0.35),
    inset 0 0 0 4px rgba(0,0,0,0.06);
  pointer-events: none;
}
.wax-seal-ring::before{
  content: '';
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255,244,220,0.65) 0deg 1.4deg, transparent 1.4deg 10deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  opacity: 0.8;
}
.wax-seal-initials{
  position: relative;
  z-index: 2;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1rem, 2.6vw, 1.45rem);
  letter-spacing: 0.03em;
  color: #3c2b16;
  text-shadow: 0 1px 0 rgba(255,255,255,0.45), 0 -1px 0 rgba(0,0,0,0.3);
}

.envelope.is-opening .wax-seal{ transform: translate(-50%, -50%) scale(0.8) rotate(-8deg); opacity: 0; transition: transform 0.4s var(--ease-soft), opacity 0.35s ease 0.05s; }
.envelope.is-opening .envelope-flap-top{ transform: rotateX(180deg); }
.envelope.is-opening .envelope-card{
  opacity: 1;
  transform: translateY(-192%) scale(1.08);
  z-index: 7; /* rise above the flap/lining/seal once it's visible and lifting out */
}
.envelope.is-opening{ animation: none; }
.envelope.is-opening .envelope-shadow{ animation: none; transform: scale(0.8); opacity: 0.5; }

.tap-hint{
  position: relative;
  z-index: 1;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  color: var(--warm-brown);
  letter-spacing: 0.04em;
  opacity: 0.85;
  animation: hintPulse 2.4s ease-in-out infinite;
}
.tap-hint-light{ color: var(--gold-light); }
@keyframes hintPulse{
  0%,100%{ opacity: 0.5; }
  50%{ opacity: 0.95; }
}

/* ---------- 3. Invitation card ---------- */
.invitation-card{
  width: min(90vw, 440px);
  padding: clamp(36px, 6vw, 52px) clamp(26px, 5vw, 40px);
  text-align: center;
  cursor: pointer;
  animation: cardIn 0.9s var(--ease-premium) both;
  box-shadow: 0 24px 60px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.15);
}
@keyframes cardIn{
  from{ opacity: 0; transform: translateY(28px) scale(0.96); }
  to{ opacity: 1; transform: translateY(0) scale(1); }
}

.invitation-names{
  font-size: clamp(2.1rem, 8vw, 2.9rem);
  color: var(--dark-brown);
}
.invitation-names span{ color: var(--gold); font-style: italic; font-family: 'Cormorant Garamond', serif; }

.invitation-date{
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.2rem, 3.2vw, 1.5rem);
  letter-spacing: 0.1em;
  color: var(--warm-brown);
  margin: 6px 0 20px;
}

.compact-countdown{
  display: flex;
  justify-content: center;
  gap: clamp(14px, 3vw, 22px);
  margin-bottom: 24px;
}
.cc-unit{ text-align: center; min-width: 46px; }
.cc-unit span{
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.4rem, 4vw, 1.7rem);
  color: var(--dark-brown);
  transition: transform 0.3s var(--ease-soft);
}
.cc-unit small{
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.tap-hint-card{
  margin-top: 16px;
  font-size: 0.95rem;
}

/* ---------- 4. Scratch card — the full wedding invitation beneath the foil ---------- */
.scratch-wrap{
  position: relative;
  width: min(90vw, 440px);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 28px 60px -16px rgba(0,0,0,0.55), 0 2px 10px rgba(0,0,0,0.2);
  transition: transform 0.6s var(--ease-premium), box-shadow 0.6s ease;
}
.scratch-wrap.is-emphasized{
  transform: scale(1.025);
  box-shadow: 0 32px 70px -14px rgba(0,0,0,0.55), 0 0 0 1px rgba(182,154,106,0.4), 0 0 40px rgba(214,182,128,0.35);
}

/* the invitation itself — printed on the same linen paper as the envelope.
   Sized by its own content (no internal scroll): the canvas above it must
   cover the same box exactly, and a scrollable card would fight the
   scratch gesture and misalign the erased holes from the scrolled text. */
.scratch-content{
  position: relative;
  background-color: var(--ivory);
  background-image:
    var(--linen-weave),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/></svg>"),
    radial-gradient(circle at 15% 0%, rgba(255,255,255,0.6), transparent 55%);
  border: 1px solid rgba(182,154,106,0.3);
  /* generous bottom padding: the reveal-instant / continue-to-site buttons
     are positioned absolutely at the bottom of the card, so the last line
     of text needs clearance to never sit underneath them */
  padding: clamp(22px, 5vw, 32px) clamp(20px, 5vw, 28px) clamp(78px, 16vw, 96px);
  text-align: center;
}

.scratch-photo-frame{
  width: 78px;
  height: 78px;
  margin: 0 auto 10px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--ivory);
  box-shadow: 0 0 0 1.5px var(--gold), 0 8px 16px rgba(46,36,29,0.3);
}
.scratch-photo{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scratch-monogram{
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  letter-spacing: 0.05em;
  color: var(--gold);
  margin: 0 0 4px;
}
.scratch-monogram span{ font-style: italic; font-family: 'Cormorant Garamond', serif; margin: 0 3px; }

.scratch-names{
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.4rem, 5.5vw, 1.8rem);
  letter-spacing: 0.03em;
  color: var(--dark-brown);
  margin: 0;
}

.scratch-date{
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  letter-spacing: 0.1em;
  color: var(--warm-brown);
  margin: 4px 0 0;
}

.scratch-hebrew{ margin-top: 4px; }
.scratch-he-lead{
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(0.98rem, 3.4vw, 1.12rem);
  line-height: 1.65;
  color: var(--warm-brown);
  margin: 0 0 10px;
}
.scratch-he-venue{
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--dark-brown);
  margin: 0;
}
.scratch-he-times{
  font-size: 0.85rem;
  color: var(--warm-brown);
  margin: 3px 0 0;
}
.scratch-he-parents{
  display: flex;
  justify-content: center;
  gap: clamp(18px, 6vw, 34px);
  flex-wrap: wrap;
}
.scratch-he-parents-label{
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--gold);
  margin: 0 0 2px;
}
.scratch-he-parents-names{
  font-size: 0.88rem;
  font-weight: 500;
  margin: 0;
}

#scratch-canvas{
  position: absolute;
  inset: 0;
  touch-action: none;
  cursor: grab;
  transition: opacity 0.7s var(--ease-soft), transform 0.7s var(--ease-soft);
}
#scratch-canvas.is-revealed{
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.scratch-instruction{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.25rem;
  color: #3c2b16;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
  pointer-events: none;
  transition: opacity 0.4s ease;
  text-align: center;
  width: 78%;
}
.scratch-instruction.is-hidden{ opacity: 0; }

.scratch-subhint{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 2.4em);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: #4a3722;
  opacity: 0.75;
  pointer-events: none;
  transition: opacity 0.4s ease;
  text-align: center;
  width: 74%;
}
.scratch-subhint.is-hidden{ opacity: 0; }

.reveal-instant-btn{
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(247,242,234,0.85);
  backdrop-filter: blur(4px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  /* it's absolutely positioned with no width of its own, so without a
     max-width its "shrink to fit" box would just grow with the text and
     get clipped by .scratch-wrap's overflow:hidden on narrow screens;
     capping it lets longer wording wrap onto a second line instead */
  max-width: min(86%, 320px);
  white-space: normal;
  text-align: center;
  line-height: 1.35;
}
.reveal-instant-btn.is-hidden{
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  pointer-events: none;
}

/* appears once the invitation has been revealed and had a moment to be seen */
.continue-to-site-btn{
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease, transform 0.6s var(--ease-premium);
}
.continue-to-site-btn.is-visible{
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* =====================================================
   MAIN SITE
===================================================== */
#site{
  opacity: 0;
}
#site.is-visible{
  opacity: 1;
  transition: opacity 0.8s var(--ease-soft);
}

.site-header{
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding-top: var(--safe-top);
  transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease;
}
.site-header.is-scrolled{
  background: rgba(247,242,234,0.75);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 18px rgba(46,36,29,0.08);
}
.header-inner{
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
}
.brand-mark{
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-decoration: none;
}
.main-nav{ display: none; gap: 28px; }
.main-nav a{
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warm-brown);
  position: relative;
  padding: 4px 0;
}
.main-nav a:hover{ color: var(--gold); }

.nav-toggle{
  width: 40px; height: 40px;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}
.nav-toggle span{
  width: 22px; height: 1.5px;
  background: var(--warm-brown);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-6.5px) rotate(-45deg); }

@media (min-width: 760px){
  .main-nav{ display: flex; }
  .nav-toggle{ display: none; }
}

@media (max-width: 759px){
  .main-nav{
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(72vw, 300px);
    background: var(--ivory);
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 40px;
    gap: 26px;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease-soft);
    box-shadow: -10px 0 30px rgba(46,36,29,0.15);
  }
  .main-nav.is-open{ transform: translateX(0); display: flex; }
}

main{ overflow: hidden; }

/* ---------- Hero ---------- */
.hero{
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(90px + var(--safe-top)) 20px 60px;
  text-align: center;
  overflow: hidden;
}
.hero-photo-frame{
  width: min(86vw, 420px);
  aspect-ratio: 4/5;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(46,36,29,0.4);
  border: 6px solid var(--ivory);
  outline: 1px solid rgba(182,154,106,0.35);
  margin-bottom: 28px;
}
.hero-photo{
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  will-change: transform;
}
.hero-names{ font-size: clamp(2.2rem, 9vw, 3.4rem); color: var(--dark-brown); }
.hero-names .amp{ color: var(--gold); font-style: italic; font-family: 'Cormorant Garamond', serif; }
.hero-date{
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  letter-spacing: 0.12em;
  margin-top: 6px;
}
.hero-tagline{
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--warm-brown);
}

.scroll-cue{
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
}
.scroll-cue span{
  display: block;
  width: 1px; height: 34px;
  background: linear-gradient(var(--gold), transparent);
  animation: scrollCue 2s ease-in-out infinite;
}
@keyframes scrollCue{
  0%{ transform: scaleY(0.4); opacity: 0.3; transform-origin: top; }
  50%{ transform: scaleY(1); opacity: 1; transform-origin: top; }
  100%{ transform: scaleY(0.4); opacity: 0.3; transform-origin: bottom; }
}

/* ---------- Countdown section ---------- */
.countdown-section{
  padding: 90px 20px;
  text-align: center;
  background: var(--cream);
}
.countdown-large{
  display: flex;
  justify-content: center;
  gap: clamp(10px, 4vw, 28px);
  margin-bottom: 30px;
  flex-wrap: wrap;
}
.cd-unit{
  min-width: 70px;
  padding: 14px 6px;
}
.cd-unit span{
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 7vw, 2.8rem);
  color: var(--dark-brown);
  line-height: 1;
}
.cd-unit small{
  display: block;
  margin-top: 6px;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}
.tick{ animation: tickPop 0.35s var(--ease-soft); }
@keyframes tickPop{
  0%{ transform: translateY(-6px); opacity: 0.4; }
  100%{ transform: translateY(0); opacity: 1; }
}
.countdown-done{
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--dark-brown);
}
.countdown-done-en{
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.1rem;
  margin-top: 6px;
}

/* ---------- Hebrew invitation text ---------- */
.invitation-text-section{
  padding: 90px 20px;
  display: flex;
  justify-content: center;
}
.invitation-text-card{
  max-width: 480px;
  width: 100%;
  padding: 48px 32px;
  text-align: center;
}
.he-lead{
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  line-height: 1.9;
  color: var(--warm-brown);
}
.he-names{
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  margin: 14px 0 6px;
  color: var(--dark-brown);
}
.he-names span{ color: var(--gold); }
.he-date{ font-family: 'Cormorant Garamond', serif; font-size: 1.2rem; letter-spacing: 0.06em; }
.he-venue{ font-size: 1.15rem; font-weight: 600; margin-top: 4px; }
.he-times{ font-size: 0.95rem; color: var(--warm-brown); margin-top: 4px; }
.he-parents-mini{
  display: flex;
  justify-content: center;
  gap: 36px;
  flex-wrap: wrap;
}
.he-parents-label{
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin: 0 0 4px;
}
.he-parents-names{ font-size: 1rem; margin: 0; font-weight: 500; }

/* ---------- Our Story ---------- */
.story-section{
  padding: 90px 20px 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.polaroid{
  width: min(86vw, 340px);
  background: var(--ivory);
  padding: 16px 16px 26px;
  box-shadow: 0 20px 40px -16px rgba(46,36,29,0.35);
  border-radius: 4px;
  transform: rotate(-3deg);
  transition: transform 0.5s var(--ease-premium), box-shadow 0.5s var(--ease-premium), width 0.5s var(--ease-premium);
  cursor: pointer;
  text-align: center;
  position: relative;
}
.polaroid-photo{
  aspect-ratio: 1/1;
  overflow: hidden;
  margin-bottom: 14px;
  border-radius: 2px;
}
.polaroid-photo img{ width: 100%; height: 100%; object-fit: cover; }
.polaroid-caption{
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--warm-brown);
  margin: 0;
}
/* Our Story text — Hebrew, RTL, broken into short romantic paragraphs */
.story-more{
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  text-align: right;
  transition: max-height 0.6s var(--ease-premium), opacity 0.5s ease, margin 0.5s ease;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--warm-brown);
}
.story-more p{
  margin: 0 0 14px;
}
.story-more .deco-line{
  margin: 4px auto 12px;
}
.story-emphasis{
  text-align: center;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
  color: var(--gold);
  margin: 0 !important;
}
.story-hint{
  display: block;
  margin-top: 10px;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}
.polaroid.is-open{
  width: min(92vw, 460px);
  transform: rotate(0deg);
  box-shadow: 0 26px 55px -18px rgba(46,36,29,0.45);
}
.polaroid.is-open .story-more{
  opacity: 1;
  margin-top: 10px;
  /* max-height is set inline (to the content's real scrollHeight) by
     script.js so the expand/collapse transition is exactly proportional
     to this story's actual length, however long it grows or shrinks */
}
.polaroid.is-open .story-hint{ opacity: 0; }

/* ---------- Details / stationery table ---------- */
.details-section{ padding: 30px 20px 100px; }

.stationery-table{
  position: relative;
  max-width: 900px;
  margin: 0 auto 90px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 34px;
  padding: 10px;
}

.details-card{
  width: min(88vw, 340px);
  padding: 36px 26px;
  text-align: center;
  cursor: pointer;
  transform: rotate(-1.5deg);
  transition: transform 0.5s var(--ease-premium), box-shadow 0.5s var(--ease-premium);
}
.details-card:hover{ transform: rotate(0deg) translateY(-2px); }
.details-names{ font-family: 'Playfair Display', serif; font-size: 1.4rem; color: var(--dark-brown); }
.details-date{ font-family: 'Cormorant Garamond', serif; font-size: 1.1rem; margin: 4px 0 18px; }

.details-hidden{
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.6s var(--ease-premium), opacity 0.5s ease;
}
.details-card.is-open{ transform: rotate(0deg) scale(1.03); }
.details-card.is-open .details-hidden{ max-height: 400px; opacity: 1; margin-top: 8px; }
.details-card.is-open .details-hint{ opacity: 0; }

.details-row{ margin-bottom: 12px; }
.details-label{ font-size: 0.8rem; color: var(--gold); letter-spacing: 0.04em; margin: 0 0 2px; }
.details-value{ font-size: 1.05rem; font-weight: 500; margin: 0; }
.details-actions{
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.details-hint{
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  transition: opacity 0.3s ease;
}

.calendar-chip{
  width: 110px;
  padding: 18px 10px;
  text-align: center;
  transform: rotate(4deg);
}
.calendar-chip-month{ font-size: 0.75rem; letter-spacing: 0.12em; color: var(--gold); margin: 0; }
.calendar-chip-day{ font-family: 'Playfair Display', serif; font-size: 2rem; margin: 2px 0; color: var(--dark-brown); }
.calendar-chip-year{ font-size: 0.8rem; margin: 0; color: var(--warm-brown); }

.deco-seal{
  width: 64px; height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #C9A05C, var(--gold) 55%, #8f6f3f 100%);
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.25), 0 6px 14px rgba(46,36,29,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-8deg);
}
.deco-seal span{ font-family: 'Playfair Display', serif; color: var(--ivory); font-size: 1rem; }

.parents-table{
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}
.parents-card{
  width: min(80vw, 280px);
  padding: 26px 20px;
}
.parents-bride{ transform: rotate(-2deg); }
.parents-groom{ transform: rotate(2deg); }
.parents-label{ font-size: 0.85rem; color: var(--gold); margin: 0 0 6px; }
.parents-names{ font-size: 1.15rem; font-weight: 600; margin: 0; }
.parents-monogram{
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--dark-brown);
  letter-spacing: 0.04em;
}
.parents-monogram span{ color: var(--gold); font-style: italic; font-family: 'Cormorant Garamond', serif; margin: 0 6px; }

@media (min-width: 820px){
  .parents-table{ flex-direction: row; justify-content: center; align-items: center; gap: 50px; }
}

/* ---------- Gallery ---------- */
.gallery-section{ padding: 30px 20px 60px; }
.gallery-grid{
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 640px){
  .gallery-grid{ grid-template-columns: repeat(4, 1fr); }
}
.gallery-item{
  border: none;
  padding: 0;
  background: var(--cream);
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1/1;
  cursor: pointer;
  position: relative;
}
.gallery-item img{
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-soft), opacity 0.4s ease;
  opacity: 0;
}
.gallery-item img.is-loaded{ opacity: 1; }
@media (hover: hover){
  .gallery-item:hover img{ transform: scale(1.06); }
}
.gallery-item.is-placeholder{
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}
.gallery-item.is-placeholder::after{
  content: '\2731';
  color: var(--gold);
  font-size: 1.4rem;
}
.gallery-item.is-placeholder img{ display: none; }

/* ---------- Closing sign-off ---------- */
.closing-section{
  padding: 40px 20px 100px;
  text-align: center;
}
.closing-monogram{
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 5vw, 2.4rem);
  color: var(--dark-brown);
  letter-spacing: 0.06em;
  margin: 0;
}
.closing-monogram span{
  color: var(--gold);
  font-style: italic;
  font-family: 'Cormorant Garamond', serif;
  margin: 0 4px;
}
.closing-text{
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.2rem;
  color: var(--warm-brown);
  margin: 6px 0 0;
}

/* ---------- Footer ---------- */
.site-footer{
  text-align: center;
  padding: 50px 20px calc(50px + var(--safe-bottom));
  background: var(--dark-brown);
  color: var(--ivory);
}
.footer-monogram{ font-family: 'Playfair Display', serif; font-size: 1.6rem; margin: 0; }
.footer-date{ font-family: 'Cormorant Garamond', serif; font-style: italic; margin: 4px 0 22px; color: var(--gold-light); }
.footer-actions{
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.footer-actions .btn{ border-color: var(--gold); color: var(--ivory); }
.footer-actions .btn:hover{ background: rgba(182,154,106,0.2); }

/* ---------- Lightbox ---------- */
.lightbox{
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(20,15,10,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease;
  padding: 30px;
}
.lightbox.is-open{ opacity: 1; visibility: visible; }
.lightbox img{
  max-width: 100%;
  max-height: 85vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-close{
  position: absolute;
  top: calc(16px + var(--safe-top));
  right: 16px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(247,242,234,0.4);
  background: transparent;
  color: var(--ivory);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Floating music control ---------- */
.floating-music-btn{
  position: fixed;
  left: 16px;
  bottom: calc(24px + var(--safe-bottom));
  z-index: 700;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(182,154,106,0.5);
  background: rgba(247,242,234,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--warm-brown);
  box-shadow: 0 8px 20px rgba(46,36,29,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s var(--ease-soft), box-shadow 0.4s ease, background 0.3s ease;
}
.floating-music-btn:hover{ transform: scale(1.06); }
.floating-music-btn:active{ transform: scale(0.95); }
.floating-music-btn:focus-visible{ outline: 2px solid var(--gold); outline-offset: 3px; }

.floating-music-btn .music-note{
  font-size: 1.15rem;
  line-height: 1;
}
.floating-music-btn .music-bars{
  display: none;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 16px;
}
.floating-music-btn .music-bars span{
  display: block;
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: var(--warm-brown);
  transform-origin: bottom;
  animation: musicBar 1s ease-in-out infinite;
}
.floating-music-btn .music-bars span:nth-child(1){ animation-delay: -0.4s; }
.floating-music-btn .music-bars span:nth-child(2){ animation-delay: -0.2s; }
.floating-music-btn .music-bars span:nth-child(3){ animation-delay: 0s; }

@keyframes musicBar{
  0%,100%{ transform: scaleY(0.35); }
  50%{ transform: scaleY(1); }
}

/* playing state: swap icon, add a soft glow pulse */
.floating-music-btn.is-playing{
  background: rgba(247,242,234,0.8);
  box-shadow: 0 8px 20px rgba(46,36,29,0.25), 0 0 0 0 rgba(182,154,106,0.55);
  animation: musicGlow 2.6s ease-in-out infinite;
}
.floating-music-btn.is-playing .music-note{ display: none; }
.floating-music-btn.is-playing .music-bars{ display: flex; }

@keyframes musicGlow{
  0%,100%{ box-shadow: 0 8px 20px rgba(46,36,29,0.25), 0 0 0 0 rgba(182,154,106,0.4); }
  50%{ box-shadow: 0 8px 20px rgba(46,36,29,0.25), 0 0 0 8px rgba(182,154,106,0); }
}

@media (prefers-reduced-motion: reduce){
  .floating-music-btn.is-playing{ animation: none; }
  .floating-music-btn .music-bars span{ animation: none; transform: scaleY(0.7); }
}

/* ---------- Floating dog-explosion button (bottom-right) ---------- */
.floating-dog-btn{
  position: fixed;
  right: 16px;
  bottom: calc(20px + var(--safe-bottom));
  z-index: 700;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(182,154,106,0.5);
  background: rgba(247,242,234,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--warm-brown);
  box-shadow: 0 8px 20px rgba(46,36,29,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.25s var(--ease-soft), box-shadow 0.4s ease;
}
.floating-dog-btn:hover{ transform: scale(1.08) rotate(-6deg); }
.floating-dog-btn:active{ transform: scale(0.94); }
.floating-dog-btn:focus-visible{ outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- Flower / rose burst (envelope opening) ---------- */
#flower-burst-layer{
  position: absolute;
  inset: 0;
  z-index: 8; /* above the seal, so blossoms burst out over the whole envelope */
  pointer-events: none;
  overflow: visible;
}
.flower-bit{
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--fb-size, 18px);
  height: var(--fb-size, 18px);
  margin: calc(var(--fb-size, 18px) / -2) 0 0 calc(var(--fb-size, 18px) / -2);
  opacity: 0;
  transform: translate3d(0,0,0) scale(0.4) rotate(0deg);
  animation: flowerBurst var(--fb-dur, 1.8s) var(--ease-soft) var(--fb-delay, 0s) forwards;
}
.flower-bit.is-petal{ border-radius: 60% 5% 60% 5%; }
.flower-bit.is-blossom{ border-radius: 50%; }
.flower-bit.is-blossom::before,
.flower-bit.is-blossom::after{
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
}
.flower-bit.is-blossom::before{ transform: rotate(72deg) scale(0.92); }
.flower-bit.is-blossom::after{ transform: rotate(144deg) scale(0.92); }

@keyframes flowerBurst{
  0%{
    opacity: 0;
    transform: translate3d(0,0,0) scale(0.3) rotate(0deg);
  }
  12%{
    opacity: 1;
  }
  70%{
    opacity: 1;
  }
  100%{
    opacity: 0;
    transform:
      translate3d(var(--fb-tx, 0), var(--fb-ty, -120px), 0)
      scale(var(--fb-scale, 1))
      rotate(var(--fb-rot, 180deg));
  }
}

@media (prefers-reduced-motion: reduce){
  .flower-bit{ animation-duration: 0.6s !important; }
}

/* ---------- Dog photo explosion ---------- */
#dog-burst-layer{
  position: fixed;
  inset: 0;
  z-index: 850;
  pointer-events: none;
  overflow: hidden;
}
.dog-sticker{
  position: absolute;
  width: var(--dg-size, 64px);
  height: var(--dg-size, 64px);
  left: var(--dg-x, 50%);
  bottom: var(--dg-bottom, 10%);
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--ivory);
  box-shadow: 0 8px 18px rgba(46,36,29,0.4);
  opacity: 0;
  transform: translate3d(-50%, 0, 0) scale(0.5) rotate(0deg);
  animation: dogPop var(--dg-dur, 2.4s) cubic-bezier(0.2, 0.7, 0.3, 1) var(--dg-delay, 0s) forwards;
}
.dog-sticker img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes dogPop{
  0%{
    opacity: 0;
    transform: translate3d(-50%, 0, 0) scale(0.4) rotate(0deg);
  }
  14%{
    opacity: 1;
    transform: translate3d(-50%, var(--dg-rise, -60vh), 0) scale(1) rotate(var(--dg-rot1, 45deg));
  }
  75%{
    opacity: 1;
  }
  100%{
    opacity: 0;
    transform: translate3d(calc(-50% + var(--dg-drift, 40px)), var(--dg-fall, -30vh), 0) scale(0.85) rotate(var(--dg-rot2, 200deg));
  }
}

@media (prefers-reduced-motion: reduce){
  .dog-sticker{ animation-duration: 0.9s !important; }
}

/* =====================================================
   Accessibility & motion
===================================================== */
:focus-visible{ outline: 2px solid var(--gold); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce){
  *{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
