/* =========================================================
   Tú Anh & Sỹ Cảnh — wedding invitation
   ========================================================= */
:root {
  --bg: #f4efe6;
  --paper: #fbf8f1;
  --ink: #23262e;
  --ink-2: #5d6068;
  --gold: #b08d57;
  --gold-2: #d9c39a;
  --navy: #1b1f28;
  --line: #d9cfb8;
  --wax-1: #c4514f;
  --wax-2: #8f2626;
  --wax-3: #5d1414;

  /* the whole site renders as a phone-width column, even on desktop */
  --col: min(100vw, 600px);
  --vw: calc(
    var(--col) / 100
  ); /* 1% of the column — use `N * var(--vw)` instead of Nvw */

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

  /* paper fibre texture (SVG turbulence) */
  --grain: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .1 0 0 0 .10 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: #ddd4c3;
}
body {
  margin: 0 auto;
  max-width: 600px;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  box-shadow: 0 0 60px rgba(60, 40, 10, 0.18);
}
body.locked {
  overflow: hidden;
  height: 100dvh;
}
/* full-screen overlays stay inside the phone column too */
.envelope-screen,
.lightbox {
  left: 0;
  right: 0;
  max-width: 600px;
  margin: 0 auto;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
b {
  font-weight: 600;
}

/* ---------- type helpers ---------- */
.eyebrow {
  display: block;
  margin: 0 0 10px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow.light {
  color: var(--gold-2);
}
.h-serif {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 6 * var(--vw), 36px);
  line-height: 1.15;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.h-script {
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(40px, 9 * var(--vw), 56px);
  line-height: 1.1;
  color: var(--gold);
}
.small-caps {
  margin: 0;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.wm {
  position: absolute;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  font-family: var(--script);
  color: var(--gold);
  opacity: 0.07;
  line-height: 1;
  font-size: clamp(110px, 24 * var(--vw), 160px);
}
.orn {
  width: 140px;
  height: 24px;
  color: var(--gold);
  display: block;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.3s,
    color 0.3s,
    border-color 0.3s;
}
.btn:hover {
  background: var(--ink);
  color: #fff;
}
.btn.dark {
  background: var(--ink);
  color: #fff;
}
.btn.dark:hover {
  background: var(--gold);
  border-color: var(--gold);
}
.btn.light {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}
.btn.light:hover {
  background: var(--gold-2);
  border-color: var(--gold-2);
}
.btn.ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
}
.btn.ghost:hover {
  background: #fff;
  color: var(--ink);
  border-color: #fff;
}
.btn[disabled] {
  opacity: 0.6;
  pointer-events: none;
}

/* ---------- reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 1s cubic-bezier(0.2, 0.7, 0.2, 1) var(--delay, 0s),
    transform 1s cubic-bezier(0.2, 0.7, 0.2, 1) var(--delay, 0s);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* =========================================================
   ENVELOPE
   ========================================================= */
.envelope-screen {
  --paper-hi: #f9f3e4;
  --paper-1: #f4ebd8;
  --paper-2: #e8dbbd;
  --paper-3: #d8c6a2;
  --lining-1: #b8975c;
  --lining-2: #96773f;
  --shade: 60, 40, 10; /* shadow tint (rgb) */

  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(
    120% 90% at 50% 30%,
    #f7f0e2 0%,
    #ecdfc7 45%,
    #d6c4a3 100%
  );
  -webkit-tap-highlight-color: transparent;
}
.envelope-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background: var(--grain);
}
.envelope-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    90% 80% at 50% 45%,
    transparent 55%,
    rgba(90, 65, 25, 0.25) 100%
  );
}
.petals {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.envelope-stage {
  /* oversized on purpose: it overflows the column and is rotated by JS (seal stays on the viewport centre) */
  --w: calc(var(--col) * 1.25);
  --h: calc(var(--w) / 1.5);
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template: 100% / 100%;
  place-items: center;
  perspective: 1800px;
}
.envelope-tilt {
  transform-style: preserve-3d;
  will-change: transform;
}
.envelope {
  position: relative;
  width: var(--w);
  height: var(--h);
  perspective: 1500px;
  cursor: pointer;
  outline: none;
  --gs: 1;
}
.envelope:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 14px;
  border-radius: 8px;
}
.envelope::before {
  content: "";
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -10%;
  height: 26%;
  z-index: 0;
  background: radial-gradient(
    50% 50% at 50% 50%,
    rgba(70, 45, 10, 0.45),
    transparent 70%
  );
  filter: blur(10px);
  opacity: var(--gs);
}
.paper {
  background-image: var(--grain);
  background-blend-mode: multiply;
}

.env-back {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 7px;
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.07) 0 2px,
      transparent 2px 7px
    ),
    radial-gradient(90% 60% at 50% 10%, var(--lining-1), var(--lining-2) 90%);
  box-shadow:
    0 1px 1px rgba(var(--shade), 0.25),
    0 6px 10px -4px rgba(var(--shade), 0.35),
    0 30px 50px -18px rgba(var(--shade), 0.5);
}
.env-back::after {
  content: "";
  position: absolute;
  inset: 5%;
  border: 1px solid rgba(255, 240, 200, 0.35);
  clip-path: polygon(0 0, 100% 0, 50% 50%);
}

/* --- card --- */
.env-card {
  position: absolute;
  z-index: 3;
  left: 5%;
  right: 5%;
  top: 4%;
  height: 92%;
  background: #fffcf5;
  border-radius: 3px;
  padding: 4.5%;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.18),
    0 10px 24px -8px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  will-change: transform;
}
.card-frame {
  position: absolute;
  inset: 2.6%;
  pointer-events: none;
  border: 1px solid rgba(176, 141, 87, 0.55);
  outline: 1px solid rgba(176, 141, 87, 0.25);
  outline-offset: 2px;
}
.card-photo {
  position: relative;
  flex: 0 0 58%;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(176, 141, 87, 0.35);
}
.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 55% 42%;
}
.card-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  padding-top: 4px;
  min-height: 0;
}
.card-overline {
  font-family: var(--script);
  color: var(--gold);
  font-size: clamp(16px, 4.2 * var(--vw), 22px);
  line-height: 1.1;
}
.card-names {
  font-family: var(--script);
  font-size: clamp(22px, 6.4 * var(--vw), 34px);
  line-height: 1.1;
  color: var(--ink);
  white-space: nowrap;
}
.card-names i {
  font-style: normal;
  color: var(--gold);
  font-size: 0.85em;
  margin: 0 0.3em;
}
.card-rule {
  width: 38px;
  height: 1px;
  background: var(--gold);
  margin: 3px 0 2px;
  opacity: 0.8;
}
.card-date {
  font-family: var(--serif);
  font-size: clamp(11px, 3 * var(--vw), 14px);
  letter-spacing: 0.3em;
  color: var(--ink-2);
}

/* --- shadow cast by the closed flap onto the pocket (key light top-left → falls down-right).
   Two layers: a tight contact shadow at the paper edge + a wider, fainter ambient one.
   The wrapper is clipped to the envelope outline so nothing leaks past the rounded corners;
   offsets/blur scale with the envelope width so the penumbra looks the same at every size. --- */
.env-shadow {
  position: absolute;
  z-index: 7;
  left: 0;
  right: 0;
  top: 0;
  height: 68%;
  pointer-events: none;
  transform-origin: 50% 0;
  clip-path: inset(0 round 7px 7px 0 0);
}
.env-shadow::before,
.env-shadow::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 82.35%; /* = the flap's 56% */
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: rgba(var(--shade), 0.3);
}
.env-shadow::before {
  transform: translate(calc(var(--w) * 0.004), calc(var(--w) * 0.006));
  filter: blur(calc(var(--w) * 0.01));
  opacity: 0.55;
}
.env-shadow::after {
  transform: translate(calc(var(--w) * 0.008), calc(var(--w) * 0.014));
  filter: blur(calc(var(--w) * 0.03));
  opacity: 0.28;
}

/* --- pocket: side + bottom flaps --- */
.env-side,
.env-bottom {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.env-side {
  z-index: 5;
}
.env-left {
  clip-path: polygon(0 0, 52% 50%, 0 100%);
  border-radius: 7px 0 0 7px;
  background-color: var(--paper-1);
  background-image:
    var(--grain),
    linear-gradient(
      155deg,
      var(--paper-hi) 0%,
      var(--paper-1) 40%,
      var(--paper-2) 100%
    );
  filter: drop-shadow(2px 1px 1px rgba(var(--shade), 0.16));
}
.env-right {
  clip-path: polygon(100% 0, 48% 50%, 100% 100%);
  border-radius: 0 7px 7px 0;
  background-color: var(--paper-1);
  background-image:
    var(--grain),
    linear-gradient(
      205deg,
      var(--paper-1) 0%,
      var(--paper-2) 55%,
      var(--paper-3) 100%
    );
  filter: drop-shadow(-1px 1px 1px rgba(var(--shade), 0.14));
}
.env-bottom {
  z-index: 6;
  clip-path: polygon(0 100%, 50% 46%, 100% 100%);
  border-radius: 0 0 7px 7px;
  background-color: var(--paper-1);
  background-image:
    var(--grain),
    linear-gradient(
      170deg,
      var(--paper-1) 0%,
      var(--paper-1) 45%,
      var(--paper-2) 100%
    );
  filter: drop-shadow(1px -2px 2px rgba(var(--shade), 0.24));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 4.5%;
}
.env-front-names {
  font-family: var(--script);
  font-size: clamp(16px, 4.3 * var(--vw), 24px);
  line-height: 1.1;
  color: #5a4a2c;
}
.env-front-names i {
  font-style: normal;
  color: var(--gold);
  font-size: 0.85em;
  margin: 0 0.3em;
}
.env-front-date {
  font-family: var(--serif);
  font-size: clamp(9px, 2.4 * var(--vw), 11px);
  letter-spacing: 0.32em;
  color: #8a7550;
  margin-top: 2px;
}

/* --- top flap: two hinged segments so the paper flexes --- */
.env-flap {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  top: 0;
  height: 56%;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  will-change: transform;
  --lit: 1;
  --litb: 0.72;
}
.flap-seg {
  position: absolute;
  transform-style: preserve-3d;
}
.seg-a {
  left: 0;
  right: 0;
  top: 0;
  height: 55%;
}
.seg-b {
  left: 27.5%;
  width: 45%;
  top: calc(100% - 1px);
  height: calc(81.82% + 1px);
  transform-origin: 50% 0;
} /* 1px overlap hides the AA hairline at the seam */
.env-flap .face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.env-flap .front {
  filter: brightness(var(--lit));
  background-color: var(--paper-1);
}
.env-flap .back {
  transform: rotateX(180deg);
  filter: brightness(var(--litb));
  background:
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.07) 0 2px,
      transparent 2px 7px
    ),
    linear-gradient(0deg, var(--lining-1), var(--lining-1)); /* flat: both segments must match at the seam */
}
/* NOTE: seg-b is nested inside seg-a — use child combinators so A's rules never leak onto B.
   The front is lit from the top-left: one diagonal gradient over the WHOLE flap, each segment
   showing its slice (A = top 55%, B = bottom 45%) via background-size/position — no step at the seam. */
.env-flap {
  --flap-light: linear-gradient(
    118deg,
    var(--paper-hi) 0%,
    var(--paper-1) 38%,
    var(--paper-2) 80%,
    var(--paper-3) 100%
  );
}
.seg-a > .front {
  clip-path: polygon(0 0, 100% 0, 72.5% 100%, 27.5% 100%);
  border-radius: 7px 7px 0 0;
  background-image: var(--grain), var(--flap-light);
  background-size:
    auto,
    100% 181.82%;
  background-position:
    0 0,
    0 0;
}
/* crease at the hinge: thin bright fold line, then a faint shade just below it */
.seg-a > .front::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: inherit;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.38) 0,
    rgba(255, 255, 255, 0.12) 3%,
    transparent 9%,
    rgba(var(--shade), 0.05) 26%,
    transparent 55%
  );
}
.seg-a > .back {
  clip-path: polygon(27.5% 0, 72.5% 0, 100% 100%, 0 100%);
  border-radius: 0 0 7px 7px;
  /* once flipped the flap lies on the table: soft contact shadow (segment A only — the tip is
     coplanar with it and must not cast a crease onto it) */
  filter: brightness(var(--litb)) drop-shadow(0 5px 6px rgba(60, 40, 10, 0.28));
}
.seg-b > .front {
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background-image: var(--grain), var(--flap-light);
  background-size:
    auto,
    222.22% 222.22%;
  background-position:
    0 0,
    50% 100%;
}
.seg-b > .back {
  clip-path: polygon(0 100%, 100% 100%, 50% 0);
}
/* --- wax seal (attached to the flap tip) --- */
.env-seal {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 100%;
  /* size: ~22% of the column, but never more than 36% of the envelope height so it clears the
     names printed below the tip. Plain px first as a fallback for browsers without clamp(). */
  --s: 80px;
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(1px);
  filter: drop-shadow(2px 7px 7px rgba(60, 10, 10, 0.45));
}
.env-seal::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(143, 38, 38, 0.45);
  animation: seal-ring 3s ease-out infinite;
}
.env-seal.go::before {
  animation: seal-go 0.7s ease-out forwards;
  border-width: 2px;
  border-color: rgba(212, 120, 110, 0.8);
}
.seal-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  animation: seal-breathe 3s ease-in-out infinite;
}

.env-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(6vh + env(safe-area-inset-bottom));
  z-index: 3;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  opacity: 0;
}
/* main line: script, flanked by thin rules */
.hint-title {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--script);
  font-size: clamp(26px, 7 * var(--vw), 34px);
  line-height: 1;
  color: #5a4a2c;
}
.hint-title::before,
.hint-title::after {
  content: "";
  width: 36px;
  height: 1px;
  background: var(--gold);
  opacity: 0.7;
}
/* subtitle: small caps with a slow pulse — the actual call to action */
.hint-sub {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #8a7550;
  animation: hint-fade 2.6s ease-in-out infinite;
}
@keyframes seal-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}
@keyframes seal-ring {
  0% {
    transform: scale(0.85);
    opacity: 0.9;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}
@keyframes seal-go {
  0% {
    transform: scale(0.9);
    opacity: 1;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}
@keyframes hint-fade {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  overflow: hidden;
  background: var(--bg);
}
.hero-bg,
.hero-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-bg img {
  object-fit: cover;
  object-position: 55% 42%;
}
.hero-veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(60, 45, 30, 0.08) 0%,
    rgba(60, 45, 30, 0) 35%,
    rgba(50, 38, 26, 0.72) 100%
  );
}
.hero-inner {
  position: relative;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 22px calc(40px + env(safe-area-inset-bottom));
}
.hero-names {
  margin: 0.05em 0 0.15em;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(58px, 15 * var(--vw), 128px);
  line-height: 0.92;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}
.hero-names span {
  display: block;
}
.hero-names em {
  display: block;
  font-style: normal;
  color: var(--gold-2);
  font-size: 0.48em;
  line-height: 1;
  margin: 0.06em 0 0.06em 0.2em;
}
.hero-date {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0 24px;
}
.hd-day {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(64px, 15 * var(--vw), 104px);
  line-height: 0.9;
}
.hd-dow,
.hd-month {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  line-height: 1.7;
}
.hd-dow {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  opacity: 0.85;
}
.countdown {
  display: flex;
  gap: clamp(18px, 6 * var(--vw), 40px);
}
.countdown div {
  display: flex;
  flex-direction: column;
}
.countdown b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(28px, 7 * var(--vw), 40px);
  line-height: 1;
}
.countdown small {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-top: 6px;
}
.scroll-cue {
  display: none;
}

/* =========================================================
   BÁO TIN — photo fades into text
   ========================================================= */
.ceremony {
  position: relative;
  background: var(--bg);
  overflow: hidden;
}
.ceremony .wm {
  right: calc(-4 * var(--vw));
  top: calc(4 * var(--vw));
  transform: rotate(-6deg);
  font-size: clamp(90px, 24 * var(--vw), 160px);
}
.ceremony-photo {
  position: relative;
  height: 64vh;
  min-height: 380px;
}
.ceremony-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 48% 20%;
  -webkit-mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 45%, transparent 100%);
}
.ceremony-body {
  position: relative;
  z-index: 1;
  margin-top: -24vh;
  padding: 0 22px 64px;
}
/* both families always share one row: the ornament stands vertically between them */
.families {
  display: grid;
  grid-template-columns: auto auto auto;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
  margin: 26px 0 18px;
}
.family-side {
  display: block;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.family-parents {
  margin: 0;
  font-size: clamp(14px, 4.4 * var(--vw), 22px);
  line-height: 1.4;
  white-space: nowrap;
}
.orn.v {
  width: 24px;
  height: 96px;
  margin-top: 2px;
}
.couple-script {
  margin: 28px 0 16px;
  text-align: center;
  font-family: var(--script);
  font-size: clamp(44px, 11 * var(--vw), 66px);
  line-height: 1;
}
.couple-script em {
  font-style: normal;
  color: var(--gold);
  font-size: 0.7em;
  margin: 0 0.25em;
}
.couple-note {
  margin: 0;
  text-align: center;
}

/* =========================================================
   HAI LỄ — Vu Quy / Thành Hôn
   ========================================================= */
.rites {
  position: relative;
  overflow: hidden;
  padding-bottom: clamp(56px, 8 * var(--vw), 100px);
}
.rites-photo {
  position: relative;
  height: 46vh;
  min-height: 280px;
}
.rites-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 48% 40%;
  -webkit-mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 40%, transparent 100%);
}
.rites-grid {
  position: relative;
  z-index: 1;
  margin: -14vh auto 0;
  padding: 0 22px;
  max-width: 980px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px;
  text-align: center;
}
.rite {
  padding: 8px 0;
}
.rite-name {
  margin: 0 0 10px;
  font-family: var(--script);
  font-weight: 400;
  color: var(--gold);
  font-size: clamp(40px, 11 * var(--vw), 56px);
  line-height: 1.1;
}
.rite-venue {
  margin: 6px 0 8px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(22px, 5.4 * var(--vw), 30px);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.rite-addr {
  margin: 0 0 18px;
  font-style: italic;
  color: var(--ink-2);
  font-size: clamp(14px, 4.4 * var(--vw), 17px);
  line-height: 1.55;
  white-space: nowrap;
}
.rite-when {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.rite-when b {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(48px, 11 * var(--vw), 64px);
  line-height: 0.9;
}
.rite-when span {
  text-align: left;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  line-height: 1.8;
  color: var(--ink-2);
}
.rite-when em {
  font-style: normal;
  font-family: var(--serif);
  font-size: clamp(26px, 6 * var(--vw), 34px);
  color: var(--gold);
  padding-left: 14px;
  border-left: 1px solid var(--line);
}
.rites-divider {
  display: flex;
  justify-content: center;
}
.rites-divider .orn {
  width: 120px;
}

/* =========================================================
   ALBUM — collage of prints on paper
   ========================================================= */
.paper-bg {
  background-color: var(--bg);
  background-image: var(--grain);
}
.album {
  position: relative;
  padding: clamp(56px, 9 * var(--vw), 120px) 0;
  overflow: hidden;
}
.album-head {
  position: relative;
  text-align: center;
  padding: 0 22px;
  margin-bottom: clamp(26px, 5 * var(--vw), 56px);
}
.collage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: calc(25 * var(--vw));
  gap: 8px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 12px;
}
.collage a {
  position: relative;
  display: block;
  overflow: hidden;
  background: #e9e1d2;
  padding: 4px;
  box-shadow: 0 10px 24px -14px rgba(60, 40, 10, 0.45);
  background: var(--paper);
}
.collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  opacity: 0;
  transition:
    opacity 0.8s,
    transform 1.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.collage img.loaded {
  opacity: 1;
}
.collage a:hover img {
  transform: scale(1.04);
}
.collage a:nth-child(1) {
  grid-column: 1 / 3;
  grid-row: 1 / 4;
}
.collage a:nth-child(2) {
  grid-column: 3 / 5;
  grid-row: 1 / 3;
}
.collage a:nth-child(3) {
  grid-column: 3 / 5;
  grid-row: 3 / 5;
}
.collage a:nth-child(4) {
  grid-column: 1 / 3;
  grid-row: 4 / 6;
}
.collage a:nth-child(5) {
  grid-column: 3 / 4;
  grid-row: 5 / 7;
}
.collage a:nth-child(6) {
  grid-column: 4 / 5;
  grid-row: 5 / 7;
}
.collage a:nth-child(7) {
  grid-column: 1 / 3;
  grid-row: 6 / 7;
}
.collage a:nth-child(8) {
  grid-column: 1 / 3;
  grid-row: 7 / 9;
}
.collage a:nth-child(9) {
  grid-column: 3 / 5;
  grid-row: 7 / 9;
}
.collage a:nth-child(10) {
  grid-column: 1 / 5;
  grid-row: 9 / 11;
}
.collage a:nth-child(11) {
  grid-column: 1 / 3;
  grid-row: 11 / 13;
}
.collage a:nth-child(12) {
  grid-column: 3 / 5;
  grid-row: 11 / 13;
}
.collage .cap {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-family: var(--script);
  font-size: 24px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  opacity: 0.95;
}
.album-foot {
  position: relative;
  text-align: center;
  margin-top: 30px;
}

/* =========================================================
   TIỆC CƯỚI — photo washed under cream, two receptions, calendar
   ========================================================= */
.party {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 10 * var(--vw), 120px) 0
    clamp(64px, 9 * var(--vw), 110px);
  background: var(--bg);
}
.party-bg,
.party-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.party-bg img {
  object-fit: cover;
  object-position: 48% 40%;
}
.party-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(244, 239, 230, 0.97) 0%,
    rgba(244, 239, 230, 0.84) 30%,
    rgba(244, 239, 230, 0.84) 70%,
    rgba(244, 239, 230, 0.98) 100%
  );
}
.party-head {
  position: relative;
  text-align: center;
  padding: 0 22px;
  margin-bottom: clamp(30px, 5 * var(--vw), 56px);
}
.receptions {
  position: relative;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}
.reception {
  position: relative;
  background: var(--paper);
  background-image: var(--grain);
  padding: 34px 24px 26px;
  box-shadow: 0 30px 50px -26px rgba(60, 40, 10, 0.5);
}
.reception::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(176, 141, 87, 0.35);
  pointer-events: none;
}
.rc-tag {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 6px 16px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}
.party-time {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0 14px;
}
.party-time b {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(56px, 14 * var(--vw), 92px);
  line-height: 0.9;
  color: var(--ink);
}
.party-time span {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  line-height: 1.9;
  color: var(--ink-2);
}
.party-venue {
  margin: 0 0 22px;
  font-size: 17px;
  line-height: 1.6;
}
.party-venue b {
  display: block;
  font-size: clamp(24px, 6 * var(--vw), 32px);
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.party-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.party-actions .btn {
  padding: 12px 20px;
}
.rc-and {
  display: flex;
  align-items: center;
  justify-content: center;
}
.rc-and span {
  font-family: var(--script);
  font-size: 40px;
  color: var(--gold);
  line-height: 1;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  position: relative;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 78px;
  top: 26px;
  bottom: 8px;
  width: 1px;
  background: rgba(176, 141, 87, 0.4);
}
.timeline li {
  display: flex;
  align-items: center;
  padding: 7px 0;
}
.timeline time {
  flex: 0 0 62px;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--gold);
  text-align: right;
  order: 0;
}
.timeline li::before {
  content: "";
  order: 1;
  flex: 0 0 8px;
  height: 8px;
  margin: 0 12px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(176, 141, 87, 0.18);
}
.timeline span {
  order: 2;
}
.timeline span {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}

.calendar-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  padding: clamp(44px, 7 * var(--vw), 80px) 22px 0;
}
.calendar {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  padding: 28px 22px 20px;
  width: 100%;
  max-width: 360px;
  transform: rotate(-2deg);
  box-shadow: 0 30px 50px -22px rgba(60, 40, 10, 0.5);
  background-image: var(--grain);
}
.calendar::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 50%;
  width: 96px;
  height: 26px;
  background: rgba(255, 255, 255, 0.55);
  transform: translateX(-50%) rotate(2deg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.cal-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.cal-head span {
  font-family: var(--script);
  font-size: 32px;
  color: var(--gold);
  line-height: 1;
}
.cal-head em {
  font-style: normal;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.3em;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px 0;
  text-align: center;
}
.cal-grid .dow {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-2);
  padding-bottom: 6px;
}
.cal-grid .dow.sun {
  color: var(--wax-2);
}
.cal-grid .day {
  font-family: var(--serif);
  font-size: 18px;
  height: 36px;
  display: grid;
  place-items: center;
  position: relative;
}
.cal-grid .day.sun {
  color: var(--wax-2);
}
.cal-grid .day.wedding {
  font-weight: 600;
  color: var(--wax-2);
}
.cal-grid .day.wedding svg {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
}
.cal-grid .day.wedding svg path {
  fill: none;
  stroke: var(--wax-2);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
}
.reveal.in .day.wedding svg path {
  animation: draw 1.2s ease-out 0.5s forwards;
}
.reveal.in .day.wedding:nth-of-type(2) svg path {
  animation-delay: 1.1s;
}
@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}
.cal-note {
  margin: 14px 0 0;
  text-align: center;
  font-style: italic;
  color: var(--ink-2);
  font-size: 16px;
}

/* =========================================================
   THANKS — photo fading into paper
   ========================================================= */
.thanks {
  position: relative;
  min-height: 88svh;
  display: grid;
  place-items: end center;
  overflow: hidden;
  text-align: center;
  background: var(--bg);
}
.thanks-bg,
.thanks-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.thanks-bg img {
  object-fit: cover;
  object-position: 48% 30%;
}
.thanks-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(244, 239, 230, 0) 0%,
    rgba(244, 239, 230, 0) 35%,
    rgba(244, 239, 230, 0.92) 72%,
    var(--bg) 100%
  );
}
.thanks-inner {
  position: relative;
  padding: 0 22px calc(48px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
}
.thanks-seal {
  width: 92px;
  max-width: 30%;
  height: auto;
  margin-bottom: 18px;
  transform: rotate(-8deg);
  filter: drop-shadow(0 8px 12px rgba(60, 10, 10, 0.35));
}
.thanks-seal.reveal {
  transform: rotate(-8deg) translateY(28px);
}
.thanks-seal.reveal.in {
  transform: rotate(-8deg);
}
.thanks-text {
  margin: 0;
  font-size: clamp(18px, 4 * var(--vw), 24px);
  font-style: italic;
  line-height: 1.6;
  color: var(--ink-2);
}
.thanks-names {
  margin: 20px 0 6px;
  font-family: var(--script);
  font-size: clamp(48px, 12 * var(--vw), 92px);
  line-height: 1;
}
.thanks-names em {
  font-style: normal;
  color: var(--gold);
  font-size: 0.6em;
  margin: 0 0.3em;
}
.thanks-date {
  margin: 0;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--ink-2);
}

/* =========================================================
   MUSIC + LIGHTBOX
   ========================================================= */
.music-btn {
  position: fixed;
  right: max(16px, calc((100vw - 600px) / 2 + 16px));
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 900;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  background: rgba(251, 248, 241, 0.9);
  color: var(--gold);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(6px);
}
.music-btn.playing svg {
  animation: spin 3s linear infinite;
}
.music-btn:not(.playing)::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 1.5px;
  background: var(--gold);
  transform: rotate(-45deg);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(244, 239, 230, 0.97);
  display: grid;
  place-items: center;
  padding: 16px;
}
.lightbox[hidden],
.music-btn[hidden] {
  display: none;
}
.lightbox figure {
  margin: 0;
  text-align: center;
}
.lightbox img {
  max-width: 100%;
  max-height: 84vh;
  box-shadow: 0 24px 60px -20px rgba(60, 40, 10, 0.5);
  background: var(--paper);
  padding: 6px;
}
.lightbox figcaption {
  margin-top: 12px;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.3em;
}
.lb-close,
.lb-nav {
  position: absolute;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--serif);
  line-height: 1;
  opacity: 0.75;
  padding: 10px;
}
.lb-close {
  top: 8px;
  right: 12px;
  font-size: 40px;
}
.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 56px;
}
.lb-prev {
  left: 4px;
}
.lb-next {
  right: 4px;
}
.lb-close:hover,
.lb-nav:hover {
  opacity: 1;
}

/* ---------- fluid seal sizes (browsers without clamp()/min() keep the px fallbacks above) ---------- */
@supports (width: min(clamp(1px, 2px, 3px), 4px)) {
  .env-seal {
    --s: min(clamp(68px, 21 * var(--vw), 104px), calc(var(--h) * 0.33));
  }
  .thanks-seal {
    width: clamp(80px, 22 * var(--vw), 104px);
  }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .seal-img,
  .env-seal::before,
  .hint-sub,
  .scroll-cue span,
  .music-btn.playing svg {
    animation: none;
  }
  .env-hint {
    opacity: 1;
  }
}
