/* ============================================================
   Altin & Ariana — Fejesa  ·  styles
   Palette: warm cream, dusty rose, burgundy, soft gold
   ============================================================ */

:root {
  --cream: #faf5ee;
  --cream-2: #f3ead9;
  --rose: #c98b87;
  --rose-soft: #e6c8c4;
  --burgundy: #6e2a2a;
  --burgundy-deep: #4b1d1d;
  --gold: #b89668;
  --gold-soft: #d8bf94;
  --ink: #2d211e;
  --ink-soft: #5a4844;

  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --script: "Great Vibes", "Brush Script MT", cursive;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --max: 880px;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Language switching — hide the inactive language */
html[lang="sq"] [lang="en"] { display: none !important; }
html[lang="en"] [lang="sq"] { display: none !important; }

body {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(17px, 1.05vw + 14px, 20px);
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--rose-soft);
  color: var(--burgundy-deep);
}

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

.container {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

/* ============================================================
   Reveal animations (Intersection Observer driven)
   ============================================================ */

.reveal,
.reveal-up {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 1100ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 1100ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.is-visible,
.reveal-up.is-visible {
  opacity: 1;
  transform: none;
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff;
  isolation: isolate;
  padding: 6rem 1.25rem 4rem;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-color: #1d0a0a; /* fallback if photo fails */
  background-image:
    linear-gradient(180deg, rgba(20, 8, 8, 0.55) 0%, rgba(30, 12, 12, 0.5) 45%, rgba(20, 8, 8, 0.9) 100%),
    url("hero.png"),
    url("hero.jpg");
  background-size: cover, cover, cover;
  background-position: center center, center center, center center;
  background-repeat: no-repeat;
  background-attachment: fixed, fixed, fixed;
  animation: heroZoom 22s ease-in-out infinite alternate;
}

@keyframes heroZoom {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

.hero__veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at center, transparent 0%, rgba(40, 18, 18, 0.45) 90%),
    linear-gradient(180deg, transparent 60%, rgba(20, 8, 8, 0.6) 100%);
  pointer-events: none;
}

.hero__content {
  max-width: 780px;
  width: 100%;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 3px 14px rgba(0, 0, 0, 0.45);
}

.hero__divider svg {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-size: 0.78rem;
  font-weight: 400;
  margin: 0 0 0.6rem;
  color: var(--gold-soft);
}

.hero__kicker {
  font-family: var(--script);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  margin: 0 0 1.2rem;
  color: var(--gold-soft);
  line-height: 1;
  letter-spacing: 0.01em;
}

.names {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  margin: 0;
  font-size: clamp(3.4rem, 12vw, 7.5rem);
  line-height: 1;
  letter-spacing: -0.005em;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.25em 0.4em;
}

.names__a,
.names__b {
  display: inline-block;
}

.names__amp {
  font-family: var(--script);
  font-style: normal;
  color: var(--gold-soft);
  font-size: 0.85em;
  transform: translateY(0.06em);
}

.hero__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: 1.6rem auto 1.4rem;
  color: var(--gold-soft);
  max-width: 360px;
}

.hero__divider span {
  height: 1px;
  flex: 1;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gold-soft) 50%,
    transparent
  );
}

.hero__divider svg {
  animation: heartPulse 2.4s ease-in-out infinite;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

.hero__date {
  font-family: var(--serif);
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  letter-spacing: 0.45em;
  text-indent: 0.45em;
  margin: 0;
  color: #fbeedd;
}

.hero__date-sep {
  margin: 0 0.4em;
  color: var(--rose-soft);
}

.scroll-mouse {
  display: inline-block;
  margin-top: 3rem;
  width: 26px;
  height: 42px;
  border: 1.5px solid var(--gold-soft);
  border-radius: 14px;
  position: relative;
  text-decoration: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
  animation: mouseFloat 2.6s ease-in-out infinite;
}

.scroll-mouse__dot {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 3px;
  height: 7px;
  margin-left: -1.5px;
  background: var(--gold-soft);
  border-radius: 2px;
  animation: scrollMouseDot 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.scroll-mouse__label {
  display: block;
  margin-top: 0.7rem;
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold-soft);
  opacity: 0.85;
}

@keyframes scrollMouseDot {
  0%   { transform: translateY(0);    opacity: 1; }
  55%  { transform: translateY(14px); opacity: 0; }
  56%  { transform: translateY(0);    opacity: 0; }
  100% { transform: translateY(0);    opacity: 1; }
}

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

/* ============================================================
   Floating petals
   ============================================================ */

.petals {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.petals span {
  position: absolute;
  top: -10%;
  width: 12px;
  height: 12px;
  background: var(--rose-soft);
  border-radius: 75% 15% 75% 15%;
  opacity: 0.55;
  filter: blur(0.3px);
  animation: petalFall linear infinite;
}

.petals span:nth-child(1)  { left: 5%;  animation-duration: 14s; animation-delay: 0s;  }
.petals span:nth-child(2)  { left: 14%; animation-duration: 18s; animation-delay: -3s; background: var(--gold-soft); }
.petals span:nth-child(3)  { left: 23%; animation-duration: 16s; animation-delay: -6s; }
.petals span:nth-child(4)  { left: 32%; animation-duration: 20s; animation-delay: -2s; background: var(--gold-soft); }
.petals span:nth-child(5)  { left: 41%; animation-duration: 15s; animation-delay: -9s; }
.petals span:nth-child(6)  { left: 50%; animation-duration: 22s; animation-delay: -1s; }
.petals span:nth-child(7)  { left: 59%; animation-duration: 17s; animation-delay: -4s; background: var(--gold-soft); }
.petals span:nth-child(8)  { left: 68%; animation-duration: 19s; animation-delay: -7s; }
.petals span:nth-child(9)  { left: 77%; animation-duration: 14s; animation-delay: -10s; }
.petals span:nth-child(10) { left: 86%; animation-duration: 21s; animation-delay: -2s; background: var(--gold-soft); }
.petals span:nth-child(11) { left: 92%; animation-duration: 16s; animation-delay: -5s; }
.petals span:nth-child(12) { left: 96%; animation-duration: 18s; animation-delay: -8s; }

@keyframes petalFall {
  0% {
    transform: translateY(-10vh) rotate(0deg);
    opacity: 0;
  }
  10% { opacity: 0.55; }
  90% { opacity: 0.5; }
  100% {
    transform: translateY(110vh) rotate(540deg);
    opacity: 0;
  }
}

/* ============================================================
   Section titles & general
   ============================================================ */

section {
  padding: clamp(4.5rem, 10vw, 7rem) 0;
}

.section-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  text-align: center;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  margin: 0;
  color: var(--burgundy-deep);
  line-height: 1.1;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 1px;
  margin: 1rem auto 0;
  background: var(--gold);
}

.section-sub {
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0.6rem 0 2.5rem;
}

/* ============================================================
   Message
   ============================================================ */

.message {
  background: var(--cream);
  text-align: center;
}

.message p {
  font-size: clamp(1.2rem, 2.4vw, 1.6rem);
  line-height: 1.7;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 auto;
  max-width: 32em;
}

.message em {
  color: var(--burgundy);
  font-style: italic;
  font-weight: 500;
}

.message__sign {
  margin-top: 1.6rem !important;
  font-family: var(--script);
  font-style: normal !important;
  font-size: clamp(1.8rem, 3.5vw, 2.4rem) !important;
  color: var(--burgundy) !important;
  line-height: 1 !important;
}

/* ============================================================
   Countdown
   ============================================================ */

.countdown {
  background:
    radial-gradient(ellipse at top, var(--cream-2), transparent 70%),
    var(--cream);
  position: relative;
}

.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.6rem, 1.5vw, 1.2rem);
  max-width: 720px;
  margin: 0 auto;
}

.countdown__cell {
  background: #fff;
  border: 1px solid rgba(184, 150, 104, 0.3);
  border-radius: var(--radius);
  padding: clamp(1rem, 2.5vw, 1.8rem) 0.5rem;
  text-align: center;
  box-shadow: 0 6px 24px -18px rgba(74, 30, 30, 0.6);
  transition: transform 200ms ease;
}

.countdown__cell:hover {
  transform: translateY(-3px);
}

.countdown__num {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 6vw, 3.5rem);
  color: var(--burgundy-deep);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: transform 350ms cubic-bezier(0.22, 1, 0.36, 1);
}

.countdown__num.tick {
  transform: scale(1.12);
}

.countdown__label {
  display: block;
  margin-top: 0.6rem;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.7rem;
  color: var(--gold);
}

.countdown__until {
  text-align: center;
  margin: 2rem 0 0;
  font-style: italic;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2vw, 1.15rem);
  letter-spacing: 0.04em;
}

/* ============================================================
   Details cards + map
   ============================================================ */

.details {
  background: linear-gradient(180deg, var(--cream) 0%, var(--cream-2) 100%);
}

.details__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1rem;
}

.card {
  background: #fff;
  border: 1px solid rgba(184, 150, 104, 0.25);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.4rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 18px 40px -30px rgba(74, 30, 30, 0.5);
  transition: transform 320ms ease, box-shadow 320ms ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 50px -28px rgba(74, 30, 30, 0.55);
}

.card__icon {
  color: var(--burgundy);
  margin-bottom: 0.8rem;
}

.card__eyebrow {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 0.6rem;
}

.card__primary {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  color: var(--burgundy-deep);
  margin: 0 0 0.2rem;
  line-height: 1.3;
}

.card__big {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.6rem, 3.2vw, 2rem);
  color: var(--ink);
  margin: 0 0 0.2rem;
  line-height: 1.15;
}

.card__meta {
  font-family: var(--sans);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0 0 1.3rem;
}

.ghost-btn {
  display: inline-block;
  margin-top: auto;
  padding: 0.7em 1.5em;
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--burgundy);
  border: 1px solid var(--burgundy);
  border-radius: 999px;
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: background 220ms ease, color 220ms ease, transform 220ms ease;
}

.ghost-btn:hover {
  background: var(--burgundy);
  color: var(--cream);
  transform: translateY(-2px);
}

.map {
  margin-top: 2.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(184, 150, 104, 0.3);
  box-shadow: 0 18px 40px -30px rgba(74, 30, 30, 0.5);
  aspect-ratio: 16 / 9;
}

.map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  filter: saturate(0.9) contrast(0.95);
}

/* ============================================================
   Note section
   ============================================================ */

.note {
  background:
    linear-gradient(180deg, var(--cream-2) 0%, var(--cream) 100%);
  text-align: center;
}

.note p {
  font-style: italic;
  color: var(--ink-soft);
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  max-width: 30em;
  margin: 1.2rem auto 0;
}

.dress-code {
  font-style: normal !important;
  color: var(--ink) !important;
  line-height: 2 !important;
}

.dress-code strong {
  color: var(--burgundy);
  font-weight: 500;
  font-style: italic;
  margin-right: 0.25em;
}

/* ============================================================
   Footer
   ============================================================ */

.foot {
  background: var(--burgundy-deep);
  color: var(--cream);
  padding: 3rem 1rem;
  text-align: center;
}

.foot__names {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  margin: 0 0 0.4rem;
  letter-spacing: 0.02em;
}

.foot__names span {
  color: var(--rose);
  margin: 0 0.4em;
}

.foot__date {
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.4em;
  margin: 0;
  color: var(--gold-soft);
  text-transform: uppercase;
}

/* ============================================================
   Mobile tweaks
   ============================================================ */

@media (max-width: 640px) {
  .hero__bg {
    background-attachment: scroll; /* iOS doesn't support fixed well */
  }
  .details__grid {
    grid-template-columns: 1fr;
  }
  .countdown__grid {
    gap: 0.5rem;
  }
  .countdown__cell {
    padding: 1rem 0.4rem;
  }
  .countdown__label {
    font-size: 0.62rem;
    letter-spacing: 0.18em;
  }
}

/* ============================================================
   Envelope splash overlay
   ============================================================ */

.envelope-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-rows: 1fr auto auto auto 1fr;
  justify-items: center;
  align-items: center;
  gap: clamp(1.2rem, 3vw, 2rem);
  padding: clamp(1.5rem, 4vw, 3rem) 1rem;
  overflow: hidden;
  transition: opacity 700ms ease, transform 700ms ease;
}

.envelope-overlay__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at center, rgba(74, 30, 30, 0.4) 0%, transparent 70%),
    linear-gradient(180deg, #160808 0%, #2a1414 50%, #160808 100%);
}

.envelope-overlay__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(216, 191, 148, 0.06) 0%, transparent 30%),
    radial-gradient(circle at 80% 70%, rgba(216, 191, 148, 0.05) 0%, transparent 30%);
}

.envelope-eyebrow {
  grid-row: 2;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.45em;
  font-size: 0.72rem;
  color: var(--gold-soft);
  opacity: 0.85;
  margin: 0;
  text-align: center;
  text-indent: 0.45em;
  animation: envIntroFade 900ms ease-out 100ms backwards;
}

/* The envelope — 16:9 rectangle so the hero image inside fills it exactly */
.envelope {
  grid-row: 3;
  position: relative;
  width: clamp(320px, 88vw, 640px);
  aspect-ratio: 16 / 9;
  perspective: 1800px;
  transform-style: preserve-3d;
  cursor: pointer;
  animation: envIntroLift 1100ms cubic-bezier(0.22, 1, 0.36, 1) 200ms backwards;
}

/* Whole overlay is clickable so any tap anywhere opens the invitation */
.envelope-overlay {
  cursor: pointer;
}

@keyframes envIntroLift {
  from { opacity: 0; transform: translateY(40px) scale(0.92); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes envIntroFade {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 0.85; transform: none; }
}

.envelope__flap,
.envelope__letter {
  position: absolute;
  inset: 0;
}

/* The four origami flaps — each is a full-size element clipped to a triangle
   from one edge to the center. Together they tile the square completely. */
.envelope__flap {
  background:
    linear-gradient(135deg, #f7ecd5 0%, #e6d3a6 100%);
  transition: transform 1100ms cubic-bezier(0.65, 0, 0.35, 1) 350ms;
  backface-visibility: hidden;
  z-index: 3;
  box-shadow:
    0 0 0 1px rgba(120, 90, 50, 0.18),
    inset 0 0 24px rgba(120, 90, 50, 0.12);
}

.envelope__flap--top {
  clip-path: polygon(0 0, 100% 0, 50% 50%);
  transform-origin: top center;
  background: linear-gradient(180deg, #f7ecd5 0%, #e2cea0 100%);
}

.envelope__flap--bottom {
  clip-path: polygon(0 100%, 100% 100%, 50% 50%);
  transform-origin: bottom center;
  background: linear-gradient(0deg, #f7ecd5 0%, #e2cea0 100%);
}

.envelope__flap--left {
  clip-path: polygon(0 0, 0 100%, 50% 50%);
  transform-origin: left center;
  background: linear-gradient(90deg, #f0e3bb 0%, #e7d6a8 100%);
}

.envelope__flap--right {
  clip-path: polygon(100% 0, 100% 100%, 50% 50%);
  transform-origin: right center;
  background: linear-gradient(-90deg, #f0e3bb 0%, #e7d6a8 100%);
}

/* Subtle paper texture / fold lines via background pattern on a single overlay */
.envelope::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background:
    linear-gradient(45deg,
      transparent calc(50% - 0.6px),
      rgba(120, 90, 50, 0.22) 50%,
      transparent calc(50% + 0.6px)),
    linear-gradient(-45deg,
      transparent calc(50% - 0.6px),
      rgba(120, 90, 50, 0.22) 50%,
      transparent calc(50% + 0.6px));
  opacity: 0.85;
  transition: opacity 500ms ease 300ms;
}

.envelope-overlay.is-opening .envelope::before {
  opacity: 0;
}

/* Drop shadow under the closed envelope */
.envelope::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 4px;
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, 0.75);
  transition: opacity 600ms ease 300ms;
}

.envelope-overlay.is-opening .envelope::after {
  opacity: 0;
}

/* Wax seal — sits at the center where all 4 flaps meet */
.envelope__seal {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(56px, 18vw, 78px);
  height: clamp(56px, 18vw, 78px);
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 32% 28%, #b54040 0%, #842121 55%, #5a1313 100%);
  border-radius: 50%;
  display: grid;
  place-items: center;
  z-index: 4;
  box-shadow:
    0 4px 14px rgba(60, 10, 10, 0.6),
    inset 0 -3px 8px rgba(0, 0, 0, 0.45),
    inset 0 3px 6px rgba(255, 200, 200, 0.18);
  transition: transform 380ms cubic-bezier(0.5, 0, 0.7, 0), opacity 380ms ease-out;
  pointer-events: none;
  /* uneven wax edge */
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.2));
}

.envelope__seal::before {
  /* uneven wax border ring */
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #c25151, #6c1818);
  z-index: -1;
  filter: blur(0.8px);
  opacity: 0.6;
}

.envelope__seal-text {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(0.95rem, 3vw, 1.25rem);
  color: rgba(248, 218, 188, 0.95);
  letter-spacing: 0.01em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  line-height: 1;
}

.envelope__seal-amp {
  font-family: var(--script);
  font-style: normal;
  font-size: 0.85em;
  margin: 0 0.05em;
  color: rgba(248, 218, 188, 0.88);
}

/* What's inside the envelope — the hero image itself, in 16:9, revealed when
   the 4 flaps unfold. Background-attachment: fixed anchors the bg to the
   viewport so the visible crop matches the real hero behind it pixel-for-pixel
   at every scale; as the letter grows, the same image is simply revealed
   through a larger window. */
.envelope__letter {
  inset: 0;
  z-index: 1;
  border-radius: 0;

  background-color: #1d0a0a;
  background-image:
    /* matches .hero__veil */
    radial-gradient(ellipse at center, transparent 0%, rgba(40, 18, 18, 0.45) 90%),
    linear-gradient(180deg, transparent 60%, rgba(20, 8, 8, 0.6) 100%),
    /* matches .hero__bg */
    linear-gradient(180deg, rgba(20, 8, 8, 0.55) 0%, rgba(30, 12, 12, 0.5) 45%, rgba(20, 8, 8, 0.9) 100%),
    url("hero.png"),
    url("hero.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;

  opacity: 0.6;
  transform: scale(0.94);
  transform-origin: center center;
  transition:
    opacity 700ms ease 700ms,
    transform 700ms cubic-bezier(0.22, 1, 0.36, 1) 700ms;
}

/* iOS / older mobile browsers fall back to `scroll` for fixed bg attachment. */
@media (max-width: 640px) {
  .envelope__letter {
    background-attachment: scroll;
  }
}

.envelope-overlay.is-opening .envelope__letter {
  opacity: 1;
  transform: scale(1);
}

/* Open button — larger so older guests can clearly see and tap it */
.envelope-btn {
  grid-row: 4;
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding: 1.05em 2.4em;
  font-family: var(--sans);
  font-size: clamp(0.82rem, 2vw, 0.95rem);
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--burgundy-deep);
  background: var(--gold-soft);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow:
    0 8px 24px -10px rgba(216, 191, 148, 0.55),
    0 0 0 1px rgba(216, 191, 148, 0.7);
  transition: transform 220ms ease, box-shadow 260ms ease, background 260ms ease;
  animation: envBtnPulse 2.6s ease-in-out infinite, envIntroFade 700ms ease-out 600ms backwards;
}

.envelope-btn:hover {
  transform: translateY(-2px);
  background: #e7d2a2;
  box-shadow:
    0 14px 30px -10px rgba(216, 191, 148, 0.65),
    0 0 0 1px rgba(216, 191, 148, 0.8);
}

.envelope-btn__icon {
  display: inline-grid;
  place-items: center;
}

@keyframes envBtnPulse {
  0%, 100% { box-shadow: 0 8px 24px -10px rgba(216, 191, 148, 0.5), 0 0 0 1px rgba(216, 191, 148, 0.6); }
  50%      { box-shadow: 0 8px 30px -8px  rgba(216, 191, 148, 0.85), 0 0 0 6px rgba(216, 191, 148, 0.18); }
}

.envelope-hint {
  grid-row: 5;
  align-self: end;
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.4em;
  font-size: 0.6rem;
  color: rgba(216, 191, 148, 0.55);
  margin: 0 0 1rem;
  text-indent: 0.4em;
  animation: envIntroFade 900ms ease-out 800ms backwards;
}

/* ===== OPENING ANIMATION ===== */

.envelope-overlay.is-opening .envelope-btn,
.envelope-overlay.is-opening .envelope-hint,
.envelope-overlay.is-opening .envelope-eyebrow {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 320ms ease, transform 320ms ease;
  pointer-events: none;
  animation: none;
}

.envelope-overlay.is-opening .envelope__seal {
  transform: translate(-50%, -50%) scale(0.15) rotate(180deg);
  opacity: 0;
}

.envelope-overlay.is-opening .envelope__flap--top    { transform: rotateX(-185deg); }
.envelope-overlay.is-opening .envelope__flap--bottom { transform: rotateX(185deg); }
.envelope-overlay.is-opening .envelope__flap--left   { transform: rotateY(185deg); }
.envelope-overlay.is-opening .envelope__flap--right  { transform: rotateY(-185deg); }

/* ===== EXPANSION PHASE ===== */
/* The letter element (now fully visible) scales up 10× to engulf the viewport,
   the dark background fades, and the hero is revealed beneath. */

.envelope-overlay.is-expanding .envelope-overlay__bg {
  opacity: 0;
  transition: opacity 1100ms ease 200ms;
}

/* The hero-image letter scales up from its own center to exactly the viewport
   size. The background is already on the base rule (with attachment: fixed),
   so as the letter scales, the visible portion of the hero image grows in
   place — the bg itself isn't distorted because it's anchored to the viewport.
   `transform-origin: center` keeps the expansion symmetric. */
.envelope-overlay.is-expanding .envelope__letter {
  /* The exact scale to end at viewport size is computed in JS and provided
     via these custom properties. Fallback values are large enough to cover
     a reasonable viewport if JS fails to run for any reason. */
  transform: scale(var(--final-scale-x, 5), var(--final-scale-y, 5));
  transform-origin: center center;
  opacity: 1;

  transition: transform 1500ms cubic-bezier(0.42, 0, 0.2, 1);
}

/* Fade out the seal, flaps, fold lines and shadow during expansion too,
   in case any are still partially visible */
.envelope-overlay.is-expanding .envelope::before,
.envelope-overlay.is-expanding .envelope::after,
.envelope-overlay.is-expanding .envelope__flap {
  opacity: 0;
  transition: opacity 600ms ease;
}

/* Slow, deliberate fade of the fully-expanded hero image into the real hero
   behind it. Both share the same image, so the cross-fade reads as one
   image gently softening rather than a swap. ease-out makes the tail of the
   fade extra-soft so the handoff is barely perceptible. */
.envelope-overlay.is-opened {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1800ms cubic-bezier(0.33, 0, 0.2, 1);
}

/* Hide everything underneath while envelope is showing? No — let it pre-load.
   The overlay covers it visually with z-index. */

@media (prefers-reduced-motion: reduce) {
  .envelope-overlay,
  .envelope,
  .envelope-btn,
  .envelope-hint,
  .envelope-eyebrow {
    animation: none !important;
  }
  .envelope-overlay.is-opening .envelope__flap--top,
  .envelope-overlay.is-opening .envelope__flap--bottom,
  .envelope-overlay.is-opening .envelope__flap--left,
  .envelope-overlay.is-opening .envelope__flap--right {
    transform: none;
    opacity: 0;
  }
  .envelope-overlay.is-opening .envelope__letter { opacity: 1; transform: none; }
}

/* ============================================================
   Language toggle (SHQ / EN)
   ============================================================ */

.lang-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: rgba(45, 33, 30, 0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(216, 191, 148, 0.3);
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  box-shadow: 0 4px 18px -8px rgba(0, 0, 0, 0.35);
}

.lang-toggle__btn {
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.55);
  padding: 0.1rem 0.3rem;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-transform: uppercase;
  transition: color 200ms ease;
}

.lang-toggle__btn.is-active {
  color: var(--gold-soft);
}

.lang-toggle__btn:hover { color: #fff; }

.lang-toggle__sep {
  color: rgba(216, 191, 148, 0.45);
  font-size: 0.85em;
  pointer-events: none;
}

/* ============================================================
   Music toggle
   ============================================================ */

.music-toggle {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(45, 33, 30, 0.6);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(216, 191, 148, 0.35);
  color: var(--gold-soft);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  opacity: 1;
  transition: opacity 400ms ease 200ms, transform 200ms ease, background 220ms ease;
  box-shadow: 0 6px 22px -8px rgba(0, 0, 0, 0.45);
}

body.is-locked {
  overflow: hidden;
}

body.is-locked .music-toggle {
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

.music-toggle:hover {
  transform: scale(1.06);
  background: rgba(45, 33, 30, 0.78);
}

.music-toggle__icon {
  width: 18px;
  height: 18px;
  position: relative;
  z-index: 2;
}

.music-toggle .icon-play  { display: none; }
.music-toggle.is-paused .icon-pause { display: none; }
.music-toggle.is-paused .icon-play  { display: block; }

.music-toggle__pulse {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1px solid var(--gold-soft);
  opacity: 0;
  pointer-events: none;
}

.music-toggle:not(.is-paused) .music-toggle__pulse {
  animation: musicPulse 2.4s ease-out infinite;
}

@keyframes musicPulse {
  0%   { transform: scale(0.95); opacity: 0.7; }
  100% { transform: scale(1.7);  opacity: 0; }
}

@media (max-width: 640px) {
  .lang-toggle {
    top: 0.7rem;
    right: 0.7rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.65rem;
  }
  .music-toggle {
    bottom: 0.9rem;
    right: 0.9rem;
    width: 42px;
    height: 42px;
  }
}

/* Respect users who don't want motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal,
  .reveal-up {
    opacity: 1;
    transform: none;
  }
  .petals { display: none; }
}
