/* ==========================================================================
   Robin & Mai — wedding site stylesheet
   A flat-lay of stationery on a plaster table: cream paper, dusty blue ink,
   sage leaves, taupe cord and a little brass.
   ========================================================================== */

:root {
  /* the palette from the swatch card */
  --sand: #E8E1D3;
  --sage: #A3B18A;
  --blue: #A7BBC7;
  --taupe: #A38A7A;
  --charcoal: #6E6E6E;

  /* derived tones */
  --surface: #E6DFD3;
  --surface-deep: #D8CFC1;
  --paper: #F6F1E7;
  --paper-deep: #EFE8DA;
  --vellum: #EDEBE6;
  --ink: #5F7386;
  --ink-strong: #48596A;
  --ink-soft: #8CA0AE;
  --text: #5B5955;
  --muted: #8B857C;
  --sage-ink: #6F7F5C;
  --taupe-ink: #8A7160;
  --cord: #A38A7A;
  --brass: #A38A7A;

  --serif: 'Cormorant Garamond', 'Cormorant', Georgia, 'Times New Roman', serif;
  --script: 'Pinyon Script', 'Snell Roundhand', 'Apple Chancery', cursive;

  --shadow-card: 0 1px 1px rgba(70, 58, 44, .10), 0 6px 14px -4px rgba(70, 58, 44, .18), 0 24px 44px -22px rgba(70, 58, 44, .40);
  --shadow-lift: 0 2px 2px rgba(70, 58, 44, .10), 0 12px 24px -8px rgba(70, 58, 44, .22), 0 36px 60px -26px rgba(70, 58, 44, .45);

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .32 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  --plaster: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.0119 .01667' numOctaves='3' seed='5' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .36 0 0 0 0 .31 0 0 0 0 .25 0 0 0 .32 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E");

  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  color: var(--text);
  background: var(--surface);
  overflow-x: hidden;
  min-height: 100vh;
}
body.is-sealed { overflow: hidden; height: 100vh; }

/* plaster tabletop: mottled tone, subtle grain and a vignette */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(55% 45% at 18% 28%, rgba(255, 252, 246, .6), rgba(255, 252, 246, 0) 70%),
    radial-gradient(45% 55% at 82% 18%, rgba(160, 130, 100, .10), rgba(160, 130, 100, 0) 70%),
    radial-gradient(60% 50% at 72% 78%, rgba(255, 252, 246, .45), rgba(255, 252, 246, 0) 70%),
    radial-gradient(38% 42% at 28% 86%, rgba(160, 130, 100, .12), rgba(160, 130, 100, 0) 70%),
    linear-gradient(180deg, rgba(255, 252, 246, .25), rgba(160, 130, 100, .06));
}
/* faint toile wallpaper: the envelope-liner pattern, barely there */
.wallpaper {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: var(--wallpaper);
  background-size: 460px 460px;
  opacity: .13;
}
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    var(--grain) repeat,
    radial-gradient(120% 90% at 50% 40%, rgba(255, 250, 240, .35) 0%, rgba(120, 100, 80, 0) 55%, rgba(70, 58, 44, .28) 100%);
  background-size: 260px 260px, 100% 100%;
  opacity: .3;
  mix-blend-mode: multiply;
}
main { position: relative; z-index: 1; }

svg.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
a { color: var(--ink); }

/* ---- typography ------------------------------------------------------- */
.eyebrow {
  font-family: var(--serif);
  font-weight: 500;
  font-size: .78rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
}
.eyebrow--wrap { max-width: 22em; margin-inline: auto; line-height: 1.8; }
.script {
  font-family: var(--script);
  font-weight: 400;
  color: var(--ink-strong);
  font-size: clamp(2.4rem, 5.5vw, 3.4rem);
  line-height: 1.1;
  margin: 0;
  letter-spacing: .01em;
}
.script--light { color: var(--paper); }
.section__title { text-align: center; margin-bottom: .35em; }
.lead {
  text-align: center;
  max-width: 34em;
  margin: 0 auto 1.6rem;
  font-size: 1.15rem;
  color: var(--text);
}
.hint { text-align: center; color: var(--muted); font-style: italic; font-size: .98rem; margin: 1rem 0 0; }
.center { text-align: center; }

.mono { display: block; margin: 0 auto; color: var(--ink-strong); fill: currentColor; width: 4.6rem; height: auto; aspect-ratio: 309 / 279; }
.mono--card { width: clamp(3.4rem, 8vw, 4.8rem); margin-bottom: 1rem; }
.mono--small { width: calc(var(--w) * .1); margin-bottom: calc(var(--w) * .015); }
.mono--tag { width: 24cqi; margin-bottom: 1cqi; }
.mono--footer { width: 3.6rem; margin-bottom: .6rem; }

.names {
  margin: 1rem 0 1.1rem;
  font-family: var(--script);
  font-weight: 400;
  color: var(--ink-strong);
  font-size: clamp(2.3rem, 6vw, 3.5rem);
  line-height: 1.15;
  display: flex; flex-direction: column; align-items: center;
}
.names__amp { font-size: .55em; color: var(--ink-soft); line-height: .9; margin: .05em 0; }

.dateline {
  margin: .25rem 0;
  text-transform: uppercase;
  letter-spacing: .2em;
  font-size: .86rem;
  font-weight: 500;
  color: var(--text);
}
.dateline--script {
  font-family: var(--script);
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.7rem;
  color: var(--ink);
  margin: 0;
}
.dateline--lunar { text-transform: none; letter-spacing: .05em; font-style: italic; font-size: .95rem; color: var(--muted); }
.dateline:empty { display: none; }
.place { margin: 1rem 0 .2rem; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; font-size: .92rem; color: var(--ink-strong); }
.footnote { margin: 0; font-style: italic; color: var(--muted); font-size: 1.05rem; }

.rule { display: flex; justify-content: center; margin: 1rem 0; }
.rule span { width: 64px; height: 1px; background: linear-gradient(90deg, transparent, var(--ink-soft), transparent); position: relative; }
.rule span::before { content: ''; position: absolute; left: 50%; top: -3px; width: 6px; height: 6px; transform: translateX(-50%) rotate(45deg); background: var(--paper); border: 1px solid var(--ink-soft); }

/* ---- paper cards ------------------------------------------------------ */
.card {
  position: relative;
  background: var(--paper);
  box-shadow: var(--shadow-card);
  border-radius: 3px;
}
.card::before {
  content: '';
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background-image: var(--grain);
  background-size: 260px 260px;
  opacity: .28; mix-blend-mode: multiply;
}

/* ---- buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .7em 1.5em;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  font-size: .82rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .25s var(--ease-out), box-shadow .25s, background .25s, color .25s;
  box-shadow: 0 6px 14px -8px rgba(72, 89, 106, .6);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -10px rgba(72, 89, 106, .7); }
.btn:active { transform: translateY(0); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: none; }
.btn--ghost:hover { background: rgba(167, 187, 199, .18); box-shadow: none; }
.btn--small { padding: .55em 1.2em; font-size: .74rem; }
.btn__ico { width: 1.1em; height: 1.1em; }
.link { background: none; border: 0; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: .2em; cursor: pointer; font-size: 1rem; }

/* ---- language toggle -------------------------------------------------- */
.lang {
  position: fixed; top: 18px; right: 18px; z-index: 60;
  display: flex; gap: 6px;
  padding: 6px;
  background: rgba(246, 241, 231, .82);
  backdrop-filter: blur(6px);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
}
.lang__btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--cord);
  background: var(--paper);
  color: var(--taupe-ink);
  font-weight: 600; font-size: .78rem; letter-spacing: .08em;
  cursor: pointer;
  transition: background .25s, color .25s, transform .25s;
}
.lang__btn:hover { transform: translateY(-1px); }
.lang__btn.is-active { background: var(--blue); border-color: var(--ink-soft); color: #fff; }

/* ---- sections --------------------------------------------------------- */
.section { position: relative; padding: clamp(4rem, 9vw, 7rem) 16px; max-width: 1120px; margin: 0 auto; }

/* ==========================================================================
   Envelope intro
   ========================================================================== */
.intro {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: var(--surface);
  background-image:
    radial-gradient(55% 45% at 18% 28%, rgba(255, 252, 246, .6), rgba(255, 252, 246, 0) 70%),
    radial-gradient(45% 55% at 82% 18%, rgba(160, 130, 100, .10), rgba(160, 130, 100, 0) 70%),
    radial-gradient(60% 50% at 72% 78%, rgba(255, 252, 246, .45), rgba(255, 252, 246, 0) 70%),
    radial-gradient(120% 90% at 50% 40%, rgba(255, 252, 246, .15), rgba(160, 130, 100, .14));
  transition: opacity .8s var(--ease-soft), visibility .8s;
}
.intro::before { content: ''; position: absolute; inset: 0; background-image: var(--wallpaper); background-size: 460px 460px; opacity: .13; pointer-events: none; }
.intro > * { position: relative; }
.intro.is-open::before { opacity: 0;
}
.intro.is-open { opacity: 0; visibility: hidden; pointer-events: none; }
.intro.is-hidden { display: none; }

.envelope {
  --w: min(600px, 92vw);
  --h: calc(var(--w) * 0.667);
  position: relative;
  width: var(--w); height: var(--h);
  perspective: 1600px;
  transform-style: preserve-3d;
  filter: drop-shadow(0 30px 40px rgba(60, 48, 36, .35));
  animation: envelope-in 1.2s var(--ease-out) both;
}
@keyframes envelope-in { from { opacity: 0; transform: translateY(30px) scale(.96); } to { opacity: 1; transform: none; } }

.envelope__back {
  position: absolute; inset: 0;
  background: #E1D9C7;
  border-radius: 6px;
}
.envelope__card {
  position: absolute; left: 5%; top: 5%; width: 90%; height: 95%;
  background: var(--paper);
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
  z-index: 2;
  transition: transform 1s var(--ease-soft);
  overflow: hidden;
}
.envelope__card::after { content: ''; position: absolute; inset: 10px; border: 1px solid #D9CFBD; pointer-events: none; }
.envelope__card-inner { padding: calc(var(--w) * .035) 6% 0; text-align: center; }
.envelope__names { margin: .3em 0 .4em; font-family: var(--script); font-size: calc(var(--w) * .062); line-height: 1.12; color: var(--ink-strong); }
.envelope__names em { font-style: normal; font-size: .6em; color: var(--ink-soft); }
.envelope__card-inner .eyebrow { font-size: calc(var(--w) * .018); }

.envelope__pocket { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 3; border-radius: 6px; overflow: hidden; }
.envelope__address {
  position: absolute; left: 0; right: 0; bottom: 4.5%; z-index: 3;
  text-align: center; pointer-events: none;
}
.envelope__to { margin: 0; font-family: var(--script); font-size: calc(var(--w) * .044); color: var(--ink-strong); line-height: 1.2; }
.envelope__from { margin: .2em 0 0; font-size: calc(var(--w) * .02); letter-spacing: .25em; text-transform: uppercase; color: var(--taupe-ink); }

.envelope__flap {
  position: absolute; left: 0; top: 0; width: 100%; height: 58.5%;
  transform-origin: top center;
  transform-style: preserve-3d;
  z-index: 4;
  transition: transform 1.1s var(--ease-soft), z-index 0s .5s;
}
.envelope__flap-face {
  position: absolute; inset: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  backface-visibility: hidden;
}
.envelope__flap-front {
  background: #EDE6D6;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .3), rgba(120, 100, 80, .06));
  border-radius: 6px 6px 0 0;
}
.envelope__flap-front::after { content: ''; position: absolute; inset: 0; background-image: var(--grain); background-size: 260px 260px; opacity: .12; mix-blend-mode: multiply; }
.envelope__flap-front::before { content: ''; position: absolute; inset: 0; clip-path: polygon(0 0, 100% 0, 50% 100%); background: linear-gradient(180deg, transparent 96%, rgba(120, 100, 80, .12)); }
.envelope__flap-liner {
  transform: rotateX(180deg);
  background-color: #E3E8EB;
  background-size: 190px 190px;
}
.envelope.is-open .envelope__flap { transform: rotateX(-180deg); z-index: 1; }
.envelope.is-open .envelope__card { transform: translateY(-62%); transition-delay: .55s; }

.seal {
  position: absolute; left: 50%; top: 58.5%; z-index: 6;
  width: calc(var(--w) * .15); height: calc(var(--w) * .15);
  transform: translate(-50%, -50%);
  border: 0; background: none; padding: 0; cursor: pointer;
  filter: drop-shadow(0 4px 6px rgba(60, 48, 36, .35));
  transition: transform .35s var(--ease-out), opacity .35s, filter .35s;
}
.seal:hover, .seal:focus-visible { transform: translate(-50%, -50%) scale(1.06); filter: drop-shadow(0 8px 12px rgba(60, 48, 36, .4)); outline: none; }
.seal__svg { width: 100%; height: 100%; display: block; }
.seal__text { font-family: var(--script); font-size: 30px; fill: #F3F6F8; opacity: .95; }
.envelope.is-open .seal { transform: translate(-50%, -50%) scale(1.25) rotate(8deg); opacity: 0; pointer-events: none; }

.intro__hint {
  position: absolute; left: 50%; top: calc(58.5% + var(--w) * .082); transform: translateX(-50%);
  z-index: 6; margin: 0;
  font-style: italic; color: var(--ink-strong); font-size: 1.05rem; white-space: nowrap;
  animation: hint-pulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hint-pulse { 0%, 100% { opacity: .55; transform: translateX(-50%) translateY(0); } 50% { opacity: 1; transform: translateX(-50%) translateY(-3px); } }
.envelope.is-open .intro__hint { opacity: 0; animation: none; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  max-width: none; min-height: 100vh; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-top: clamp(6rem, 12vh, 9rem);
}
/* the flat-lay group: card, envelope liner and props. Scaled with the viewport by main.js */
.stage { position: relative; width: min(600px, 100%); transform: scale(var(--stage-scale, 1)); transform-origin: 50% 50%; }
.invite {
  position: relative; z-index: 2;
  width: min(600px, 100%);
  padding: clamp(2.2rem, 7vw, 3.6rem) clamp(1.6rem, 6vw, 3.4rem);
  text-align: center;
  opacity: 0; transform: translateY(24px) scale(.97);
  transition: opacity 1s var(--ease-out) .2s, transform 1s var(--ease-out) .2s;
}
body:not(.is-sealed) .invite { opacity: 1; transform: none; }
.invite__border { position: absolute; inset: 0; pointer-events: none; }
.invite__border img, .invite__border svg { width: 100%; height: 100%; display: block; }
.invite__body { position: relative; padding: clamp(1rem, 3vw, 1.6rem) clamp(.4rem, 2vw, 1rem); }
.invite__actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin-top: 1.8rem; }

/* flat-lay props around the invitation */
.props { position: absolute; inset: 0; pointer-events: none; }
.prop { position: absolute; transition: transform .7s var(--ease-out), opacity 1s var(--ease-out) .6s; will-change: transform; opacity: 0; animation: drift 6s ease-in-out infinite alternate; }
.prop:nth-child(2n) { animation-duration: 7.5s; animation-direction: alternate-reverse; }
.prop:nth-child(3n) { animation-duration: 8.5s; animation-delay: -3s; }
.prop:nth-child(5n) { animation-duration: 9.5s; animation-delay: -5s; }
/* slow idle drift on the `translate` property, so it stacks with the pointer parallax set on `transform` */
@keyframes drift { from { translate: -4px 3px; } to { translate: 5px -6px; } }
body:not(.is-sealed) .prop { opacity: 1; }
.prop--key { left: -200px; top: 40px; width: 72px; height: 240px; rotate: -24deg; filter: drop-shadow(2px 6px 6px rgba(60, 48, 36, .35)); }
.prop--lantern { right: -430px; bottom: 30px; width: 104px; height: 170px; filter: drop-shadow(2px 8px 8px rgba(60, 48, 36, .35)); }
.prop--bouquet { right: -250px; top: -150px; width: 320px; height: 320px; z-index: 3; }
.prop--bouquet-2 { left: -290px; bottom: -90px; width: 250px; height: 250px; rotate: 160deg; }
.prop--rose { left: -520px; top: 330px; width: 420px; height: 240px; rotate: 8deg; z-index: 3; }
.prop--tassel-loose { left: -130px; top: -120px; width: 70px; height: 175px; rotate: -34deg; filter: drop-shadow(1px 4px 5px rgba(60, 48, 36, .25)); }
.prop--seal { width: 74px; height: 74px; filter: drop-shadow(0 4px 6px rgba(60, 48, 36, .3)); z-index: 3; }
.prop--seal-1 { left: -120px; bottom: -70px; }
.prop--seal-2 { left: -40px; bottom: -104px; rotate: 12deg; }
.prop--minitag { right: -262px; top: 300px; rotate: 9deg; transform-origin: top center; filter: drop-shadow(0 16px 22px rgba(60, 48, 36, .28)); }
.tag.tag--mini { width: 210px; filter: none; }
.tag--mini .tag__body { padding: 16% 12% 10%; }
.tag__script { font-family: var(--script); color: var(--ink-strong); font-size: 12cqi; line-height: 1; margin: 1cqi 0 0; }
.tag--mini .tassel { width: 32%; height: 60%; }
.tag--mini .mono--tag { width: 30cqi; margin-bottom: 0; }
.tag--mini .tag__body .eyebrow { font-size: 4.4cqi; }
.tag--mini .tag__date { font-size: 5.6cqi; letter-spacing: .28em; margin-top: 1.5cqi; }
.tag--mini .tag__ornament { width: 40%; }
.liner-peek {
  position: absolute; left: 50%; top: -110px; width: 640px; height: 460px; margin-left: -320px; z-index: 0;
  background-color: #E3E8EB; background-size: 190px 190px;
  clip-path: path('M0 176 C0 100 44 66 122 52 C198 40 232 0 320 0 C408 0 442 40 518 52 C596 66 640 100 640 176 V460 H0 Z');
  rotate: -2deg;
  filter: drop-shadow(0 10px 18px rgba(60, 48, 36, .25));
  opacity: 0; transition: opacity 1.2s var(--ease-out) .5s;
}
body:not(.is-sealed) .liner-peek { opacity: 1; }
.liner-peek::after { content: ''; position: absolute; inset: 10px; clip-path: path('M0 166 C0 94 40 62 116 48 C190 36 224 0 310 0 C396 0 430 36 504 48 C580 62 620 94 620 166 V440 H0 Z'); box-shadow: inset 0 0 0 1px rgba(95, 115, 134, .35); }
.prop > svg { width: 100%; height: 100%; display: block; }

.scroll-hint {
  margin-top: 3rem; text-decoration: none; color: var(--muted);
  font-size: .72rem; letter-spacing: .3em; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: .6rem;
}
.scroll-hint i { width: 1px; height: 46px; background: linear-gradient(var(--muted), transparent); animation: drip 2.2s ease-in-out infinite; }
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ==========================================================================
   Countdown tag
   ========================================================================== */
.section--countdown { padding-top: 1rem; display: flex; flex-direction: column; align-items: center; }
.hanger { position: relative; display: flex; flex-direction: column; align-items: center; transform-origin: top center; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; padding-bottom: calc(min(320px, 82vw) * .74); }
.hanger:active { cursor: grabbing; }
.hanger__string { width: 20px; height: 120px; display: block; }
.tag {
  position: relative; width: min(320px, 82vw); aspect-ratio: 300 / 420;
  filter: drop-shadow(0 18px 24px rgba(60, 48, 36, .3));
  container-type: inline-size;
  margin-top: -2px;
}
.tag__shape { position: absolute; inset: 0; width: 100%; height: 100%; }
.tag__body { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 14% 12% 10%; gap: .5rem; }
.tag__body .eyebrow { font-size: 3.6cqi; }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5cqi; width: 100%; margin: 1cqi 0; }
.countdown div { display: flex; flex-direction: column; align-items: center; }
.countdown b { font-family: var(--serif); font-weight: 500; font-size: 10cqi; color: var(--ink-strong); line-height: 1; font-variant-numeric: tabular-nums; }
.countdown span { font-size: 2.7cqi; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-top: .5cqi; }
.countdown.is-done { grid-template-columns: 1fr; }
.countdown.is-done b { font-family: var(--script); font-size: 11cqi; }
.tag__date { margin: 0; font-size: 3.4cqi; letter-spacing: .3em; color: var(--taupe-ink); }
.tag__ornament { width: 46%; margin-top: 2cqi; opacity: .9; }
.tag__ornament svg { width: 100%; height: auto; display: block; }
.tassel { position: absolute; left: 50%; top: 100%; width: 30%; height: 62%; transform: translate(-50%, -6%); transform-origin: top center; }
.tassel--tag { animation: sway 5s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: translate(-50%, -6%) rotate(-2.5deg); } 50% { transform: translate(-50%, -6%) rotate(2.5deg); } }
.hanger.is-swinging .tassel--tag { animation: none; }

/* ==========================================================================
   Details + Welcome
   ========================================================================== */
.details-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: clamp(2rem, 6vw, 5rem); }
.arch { position: relative; width: min(500px, 92vw); aspect-ratio: 320 / 440; container-type: inline-size; filter: drop-shadow(0 22px 30px rgba(40, 48, 60, .35)); transform: rotate(-1.5deg); }
.arch__shape { position: absolute; inset: 0; width: 100%; height: 100%; }
.arch__body { position: absolute; inset: 0; padding: 21.5% 11% 12%; text-align: center; color: #FBF8F2; display: flex; flex-direction: column; align-items: center; }
.arch__body .script { font-size: 11cqi; margin-bottom: 1cqi; }
.deflist { margin: 0; display: grid; gap: .1cqi; }
.deflist dt { font-size: 2.9cqi; letter-spacing: .24em; text-transform: uppercase; font-weight: 700; color: #FBF8F2; margin-top: 1.6cqi; }
.deflist dd { margin: 0; font-size: 3.5cqi; line-height: 1.25; color: #FBF8F2; }

.welcome {
  width: min(460px, 92vw); padding: 2.8rem 2.2rem 2.4rem; text-align: center;
  border-radius: 999px 999px 3px 3px; transform: rotate(1.5deg);
  margin-top: 2rem;
}
.welcome::before { border-radius: inherit; }
.welcome__ring { position: absolute; inset: 12px; border-radius: 999px 999px 2px 2px; border: 1px solid var(--blue); pointer-events: none; }
.welcome__ring::after { content: ''; position: absolute; inset: 4px; border-radius: 999px 999px 1px 1px; border: 1px solid var(--blue); opacity: .5; }
.welcome .script { font-size: clamp(2.6rem, 4vw, 3.3rem); margin-top: .8rem; }
.venue { width: 100%; height: auto; margin: 1.2rem 0 .6rem; display: block; }
.welcome__names { margin: .2rem 0 .3rem; font-family: var(--script); font-size: clamp(2rem, 3vw, 2.5rem); color: var(--ink-strong); }
.welcome__names i { font-style: normal; font-size: .6em; color: var(--ink-soft); }

/* ==========================================================================
   Programme
   ========================================================================== */
.timeline { list-style: none; margin: 2rem auto 0; padding: 0; max-width: 560px; position: relative; }
/* the line runs through the dot centres: time column + gap + half a dot */
.timeline::before { content: ''; position: absolute; left: calc(64px + .6rem + 23.5px); top: 12px; bottom: 12px; width: 1px; background: linear-gradient(var(--ink-soft), var(--ink-soft) 80%, transparent); }
.timeline li { display: grid; grid-template-columns: 64px 48px 1fr; align-items: center; gap: .6rem; padding: .9rem 0; }
.timeline time { font-weight: 600; letter-spacing: .12em; color: var(--ink-strong); font-size: 1.05rem; text-align: right; font-variant-numeric: tabular-nums; }
.timeline .dot { width: 48px; height: 48px; border-radius: 50%; background: var(--paper); border: 1px solid var(--blue); display: grid; place-items: center; color: var(--ink); box-shadow: var(--shadow-card); position: relative; z-index: 1; }
.timeline .dot svg { width: 26px; height: 26px; }
.timeline p { margin: 0; font-size: 1.15rem; }
/* cycle the dress-code colours through the timeline and the note icons */
.timeline li:nth-child(3n+2) .dot { border-color: var(--sage); color: var(--sage-ink); background: color-mix(in srgb, var(--sage) 14%, var(--paper)); }
.timeline li:nth-child(3n) .dot { border-color: var(--taupe); color: var(--taupe-ink); background: color-mix(in srgb, var(--taupe) 14%, var(--paper)); }
.timeline li:nth-child(3n+1) .dot { background: color-mix(in srgb, var(--blue) 16%, var(--paper)); }

/* ==========================================================================
   Travel / map
   ========================================================================== */
.map { max-width: 900px; margin: 1.5rem auto 0; padding: 12px; border-radius: 4px; cursor: pointer; transition: transform .4s var(--ease-out), box-shadow .4s; }
.map:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.map:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.map__svg { width: 100%; height: auto; display: block; border: 1px solid var(--blue); border-radius: 2px; }
.map__label { font-family: var(--serif); font-size: 24px; fill: var(--ink-strong); font-style: italic; }
.map__label--big { font-family: var(--script); font-style: normal; font-size: 34px; }
.map__label--sub { font-style: normal; font-size: 11px; letter-spacing: 3px; text-transform: uppercase; fill: var(--ink); }
.map__label--sea { font-size: 20px; fill: #7E95A6; letter-spacing: 4px; text-transform: uppercase; font-style: normal; }
.map__heart { animation: heart 2.2s ease-in-out infinite; }
@keyframes heart { 0%, 100% { transform: translate(650px, 258px) scale(1); } 50% { transform: translate(650px, 258px) scale(1.15); } }
.travel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; max-width: 900px; margin: 2.5rem auto 2rem; }
.note { text-align: center; padding: 0 .6rem; }
.note__ico { width: 40px; height: 40px; color: var(--ink); margin-bottom: .4rem; }
.note:nth-child(3n+2) .note__ico { color: var(--sage-ink); }
.note:nth-child(3n) .note__ico { color: var(--taupe-ink); }
.note h3 { margin: 0 0 .3rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; font-size: .82rem; color: var(--ink-strong); }
.note p { margin: 0; font-size: 1.05rem; }

/* ==========================================================================
   Dress code
   ========================================================================== */
.torn { max-width: 860px; margin: 1rem auto 0; filter: drop-shadow(0 14px 18px rgba(60, 48, 36, .25)); transform: rotate(-.6deg); }
.torn__paper { background: #F4EFE5; padding: 2.8rem 2rem 2.6rem; position: relative; }
.torn__paper::before { content: ''; position: absolute; inset: 0; background-image: var(--grain); background-size: 260px 260px; opacity: .3; mix-blend-mode: multiply; pointer-events: none; }
.swatches { position: relative; }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.2rem; }
.swatch { background: none; border: 0; padding: 0; cursor: pointer; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .6rem; transition: transform .3s var(--ease-out); }
.swatch:hover { transform: translateY(-3px); }
.swatch__chip { width: 100%; aspect-ratio: 1 / .78; border-radius: 6px; filter: url(#rough); position: relative; transition: transform .3s var(--ease-out); }
.swatch__chip::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background-image: var(--grain); background-size: 200px 200px; opacity: .35; mix-blend-mode: multiply; }
.swatch.is-selected .swatch__chip { transform: scale(1.06); }
.swatch.is-selected .swatch__chip::before { content: ''; position: absolute; inset: -6px; border: 1px solid var(--ink); border-radius: 10px; }
.swatch__name { font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text); font-weight: 600; }
.swatch__hex { font-size: .82rem; color: var(--muted); letter-spacing: .1em; margin-top: -.4rem; }

.figures { display: flex; justify-content: center; gap: clamp(1.5rem, 6vw, 5rem); margin-top: 2.2rem; }
.figure { background: none; border: 0; padding: 1rem; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: .3rem; border-radius: 12px; transition: background .3s; position: relative; }
.figure svg { width: clamp(120px, 22vw, 180px); height: auto; overflow: visible; }
.figure__fill { transition: fill .6s var(--ease-soft); }
.figure__label { font-size: .8rem; letter-spacing: .22em; text-transform: uppercase; font-weight: 600; color: var(--ink-strong); margin-top: .6rem; }
.figure__color { font-style: italic; color: var(--muted); font-size: .95rem; }
.figure::before { content: ''; position: absolute; inset: 0; border-radius: 12px; border: 1px dashed transparent; transition: border-color .3s; }
.figure.is-active::before { border-color: var(--ink-soft); opacity: .6; }
.figure.is-active .figure__label::after { content: ' ✦'; color: var(--ink); }

/* ==========================================================================
   Photos: two oval frames beside the countdown tag
   ========================================================================== */
/* photo · tag · photo in one row, never wrapping; below 900px it becomes one column */
.keepsakes { display: flex; flex-wrap: nowrap; align-items: center; justify-content: center; gap: clamp(1.5rem, 5vw, 6.5rem); width: 100%; }
.frame { position: relative; width: min(300px, 24vw); aspect-ratio: 3 / 4; filter: drop-shadow(0 16px 22px rgba(60, 48, 36, .28)); flex: none; }
.frame--left { rotate: -3deg; margin-top: 4rem; }
.frame--right { rotate: 3deg; margin-top: 6rem; }
.frame__mat { position: absolute; inset: 0; background: var(--vellum); clip-path: ellipse(50% 50% at 50% 50%); }
.frame__mat::after { content: ''; position: absolute; inset: 0; background-image: var(--grain); background-size: 260px 260px; opacity: .3; mix-blend-mode: multiply; }
.frame__img { position: absolute; inset: 7%; clip-path: ellipse(50% 50% at 50% 50%); overflow: hidden; background: var(--paper-deep); }
.frame__img img { width: 100%; height: 100%; object-fit: cover; }
.frame__ring { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.frame__placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 18%; color: var(--muted); font-size: .9rem; gap: .4rem; }
.frame__placeholder code { font-family: ui-monospace, Menlo, monospace; font-size: .68rem; white-space: nowrap; color: var(--ink); background: rgba(167, 187, 199, .2); padding: .15em .5em; border-radius: 4px; }
.frame__placeholder svg { width: 40%; height: auto; opacity: .8; }
.frame__caption { position: absolute; left: 0; right: 0; top: 100%; margin: .8rem 0 0; text-align: center; font-style: italic; color: var(--muted); font-size: 1rem; }
.frame__caption:empty { display: none; }

/* ==========================================================================
   RSVP
   ========================================================================== */
.section--rsvp { display: flex; justify-content: center; }
.rsvp { width: min(620px, 100%); padding: clamp(2.4rem, 6vw, 3.4rem) clamp(1.4rem, 5vw, 3rem); text-align: center; border-radius: 28px; border: 6px solid var(--blue); }
.rsvp::before { border-radius: inherit; }
.rsvp::after { content: ''; position: absolute; inset: 14px; border: 1px solid var(--blue); border-radius: 18px; pointer-events: none; }
.rsvp__corner { position: absolute; width: 70px; height: 70px; z-index: 1; }
.rsvp__corner--tl { left: 8px; top: 8px; }
.rsvp__corner--tr { right: 8px; top: 8px; transform: scaleX(-1); }
.rsvp__corner--bl { left: 8px; bottom: 8px; transform: scaleY(-1); }
.rsvp__corner--br { right: 8px; bottom: 8px; transform: scale(-1); }
.rsvp .script { font-size: clamp(2.4rem, 6vw, 3.2rem); }
.rsvp__form { position: relative; z-index: 2; margin-top: 1.6rem; display: grid; gap: 1.3rem; text-align: left; }
.field { display: flex; flex-direction: column; gap: .35rem; }
.field__label { font-size: .74rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ink); font-weight: 600; }
.field--name { flex-direction: row; align-items: baseline; gap: .6rem; }
.field__m { font-family: var(--script); font-size: 2rem; color: var(--ink-strong); line-height: 1; flex: none; white-space: nowrap; }
.rsvp input[type=text], .rsvp textarea {
  width: 100%; font: inherit; font-size: 1.2rem; color: var(--text);
  background: transparent; border: 0; border-bottom: 1px solid var(--ink-soft); padding: .35rem .2rem; border-radius: 0;
  transition: border-color .3s;
}
.rsvp input[type=text]:focus, .rsvp textarea:focus { outline: none; border-bottom-color: var(--ink-strong); }
.rsvp textarea { resize: vertical; min-height: 2.6em; line-height: 1.4; }
.rsvp ::placeholder { color: #B3ADA3; font-style: italic; }
.choice { display: grid; gap: .6rem; }
.choice__opt { display: flex; align-items: center; gap: .8rem; cursor: pointer; font-size: 1.15rem; }
.choice__opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.choice__opt i { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--ink); position: relative; flex: none; transition: background .25s; }
.choice__opt i::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--ink); transform: scale(0); transition: transform .25s var(--ease-out); }
.choice__opt input:checked + i::after { transform: scale(1); }
.choice__opt input:focus-visible + i { outline: 2px solid var(--blue); outline-offset: 2px; }
.field--row { flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem; transition: opacity .3s, max-height .3s; }
.field--row.is-hidden { display: none; }
.stepper { display: inline-flex; align-items: center; gap: .2rem; border: 1px solid var(--ink-soft); border-radius: 999px; padding: .15rem; }
.stepper__btn { width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: var(--ink); font-size: 1.3rem; cursor: pointer; line-height: 1; }
.stepper__btn:hover { background: rgba(167, 187, 199, .25); }
.stepper output { min-width: 2.2em; text-align: center; font-weight: 600; font-size: 1.2rem; color: var(--ink-strong); }
.rsvp__actions { display: flex; flex-wrap: wrap; gap: .8rem; justify-content: center; margin-top: .4rem; }
.btn--wa { background: var(--sage-ink); border-color: var(--sage-ink); box-shadow: 0 6px 14px -8px rgba(111, 127, 92, .7); }
.btn--zalo { background: var(--ink); }
.btn__ico--brand { width: 1.5em; height: 1.5em; }
.btn--zalo .btn__ico--brand { width: 2.4em; }
.rsvp__direct { text-align: center; margin: .2rem 0 0; color: var(--muted); font-size: 1rem; }
.rsvp__direct a { font-weight: 600; letter-spacing: .06em; white-space: nowrap; text-decoration: none; color: var(--ink-strong); border-bottom: 1px solid transparent; transition: border-color .25s; }
.rsvp__direct a:hover { border-bottom-color: var(--ink-soft); }
.rsvp.is-shaking { animation: shake .4s; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ==========================================================================
   Gifts + footer
   ========================================================================== */
.programme-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: clamp(2rem, 6vw, 6rem); }
.programme-col { flex: 0 1 560px; min-width: 0; }
.giftnote { flex: 0 1 340px; max-width: 360px; margin-top: 3rem; text-align: center; padding: 3.4rem 2rem 2.2rem; rotate: 1.5deg; }
.giftnote__seal { position: absolute; top: -44px; left: 50%; translate: -50% 0; width: 88px; height: 88px; filter: drop-shadow(0 4px 6px rgba(60, 48, 36, .3)); }
.giftnote .script { font-size: 2.2rem; }
.giftnote p { font-size: 1.1rem; font-style: italic; margin: .6rem 0 0; }

.footer { position: relative; text-align: center; padding: 4rem 16px 3rem; }
.footer__flowers { width: min(440px, 86vw); margin: 0 auto .4rem; }
.footer__flowers svg { display: block; width: 100%; height: auto; }
.footer__names { margin: .4rem 0 .4rem; font-family: var(--script); font-size: 2.6rem; color: var(--ink-strong); }
.footer__names i { font-style: normal; font-size: .6em; color: var(--ink-soft); }
.footer__links { margin: 1rem 0 0; display: flex; justify-content: center; gap: .6rem; flex-wrap: wrap; color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 70;
  background: var(--ink-strong); color: var(--paper); padding: .8rem 1.4rem; border-radius: 999px;
  font-size: 1rem; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s var(--ease-out);
  max-width: min(92vw, 520px); text-align: center; box-shadow: var(--shadow-lift);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---- motion helpers --------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
.arch.reveal.is-visible { transform: rotate(-1.5deg); }
.welcome.reveal.is-visible { transform: rotate(1.5deg); }
.tilt { transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out); }
.tilt.is-tilting { transition: transform .12s linear; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---- responsive ------------------------------------------------------- */
@media (max-width: 1240px) {
  .prop--rose { left: -420px; width: 340px; height: 200px; top: 360px; }
  .prop--minitag { right: -200px; }
  .prop--lantern { right: -330px; }
}
@media (max-width: 1080px) {
  .prop--key { left: -120px; }
  .prop--bouquet-2 { left: -200px; }
  .prop--seal-1 { left: -60px; }
  .prop--seal-2 { left: 10px; bottom: -96px; }
  .prop--rose, .prop--minitag { display: none; }
  .prop--lantern { right: -150px; bottom: -70px; }
}
@media (max-width: 900px) {
  .keepsakes { flex-direction: column; gap: 2.5rem; }
  .frame { width: min(260px, 64vw); }
  .frame--left, .frame--right { margin-top: 0; }
  .hanger { padding-bottom: calc(min(320px, 82vw) * .7); }
}
@media (max-width: 860px) {
  .prop--key, .prop--lantern, .prop--bouquet-2, .prop--tassel-loose, .prop--seal { display: none; }
  .prop--bouquet { width: 200px; height: 200px; right: -70px; top: -70px; }
  .timeline::before { left: calc(54px + .6rem + 23.5px); }
  .timeline li { grid-template-columns: 54px 48px 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .wallpaper, .intro::before { background-size: 320px 320px; }
  .section { padding-left: 16px; padding-right: 16px; }
  .lang { top: 12px; right: 12px; padding: 4px; }
  .lang__btn { width: 34px; height: 34px; font-size: .72rem; }
  .invite { padding: 2.4rem 1.2rem; }
  .invite__body { padding: 1rem .2rem; }
  .eyebrow { font-size: .7rem; letter-spacing: .2em; }
  .names { font-size: 2.35rem; }
  /* the clip path is drawn in px, so the box keeps the path's own 440px width and stays centred */
  .liner-peek { width: 440px; left: 50%; margin-left: -220px; top: -60px; height: 300px; clip-path: path('M0 120 C0 70 30 48 80 38 C130 28 160 0 220 0 C280 0 310 28 360 38 C410 48 440 70 440 120 V300 H0 Z'); }
  .liner-peek::after { clip-path: path('M0 110 C0 64 29 44 76 35 C124 26 153 0 210 0 C267 0 296 26 344 35 C391 44 420 64 420 110 V280 H0 Z'); }
  .swatches { grid-template-columns: repeat(5, 1fr); gap: .5rem; }
  .torn__paper { padding: 1.6rem 1rem 1.4rem; }
  .swatch__name { font-size: .55rem; letter-spacing: .12em; }
  .swatch__hex { font-size: .68rem; }
  .keepsakes { gap: 2rem; }
  .timeline::before { left: calc(44px + .5rem + 19.5px); }
  .timeline li { grid-template-columns: 44px 44px 1fr; gap: .5rem; }
  .timeline time { font-size: .95rem; }
  .timeline .dot { width: 40px; height: 40px; }
  .timeline .dot svg { width: 22px; height: 22px; }
  .map { padding: 6px; }
  .map__label { font-size: 30px; }
  .map__label--big { font-size: 42px; }
  .map__label--sub { font-size: 15px; letter-spacing: 2px; }
  .map__label--sea { font-size: 24px; }
  /* town names carry font-size="12" in the SVG, about 5px on a phone */
  #map-card g[font-size] > text { font-size: 20px; }
  .field--name { flex-direction: row; }
  .rsvp__corner { width: 50px; height: 50px; }
  .figures { gap: 1rem; }
  .figure { padding: .6rem; }
}
.venue-spot { margin-top: 1.6rem; font-style: italic; }
.spot-heart path { transform-box: fill-box; transform-origin: center; animation: spot-pulse 2.4s var(--ease-soft) infinite, spot-colours 12s linear infinite; }
/* the heart cycles through the dress-code palette */
@keyframes spot-colours { 0%, 100% { fill: var(--blue); } 20% { fill: var(--sage); } 40% { fill: var(--taupe); } 60% { fill: var(--sand); } 80% { fill: var(--charcoal); } }
@keyframes spot-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@media (prefers-reduced-motion: reduce) { .spot-heart path { animation: spot-colours 12s linear infinite; } }

/* Welcome card toys: tap the birds or the coconuts */
.toys .toy { cursor: pointer; pointer-events: bounding-box; }
.toys .toy__hit { fill: transparent; stroke: none; pointer-events: all; }
.toys .toy:focus-visible { outline: none; }
.toys .bird.is-flying .bird__wings { transform-box: fill-box; transform-origin: center; animation: flap .22s ease-in-out infinite alternate; }
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(-.6); } }

/* venue flows straight into travel: no double section gap between them */
.section--venue { padding-bottom: clamp(2rem, 4vw, 3.5rem); }
.section--venue .travel-grid { margin-bottom: 0; }
.section--travel { padding-top: clamp(2.5rem, 5vw, 4rem); }
@media (hover: none) { .hanger { cursor: default; } .hanger:active { cursor: default; } }

/* no blue tap flash or accidental text selection when tapping drawings on phones */
html { -webkit-tap-highlight-color: transparent; }
.toys, .map, .seal, .envelope, .hanger, .swatch, .frame, .venue, .prop { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
