/* ==========================================================================
   Melvin & Anju — Wedding Invitation
   1. Tokens   2. Base   3. Typography   4. Layout   5. Opening
   6. Hero     7. Couple 8. Announce     9. Events  10. Countdown
   11. Closing 12. Buttons 13. Music 14. Petals 15. Reveal 16. Reduced motion
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
:root {
  --ivory: #FFFDF7;
  --ivory-2: #FAF5EA;
  --beige: #EDE3D2;
  --gold: #C6A56B;
  --gold-soft: #E3D2AE;
  --gold-text: #8A6A38;           /* AA-contrast gold for small text */
  --green: #263D32;
  --green-2: #2F4A3D;
  --brown: #695545;
  --ink: #3A3029;

  --font-script: 'Pinyon Script', 'Great Vibes', cursive;
  --font-serif: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --font-sans: 'Jost', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in-out: cubic-bezier(.7, 0, .25, 1);

  --gutter: clamp(1rem, 5vw, 3rem);
  --section-y: clamp(4.5rem, 13vw, 8.5rem);
  --radius: 18px;
  --shadow: 0 1px 2px rgba(105, 85, 69, .06), 0 18px 48px -18px rgba(105, 85, 69, .25);

  --paper: 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 .41 0 0 0 0 .33 0 0 0 0 .27 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--ivory);
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ivory) var(--paper);
  color: var(--brown);
  font-family: var(--font-serif);
  font-size: clamp(1.08rem, 1rem + .35vw, 1.25rem);
  font-weight: 500;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
@supports (overflow: clip) { body { overflow-x: clip; } }
body.is-locked { overflow: hidden; height: 100%; }

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 3. Typography ------------------------------------------------------------ */
.eyebrow {
  font-family: var(--font-sans);
  font-size: clamp(.68rem, .64rem + .2vw, .8rem);
  font-weight: 400;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold-text);
  padding-left: .32em;               /* optically centre letter-spaced text */
}
.eyebrow--light { color: var(--gold-soft); }

.section-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.1rem, 1.6rem + 2.6vw, 3.4rem);
  line-height: 1.15;
  color: var(--green);
  margin-top: .5rem;
}
.section-title--light { color: var(--ivory); }

.amp {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--gold);
}

.verse {
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.02rem, .95rem + .4vw, 1.25rem);
  line-height: 1.5;
  color: var(--brown);
  max-width: 24ch;
  margin-inline: auto;
}
.verse cite {
  display: block;
  margin-top: .45rem;
  font-family: var(--font-sans);
  font-style: normal;
  font-size: .68rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--gold-text);
}

.divider-svg {
  width: min(220px, 60%);
  height: 18px;
  margin: clamp(1rem, 3vw, 1.5rem) auto;
  color: var(--gold);
}
.divider-svg--sm { width: 150px; height: 14px; margin: .9rem auto; }

/* 4. Layout ---------------------------------------------------------------- */
.section {
  position: relative;
  padding: var(--section-y) var(--gutter);
  overflow: hidden;
  text-align: center;
}
@supports (overflow: clip) { .section { overflow: clip; } }
.section--soft {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 253, 247, .9), transparent 70%),
    var(--ivory-2);
}
.section--dark { background: var(--green); color: var(--ivory); }

.container { position: relative; z-index: 1; width: 100%; max-width: 1100px; margin-inline: auto; }
.container--narrow { max-width: 720px; }
.section-head { margin-bottom: clamp(2.5rem, 7vw, 4rem); }

/* Floral corners (parallax wrapper + flipped svg) */
.corner {
  position: absolute;
  width: clamp(130px, 34vw, 300px);
  aspect-ratio: 1;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}
.corner svg { width: 100%; height: 100%; }
.corner--sm { width: clamp(110px, 26vw, 220px); opacity: .9; }
.corner--tl { top: -10px; left: -10px; }
.corner--tr { top: -10px; right: -10px; }
.corner--tr svg { transform: scaleX(-1); }
.corner--bl { bottom: -10px; left: -10px; }
.corner--bl svg { transform: scaleY(-1); }
.corner--br { bottom: -10px; right: -10px; }
.corner--br svg { transform: scale(-1, -1); }

/* 5. Opening --------------------------------------------------------------- */
.opening {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: max(1.25rem, env(safe-area-inset-top)) var(--gutter) max(1.25rem, env(safe-area-inset-bottom));
  perspective: 1800px;
  overflow: hidden;
  text-align: center;
}

.gate {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.2%;
  overflow: hidden;
  background: var(--ivory) var(--paper);
  backface-visibility: hidden;
  transition: transform 1.9s var(--ease-in-out) .45s, filter 1.9s ease .45s;
  will-change: transform;
}
.gate--left  { left: 0;  transform-origin: left center; }
.gate--right { right: 0; transform-origin: right center; }

.gate::after {                          /* shading that deepens as the doors swing */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(105, 85, 69, .0), rgba(105, 85, 69, .18));
  opacity: 0;
  transition: opacity 1.6s ease .5s;
}
.gate--right::after { transform: scaleX(-1); }

.gate__arch {
  --aw: min(44vw, 330px);
  position: absolute;
  top: clamp(1.5rem, 7vh, 4rem);
  bottom: clamp(1.5rem, 6vh, 3.5rem);
  width: var(--aw);
  border: 1px solid var(--gold-soft);
}
.gate__arch::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(198, 165, 107, .35);
}
.gate--left .gate__arch  { right: 0; border-right: 0; border-top-left-radius: var(--aw); }
.gate--left .gate__arch::before  { right: -1px; border-right: 0; border-top-left-radius: calc(var(--aw) - 8px); }
.gate--right .gate__arch { left: 0;  border-left: 0;  border-top-right-radius: var(--aw); }
.gate--right .gate__arch::before { left: -1px; border-left: 0; border-top-right-radius: calc(var(--aw) - 8px); }

.gate__floral {
  position: absolute;
  width: min(clamp(120px, 32vw, 300px), 32vh);
  height: min(clamp(120px, 32vw, 300px), 32vh);
}
.gate--left .gate__floral--top     { top: -12px; left: -12px; }
.gate--left .gate__floral--bottom  { bottom: -12px; left: -12px; transform: scaleY(-1); }
.gate--right .gate__floral--top    { top: -12px; right: -12px; transform: scaleX(-1); }
.gate--right .gate__floral--bottom { bottom: -12px; right: -12px; transform: scale(-1, -1); }

.gate__handle {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 46px;
  margin-top: -23px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  opacity: 0;                           /* appear only as the doors part */
  transition: opacity .4s ease .3s;
}
.is-opening .gate__handle { opacity: .55; }
.gate--left .gate__handle  { right: 14px; }
.gate--right .gate__handle { left: 14px; }

.opening__content {
  position: relative;
  z-index: 2;
  width: min(100%, 520px);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity .6s ease, transform .9s var(--ease-out), filter .6s ease;
}
.opening__cross { width: 22px; height: 34px; color: var(--gold); margin-bottom: clamp(.8rem, 2.4vh, 1.3rem); }
.opening__names {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: clamp(.5rem, 1.8vh, 1rem) 0 clamp(.3rem, 1.2vh, .6rem);
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.5rem, 1.7rem + 4vw, 4rem);
  line-height: 1.1;
  color: var(--green);
}
.opening__names .amp { font-size: .42em; line-height: 1.3; }
.opening__invite {
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1rem, .95rem + .3vw, 1.18rem);
  line-height: 1.45;
  color: var(--brown);
  max-width: 22ch;
}

/* Event details panel — date sits on the top border like a legend */
.details {
  position: relative;
  width: min(100%, 480px, 78vw);
  margin: clamp(1.6rem, 4.5vh, 2.4rem) 0 clamp(1.4rem, 4vh, 2.1rem);
  padding: 1.55rem clamp(.6rem, 3vw, 1.2rem) 1.05rem;
  border: 1px solid var(--gold-soft);
  border-radius: 14px;
  background: rgba(255, 253, 247, .85);
}
.details__date {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 0 .9rem;
  background: var(--ivory);
  font-family: var(--font-sans);
  font-size: clamp(.62rem, .58rem + .2vw, .72rem);
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--gold-text);
}
.details__dot { width: 4px; height: 4px; background: var(--gold); transform: rotate(45deg); flex: none; }
.details__cols { display: grid; grid-template-columns: 1fr 1fr; }
.details__col { padding: 0 clamp(.4rem, 2vw, .9rem); }
.details__col + .details__col { border-left: 1px solid var(--gold-soft); }
.details__label {
  font-family: var(--font-sans);
  font-size: .58rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  line-height: 1.6;
  color: var(--gold-text);
  margin-bottom: .35rem;
}
.details__venue {
  font-weight: 600;
  font-size: clamp(.95rem, .9rem + .25vw, 1.08rem);
  line-height: 1.25;
  color: var(--ink);
}
.details__place {
  margin-top: .2rem;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(.88rem, .84rem + .2vw, .98rem);
  line-height: 1.3;
  color: var(--brown);
}
@media (max-width: 359px) {
  .details__date { letter-spacing: .1em; gap: .4rem; padding: 0 .5rem; }
}

.opening__hint {
  margin-top: .9rem;
  font-family: var(--font-sans);
  font-size: .64rem;
  letter-spacing: .14em;
  color: rgba(105, 85, 69, .65);
}

/* Entrance of the opening card */
.o-item { animation: rise 1.1s var(--ease-out) both; animation-delay: calc(.2s + var(--i, 0) * .14s); }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* Opening sequence */
.is-opening .opening__content { opacity: 0; transform: scale(.94) translateY(-12px); filter: blur(3px); pointer-events: none; }
.is-opening .gate--left  { transform: rotateY(-102deg); filter: brightness(.94); }
.is-opening .gate--right { transform: rotateY(102deg);  filter: brightness(.94); }
.is-opening .gate::after { opacity: 1; }
.is-opening .opening { pointer-events: none; }
.is-open .opening { opacity: 0; transition: opacity .9s ease .9s; }

/* Short screens (landscape phones) */
@media (max-height: 680px) {
  .opening__hint { display: none; }
  .opening__cross { height: 28px; margin-bottom: .5rem; }
  .opening__names { font-size: clamp(2.2rem, 1.5rem + 4vw, 3rem); margin: .3rem 0 .2rem; }
  .details { margin: 1.3rem 0 1.2rem; padding-top: 1.35rem; padding-bottom: .85rem; }
}
@media (max-height: 560px) {
  .opening__cross { display: none; }
  .opening__names { flex-direction: row; gap: .3em; font-size: clamp(1.9rem, 7vh, 2.5rem); margin: .1rem 0; }
  .opening__invite { max-width: none; font-size: .98rem; }
  .details { width: min(100%, 560px); margin: 1.1rem 0 .9rem; padding: 1.2rem 1rem .7rem; }
  .details__label { margin-bottom: .15rem; }
  .btn--open { min-height: 46px; padding-block: .7rem; }
}

/* Main invitation entrance (revealed behind the opening doors) */
.js .invitation { opacity: 0; transform: scale(1.04); transform-origin: 50% 30vh; }
.is-opening .invitation {
  opacity: 1;
  transform: none;
  transition: opacity 1.2s ease .6s, transform 2.4s var(--ease-out) .5s;
}

/* 6. Hero ------------------------------------------------------------------ */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding-top: clamp(4rem, 10vh, 6rem);
  padding-bottom: clamp(6.5rem, 14vh, 8rem);
}
.hero__arch {
  position: relative;
  z-index: 1;
  width: min(100%, 470px);
  padding: 8px;
  border: 1px solid var(--gold-soft);
  border-radius: 999px 999px 14px 14px;
  background: rgba(255, 253, 247, .72);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.hero__inner {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(198, 165, 107, .55);
  border-radius: 999px 999px 10px 10px;
  padding: clamp(3.5rem, 12vw, 5rem) clamp(1rem, 5vw, 2.5rem) clamp(2.4rem, 7vw, 3.2rem);
}
.hero__rays {
  position: absolute;
  top: -40px;
  left: 50%;
  width: 320px;
  height: 320px;
  margin-left: -160px;
  background: radial-gradient(circle, rgba(198, 165, 107, .18), transparent 62%);
  pointer-events: none;
  animation: breathe 7s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: .55; transform: scale(1.08); } }
.hero__cross { width: 30px; height: 46px; margin: 0 auto 1.2rem; color: var(--gold); position: relative; }
.hero .verse { margin-bottom: clamp(1.6rem, 5vw, 2.2rem); position: relative; }
.hero__names {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: .6rem;
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(3.4rem, 2rem + 8vw, 6rem);
  line-height: 1.1;
  color: var(--green);
}
.hero__names .amp { font-size: .45em; line-height: 1.1; }
.hero__date {
  font-family: var(--font-sans);
  font-size: clamp(.72rem, .68rem + .2vw, .85rem);
  letter-spacing: .26em;
  padding-left: .26em;
  text-transform: uppercase;
  color: var(--brown);
}

.scroll-cue {
  position: absolute;
  bottom: max(1rem, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  width: max-content;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
  font-family: var(--font-sans);
  font-size: .62rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold-text);
  z-index: 2;
}
.scroll-cue__line {
  width: 1px;
  height: 38px;
  background: linear-gradient(var(--gold), transparent);
  transform-origin: top;
  animation: cue 2.2s var(--ease-in-out) infinite;
}
@keyframes cue {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* 7. Couple ---------------------------------------------------------------- */
.couple__grid {
  display: grid;
  gap: clamp(1.5rem, 5vw, 2.5rem);
  justify-items: center;
}
.person { max-width: 340px; }
.person__medallion {
  position: relative;
  width: 132px;
  height: 160px;
  margin: 0 auto 1.4rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 999px 999px 10px 10px;
  background: var(--ivory);
  box-shadow: 0 0 0 6px var(--ivory-2), 0 0 0 7px var(--gold-soft), var(--shadow);
}
.person__wreath {
  position: absolute;
  left: 50%;
  bottom: -24px;
  width: 110px;
  height: 110px;
  margin-left: -55px;
  overflow: visible;
}
.person__initial {
  font-family: var(--font-script);
  font-size: 4.6rem;
  line-height: 1;
  color: var(--green);
  transform: translateY(-8px);
}
.person__role {
  font-family: var(--font-sans);
  font-size: .72rem;
  letter-spacing: .32em;
  padding-left: .32em;
  text-transform: uppercase;
  color: var(--gold-text);
  margin-top: 1.6rem;
}
.person__name {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(2.6rem, 2rem + 3vw, 3.4rem);
  line-height: 1.25;
  color: var(--green);
  margin: .2rem 0 .5rem;
}
.person__relation { font-style: italic; font-weight: 400; font-size: 1rem; color: var(--gold-text); }
.person__parents {
  font-weight: 600;
  font-size: clamp(1.1rem, 1rem + .4vw, 1.28rem);
  color: var(--ink);
  line-height: 1.4;
}
.person__house {
  margin-top: .3rem;
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 300;
  letter-spacing: .08em;
  line-height: 1.6;
  color: var(--brown);
}

.rings { width: 132px; }
.rings__svg { overflow: visible; }
.rings__ring, .rings__gem {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.rings__ring--b { stroke: #B8925A; }
.rings__gem { stroke-width: 1.6; fill: rgba(255, 253, 247, .9); }
.rings__spark { fill: none; stroke: var(--gold); stroke-width: 1.4; stroke-linecap: round; opacity: 0; }
.rings__heart { fill: #D9B98A; opacity: 0; transform-origin: 70px 12px; }
.rings.is-visible .rings__ring--a { animation: draw 1.6s var(--ease-out) .2s forwards; }
.rings.is-visible .rings__ring--b { animation: draw 1.6s var(--ease-out) .5s forwards; }
.rings.is-visible .rings__gem     { animation: draw .9s ease 1.4s forwards; }
.rings.is-visible .rings__spark   { animation: twinkle 2.6s ease-in-out 2s infinite; }
.rings.is-visible .rings__heart   { animation: heart-in .8s var(--ease-out) 1.8s forwards, heartbeat 2.4s ease-in-out 2.8s infinite; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes twinkle { 0%, 100% { opacity: 0; } 40%, 60% { opacity: 1; } }
@keyframes heart-in { from { opacity: 0; transform: translateY(8px) scale(.6); } to { opacity: 1; transform: none; } }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } }

@media (min-width: 900px) {
  .couple__grid { grid-template-columns: 1fr auto 1fr; align-items: center; }
  .rings { width: 150px; }
}

/* 8. Announcement ---------------------------------------------------------- */
.announce { padding-block: calc(var(--section-y) * 1.05); }
.announce__title {
  margin: .9rem auto clamp(2rem, 6vw, 3rem);
  font-weight: 400;
  font-size: clamp(2.2rem, 1.5rem + 3.6vw, 4rem);
  line-height: 1.12;
  color: var(--green);
  max-width: 16ch;
}
.announce__title em {
  display: block;
  font-family: var(--font-script);
  font-style: normal;
  font-size: 1.15em;
  line-height: 1.35;
  color: var(--gold);
}
.datecard { width: min(100%, 460px); margin-inline: auto; color: var(--ink); }
.datecard__month, .datecard__year {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.15rem, 1rem + .7vw, 1.5rem);
  letter-spacing: .32em;
  padding-left: .32em;
  text-transform: uppercase;
}
.datecard__row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(.6rem, 3vw, 1.4rem);
  margin: .5rem 0;
}
.datecard__side {
  padding: .7rem 0;
  border-top: 1px solid var(--brown);
  border-bottom: 1px solid var(--brown);
  font-family: var(--font-sans);
  font-size: clamp(.72rem, .66rem + .35vw, .95rem);
  letter-spacing: .22em;
  padding-left: .22em;
  text-transform: uppercase;
  white-space: nowrap;
}
.datecard__day {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(4rem, 3rem + 5vw, 6rem);
  line-height: 1;
  color: var(--gold);
  min-width: 1.1em;
}
.announce__line {
  margin-top: clamp(2rem, 6vw, 2.8rem);
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  font-style: italic;
  font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem);
  color: var(--brown);
}
.announce__line .sep { width: 5px; height: 5px; background: var(--gold); transform: rotate(45deg); }

.dove { position: absolute; width: clamp(54px, 12vw, 96px); height: auto; aspect-ratio: 64 / 40; z-index: 0; }
.dove--left  { top: 14%; left: clamp(.5rem, 6vw, 12%); transform-origin: center; }
.dove--left use, .dove--right use { animation: glide 7s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.dove--right { bottom: 16%; right: clamp(.5rem, 6vw, 12%); scale: -1 1; }
.dove--right use { animation-delay: -3.5s; }
@media (max-width: 699px) {
  .dove { width: 48px; }
  .dove--left { top: 3.2rem; }
  .dove--right { top: 5.2rem; bottom: auto; }
}
@keyframes glide {
  0%, 100% { transform: translate(0, 0) rotate(-2deg); }
  50% { transform: translate(6px, -10px) rotate(3deg); }
}

/* 9. Events ---------------------------------------------------------------- */
.events__grid {
  display: grid;
  gap: clamp(2rem, 6vw, 2.75rem);
  max-width: 520px;
  margin-inline: auto;
}
@media (min-width: 900px) {
  .events__grid { grid-template-columns: 1fr 1fr; max-width: none; align-items: stretch; }
}
.event-card {
  position: relative;
  padding: 10px;
  border-radius: var(--radius);
  background: var(--ivory);
  border: 1px solid var(--gold-soft);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .6s var(--ease-out), box-shadow .6s var(--ease-out);
}
@media (hover: hover) {
  .event-card:hover { transform: translateY(-6px); box-shadow: 0 2px 4px rgba(105, 85, 69, .06), 0 30px 60px -22px rgba(105, 85, 69, .35); }
}
.event-card__inner {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(2rem, 6vw, 2.75rem) clamp(1.1rem, 5vw, 2.25rem) clamp(1.75rem, 5vw, 2.25rem);
  border: 1px solid rgba(198, 165, 107, .45);
  border-radius: calc(var(--radius) - 6px);
}
.event-card__floral {
  position: absolute;
  top: -6px;
  width: clamp(90px, 24vw, 120px);
  height: clamp(90px, 24vw, 120px);
  z-index: 0;
  opacity: .95;
}
.event-card__floral--l { left: -6px; }
.event-card__floral--r { right: -6px; transform: scaleX(-1); }
.event-card__art { width: min(100%, 230px); margin: 1.2rem auto .4rem; color: var(--gold); }
.art { width: 100%; height: auto; overflow: visible; }
.art__fill { fill: var(--ivory); }
.art__lines {
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.art__lines > * { stroke-dasharray: 1; stroke-dashoffset: 0; }
.js .art__lines > * { stroke-dashoffset: 1; }
.art__accent { stroke: #A8854A; stroke-width: 1.8; }
.art__green { stroke: #6C8A68; }
.art__dots { fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: .1 9; opacity: .7; }
.art__blooms circle { fill: #FFFAF1; stroke: var(--gold); stroke-width: 1; }
.event-card.is-visible .art__lines > * { animation: draw 2.2s var(--ease-out) .3s forwards; }
.event-card.is-visible .art__lines > *:nth-child(2n) { animation-delay: .5s; }
.event-card.is-visible .art__lines > *:nth-child(3n) { animation-delay: .7s; }

.event-card__title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.3rem);
  line-height: 1.15;
  color: var(--green);
}
.event-card__venue {
  font-weight: 600;
  font-size: clamp(1.18rem, 1.05rem + .5vw, 1.38rem);
  color: var(--ink);
  line-height: 1.35;
}
.event-card__place { font-style: italic; color: var(--brown); }
.event-card__meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  margin: 1.4rem 0;
  border-top: 1px solid var(--gold-soft);
  border-bottom: 1px solid var(--gold-soft);
}
.event-card__meta > div { padding: .85rem .4rem; }
.event-card__meta > div + div { border-left: 1px solid var(--gold-soft); }
.event-card__meta dt {
  font-family: var(--font-sans);
  font-size: .62rem;
  letter-spacing: .3em;
  padding-left: .3em;
  text-transform: uppercase;
  color: var(--gold-text);
}
.event-card__meta dd { margin: .25rem 0 0; font-size: 1.02rem; line-height: 1.35; color: var(--ink); }
.event-card__map { width: 100%; max-width: 300px; margin: 0 auto 1.5rem; margin-top: auto; }
.minimap { width: 100%; height: auto; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--gold-soft); }
.minimap__bg { fill: #F3EBDD; }
.minimap__river { fill: none; stroke: #CFDCD3; stroke-width: 9; stroke-linecap: round; }
.minimap__road path { fill: none; stroke: #FFFDF7; stroke-width: 5; stroke-linecap: round; }
.minimap__lane path { fill: none; stroke: #FBF7EF; stroke-width: 2.2; stroke-linecap: round; }
.minimap__route { fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-dasharray: 5 5; stroke-linecap: round; animation: march 1.6s linear infinite; }
.minimap__start { fill: var(--gold); stroke: var(--ivory); stroke-width: 2; }
.minimap__pinbody path { fill: var(--green); }
.minimap__pinbody circle { fill: var(--gold-soft); }
.minimap__pinbody { animation: bob 2.4s ease-in-out infinite; }
.minimap__shadow { fill: rgba(38, 61, 50, .18); animation: shadow 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes march { to { stroke-dashoffset: -20; } }
@keyframes bob { 50% { transform: translateY(-5px); } }
@keyframes shadow { 50% { transform: scale(.7); opacity: .6; } }

/* 10. Countdown ------------------------------------------------------------ */
.countdown {
  background:
    radial-gradient(ellipse at 50% -10%, rgba(198, 165, 107, .16), transparent 60%),
    var(--green) var(--paper);
}
.countdown::before {                    /* fine gold frame */
  content: "";
  position: absolute;
  inset: clamp(10px, 2.5vw, 22px);
  border: 1px solid rgba(198, 165, 107, .35);
  pointer-events: none;
}
.countdown__cross { width: 24px; height: 36px; margin: 0 auto 1.2rem; color: var(--gold); }
.timer {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.45rem, 2.5vw, 1.25rem);
  max-width: 600px;
  margin: clamp(2rem, 6vw, 3rem) auto 0;
}
.timer__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(1.4rem, 5vw, 2.2rem) .25rem clamp(.85rem, 3vw, 1.2rem);
  border: 1px solid rgba(198, 165, 107, .55);
  border-radius: 999px 999px 10px 10px;
  background: rgba(255, 253, 247, .04);
  min-width: 0;
}
.timer__num {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.9rem, 1.2rem + 3.6vw, 3.4rem);
  line-height: 1;
  color: var(--ivory);
  font-variant-numeric: tabular-nums lining-nums;
}
.timer__num.is-tick { animation: tick .6s var(--ease-out); }
@keyframes tick { from { opacity: .2; transform: translateY(-35%); } to { opacity: 1; transform: none; } }
.timer__label {
  margin-top: .55rem;
  font-family: var(--font-sans);
  font-size: clamp(.52rem, .48rem + .3vw, .7rem);
  letter-spacing: .22em;
  padding-left: .22em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.timer-message { margin: clamp(2rem, 6vw, 3rem) auto 0; max-width: 32ch; animation: rise 1.2s var(--ease-out) both; }
.timer-message__script { font-family: var(--font-script); font-size: clamp(2.6rem, 2rem + 4vw, 4rem); line-height: 1.25; color: var(--gold-soft); }
.timer-message__text { margin-top: .6rem; font-style: italic; color: rgba(255, 253, 247, .88); }
.countdown__foot {
  margin-top: clamp(1.8rem, 5vw, 2.5rem);
  font-family: var(--font-sans);
  font-size: .72rem;
  letter-spacing: .2em;
  padding-left: .2em;
  text-transform: uppercase;
  color: rgba(255, 253, 247, .7);
}

/* 11. Closing & footer ------------------------------------------------------ */
.closing { padding-bottom: calc(var(--section-y) * 1.3); }
.closing__cross { position: relative; width: 80px; height: 100px; margin: 0 auto 1.6rem; display: grid; place-items: center; color: var(--gold); }
.closing__cross svg { position: relative; width: 34px; height: 52px; }
.closing__glow {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(198, 165, 107, .28), transparent 65%);
  animation: breathe 6s ease-in-out infinite;
}
.closing__lead {
  font-weight: 400;
  font-size: clamp(1.55rem, 1.2rem + 1.8vw, 2.4rem);
  line-height: 1.3;
  color: var(--green);
  max-width: 24ch;
  margin-inline: auto;
}
.closing__text {
  font-style: italic;
  font-size: clamp(1.1rem, 1rem + .5vw, 1.35rem);
  max-width: 34ch;
  margin-inline: auto;
}
.closing__sharing { margin-top: clamp(2.6rem, 8vw, 4rem); }
.closing__sharer { font-family: var(--font-script); font-size: clamp(2.4rem, 2rem + 2vw, 3.2rem); line-height: 1.4; color: var(--green); }

.footer {
  padding: 2.5rem var(--gutter) calc(6rem + env(safe-area-inset-bottom));
  text-align: center;
  background: var(--beige);
  border-top: 1px solid var(--gold-soft);
}
.footer__mono { display: flex; justify-content: center; align-items: center; gap: .8rem; font-family: var(--font-script); font-size: 2.2rem; color: var(--green); line-height: 1; }
.footer__mono svg { width: 14px; height: 22px; color: var(--gold); }
.footer__names { margin-top: .6rem; font-size: 1.1rem; color: var(--ink); }
.footer__date { font-family: var(--font-sans); font-size: .7rem; letter-spacing: .3em; padding-left: .3em; color: var(--gold-text); }

/* 12. Buttons -------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  min-height: 52px;
  padding: .9rem 1.9rem;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  isolation: isolate;
  font-family: var(--font-sans);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .45s var(--ease-out), box-shadow .45s var(--ease-out), background-color .3s;
}
.btn__icon { width: 18px; height: 18px; flex: none; }
.btn__icon--arrow { transition: transform .4s var(--ease-out); }
.btn:active { transform: scale(.97); }

.btn--open {
  color: var(--ivory);
  background: var(--green);
  box-shadow: 0 0 0 1px var(--green), 0 0 0 5px var(--ivory), 0 0 0 6px var(--gold), 0 18px 34px -14px rgba(38, 61, 50, .6);
}
.btn--open::before {                     /* soft pulsing halo */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(198, 165, 107, .55);
  animation: halo 2.8s ease-out 2s infinite;
  z-index: -1;
}
@keyframes halo { 0% { box-shadow: 0 0 0 0 rgba(198, 165, 107, .5); } 100% { box-shadow: 0 0 0 22px rgba(198, 165, 107, 0); } }
.btn__shine {
  position: absolute;
  top: 0; bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 253, 247, .35), transparent);
  transform: skewX(-18deg);
  animation: shine 4.5s ease-in-out 2.4s infinite;
  pointer-events: none;
}
@keyframes shine { 0% { left: -60%; } 30%, 100% { left: 130%; } }

.btn--gold {
  color: var(--ivory);
  background: var(--green);
  box-shadow: inset 0 0 0 1px rgba(198, 165, 107, .7), 0 12px 26px -14px rgba(38, 61, 50, .7);
}
.btn--gold::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--gold);
  transform: translateY(101%);
  transition: transform .5s var(--ease-out);
}
@media (hover: hover) {
  .btn--open:hover { transform: translateY(-2px); }
  .btn--gold:hover { color: var(--green); }
  .btn--gold:hover::after { transform: none; }
  .btn--gold:hover .btn__icon--arrow { transform: translateX(4px); }
}
.btn--gold:focus-visible { outline-offset: 5px; }

/* 13. Music control -------------------------------------------------------- */
.music {
  position: fixed;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 90;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: rgba(255, 253, 247, .92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--green);
  cursor: pointer;
  box-shadow: 0 10px 26px -10px rgba(38, 61, 50, .45);
  opacity: 0;
  transform: translateY(16px) scale(.9);
  transition: opacity .6s ease, transform .6s var(--ease-out), background-color .3s;
  touch-action: manipulation;
}
.music.is-visible { opacity: 1; transform: none; transition-delay: 2.2s, 2.2s, 0s; }
.music__icon { grid-area: 1 / 1; width: 22px; height: 22px; transition: opacity .3s, transform .3s; }
.music__icon--pause { opacity: 0; transform: scale(.6); }
.music.is-playing .music__icon--play { opacity: 0; transform: scale(.6); }
.music.is-playing .music__icon--pause { opacity: 1; transform: none; }
.music__ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px dashed var(--gold);
  opacity: 0;
  transition: opacity .4s;
}
.music.is-playing .music__ring { opacity: .8; animation: spin 9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (hover: hover) { .music:hover { background: var(--ivory); } }
@media (min-width: 900px) { .music { right: 28px; bottom: 28px; width: 56px; height: 56px; } }

/* 14. Petals --------------------------------------------------------------- */
.petals { position: fixed; inset: 0; z-index: 80; pointer-events: none; overflow: hidden; }
.petals.is-paused .petal, .petals.is-paused .petal i { animation-play-state: paused; }
.petal {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--size);
  height: var(--size);
  transform: translate3d(var(--x), -8vh, 0);
  animation: fall var(--dur) linear var(--delay) infinite;
  will-change: transform;
}
.petal--once { animation-iteration-count: 1; animation-fill-mode: both; }
.petal i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 150% 0 150% 0;
  background: #FFFCF6;
  box-shadow: inset -1px -1px 2px rgba(198, 165, 107, .35), 0 1px 2px rgba(105, 85, 69, .12);
  opacity: .9;
  animation: sway var(--sway) ease-in-out infinite alternate;
}
.petal--gold i { background: #F2E3C6; }
@keyframes fall {
  from { transform: translate3d(var(--x), -8vh, 0) rotate(0deg); }
  to   { transform: translate3d(calc(var(--x) + var(--drift)), 108vh, 0) rotate(var(--spin)); }
}
@keyframes sway {
  from { transform: rotateX(0deg) rotateY(0deg) translateX(-6px); }
  to   { transform: rotateX(55deg) rotateY(40deg) translateX(6px); }
}

/* 15. Scroll reveal -------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transition: opacity 1.1s ease var(--delay, 0s), transform 1.2s var(--ease-out) var(--delay, 0s), clip-path 1.6s var(--ease-in-out) var(--delay, 0s);
}
.js [data-reveal="up"]   { transform: translateY(28px); }
.js [data-reveal="zoom"] { transform: scale(.88); }
.js [data-reveal="write"] { opacity: 1; }
/* clip the inner span — a fully clipped observed element never "intersects" */
.js [data-reveal="write"] > span {
  display: inline-block;
  -webkit-clip-path: inset(-20% 100% -20% 0);
  clip-path: inset(-20% 100% -20% 0);
  transition: clip-path 1.8s var(--ease-in-out) var(--delay, 0s), -webkit-clip-path 1.8s var(--ease-in-out) var(--delay, 0s);
}
.js [data-reveal].is-visible { opacity: 1; transform: none; }
.js [data-reveal="write"].is-visible > span { -webkit-clip-path: inset(-20% -10% -20% -10%); clip-path: inset(-20% -10% -20% -10%); }
.script-reveal { display: inline-block; padding: 0 .15em; }

/* 16. Reduced motion ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .gate { transition: opacity .6s ease !important; }
  .is-opening .gate--left, .is-opening .gate--right { transform: none; opacity: 0; }
  .is-opening .invitation { transition: opacity .6s ease !important; }
  .rings__ring, .rings__gem, .js .art__lines > * { stroke-dashoffset: 0; }
  .rings__heart { opacity: 1; }
  .petals, .scroll-cue__line { display: none; }
}
