@font-face {
  font-family: 'NiDAChenla';
  src: url('fonts/nidachenla.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}

@font-face {
  font-family: 'Noto Sans Khmer';
  src: url('fonts/notosanskhmer-regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}

@font-face {
  font-family: 'Noto Sans Khmer';
  src: url('fonts/notosanskhmer-bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}

@font-face {
  font-family: 'Khmer S2';
  src: url('fonts/notosanskhmer-regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}

@font-face {
  font-family: 'Khmer S2';
  src: url('fonts/notosanskhmer-bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}

@font-face {
  font-family: 'Khmer OS Siemreap';
  src: url('fonts/notosanskhmer-regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}

@font-face {
  font-family: 'Khmer OS Siemreap';
  src: url('fonts/notosanskhmer-bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}

@font-face {
  font-family: 'Noto Serif Khmer';
  src: url('fonts/notoserifkhmer-variablefont_wdth%2Cwght.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}

@font-face {
  font-family: 'Kh Muol Pali';
  src: url('fonts/kh-muol-pali.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}

@font-face {
  font-family: 'Kh Ang Moul Seda';
  src: url('fonts/kh%20ang%20moul%20seda.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}

@font-face {
  font-family: 'Khmer OS';
  src: url('fonts/notoserifkhmer-variablefont_wdth%2Cwght.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}

@font-face {
  font-family: 'Moul';
  src: url('fonts/notoserifkhmer-variablefont_wdth%2Cwght.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}

@font-face {
  font-family: 'Noto Serif';
  src: url('fonts/notoserifkhmer-variablefont_wdth%2Cwght.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+1780-17FF, U+19E0-19FF, U+200C-200D, U+25CC;
}

:root {
  color-scheme: light;
  --W: 390px;
  --H: 664px;
  --DESIGN_W: var(--W);
  --DESIGN_H: var(--H);
  --background: #f7f4ee;
  --paper: #fdf8f0;
  --paper-deep: #f8f1e5;
  --text: #ffc770;
  --muted: #ffc770;
  --gold: #ffc770;
  --accent: #ffc770;
  --border: rgba(122, 74, 40, 0.18);
  --shadow: 0 24px 60px rgba(122, 74, 40, 0.12);
  --section-heading-size: clamp(0.8rem, 15.6px, 1.15rem);
}

html[data-language="km"] [lang="en"],
html[data-language="en"] [lang="km"] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  background: #2a180e;
  touch-action: pan-y;
  overscroll-behavior: none;
}

body {
  margin: 0;
  min-height: 664px;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: center;
  font-family: 'Times New Roman', Times, serif;
  font-size: 0.95rem;
  background: #2a180e;
  color: var(--text);
  overflow-x: clip;
  overflow-y: visible;
  touch-action: pan-y;
  overscroll-behavior: none;
}

body:not(.entered) {
  background: #160907;
}

body.entered {
  background: #2a180e;
}

body.entered .page-shell {
  background: #2a180e;
}

.preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(rgba(27, 16, 13, 0.48), rgba(27, 16, 13, 0.58)),
    radial-gradient(ellipse at 50% 43%, rgba(116, 73, 37, 0.3), transparent 38%),
    radial-gradient(ellipse at 50% 100%, rgba(120, 74, 34, 0.17), transparent 54%),
    url('img/Final.jpg') center / cover no-repeat,
    #1b100d;
  opacity: 1;
  animation: none;
}

.preloader.hidden {
  animation: fadeOut 0.6s ease forwards;
  pointer-events: none;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.preloader-content {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  padding-top: 0;
  text-align: center;
}

.preloader-emblem {
  position: relative;
  display: grid;
  width: clamp(8.5rem, 148.2px, 10rem);
  aspect-ratio: 1;
  place-items: center;
  margin-bottom: 0.35rem;
  border: 1px solid rgba(232, 193, 90, 0.34);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 193, 90, 0.1), rgba(27, 16, 13, 0.08) 68%);
  box-shadow: 0 0 32px rgba(232, 193, 90, 0.09), inset 0 0 24px rgba(232, 193, 90, 0.06);
}

.preloader-emblem::before {
  content: '';
  position: absolute;
  inset: -0.5rem;
  width: auto;
  aspect-ratio: 1;
  border: 1px solid transparent;
  border-top-color: rgba(232, 193, 90, 0.8);
  border-right-color: rgba(232, 193, 90, 0.28);
  border-radius: 50%;
  animation: preloaderSpin 7s linear infinite;
}

.preloader-emblem::after {
  content: '';
  position: absolute;
  top: 0.4rem;
  right: 1.25rem;
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 50%;
  background: #f5dc9b;
  box-shadow: 0 0 12px 3px rgba(232, 193, 90, 0.4);
}

.preloader-monogram {
  display: block;
  width: 70%;
  height: 70%;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.25));
}

@keyframes preloaderSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .preloader-emblem::before {
    animation: none;
  }
}

.splash-screen {
  opacity: 0;
  animation: none;
}

body.loaded .splash-screen {
  opacity: 1;
  animation: fadeInSplash 2.2s ease forwards;
}

@keyframes fadeInSplash {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.page-shell {
  width: min(100%, 480px);
  max-width: calc(390px - 32px);
  min-width: 0;
  overflow-x: clip;
  min-height: 664px;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.08);
  margin: 0 auto;
  border: 1px solid rgba(122, 74, 40, 0.13);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) 0;
}

body:not(.entered) .page-shell {
  width: 100%;
  max-width: none;
  min-height: 664px;
  overflow-x: clip;
  overflow-y: visible;
  border: 2px solid rgba(255, 199, 112, 0.52);
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
}

body.entrance-video-playing .page-shell {
  border-color: transparent;
  border-radius: 0;
}

body.entrance-video-playing .intro-screen {
  pointer-events: none;
}

body:not(.entered) .page-shell::before,
body:not(.entered) .page-shell::after {
  display: none;
}

body.entered .page-shell::after {
  display: none;
}

body.entered .page-shell::before {
  display: none;
}

.page-shell::before,
.page-shell::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 100%;
  height: 80px;
  transform: translateX(-50%);
  background: radial-gradient(circle at center, rgba(255, 250, 242, 0.85), transparent 62%);
  pointer-events: none;
}

.page-shell::before {
  top: -30px;
  border-bottom-left-radius: 100% 40px;
  border-bottom-right-radius: 100% 40px;
}

.page-shell::after {
  bottom: -30px;
  border-top-left-radius: 100% 40px;
  border-top-right-radius: 100% 40px;
}

.main-content {
  width: 100%;
  min-height: 664px;
  padding-top: 100px;
  overflow-y: auto;
  position: relative;
}

.fireflies {
  position: fixed;
  inset: 0;
  left: 50%;
  width: min(390px, 480px);
  transform: translateX(-50%);
  overflow: hidden;
  pointer-events: none;
  z-index: 5;
}

.envelope-fireflies {
  z-index: 1001;
  width: min(390px, 540px);
}

.fireflies span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff1b8;
  box-shadow: 0 0 6px 2px rgba(255, 216, 115, 0.62), 0 0 14px 4px rgba(255, 190, 72, 0.28);
  opacity: 0.2;
  animation: fireflyGlow 2.8s ease-in-out var(--firefly-delay) infinite;
}

.fireflies span:nth-child(1) { --firefly-delay: -2s; }
.fireflies span:nth-child(2) { --firefly-delay: -7s; }
.fireflies span:nth-child(3) { --firefly-delay: -4s; }
.fireflies span:nth-child(4) { --firefly-delay: -9s; }
.fireflies span:nth-child(5) { --firefly-delay: -5s; }
.fireflies span:nth-child(6) { --firefly-delay: -3s; }
.fireflies span:nth-child(7) { --firefly-delay: -8s; }
.fireflies span:nth-child(8) { --firefly-delay: -6s; }
.fireflies span:nth-child(9) { --firefly-delay: -1s; }
.fireflies span:nth-child(10) { --firefly-delay: -10s; }
.fireflies span:nth-child(11) { --firefly-delay: -4.5s; }
.fireflies span:nth-child(12) { --firefly-delay: -7.5s; }

@keyframes fireflyGlow {
  0%, 100% {
    opacity: 0.15;
    filter: brightness(0.7);
  }
  45%, 60% {
    opacity: 0.95;
    filter: brightness(1.3);
  }
}

.flying-butterflies {
  position: fixed;
  inset: 0;
  left: 50%;
  width: min(390px, 480px);
  transform: translateX(-50%);
  overflow: hidden;
  pointer-events: none;
  z-index: 1002;
}

.butterfly-flight {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  color: #fffaf0;
  opacity: 0;
  animation: var(--flight-path) var(--flight-duration) ease-in-out var(--flight-delay) infinite;
}

.butterfly-flight svg {
  display: block;
  width: 18px;
  height: 15px;
  overflow: visible;
  filter: drop-shadow(0 0 4px rgba(255, 250, 240, 0.45));
  animation: butterflyWings 0.38s ease-in-out infinite alternate;
}

.butterfly-flight-one {
  --flight-path: butterflyFlightOne;
  --flight-duration: 26s;
  --flight-delay: -9s;
}

.butterfly-flight-two {
  --flight-path: butterflyFlightTwo;
  --flight-duration: 31s;
  --flight-delay: -18s;
}

.butterfly-flight-three {
  --flight-path: butterflyFlightThree;
  --flight-duration: 29s;
  --flight-delay: -13s;
}

.butterfly-flight-four {
  --flight-path: butterflyFlightTwo;
  --flight-duration: 34s;
  --flight-delay: -6s;
}

.butterfly-flight-five {
  --flight-path: butterflyFlightThree;
  --flight-duration: 32s;
  --flight-delay: -21s;
}

.butterfly-flight-six {
  --flight-path: butterflyFlightOne;
  --flight-duration: 30s;
  --flight-delay: -16s;
}

@keyframes butterflyFlightOne {
  0% {
    left: 4%;
    top: 18%;
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-15deg);
  }
  12% {
    left: 28%;
    top: 10%;
    opacity: 0.85;
    transform: translate(-50%, -50%) rotate(18deg);
  }
  27% {
    left: 63%;
    top: 17%;
    opacity: 0.85;
    transform: translate(-50%, -50%) rotate(-12deg);
  }
  42% {
    left: 91%;
    top: 37%;
    opacity: 0.85;
    transform: translate(-50%, -50%) rotate(22deg);
  }
  57% {
    left: 70%;
    top: 57%;
    opacity: 0.85;
    transform: translate(-50%, -50%) rotate(-18deg);
  }
  73% {
    left: 34%;
    top: 47%;
    opacity: 0.85;
    transform: translate(-50%, -50%) rotate(14deg);
  }
  88% {
    left: 14%;
    top: 72%;
    opacity: 0.85;
    transform: translate(-50%, -50%) rotate(-12deg);
  }
  100% {
    left: 4%;
    top: 18%;
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-15deg);
  }
}

@keyframes butterflyFlightTwo {
  0% {
    left: 95%;
    top: 26%;
    opacity: 0;
    transform: translate(-50%, -50%) rotate(16deg);
  }
  14% {
    left: 71%;
    top: 16%;
    opacity: 0.78;
    transform: translate(-50%, -50%) rotate(-14deg);
  }
  30% {
    left: 38%;
    top: 28%;
    opacity: 0.78;
    transform: translate(-50%, -50%) rotate(12deg);
  }
  46% {
    left: 10%;
    top: 47%;
    opacity: 0.78;
    transform: translate(-50%, -50%) rotate(-20deg);
  }
  62% {
    left: 31%;
    top: 69%;
    opacity: 0.78;
    transform: translate(-50%, -50%) rotate(16deg);
  }
  78% {
    left: 66%;
    top: 79%;
    opacity: 0.78;
    transform: translate(-50%, -50%) rotate(-12deg);
  }
  92% {
    left: 88%;
    top: 54%;
    opacity: 0.78;
    transform: translate(-50%, -50%) rotate(18deg);
  }
  100% {
    left: 95%;
    top: 26%;
    opacity: 0;
    transform: translate(-50%, -50%) rotate(16deg);
  }
}

@keyframes butterflyFlightThree {
  0% {
    left: 14%;
    top: 82%;
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-14deg);
  }
  13% {
    left: 39%;
    top: 70%;
    opacity: 0.72;
    transform: translate(-50%, -50%) rotate(18deg);
  }
  29% {
    left: 75%;
    top: 82%;
    opacity: 0.72;
    transform: translate(-50%, -50%) rotate(-18deg);
  }
  45% {
    left: 92%;
    top: 61%;
    opacity: 0.72;
    transform: translate(-50%, -50%) rotate(14deg);
  }
  61% {
    left: 69%;
    top: 42%;
    opacity: 0.72;
    transform: translate(-50%, -50%) rotate(-12deg);
  }
  77% {
    left: 34%;
    top: 54%;
    opacity: 0.72;
    transform: translate(-50%, -50%) rotate(20deg);
  }
  92% {
    left: 11%;
    top: 35%;
    opacity: 0.72;
    transform: translate(-50%, -50%) rotate(-16deg);
  }
  100% {
    left: 14%;
    top: 82%;
    opacity: 0;
    transform: translate(-50%, -50%) rotate(-14deg);
  }
}

@keyframes butterflyWings {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0.48);
  }
}

.page-foreground {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(100%, 520px);
  height: auto;
  max-width: 100%;
  transform: translateX(-50%);
  object-fit: contain;
  backface-visibility: hidden;
  pointer-events: none;
  z-index: 15;
}

@container invitation-stage (max-width: 768px) {
  .page-foreground {
    max-width: 390px;
  }

  .main-content {
    overflow-y: visible;
  }

  body {
    justify-content: stretch;
  }

  .page-shell {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
  }

}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.NamefadeIn {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.2s ease-out var(--fade-delay, 0.2s), transform 1.2s ease-out var(--fade-delay, 0.2s);
}

.NamefadeIn.reveal-text {
  transform: translateY(16px);
  filter: blur(3px);
  transition:
    opacity 1s ease-out var(--fade-delay, 0.2s),
    transform 1s cubic-bezier(0.2, 0.8, 0.2, 1) var(--fade-delay, 0.2s),
    filter 1s ease-out var(--fade-delay, 0.2s);
}

.NamefadeIn.reveal-image {
  transform: scale(0.94);
  filter: blur(5px);
  transition:
    opacity 1.1s ease-out var(--fade-delay, 0.2s),
    transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) var(--fade-delay, 0.2s),
    filter 1.1s ease-out var(--fade-delay, 0.2s);
}

.NamefadeIn.reveal-element {
  transform: translateY(24px) scale(0.98);  
  transition:
    opacity 1.1s ease-out var(--fade-delay, 0.2s),
    transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) var(--fade-delay, 0.2s);
}

.NamefadeIn.is-visible {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.NamefadeIn.reveal-image.is-visible {
  transform: scale(1);
}

.NamefadeIn.gallery-reveal-left,
.NamefadeIn.gallery-reveal-right {
  transform: translateX(48px) scale(0.98);
  transition:
    opacity 1s ease-out var(--fade-delay, 0.2s),
    transform 1s cubic-bezier(0.2, 0.8, 0.2, 1) var(--fade-delay, 0.2s);
}

.NamefadeIn.gallery-reveal-left {
  transform: translateX(-48px) scale(0.98);
}

.NamefadeIn.gallery-reveal-left.is-visible,
.NamefadeIn.gallery-reveal-right.is-visible {
  transform: translateX(0) scale(1);
}

.agenda-item.NamefadeIn {
  transform: translateX(var(--agenda-reveal-x, -18px)) scale(0.98);
  transition:
    opacity 0.8s ease-out var(--fade-delay, 0s),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) var(--fade-delay, 0s);
}

.agenda-item.NamefadeIn:nth-child(even) {
  --agenda-reveal-x: 18px;
}

.agenda-item.NamefadeIn.is-visible {
  transform: translateX(0) scale(1);
}

.invitation-text-line {
  display: block;
  opacity: 0;
  transform: translateY(0.45em);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.main-content.first-opening-text-delay .NamefadeIn:not(.reveal-image):not(.gallery-reveal-left):not(.gallery-reveal-right) {
  transition-delay: 1s !important;
}

.main-content.first-opening-text-delay .invitation-text-line {
  transition-delay: calc(1s + var(--stagger-delay, 0s)) !important;
}

.khmer-invitation .invitation-text-line,
.english-invitation .invitation-text-line {
  transform: translateY(0.35em) scale(0.96);
  transform-origin: center;
  filter: blur(2px);
  transition:
    opacity 0.85s ease,
    transform 0.85s cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 0.85s ease;
  transition-delay: var(--stagger-delay, 0s);
}

.khmer-invitation .invitation-text-line {
  font-family: 'Khmer S2', 'Kh Muol Pali', 'Khmer OS', 'Noto Sans Khmer', sans-serif;
}

.invitation-text-line.is-visible {
  opacity: 1;
  filter: blur(0);
}

.khmer-invitation .invitation-text-line.is-visible,
.english-invitation .invitation-text-line.is-visible {
  transform: translateY(0) scale(1);
}

.khmer-invitation-family .invitation-text-line,
.english-invitation-family .invitation-text-line {
  display: flex;
  justify-content: center;
  gap: 0.45em;
}

.english-invitation-family .invitation-text-line {
  gap: 0.4em;
}

.hero-image-stack {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  position: relative;
  z-index: 5;
}

.hero-image-stack img {
  width: 100%;
  max-width: 420px;
  height: auto;
  display: block;
}

.hero-image-stack #locationMapImage {
  display: block;
}

html[data-language="en"] .hero-countdown-label [lang="en"] {
  font-family: 'Times New Roman', Times, serif;
}

.khmer-invitation {
  width: min(100%, 420px);
  aspect-ratio: 1080 / 1330;
  margin-top: 0;
  position: relative;
  color: var(--text);
  text-align: center;
  font-family: 'Kh Ang Moul Seda', 'Kh Muol Pali', 'Khmer OS', 'Noto Sans Khmer', sans-serif;
}

.english-invitation {
  width: min(100%, 420px);
  aspect-ratio: 1080 / 1307;
  margin-top: 0;
  position: relative;
  color: var(--text);
  text-align: center;
  font-family: 'Times New Roman', Times, serif;
}

.hero-image-stack .invitation-panel-logo-wrap {
  position: absolute;
  top: 1%;
  left: 50%;
  width: 36%;
  height: 41%;
  margin-top: -22% !important;
  transform: translateX(-50%);
}

.hero-image-stack img.invitation-panel-logo {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  object-fit: contain;
}

.invitation-panel-logo-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    112deg,
    transparent 28%,
    rgba(255, 244, 209, 0.08) 40%,
    rgba(255, 250, 226, 0.78) 50%,
    rgba(255, 244, 209, 0.08) 60%,
    transparent 72%
  );
  background-size: 240% 100%;
  background-position: 150% 0;
  mask-image: url('img/wedding-monogram.png');
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
  animation: monogramLightSweep 4.5s ease-in-out 0.6s infinite;
  pointer-events: none;
}

.english-invitation-family {
  position: absolute;
  top: 30%;
  left: 4%;
  width: 92%;
  margin-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 4%;
  row-gap: 0.35em;
  font-size: clamp(0.58rem, 10.296px, 0.79rem);
  line-height: 1.45;
}

.english-invitation-title {
  position: absolute;
  top: 29%;
  left: 4%;
  width: 92%;
  margin: 0;
  font-family: 'Times New Roman', Times, serif;
  font-size: clamp(0.88rem, 10.92px, 0.84rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.english-invitation-family div {
  margin-top: 3px !important; 
  display: flex;
  justify-content: center;
  gap: 0.4em;
  white-space: nowrap;
}

.english-invitation-family strong {
  font-weight: 400;
}

.english-invitation-heading,
.english-invitation-intro,
.english-invitation-event {
  position: absolute;
  left: 4%;
  width: 92%;
  margin: 0;
}

.english-invitation-heading {
  top: 46%;
  font-family: 'Times New Roman', Times, serif;
  font-size: clamp(0.86rem, 15.015px, 1.1rem);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.english-invitation-intro,
.english-invitation-event {
  font-size: clamp(0.59rem, 10.725px, 0.9rem);
  line-height: 1;
  margin-top: 0.9rem !important;
}

.english-invitation-intro {
  top: 54%;
}

.english-invitation-couple {
  position: absolute;
  top: 69%;
  left: 4%;
  width: 92%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  column-gap: 3%;
  font-size: clamp(0.6rem, 12.012px, 0.2rem);
  line-height: 1.6;
}

.english-invitation-couple div {
  display: grid;
  justify-items: center;
  gap: 0.25em;
  margin-top: 0.2rem !important;
}

.english-invitation-couple strong {
  font-size: 1.12em;
  font-weight: 600;
}

.english-invitation-event {
  top: 89%;
  
}

.english-invitation-event-title {
  position: absolute;
  top: 78%;
  left: 4%;
  width: 92%;
  margin: 0;
  font-family: 'Times New Roman', Times, serif;
  font-weight: 600;
  line-height: 5;
  text-align: center;
}

.english-invitation-title,
.english-invitation-heading,
.english-invitation-event-title {
  font-size: clamp(0.86rem, 15.015px, 1.1rem);
  
}

.english-invitation-event sup {
  font-size: 0.65em;
  line-height: 0;
}

.khmer-invitation-family {
  position: absolute;
  top: 32%;
  left: 5%;
  width: 92%;
  margin-top: 1.3rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 17%;
  row-gap: 0.75em;
  font-size: clamp(0.7rem, 9.672px, 0.7rem);
  line-height: 1.4;
  
}

.khmer-invitation-title {
  position: absolute;
  top: 27%;
  left: 3%;
  width: 92%;
  margin: 0;
  font-family: 'Kh Muol Pali', 'Kh Ang Moul Seda', 'Khmer OS', 'Noto Sans Khmer', sans-serif;
  margin-top: 0.5rem !important;
  font-weight: 800  !important;
  line-height: 1;
}

.khmer-invitation-family div {
  display: flex;
  justify-content: center;
  gap: 0.45em;
  white-space: nowrap;
}

.khmer-invitation-family div {
  justify-content: flex-start;
  text-align: left;
}

.khmer-invitation-family span,
.khmer-invitation-intro,
.khmer-invitation-couple span,
.khmer-invitation-event {
  font-size: clamp(0.6rem, 11.7px, 0.6rem);
  margin-top: 0.4rem !important;
  font-family: 'Khmer OS Siemreap', 'Noto Sans Khmer', sans-serif;
}

.khmer-invitation-family strong,
.khmer-invitation .khmer-invitation-couple strong {
  font-family: 'Kh Muol Pali', 'Kh Ang Moul Seda', 'Khmer OS', 'Noto Sans Khmer', sans-serif;
}

.khmer-invitation-family strong {
  font-size: clamp(0.65rem, 11.7px, 0.6rem);
  margin-top: 0.4rem !important;
}

.khmer-family-name-regular {
  font-weight: 400;
}

.khmer-invitation-heading {
  position: absolute;
  top: 55%;
  left: 4%;
  width: 92%;
  margin: 0;
  margin-top: 2.5rem !important;
  line-height: 1.4;
  font-family: 'Kh Muol Pali', 'Kh Ang Moul Seda', 'Khmer OS', 'Noto Sans Khmer', sans-serif;
  font-weight: 800  !important;
}

.khmer-invitation-intro,
.khmer-invitation-event {
  position: absolute;
  left: 3%;
  width: 92%;
  margin-top: 1.8rem !important;
  font-size: clamp(0.6rem, 11.53px, 0.6rem);
  line-height: 2.4;
}

.khmer-invitation-intro {
  top: 53%;
  margin-top: 0.9rem;
}

.khmer-invitation-intro .invitation-text-line,
.khmer-invitation-event .invitation-text-line {
  display: block;
  margin: 0;
  line-height: 2.6;
  font-size: clamp(0.33rem, 15.483px, 0.65rem);
}

.khmer-invitation-couple-label {
  position: absolute;
  top: 86%;
  left: 2%;
  width: 100%;
  margin: 0;
  text-align: center;
  font-size: clamp(0.52rem, 15.483px, 0.52rem);
  line-height: 1.4;
}

.hero-image-stack img.khmer-invitation-couple-monogram {
  display: block;
  width: 10%;
  max-width: none;
  margin-top: -1.2rem !important;
  height: 6em;
  margin: 0;
  justify-self: center;
  object-fit: contain;
}

.khmer-invitation-couple {
  position: absolute;
  top: 80%;
  left: 3%;
  width: 92%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  column-gap: 13%;
  font-size: clamp(0.53rem, 15.483px, 0.58rem);
  line-height: 2.9;
}

.khmer-invitation-couple > div > span.invitation-text-line {
  --stagger-delay: 0.08s;
}

.khmer-invitation-couple > div > strong.invitation-text-line {
  --stagger-delay: 0.2s;
}

.khmer-invitation-couple > div:last-child > span.invitation-text-line {
  --stagger-delay: 0.22s;
}

.khmer-invitation-couple > div:last-child > strong.invitation-text-line {
  --stagger-delay: 0.34s;
}

.khmer-invitation-event {
  top: 95%;
  line-height: 2.4;
  margin-top: 2.8rem !important;
}

.khmer-invitation-event-title,
.english-invitation-event-title {
  top: 75%;
}

.khmer-invitation-title,
.khmer-invitation-heading,
.khmer-invitation-event-title {
  font-size: clamp(0.52rem, 11.7px, 0.75rem);
}

.khmer-invitation-title,
.khmer-invitation-heading,
.khmer-invitation-event-title {
  font-size: clamp(0.52rem, 15.6px, 0.75rem);
}

.khmer-invitation-title {
  font-size: clamp(0.52rem, 17.55px, 0.98rem);
}

.khmer-invitation-heading {
  top: 45%;
}

.khmer-invitation-event-title {
  position: absolute;
  top: 99%;
  left: 4%;
  width: 92%;
  margin: 0;
  font-weight: 800 !important;
  line-height: 1.4;
  text-align: center;
}

.english-invitation-event-title {
  font-size: clamp(0.75rem, 16.575px, 0.6rem);
}

.khmer-invitation-couple div {
  display: grid;
  justify-items: center;
  gap: 0.3em;
}

.khmer-invitation-couple div:last-child {
  transform: translateX(1.5rem);
}

.khmer-invitation-couple strong {
  font-size: 1.2em;
}

.footer-text-image {
  width: calc(100% + 1rem);
  max-width: 550px;
  margin: 2rem auto 0;
  margin-top: -2rem;
  display: block;
}

.contact-info {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  margin: 1.5rem auto 2rem;
  margin-top: -5rem;
  color: var(--accent);
  text-align: center;
} 

.contact-title {
  margin: 0; 
  font: 500 clamp(0.9rem, 15.6px, 1.1rem)/1.4 'Times New Roman', Times, serif;
  letter-spacing: 0.12em;
}

.contact-social-links {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.contact-social-link {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 199, 112, 0.65);
  border-radius: 50%;
  color: #2a180e;
  background: #ffc770;
  transition: transform 0.2s ease, background 0.2s ease;
}

.contact-social-link:hover,
.contact-social-link:focus-visible {
  transform: translateY(-2px);
  background: #ffdfa2;
  outline: none;
}

.contact-social-link svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.contact-phone {
  color: var(--accent);
  font: 500 1rem/1.4 'Times New Roman', Times, serif;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.page-background-layer {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(100%, 480px);
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 0;
}

.page-background-layer .main-bg-image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
}

.scroll-content-layer {
  position: relative;
  z-index: 10;
  width: 100%;
  min-height: 664px;
  padding-right: 1rem;
  padding-left: 1rem;
  padding-bottom: 0;
}

.section {
  padding: 2.5rem 0 3rem;
  position: relative;
}

#section-invitation.section {
  padding: 0;
}

#section-invitation.section::before,
#section-invitation.section::after {
  display: none;
}

#section-invitation .hero-image-stack {
  gap: 0;
}

#section-invitation .location-direction-button {
  margin-top: 0.5rem;
  margin-bottom: -1.5rem;
}

#section-invitation .wishes-header {
  margin-top: 2rem;
}

#section-invitation .wishes-header .section-title {
  width: 100%;
  justify-content: center;
  font-size: clamp(1rem, 16.38px, 1.15rem);
  text-transform: uppercase;
  white-space: nowrap;
}

.section-hero {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  background: transparent;
  border-radius: 24px;
  z-index: 10;
}

.section-hero::before {
  content: none;
}

.section-hero .section-inner {
  position: relative;
  z-index: 10;
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
  height: 100%;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: transparent;
  backdrop-filter: none;
  border-radius: 0;
}

.splash-screen,
.intro-screen,
.main-content {
  width: 100%;
}

.splash-screen,
.intro-screen {
  position: relative;
  min-height: 664px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #f7f4ee url('img/bg_start.png') center / cover no-repeat;
}

.splash-screen {
  align-items: end;
  padding-bottom: 12rem;
}

.splash-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  transform: scale(1);
}

.splash-screen::before {
  content: '';
  position: absolute;
  inset: -12%;
  z-index: 1;
  background:
    radial-gradient(ellipse at 18% 82%, rgba(226, 218, 204, 0.22), transparent 34%),
    radial-gradient(ellipse at 76% 74%, rgba(203, 210, 216, 0.18), transparent 38%),
    radial-gradient(ellipse at 48% 96%, rgba(239, 225, 203, 0.16), transparent 42%);
  filter: blur(24px);
  mix-blend-mode: screen;
  opacity: 0.72;
  pointer-events: none;
  animation: entranceSmokeDrift 18s ease-in-out infinite alternate;
}

@keyframes entranceSmokeDrift {
  from {
    transform: translate3d(-2%, 2%, 0) scale(1);
    opacity: 0.46;
  }
  to {
    transform: translate3d(2%, -3%, 0) scale(1.12);
    opacity: 0.82;
  }
}

.splash-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at center, transparent 48%, rgba(19, 14, 12, 0.34) 100%),
    linear-gradient(135deg, rgba(40, 54, 65, 0.1), rgba(170, 104, 51, 0.14));
  pointer-events: none;
}

#entranceVideoScreen::before,
#entranceVideoScreen::after {
  display: none;
}

.skip-video-button {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
  bottom: auto;
  left: auto;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff8ea;
  font: 400 2rem/0.75 'Times New Roman', Times, serif;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.8);
  transition: color 0.2s ease;
}

.skip-video-button:hover,
.skip-video-button:focus-visible {
  color: #ffc770;
}

.splash-screen {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 999;
  width: min(540px, 390px, 373.5px);
  height: auto;
  aspect-ratio: 540 / 960;
  min-height: 0;
  max-height: 664px;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
  transform: translate(-50%, -50%);
}

@container invitation-stage (max-width: 768px) {
  .splash-screen {
    inset: 0;
    top: 0;
    left: 0;
    width: 390px;
    height: 664px;
    height: 664px;
    max-height: none;
    aspect-ratio: auto;
    transform: none;
  }
}

body.loaded .splash-screen.is-playing {
  opacity: 1;
  animation: none;
}

.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 390px;
  height: 664px;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(111, 56, 37, 0.38), transparent 62%),
    linear-gradient(145deg, #321413, #160907 78%);
  transition: background 1.4s ease;
}

.intro-screen.is-opening {
  background: transparent;
  transition: none;
}

.envelope-scene {
  position: relative;
  width: min(540px, 390px, 373.5px);
  height: auto;
  aspect-ratio: 540 / 960;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 28px 65px rgba(0, 0, 0, 0.48);
  perspective: 1200px;
  transform-style: preserve-3d;
}

.envelope-back,
.envelope-pocket,
.envelope-flap,
.envelope-seal-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.envelope-pocket,
.envelope-flap {
  inset: -1.5%;
  width: 103%;
  height: 103%;
}

.envelope-back {
  z-index: 0;
  background: linear-gradient(150deg, #54231b 0%, #2b100d 78%);
  transition: opacity 2.4s ease;
}

.envelope-scene.is-opening .envelope-back {
  opacity: 0;
}

.envelope-pocket {
  z-index: 3;
  object-fit: fill;
  pointer-events: none;
  transform-origin: 50% 100%;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform 2.4s cubic-bezier(0.72, 0, 0.24, 1) 120ms, opacity 2.4s ease 950ms;
}

.envelope-scene.is-opening .envelope-pocket {
  opacity: 0;
  transform: rotateX(78deg) translateY(12%);
}

.envelope-flap {
  z-index: 4;
  object-fit: fill;
  pointer-events: none;
  transform-origin: 50% 0%;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform 2.4s cubic-bezier(0.72, 0, 0.24, 1), opacity 2.4s ease 950ms;
}

.envelope-scene.is-opening .envelope-flap {
  opacity: 0;
  transform: rotateX(-78deg) translateY(-5%);
}

.envelope-branding {
  position: absolute;
  z-index: 5;
  top: 5%;
  left: 8%;
  width: 84%;
  display: grid;
  justify-items: center;
  color: #ffc770;
  text-align: center;
  pointer-events: none;
  transition: opacity 350ms ease;
}

.envelope-monogram-wrap {
  position: relative;
  display: block;
  width: 52%;
  margin: 1rem 0 2.3rem;
  overflow: hidden;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.envelope-monogram-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    112deg,
    transparent 28%,
    rgba(255, 244, 209, 0.08) 40%,
    rgba(255, 250, 226, 0.78) 50%,
    rgba(255, 244, 209, 0.08) 60%,
    transparent 72%
  );
  background-size: 240% 100%;
  background-position: 150% 0;
  mask-image: url('img/wedding-monogram.png');
  mask-size: 100% 100%;
  mask-repeat: no-repeat;
  animation: monogramLightSweep 4.5s ease-in-out 0.6s infinite;
  pointer-events: none;
}

.envelope-monogram {
  display: block;
  width: 100%;
  height: auto;
  max-height: clamp(120px, 139.44px, 185px);
  object-fit: contain;
}

@keyframes monogramLightSweep {
  0%,
  18% {
    background-position: 150% 0;
    opacity: 0;
  }
  30% {
    opacity: 1;
  }
  58%,
  100% {
    background-position: -150% 0;
    opacity: 0;
  }
}

.envelope-title,
.envelope-subtitle {
  margin: 0;
  color: #ffc770;
  font-family: 'Kh Muol Pali', 'Kh Ang Moul Seda', 'Khmer OS', 'Noto Sans Khmer', serif;
  text-shadow: 0 2px 7px rgba(0, 0, 0, 0.72);
}

.envelope-title {
  font-size: clamp(0.99rem, 17.55px, 1.2rem);
  line-height: 0;
}

.envelope-subtitle {
  position: absolute;
  z-index: 6;
  top: 67.5%;
  left: 8%;
  width: 84%;
  margin: 0;
  color: #ffc770;
  font-size: clamp(1.2rem, 13.065px, 0.95rem);
  line-height: 1.5;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  transition: opacity 350ms ease;
}

.envelope-guest-name {
  position: absolute;
  z-index: 6;
  top: 77%;
  left: 8%;
  width: 84%;
  min-height: 2em;
  margin: 0;
  padding: 0.18em 0;
  color: #ffc770;
  font: 400 clamp(1.5rem, 17.16px, 1.25rem)/1.6 'Times New Roman', Times, serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  text-shadow: none;
  pointer-events: none;
  transition: opacity 350ms ease;
}

.envelope-guest-name.is-khmer-name {
  font-family: 'Khmer S2', 'Kh Muol Pali', serif;
}

.envelope-guest-name.is-english-name {
  font-family: 'Times New Roman', Times, serif;
}

.envelope-guest-name::after {
  content: '';
  position: absolute;
  left: 50%;
  width: min(48%, 13rem);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 210, 135, 0.72) 18%, #ffe8bd 50%, rgba(255, 210, 135, 0.72) 82%, transparent);
  box-shadow: none;
  transform: translateX(-50%);
}

.envelope-guest-name::after {
  bottom: -1rem;
  background:
    linear-gradient(90deg, transparent, rgba(255, 210, 135, 0.72) 18%, #ffe8bd 50%, rgba(255, 210, 135, 0.72) 82%, transparent);
}

.envelope-guest-name:empty::after {
  display: none;
}

.envelope-guest-name:not(:empty)::after {
  height: 2px;
  background:
    radial-gradient(circle, #fff0cf 0 1px, transparent 1.5px) 50% 50% / 5px 5px no-repeat,
    linear-gradient(90deg, transparent, rgba(255, 210, 135, 0.72) 18%, #ffe8bd 50%, rgba(255, 210, 135, 0.72) 82%, transparent);
  box-shadow: none;
}

.envelope-open-prompt {
  position: absolute;
  z-index: 7;
  top: 39%;
  left: 8%;
  width: 84%;
  margin: 0;
  color: #ffc770;
  font: 500 clamp(0.64rem, 11.7px, 0.84rem)/1.5 'Khmer OS Siemreap', 'Noto Sans Khmer', serif;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.82);
  pointer-events: none;
  animation: envelopePromptFloat 1.8s ease-in-out infinite;
  transition: opacity 300ms ease;
}

.envelope-open-prompt::after {
  content: '';
  position: absolute;
  top: calc(100% + 0.28rem);
  left: 50%;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7));
  transform: translateX(-50%) rotate(45deg);
  animation: envelopePromptArrow 1.1s ease-in-out infinite;
}

@keyframes envelopePromptFloat {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -4px;
  }
}

@keyframes envelopePromptArrow {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 4px;
  }
}

.envelope-scene.is-opening .envelope-branding,
.envelope-scene.is-opening .envelope-subtitle,
.envelope-scene.is-opening .envelope-guest-name,
.envelope-scene.is-opening .envelope-open-prompt {
  opacity: 0;
}

.envelope-scene.is-opening .envelope-monogram-wrap::after {
  animation: none;
}

.envelope-seal-art {
  z-index: 5;
  object-fit: fill;
  pointer-events: none;
  transform: scale(0.9);
  animation: envelopeSealGleam 3s ease-in-out infinite;
  transition: opacity 300ms ease;
}

.envelope-seal-button {
  position: absolute;
  z-index: 6;
  top: 52.8%;
  left: 50%;
  width: 24%;
  height: 14.3%;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.envelope-seal-button::before {
  content: '';
  position: absolute;
  inset: -5%;
  border: 1.5px solid rgba(255, 205, 116, 0.72);
  border-radius: 50%;
  box-shadow: 0 0 7px rgba(255, 199, 112, 0.32);
  animation: envelopeSealRipple 3.6s ease-out infinite;
  pointer-events: none;
}

@keyframes envelopeSealRipple {
  0% {
    opacity: 0;
    transform: scale(0.94);
  }
  18% {
    opacity: 0.55;
  }
  72% {
    opacity: 0;
    transform: scale(1.12);
  }
  100% {
    opacity: 0;
    transform: scale(1.12);
  }
}

@keyframes envelopeSealGleam {
  0%,
  100% {
    filter: brightness(1.02) drop-shadow(0 0 3px rgba(255, 199, 112, 0.22));
  }
  50% {
    filter: brightness(1.12) drop-shadow(0 0 8px rgba(255, 210, 135, 0.48));
  }
}

.envelope-seal-button:focus-visible {
  outline: 3px solid rgba(255, 230, 160, 0.9);
  outline-offset: 4px;
}

.envelope-seal-button:disabled {
  cursor: default;
}

.envelope-scene.is-opening .envelope-seal-art {
  transform-origin: center;
  transform: none;
  animation: sealRollInPlace 1.1s cubic-bezier(0.45, 0, 0.55, 1) forwards;
}

.envelope-scene.is-opening .envelope-seal-button {
  pointer-events: none;
}

.envelope-scene.is-opening .envelope-seal-button::before {
  animation: none;
  opacity: 0;
}

@keyframes sealRollInPlace {
  0% {
    opacity: 1;
    transform: scale(0.82) rotate(0deg);
  }
  35% {
    opacity: 0.72;
  }
  100% {
    opacity: 0;
    transform: scale(1.05) rotate(360deg);
  }
}

.splash-content {
  position: relative;
  z-index: 4;
  text-align: center;
  padding: 0 1.5rem;
  max-width: 620px;
}

.splash-guest {
  font-size: clamp(1.4rem, 39px, 1.4rem);
  text-transform: uppercase;
  margin-bottom: 1rem;
  color: var(--accent);
  font-weight: 700;
}

.splash-label,
.intro-label,
.section-tag,
.section-subtitle {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--accent);
  font-size: 0.78rem;
  margin-bottom: 1rem;
}

.crest-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
  margin: 0 auto 1.2rem;
  border: 1px solid rgba(197, 155, 95, 0.8);
  border-radius: 50%;
  color: var(--accent);
  font-size: 2rem;
  background: rgba(255, 250, 242, 0.82);
  box-shadow: inset 0 0 0 1px rgba(197, 155, 95, 0.18);
}

.splash-title {
  margin: 0;
  font-size: clamp(2.8rem, 31.2px, 4.8rem);
  line-height: 1.02;
  color: var(--accent);
  letter-spacing: 0.02em;
  font-family: 'Times New Roman', Times, serif;
}

.splash-guest-name {
  font-family: 'Times New Roman', Times, serif;
  color: var(--text);
  text-transform: none;
}

.splash-amp {
  color: var(--gold);
}

.splash-subtitle,
.intro-note,
.section-description,
.event-details,
.location-address,
.wish-intro,
.wish-message,
.wish-meta,
.detail-row {
  color: var(--muted);
}

.splash-subtitle {
  margin: 1rem auto 2rem;
  max-width: 520px;
  font-size: 1rem;
  line-height: 1.85;
}

.intro-note {
  max-width: 560px;
  font-size: 1rem;
  line-height: 1.8;
}

.primary-button,
.secondary-button,
.text-button {
  border: 1px solid rgba(197, 155, 95, 0.9);
  border-radius: 24px;
  padding: 1.1rem 2rem;
  font-size: 1.05rem;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
  background: rgba(255, 250, 242, 0.92);
  color: var(--accent);
  box-shadow: inset 0 0 0 0 rgba(197, 155, 95, 0);
  animation: buttonFloat 4.2s ease-in-out infinite;
}

.primary-button {
  background: linear-gradient(180deg, rgba(197, 155, 95, 0.16), rgba(255, 250, 242, 0.95));
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.primary-button.open-image-button {
  background: none;
  border: none;
  padding: 0;
  min-width: 0;
  pointer-events: auto;
  position: relative;
  z-index: 5;
  box-shadow: none;
  animation: none;
}

.primary-button.open-image-button img {
  display: block;
  width: 160px;
  max-width: 234px;
  height: auto;
  transition: transform 0.22s ease;
  animation: hoverPulse 2.5s ease-in-out infinite;
}

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

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

.primary-button,
.secondary-button,
.text-button,
.save-date-button,
.location-direction-button,
.send-wish-btn,
.icon-button {
  box-shadow: none;
}

.secondary-button {
  background: rgba(255, 250, 242, 0.9);
}

.primary-button:hover,
.secondary-button:hover,
.text-button:hover {
  transform: translateY(-2px);
  background: rgba(255, 250, 242, 1);
}

.primary-button.open-image-button:hover,
.primary-button.open-image-button:focus-visible {
  transform: none;
  background: none;
  box-shadow: none;
}

.section {
  padding: 2.5rem 0 3rem;
  position: relative;
}

.section::before,
.section::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 100%;
  max-width: 100%;
  height: 36px;
  transform: translateX(-50%);
  background: radial-gradient(circle at center, rgba(255, 250, 242, 0.92), transparent 55%);
}

.section::before {
  top: 0;
  border-bottom-left-radius: 100% 40px;
  border-bottom-right-radius: 100% 40px;
}

.section::after {
  bottom: 0;
  border-top-left-radius: 100% 40px;
  border-top-right-radius: 100% 40px;
}

.section-header {
  max-width: 760px;
  margin: 0 auto 1.75rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.section-header h2,
.section-title {
  margin: 48px auto 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(1rem, 19.5px, 1.2rem);
  line-height: 1.05;
  color: var(--accent);
  font-family: 'Times New Roman', Times, serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
}

.gallery-title {
  width: 100%;
  justify-content: center;
  font-size: var(--section-heading-size);
  white-space: nowrap;
}

.section-title::before,
.section-header h2::before {
  display: none;
}

.section-title .khmer,
.section-header h2 .khmer {
  font-family: 'Kh Ang Moul Seda', 'Moul', 'Kh Muol Pali', serif;
  letter-spacing: normal;
  text-transform: none;
}

.section-title .english,
.section-header h2 .english {
  font-family: 'Times New Roman', Times, serif;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.section-description {
  max-width: 620px;
  margin: 1rem auto 0;
  font-size: 0.98rem;
  line-height: 1.9;
}

.section-subtitle {
  display: inline-block;
  margin: 1.5rem auto 1rem;
  text-align: center;
  color: var(--accent);
}

.section-inner {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
}

.invitation-section,
.location-section {
  padding-top: 3.5rem;
}

.section-video-layer {
  position: absolute;
  inset: 0;
  opacity: 0.35;
}

.section-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.invitation-card,
.location-card,
.wish-form,
.countdown-card,
.agenda-item,


.invitation-card {
  padding: 2rem 1.8rem;
}

.parents-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.8rem;
}

.parent-label {
  margin: 0 0 0.45rem;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.95rem;
}

.parent-name {
  margin: 0;
  color: var(--text);
  line-height: 1.8;
}

.couple-names {
  text-align: center;
  margin: 1.8rem 0;
}

.groom-name,
.bride-name {
  margin: 0;
  color: var(--accent);
  font-size: clamp(2rem, 19.5px, 2.8rem);
  font-weight: 800;
  letter-spacing: 0.05em;
}

.floral-divider {
  margin: 1rem auto;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(197, 155, 95, 0.7);
  border-radius: 50%;
  color: var(--gold);
}

.event-details {
  margin: 1.6rem 0 2rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.9;
}

.detail-row {
  margin: 0.35rem 0;
}

.hero-countdown-wrapper {
  width: min(100%, 1080px);
  max-width: 100%;
  margin: 0.25rem auto 0.5rem;
  text-align: center;
}

.hero-countdown {
  position: relative;
  width: 95%;
  aspect-ratio: 1 / 1.15;
  margin-top: 0.35rem;
  margin-left: calc(8px);
  text-align: center;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(122, 74, 40, 0.12);
}

.hero-countdown-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: 100%;
  margin-top: -5.5rem;
  object-fit: contain;
  object-position: center center;
  background: #7a4a28;
  z-index: 0;
}

.hero-countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 0.8rem 0.75rem 1rem;
  z-index: 1;
  transform: scale(0.9);
  transform-origin: center top;
}

.save-date-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem 0;
  margin: 0 auto 0rem;
  margin-top: 7.5rem;
  text-decoration: none;
  animation: saveDateFloat 2.2s ease-in-out infinite;
}

.save-date-button img {
  display: block;
  width: min(100%, 190px);
  height: auto;
  border-radius: 999px;
  box-shadow: none;
}

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

.location-button-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
}

.location-direction-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 1rem auto 0;
  text-decoration: none;
  transition: transform 0.25s ease, filter 0.25s ease;
  animation: buttonFloat 4.2s ease-in-out infinite;
}

.location-direction-button img {
  display: block;
  margin-top: 1rem;
  width: min(100%, 190px);
  height: auto;
}

.location-direction-button:hover,
.location-direction-button:focus-visible {
  transform: translateY(-2px) scale(1.02);
  filter: brightness(1.05);
}

.hero-countdown-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.hero-countdown-line {
  display: block;
  width: 150px !important;
  height: 10px !important;
  margin: 0 auto;
}

.hero-countdown-label {
  position: relative;
  width: fit-content;
  margin: 0;
  padding-bottom: 1.5em;
  color: var(--accent);
  font-size: clamp(1rem, 18.72px, 1.35rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  font-family: 'Kh Muol Pali', 'Kh Ang Moul Seda', serif;
}

.hero-countdown-subtitle {
  margin: 0 0 0.7rem;
  color: var(--accent);
  font-size: clamp(1rem, 15.6px, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.countdown-section {
  background: rgba(255, 250, 242, 0.85);
}

.countdown-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.25rem auto 0;
  width: 100%;
}

.countdown-card {
  padding: 0.55rem 0.35rem;
  text-align: center;
  background: transparent;
  border: none;
  border-radius: 0;
  min-width: 3.6rem;
}

.countdown-card span {
  display: block;
  font-size: clamp(1.5rem, 19.5px, 1.8rem);
  font-weight: 800;
  color: var(--text);
  font-family: 'Times New Roman', Times, serif;
  text-shadow:
    1px 1px 2px rgba(42, 24, 14, 0.72),
    -1px -1px 2px rgba(42, 24, 14, 0.42);
  transform-origin: center bottom;
  backface-visibility: hidden;
}

.countdown-card span.countdown-number-changing {
  animation: countdownNumberFlip 420ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

@keyframes countdownNumberFlip {
  from {
    opacity: 0.35;
    transform: perspective(360px) rotateX(-75deg) translateY(-0.15em);
  }
  to {
    opacity: 1;
    transform: perspective(360px) rotateX(0) translateY(0);
  }
}

.countdown-card small {
  display: block;
  margin-top: 0.35rem;
  font-size: clamp(0.82rem, 10.92px, 0.95rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text);
  font-family: 'Times New Roman', Times, serif;
  text-shadow:
    1px 1px 2px rgba(42, 24, 14, 0.72),
    -1px -1px 2px rgba(42, 24, 14, 0.42);
}

.agenda-panel {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 0.75rem 0;
  box-sizing: border-box;
  background: transparent;
  color: #ffc770;
}

.agenda-date {
  width: min(100%, 42rem);
  margin: 1rem auto;
  padding: 0 0.5rem;
  box-sizing: border-box;
  font: 400 clamp(0.74rem, 12px, 0.9rem)/1.8 'Khmer S2', 'Kh Muol Pali', 'Khmer OS', 'Noto Sans Khmer', sans-serif;
  text-align: center;
}

.agenda-date-english {
  font-family: 'Times New Roman', Times, serif;
}

html[data-language="en"] .agenda-time,
html[data-language="en"] .agenda-description {
  font-family: 'Times New Roman', Times, serif;
}

.agenda-list {
  --agenda-icon-column: 3.25rem;
  --agenda-axis: calc(var(--agenda-icon-column) / 2);
  position: relative;
  max-width: none;
  margin: 0 auto;
}

.agenda-item {
  display: grid;
  grid-template-columns: var(--agenda-icon-column) minmax(0, 1fr);
  align-items: center;
  column-gap: var(--agenda-column-gap);
  row-gap: 0;
  position: relative;
  min-height: 3.2rem;
}



.agenda-list::before {
  content: '';
  position: absolute;
  top: 1.6rem;
  bottom: 1.6rem;
  left: 7rem;
  width: 2px;
  background: #ffc770;
  transform: translateX(-50%);
}

.agenda-panel .agenda-icon {
  display: block;
  width: 3rem;
  height: 2.5rem;
  margin-left: 2rem;
  object-fit: contain;
  justify-self: center;
}

.agenda-marker {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 7rem;
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: #ffc770;
  transform: translate(-50%, -50%);
}

.agenda-entry-content {
  min-width: 0;
  grid-column: 2;
  margin-left: 3.5rem;
  overflow-wrap: normal;
}

.agenda-time {
  margin: 0 0 0.2rem;
  font-weight: 700;
  font-family: 'Khmer S2', 'Kh Muol Pali', 'Khmer OS', 'Noto Sans Khmer', sans-serif;
  font-size: 0.88rem;
  line-height: 1.6;
  color: #ffc770;
}

.agenda-description {
  margin: 0;
  font: 200 clamp(0.72rem, 11.7px, 0.86rem)/1.7 'Khmer S2', 'Kh Muol Pali', 'Khmer OS', 'Noto Sans Khmer', sans-serif;
  color: #fff4dc;
}


.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
  width: 92%;
  margin: 0 auto;
}

.gallery-triple-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.gallery-triple-row > .gallery-card {
  min-width: 0;
  grid-column: auto;
}

.gallery-card {
  overflow: hidden;
  border: none;
  border-radius: 8px;
  min-width: 0;
  padding: 0.15rem;
  box-shadow: 0 8px 18px rgba(70, 44, 20, 0.08);
}

.gallery-grid > .gallery-card:nth-child(3) {
  grid-column: 1 / -1;
}

.gallery-card-wide {
  grid-column: 1 / -1;
}

.gallery-card-square img {
  aspect-ratio: 1 / 1.4;
}

.gallery-card button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}

.gallery-card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transform: scale(1.04);
  transition: transform 0.35s ease;
}

.gallery-card button:hover img,
.gallery-card button:focus img {
  transform: scale(1.08);
}

.gallery-section {
  padding-top: 2rem;
}

#section-gallery.section.gallery-section::before,
#section-gallery.section.gallery-section::after,
#section-wishes.section.wishes-section::before,
#section-wishes.section.wishes-section::after {
  display: none;
}

.section-title {
  margin: 0.6rem auto 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
 font-size: clamp(1rem, 19.5px, 1.2rem);
  line-height: 1.05;
  color: var(--accent);
  font-family: 'Times New Roman', Times, serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  position: relative;
}

.section-title::before {
  display: none;
}

.section-title .khmer {
  font-family: 'Kh Ang Moul Seda', 'Moul', 'Kh Muol Pali', serif;
  letter-spacing: normal;
  text-transform: none;
}

.section-title .english {
  font-family: 'Times New Roman', Times, serif;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.wishes-section {
  padding-bottom: 3rem;
}

.wish-intro {
  margin: 0 auto 1.4rem;
  max-width: 720px;
  color: var(--muted);
  text-align: center;
  line-height: 1.95;
}

.thank-you-message {
  width: 100%;
  max-width: 480px;
  margin: -1rem auto 2rem;
  color: var(--accent);
  text-align: center;
}

.thank-you-khmer-title,
.thank-you-english-title {
  margin: 0 auto 1rem;
  color: inherit;
  font-weight: 700;
  text-align: center;
}

.thank-you-khmer-title {
  font: 700 clamp(1rem, 16.38px, 1.25rem)/1.7 'Kh Ang Moul Seda', 'Kh Muol Pali', 'Khmer OS', 'Noto Sans Khmer', sans-serif;
}

.thank-you-khmer-title,
.thank-you-english-title {
  position: relative;
  width: fit-content;
  padding-bottom: 0.45em;
}

.thank-you-khmer,
.thank-you-english {
  margin: 1.5rem auto;
  text-align: center;
}

.thank-you-khmer {
  margin-top: -0.7rem;
  line-height: 1.95;
  font: 400 clamp(0.7rem, 9.6px, 1rem)/1.9 'Khmer S2', 'Kh Muol Pali', 'Khmer OS', 'Noto Sans Khmer', sans-serif;
}

.thank-you-divider {
  width: min(70%, 230px);
  height: 1px;
  margin: 2rem auto;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.thank-you-english-title {
  font: 700 clamp(1rem, 15.6px, 1.2rem)/1.4 'Times New Roman', Times, serif;
  letter-spacing: 0.03em;
}

.thank-you-english {
  font: 500 clamp(0.78rem, 12.48px, 0.95rem)/1.85 'Times New Roman', Times, serif;
  letter-spacing: 0.02em;
}

.wishes-header {
  margin-bottom: 1rem;
}

.wishes-header .section-title {
  margin: 0 auto;
  font-size: clamp(0.8rem, 15.6px, 1.15rem);
  line-height: 1.1;
  text-transform: none;
  white-space: nowrap;
}

#section-wishes .wishes-header .section-title {
  font-size: clamp(0.65rem, 12.48px, 0.95rem);
}

.wish-form {
  position: relative;
  display: grid;
  gap: 0.7rem;
  max-width: 30rem;
  margin: 0 auto;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.wish-form::before {
  display: none;
}

.wish-fields {
  display: grid;
  gap: 0.5rem;
}

.wish-label {
  position: relative;
  display: block;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(255, 199, 112, 0.24);
  border-radius: 12px;
  background: rgba(18, 11, 8, 0.3);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.wish-field-title {
  display: table;
  position: relative;
  margin-bottom: 0.1rem;
  padding-bottom: -0.2rem;
  color: rgba(255, 220, 157, 0.88);
  font: 700 0.68rem/1.3 'Times New Roman', Times, serif;
  letter-spacing: 0.1em;
}

.wish-field-title [lang="km"] {
  font: 500 0.78rem/1.5 'Kh Muol Pali', 'Kh Ang Moul Seda', 'Khmer OS', sans-serif;
  letter-spacing: 0;
}

.wish-label:focus-within {
  border-color: rgba(255, 199, 112, 0.78);
  background: rgba(58, 37, 25, 0.68);
  box-shadow: 0 0 0 3px rgba(255, 199, 112, 0.12);
  transform: translateY(-1px);
}

.wish-form input,
.wish-form textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  padding: 0.25rem 0;
  background: transparent;
  color: #fff4dc;
  font-family: 'Times New Roman', Times, serif;
  font-size: 0.9rem;
  outline: none;
  box-shadow: none;
  transition: color 0.2s ease;
}

.wish-form textarea {
  min-height: 5rem;
  resize: vertical;
}

#wishMessage {
  font-family: 'Times New Roman', Times, serif;
}

.wish-form input:focus,
.wish-form textarea:focus {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.wish-form input::placeholder,
.wish-form textarea::placeholder {
  color: rgba(255, 226, 178, 0.68);
  font-style: normal;
  opacity: 1;
}

html[data-language="km"] #wishMessage::placeholder {
  font-family: 'NiDAChenla', 'Noto Sans Khmer', sans-serif;
}

.send-wish-btn:focus-visible {
  outline: 2px solid #ffe0a8;
  outline-offset: 3px;
}

.wish-form input:focus-visible,
.wish-form textarea:focus-visible {
  outline: none;
}

.form-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.wish-thank-you {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  margin: 0.75rem auto;
  color: #ffc770;
  font: 500 0.95rem/1.7 'Khmer S2', 'Kh Muol Pali', 'Khmer OS', 'Noto Sans Khmer', sans-serif;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.35rem);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}


.wish-actions {
  justify-content: center;
  width: 100%;
  min-height: 0;
  margin-top: -3.5rem;
}

.wish-send-control {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  width: min(100%, 11rem);
  max-width: 100%;
}

.send-wish-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  box-shadow: none;
  margin-top: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.send-wish-btn img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}

.send-wish-btn:hover {
  transform: translateY(-2px);
  box-shadow: none;
  filter: brightness(1.06);
}

.send-wish-btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.send-wish-btn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.send-wish-label[lang="km"] {
  font: 700 0.78rem/1.2 'Kh Muol Pali', 'Kh Ang Moul Seda', 'Khmer OS', sans-serif;
}

.send-wish-label[lang="en"] {
  font: 700 0.72rem/1.2 'Times New Roman', Times, serif;
  letter-spacing: 0.07em;
}

.send-wish-arrow {
  width: 0.9rem;
  height: 0.9rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.wish-send-control.is-loading .send-wish-btn {
  opacity: 0.65;
}

.wish-loading-dots {
  display: none;
  align-items: center;
  gap: 0.3rem;
}

.wish-send-control.is-loading .wish-loading-dots {
  display: inline-flex;
}

.wish-loading-dots span {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: #a66e2e;
  animation: wishDotBounce 0.7s ease-in-out infinite alternate;
}

.wish-loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.wish-loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes wishDotBounce {
  to {
    transform: translateY(-0.45rem);
    opacity: 0.45;
  }
}

.wish-list-scroll {
  position: relative;
  margin-top: 1rem;
  padding-bottom: 0.75rem;
}

.wish-list-scroll.is-scrollable:not(.is-at-end)::before {
  content: '';
  position: absolute;
  z-index: 1;
  right: 0;
  top: 0;
  bottom: 0.75rem;
  width: 2.75rem;
  background: linear-gradient(90deg, transparent, rgba(35, 20, 14, 0.82));
  pointer-events: none;
}

.wish-list-scroll.is-scrollable:not(.is-at-end)::after {
  content: '';
  position: absolute;
  z-index: 2;
  top: 50%;
  right: 0.8rem;
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid #ffdc9d;
  border-bottom: 2px solid #ffdc9d;
  filter: drop-shadow(0 2px 4px rgba(22, 9, 7, 0.7));
  transform: translateY(-50%) rotate(-45deg);
  pointer-events: none;
}

.wish-list {
  display: flex;
  align-items: stretch;
  gap: 0.9rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.2rem 0.15rem 0.65rem;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.wish-list::-webkit-scrollbar {
  display: none;
}

.wish-scrollbar {
  display: none;
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: #7f582b7a;
  border-radius: 999px;
}

.wish-list-scroll.is-scrollable .wish-scrollbar {
  display: block;
}

.wish-scrollbar-thumb {
  display: block;
  width: 100%;
  height: 100%;
  background: #ffca57c5;
  border-radius: 999px;
}

.wish-card {
  position: relative;
  flex: 0 0 min(319.8px, 22rem);
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1px auto;
  grid-template-areas:
    "meta"
    "divider"
    "message";
  align-content: start;
  row-gap: 0.55rem;
  padding: 0.95rem 1rem;
  overflow: hidden;
  border: 1px solid rgba(255, 220, 157, 0.2);
  border-radius: 14px;
  background: linear-gradient(110deg, rgba(255, 220, 157, 0.1), rgba(61, 37, 25, 0.42) 48%, rgba(35, 20, 14, 0.6));
  box-shadow: 0 8px 22px rgba(22, 9, 7, 0.16), inset 0 1px rgba(255, 240, 211, 0.08);
  text-align: left;
  opacity: 1;
  scroll-snap-align: start;
}

.wish-card-meta {
  grid-area: meta;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.25rem;
  min-width: 0;
  text-align: left;
}

.wish-card-header {
  min-width: 0;
  margin: 0;
}

.wish-card-name {
  min-width: 0;
  font-family: 'Times New Roman', Times, serif;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffe0a8;
  letter-spacing: 0.05em;
  text-align: left;
  overflow-wrap: anywhere;
}

.wish-card-divider { 
  grid-area: divider;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 199, 112, 0.52), rgba(255, 199, 112, 0.08));
  margin: 0;
}

.wish-card-message {
  grid-area: message;
  min-width: 0;
  margin: 0;
  color: #fff4dc;
  font-size: 0.8rem;
  line-height: 1.6;
  text-align: left;
  font-family: 'Times New Roman', Times, serif;
  white-space: normal;
  overflow-wrap: anywhere;
}

.wish-card-time {
  min-width: 0;
  margin: 0;
  color: rgba(255, 220, 157, 0.72);
  font-size: 0.65rem;
  line-height: 1.35;
  text-align: left;
  font-family: 'Times New Roman', Times, serif;
}

.rsvp-section {
  padding: 0.75rem 0;
}

.rsvp-section::before,
.rsvp-section::after {
  display: none;
}

.rsvp-header {
  margin-bottom: 1.35rem;
}

.rsvp-header .section-title {
  margin-top: -4rem;
}

.rsvp-card {
  width: min(78%, 24rem);
  margin: 0 auto;
  padding: 6px;
  border: 1px solid rgba(255, 199, 112, 0.34);
  border-radius: 18px 34px 18px 34px;
  background:
    radial-gradient(ellipse at 95% 0, rgba(255, 199, 112, 0.1), transparent 42%),
    linear-gradient(145deg, rgba(65, 39, 25, 0.42), rgba(29, 17, 13, 0.56));
  box-shadow: 0 18px 42px rgba(12, 5, 3, 0.2), inset 0 1px rgba(255, 240, 211, 0.08);
  color: #fff4dc;
  text-align: center;
}

.rsvp-prompt,
.rsvp-people-prompt {
  margin: 0 0 0.55rem;
  color: #ffe0a8;
  font: 500 0.88rem/1.55 'Kh Muol Pali', 'Kh Ang Moul Seda', serif;
}

.rsvp-card > .rsvp-prompt,
.rsvp-card > .rsvp-choices {
  margin-top: 0.65rem;
  width: 100%;
  text-align: center;
}

.rsvp-card > .rsvp-choices {
  justify-content: center;
}

.rsvp-prompt[lang="en"],
.rsvp-people-prompt[lang="en"] {
  font-family: 'Times New Roman', Times, serif;
}

.rsvp-choices,
.rsvp-people-options {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rsvp-choice,
.rsvp-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(255, 199, 112, 0.52);
  border-radius: 999px;
  background: rgba(25, 14, 10, 0.48);
  color: #ffe0a8;
  font: 600 0.82rem/1.3 'Kh Muol Pali', 'Kh Ang Moul Seda', serif;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.rsvp-choice [lang="en"] {
  font-family: 'Times New Roman', Times, serif;
}

.rsvp-choice:hover,
.rsvp-count:hover,
.rsvp-choice:focus-visible,
.rsvp-count:focus-visible,
.rsvp-choice[aria-pressed="true"],
.rsvp-count[aria-pressed="true"] {
  border-color: #ffc770;
  background: #ffc770;
  color: #2a180e;
  outline: none;
}

.rsvp-choice:active,
.rsvp-count:active {
  transform: scale(0.97);
}

.rsvp-people {
  margin-top: 0.85rem;
}

.rsvp-people-prompt {
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
}

.rsvp-count {
  width: 40px;
  min-height: 40px;
  padding: 0.4rem;
  font-family: 'Times New Roman', Times, serif;
  font-size: 0.88rem;
}

.rsvp-status {
  min-height: 1.2em;
  margin: 0.45rem 0 0;
  color: #ffe0a8;
  font-size: 0.68rem;
  line-height: 1.4;
  font-family: 'Noto Sans Khmer', sans-serif;
}

@container invitation-stage (max-width: 380px) {
  .wish-card {
    padding: 0.85rem 0.75rem;
  }

  .wish-card-name {
    font-size: 0.75rem;
  }

  .wish-card-message {
    font-size: 0.88rem;
  }
}

.wish-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.wish-name {
  font-weight: 700;
}

.wish-message,
.wish-meta {
  color: var(--muted);
}

.site-footer {
  display: grid;
  gap: 0.75rem;
  padding-bottom: 3rem;
  text-align: center;
}

.footer-title {
  margin: 0;
  font-size: 1.4rem;
  letter-spacing: 0.18em;
  color: var(--accent);
}

.footer-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.8;
}

.footer-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.text-button {
  background: none;
  border: none;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

.bottom-nav {
  position: fixed;
  right: 1rem;
  bottom: 16px;
  display: block;
  z-index: 20;
}

.nav-menu-toggle {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0.65rem;
  border: 1px solid rgba(255, 199, 112, 0.62);
  border-radius: 50%;
  background: rgba(42, 24, 14, 0.96);
  color: #ffc770;
  box-shadow: 0 8px 22px rgba(22, 9, 7, 0.3);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-menu-toggle svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.nav-menu-toggle:hover,
.nav-menu-toggle:focus-visible,
.bottom-nav.is-open .nav-menu-toggle {
  color: #2a180e;
  background: #ffc770;
  outline: none;
}

.nav-menu-list {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.65rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem;
  border: 1px solid rgba(255, 199, 112, 0.48);
  border-radius: 999px;
  background: rgba(42, 24, 14, 0.96);
  box-shadow: 0 8px 22px rgba(22, 9, 7, 0.28);
  backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(0.5rem) scale(0.88);
  transform-origin: bottom right;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.22s ease;
}

.bottom-nav.is-open .nav-menu-list {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.nav-menu-list a {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0.55rem;
  border-radius: 50%;
  color: #ffc770;
  background: rgba(255, 199, 112, 0.08);
  border: 1px solid rgba(255, 199, 112, 0.18);
  text-decoration: none;
  opacity: 0;
  transform: translateY(0.35rem) scale(0.8);
  transition: color 0.18s ease, background 0.18s ease, opacity 0.2s ease, transform 0.2s ease;
}

.nav-menu-list a > span:not(.icon) {
  display: none;
}

.bottom-nav.is-open .nav-menu-list a {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.bottom-nav.is-open .nav-menu-list a:nth-child(1) { transition-delay: 0.02s; }
.bottom-nav.is-open .nav-menu-list a:nth-child(2) { transition-delay: 0.06s; }
.bottom-nav.is-open .nav-menu-list a:nth-child(3) { transition-delay: 0.1s; }
.bottom-nav.is-open .nav-menu-list a:nth-child(4) { transition-delay: 0.14s; }

.bottom-nav:not(.is-open) .nav-menu-list a {
  transition-delay: 0s;
}

.nav-menu-list a:hover,
.nav-menu-list a:focus-visible {
  color: #2a180e;
  background: #ffc770;
  border-color: #ffc770;
  outline: none;
}

.nav-menu-list a .icon {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.nav-menu-list a .icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.wish-placeholder {
    max-width: 680px;
    margin: 0 auto;
    color: var(--muted);
    text-align: center;
    font-size: 1rem;
    line-height: 1.85;
}

.audio-strip {
  position: fixed;
  right: 1rem;
  top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  z-index: 30;
  backdrop-filter: none;
}

.icon-button {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(197, 155, 95, 0.35);
  border-radius: 50%;
  background: linear-gradient(180deg, #fff 0%, #f7efe0 100%);
  color: var(--accent);
  font-size: 1.25rem;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  box-shadow: none;
  animation: buttonFloat 4.2s ease-in-out infinite;
}

.icon-button:hover,
.icon-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: none;
  background: linear-gradient(180deg, #fff 0%, #f0e5d4 100%);
}

.icon-button:active {
  transform: translateY(0);
  box-shadow: none;
}

#audioToggleIcon {
  display: block;
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(82%) sepia(39%) saturate(657%) hue-rotate(330deg) brightness(102%) contrast(101%);
}

#audioToggle {
  width: 36px;
  height: 36px;
  padding: 8px;
  border: 1px solid rgba(255, 199, 112, 0.55);
  border-radius: 50%;
  background: rgba(42, 24, 14, 0.92);
  box-shadow: 0 6px 18px rgba(22, 9, 7, 0.3);
  animation: none;
  opacity: 0.92;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, opacity 0.22s ease;
}

#languageToggle {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(255, 199, 112, 0.55);
  border-radius: 50%;
  background: rgba(42, 24, 14, 0.92);
  color: var(--accent);
  font: 600 0.72rem/1 'Times New Roman', Times, serif;
  box-shadow: 0 6px 18px rgba(22, 9, 7, 0.3);
  animation: none;
  cursor: pointer;
}

#languageToggle:hover,
#languageToggle:focus-visible,
#languageToggle:active {
  background: #432a18;
  border-color: #ffc770;
  box-shadow: 0 0 0 4px rgba(255, 199, 112, 0.16), 0 6px 18px rgba(22, 9, 7, 0.3);
  transform: translateY(-1px);
}

#audioToggle:hover,
#audioToggle:focus-visible,
#audioToggle:active {
  background: #432a18;
  border-color: #ffc770;
  box-shadow: 0 0 0 4px rgba(255, 199, 112, 0.16), 0 6px 18px rgba(22, 9, 7, 0.3);
  transform: translateY(-1px);
}

.audio-strip span {
  font-size: 0.92rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(11, 8, 5, 0.88);
  padding: 1.5rem;
  z-index: 30;
  touch-action: pan-y pinch-zoom;
}

.lightbox img {
  max-width: 100%;
  max-height: 564.4px;
  border-radius: 26px;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.45);
}

.lightbox-close {
  position: absolute;
  right: 1.25rem;
  top: 1.25rem;
  border: none;
  background: transparent;
  color: var(--accent);
  width: 54px;
  height: 54px;
  border-radius: 0;
  font-size: 1.4rem;
}

.lightbox-close:hover,
.lightbox-close:focus-visible,
.lightbox-close:active {
  background: transparent;
  box-shadow: none;
}

.lightbox-controls {
  position: absolute;
  bottom: 1.5rem;
  display: flex;
  gap: 1rem;
}

.lightbox-controls .icon-button {
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ffc770;
  font-size: 2rem;
  box-shadow: none;
  animation: none;
}

.lightbox-controls .icon-button:hover,
.lightbox-controls .icon-button:focus-visible,
.lightbox-controls .icon-button:active {
  background: transparent;
  box-shadow: none;
}

@container invitation-stage (max-width: 900px) {
  .countdown-grid,
  .agenda-list,
  .wish-form,
  .parents-grid,
  .location-card {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 2rem 0 2.5rem;
  }
}

@container invitation-stage (max-width: 640px) {
  .splash-screen {
    padding-bottom: 4rem;
  }

  .section {
    padding: 1.6rem 0 2rem;
  }

  .gallery-title {
    font-size: clamp(0.8rem, 15.6px, 1.15rem);
  }

  .gallery-triple-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .audio-strip {
    left: auto;
    right: 1rem;
    top: 1rem;
    bottom: auto;
  }
}

/* Keep the main section titles visually consistent. */
.section-header h2,
.section-title,
#section-wishes .wishes-header .section-title {
  font-size: var(--section-heading-size);
  line-height: 1.1;
  color: var(--accent);
  font-family: 'Times New Roman', Times, serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-countdown-label,
.section-header h2,
.section-title,
.thank-you-khmer-title,
.thank-you-english-title {
  font-size: var(--section-heading-size);
}

#section-countdown .hero-countdown-label {
  font-size: clamp(0.75rem, 13px, 1rem);
}

.section-header h2 .khmer,
.section-title .khmer {
  font-family: 'Kh Ang Moul Seda', 'Moul', 'Kh Muol Pali', serif;
  letter-spacing: normal;
  text-transform: none;
}

.envelope-title,
.envelope-subtitle,
.khmer-invitation-title,
.khmer-invitation-heading,
.khmer-invitation-event-title,
.hero-countdown-label [lang="km"],
.section-header h2 .khmer,
.section-title .khmer,
.thank-you-khmer-title,
.contact-title [lang="km"] {
  font-family: 'Kh Muol Pali', serif;
}

html[data-language="km"] [lang="km"],
html[data-language="km"] [lang="km"] * {
  font-family: 'NiDAChenla', 'Noto Sans Khmer', sans-serif;
}

:lang(km),
:lang(km) *,
.khmer {
  font-weight: 400 !important;
}

html[data-language="km"] .envelope-title,
html[data-language="km"] .envelope-subtitle,
html[data-language="km"] .envelope-guest-name,
html[data-language="km"] .khmer-invitation-title,
html[data-language="km"] .khmer-invitation-heading,
html[data-language="km"] .khmer-invitation-event-title,
html[data-language="km"] .khmer-invitation-family strong,
html[data-language="km"] .khmer-invitation-couple strong,
html[data-language="km"] .hero-countdown-label [lang="km"],
html[data-language="km"] .section-header h2 .khmer,
html[data-language="km"] .section-title .khmer,
html[data-language="km"] .thank-you-khmer-title,
html[data-language="km"] .contact-title [lang="km"] {
  font-family: 'Kh Muol Pali', 'Kh Ang Moul Seda', serif;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }

  .butterfly-flight {
    opacity: 0.75;
    transform: translate(-50%, -50%);
  }

  .butterfly-flight-one { left: 15%; top: 20%; }
  .butterfly-flight-two { left: 82%; top: 25%; }
  .butterfly-flight-three { left: 30%; top: 52%; }
  .butterfly-flight-four { left: 72%; top: 61%; }
  .butterfly-flight-five { left: 18%; top: 82%; }
  .butterfly-flight-six { left: 86%; top: 88%; }

  .invitation-text-line {
    opacity: 1;
    transform: none;
  }

  .envelope-open-prompt,
  .envelope-open-prompt::after {
    translate: none;
  }

}

.english-invitation {
  aspect-ratio: 1080 / 1330;
}

.english-invitation-title {
  top: 27%;
  left: 3%;
  width: 92%;
  margin-top: 0.5rem !important;
  font-size: clamp(0.52rem, 17.55px, 0.98rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}

.english-invitation-family {
  top: 32%;
  left: 5%;
  width: 92%;
  margin-top: 1.3rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 17%;
  row-gap: 0.75em;
  font-size: clamp(0.7rem, 9.672px, 0.7rem);
  line-height: 1.4;
}

.english-invitation-family div {
  justify-content: flex-start;
  gap: 0.45em;
  white-space: nowrap;
}

.english-invitation-family strong {
  font-size: inherit;
  font-weight: 700;
}

.english-invitation-heading {
  top: 45%;
  left: 4%;
  width: 92%;
  margin-top: 2.5rem !important;
  font-size: clamp(0.52rem, 15.6px, 0.75rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.4;
}

.english-invitation-intro {
  top: 53%;
  left: 3%;
  width: 92%;
  margin-top: 1.8rem !important;
  font-size: clamp(0.6rem, 11.53px, 0.6rem);
  line-height: 2.4;
  letter-spacing: 0;
}

.english-invitation-intro .invitation-text-line {
  display: block;
  margin: 0;
  line-height: 2.6;
  font-size: clamp(0.33rem, 15.483px, 0.65rem);
}

.english-invitation-couple {
  top: 80%;
  left: 3%;
  width: 92%;
  column-gap: 13%;
  margin-top: 0;
  font-size: clamp(0.53rem, 15.483px, 0.58rem);
  line-height: 2.9;
}

.english-invitation-couple div {
  gap: 0.3em;
  margin-top: 0;
}

.english-invitation-couple strong {
  white-space: nowrap;
  font-size: 1.2em;
  font-weight: 600;
}

.english-invitation-event {
  top: 95%;
  left: 3%;
  width: 92%;
  margin-top: 2.8rem !important;
  font-size: clamp(0.6rem, 11.53px, 0.6rem);
  line-height: 2.4;
  letter-spacing: 0;
}

.english-invitation-event .invitation-text-line {
  display: block;
  margin: 0;
  line-height: 2.6;
  font-size: clamp(0.33rem, 15.483px, 0.65rem);
}

.english-invitation-event-title {
  top: 99%;
  left: 4%;
  width: 92%;
  font-size: clamp(0.52rem, 15.6px, 0.75rem);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
}

:root {
  --envelope-surface: #21100d;
  --envelope-gold: #f4cd7a;
  --envelope-gold-glow: rgba(255, 202, 105, 0.72);
}

@media (prefers-color-scheme: light) {
  :root {
    --envelope-surface: #f4e8d0;
    --envelope-gold: #7d4a19;
    --envelope-gold-glow: rgba(166, 111, 42, 0.55);
  }
}

.intro-screen {
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse at 50% 42%, color-mix(in srgb, var(--envelope-gold) 24%, transparent), transparent 62%),
    var(--envelope-surface);
}

.stage {
  --dur: 2.4s;
  position: relative;
  width: min(390px, 373.5px, 540px);
  max-width: 390px;
  height: auto;
  aspect-ratio: 540 / 960;
  overflow: hidden;
  perspective: 1600px;
  isolation: isolate;
}

.stage[data-animation="snappy"] {
  --dur: 0.4s;
}

.stage[data-animation="zoom"] {
  --dur: 2.2s;
}

.stage .envelope-back {
  z-index: -1;
  background: var(--envelope-surface);
  transition: opacity 0.3s ease;
}

.stage.open .envelope-back {
  opacity: 0;
}

.stage .envelope-pocket {
  z-index: 1;
  transform: none;
  transition: transform var(--dur) cubic-bezier(0.77, 0, 0.18, 1) calc(var(--dur) + 0.3s);
}

.stage .envelope-flap {
  z-index: 2;
  transform-origin: 50% 0;
  backface-visibility: hidden;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.22));
  transition:
    transform calc(var(--dur) + 0.8s) cubic-bezier(0.77, 0, 0.18, 1) 0.3s,
    filter calc(var(--dur) + 0.8s) ease 0.3s,
    opacity 0.4s ease calc(var(--dur) + 0.4s);
}

.stage .envelope-seal-art {
  z-index: 3;
  transform: scale(0.82);
  transform-origin: 50% 52.5%;
  animation: envelopeSealPulse 2.4s ease-in-out infinite;
  transition: transform 0.7s ease, opacity 0.7s ease;
}

@keyframes envelopeSealPulse {
  0%, 100% { transform: scale(0.82); }
  50% { transform: scale(0.88); }
}

.stage.open .envelope-flap {
  opacity: 0;
  transform: rotateX(170deg);
  filter: drop-shadow(0 16px 12px rgba(0, 0, 0, 0.52));
  transition:
    transform calc(var(--dur) + 0.8s) cubic-bezier(0.77, 0, 0.18, 1) 0.3s,
    filter calc(var(--dur) + 0.8s) ease 0.3s,
    opacity 0.2s ease calc(var(--dur) + 0.9s);
}

.stage.open .envelope-pocket {
  opacity: 1;
  transform: translateY(100%);
  transition: transform 1.1s cubic-bezier(0.77, 0, 0.18, 1) 0.4s;
}

.stage.open .envelope-seal-art {
  opacity: 0;
  transform: scale(1.3) rotate(8deg);
  animation: sealRollInPlace 1.5s cubic-bezier(0.45, 0, 0.55, 1) forwards;
}

.envelope-sparkles {
  position: absolute;
  z-index: 7;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.envelope-sparkle {
  position: absolute;
  top: 52.5%;
  left: 50%;
  width: var(--spark-size);
  height: var(--spark-size);
  border-radius: 50%;
  background: radial-gradient(circle, #fff8d8 0%, #ffd36e 42%, rgba(255, 174, 48, 0.08) 100%);
  box-shadow: 0 0 8px 2px var(--envelope-gold-glow);
  opacity: 0;
  animation: envelopeSparkleFly var(--spark-duration) ease-out var(--spark-delay) forwards;
}

@keyframes envelopeSparkleFly {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--spark-x)), calc(-50% + var(--spark-y))) scale(0);
  }
}

.stage[data-animation="zoom"].open .envelope-flap {
  transform-origin: center;
  transform: translateY(-100%) scale(1.6);
}

.stage[data-animation="zoom"].open .envelope-pocket {
  transform-origin: center;
  transform: translateY(100%) scale(1.6);
}

.stage[data-animation="zoom"].open .envelope-seal-art {
  transform: scale(0.2) rotate(360deg);
}

@media (prefers-reduced-motion: reduce) {
  .stage {
    --dur: 0.01s;
  }

  .stage .envelope-seal-art {
    animation: none;
  }

  .stage.open .envelope-pocket,
  .stage.open .envelope-flap,
  .stage.open .envelope-seal-art {
    transition-duration: 0.01s;
    transition-delay: 0s;
  }

  .stage .envelope-pocket {
    transition-delay: 0.01s;
  }

  .envelope-sparkle {
    animation-duration: 0.01s;
    animation-delay: 0s;
  }
}

.splash-screen.is-transitioning {
  opacity: 0;
  animation: none;
  transition: opacity 800ms ease;
}

.intro-screen.is-transitioning {
  opacity: 0;
  transition: opacity 800ms ease;
}

.main-content.is-entering {
  animation: revealInvitationContent 1s ease both;
}

@keyframes revealInvitationContent {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

body.is-flash-transitioning::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  animation: fadeFlash 700ms ease-out both;
}

@keyframes fadeFlash {
  0%,
  100% {
    opacity: 0;
  }
  18%,
  34% {
    opacity: 0.92;
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash-screen.is-transitioning,
  .intro-screen.is-transitioning,
  .main-content.is-entering {
    animation: none;
    transition: none;
  }

  body.is-flash-transitioning::after {
    animation: none;
  }
}

body:not(.entered) {
  background: #25160e;
}

body.entered {
  background: #25160e;
}

html,
body {
  margin: 0;
  height: auto;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  background: #25160e;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

#stage {
  position: relative;
  width: var(--W);
  height: var(--stage-height, var(--H));
  overflow: hidden;
  container-name: invitation-stage;
  container-type: inline-size;
  background: #25160e;
  transform: scale(var(--s, 1));
  transform-origin: top center;
  z-index: 1;
}

#viewport {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: start center;
  overflow: hidden;
  background: #25160e;
}

#viewport.desktop-scale {
  place-items: center;
}

#viewport.desktop-scale #stage {
  transform-origin: center center;
  transition: transform 160ms ease-out;
}

#viewport.desktop-scale::before {
  content: '';
  position: absolute;
  inset: -1rem;
  background: url('img/Final.jpg') center / cover no-repeat;
  filter: blur(20px) brightness(0.7);
  transform: scale(1.1);
  z-index: 0;
  pointer-events: none;
}

#stage .page-shell {
  width: var(--W);
  max-width: none;
  height: var(--H);
  min-height: var(--H);
  margin: 0;
  position: relative;
  z-index: 2;
  background: transparent;
}

#stage .main-content {
  width: var(--W);
  height: var(--H);
  min-height: 0;
  max-height: var(--H);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#stage .main-content::-webkit-scrollbar {
  display: none;
}

#stage .page-background-layer,
#stage .page-foreground {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--W);
  height: var(--H);
  max-width: none;
  max-height: none;
  transform: none;
}

#stage .page-foreground {
  object-fit: fill;
}

#stage .page-background-layer,
#stage .page-foreground {
  display: none;
}

#stage #content {
  position: relative;
  z-index: 1;
}

body.entered #stage .page-background-layer {
  display: block;
  z-index: 0;
  background: #25160e;
}

body.entered #stage .page-foreground {
  display: block;
  z-index: 2;
  left: 0;
  width: var(--W);
  height: var(--H);
}

body.entrance-video-playing #stage .page-foreground {
  display: none;
}

body.entrance-video-playing #stage > .audio-strip,
body.entrance-video-playing #stage > .bottom-nav {
  display: none;
}

#stage .main-bg-image {
  display: block;
  width: var(--W);
  height: var(--H);
  object-fit: fill;
  object-position: center;
}

#viewport.social-in-app #stage .page-shell,
#viewport.social-in-app #stage .main-content,
#viewport.social-in-app #stage .splash-screen,
#viewport.social-in-app #stage .intro-screen,
#viewport.social-in-app #stage .page-background-layer,
#viewport.social-in-app #stage .page-foreground {
  height: var(--stage-height, var(--H));
}

#viewport.social-in-app #stage .page-shell,
#viewport.social-in-app #stage .main-content {
  min-height: var(--stage-height, var(--H));
  max-height: var(--stage-height, var(--H));
}

#viewport.social-in-app #stage .intro-screen {
  display: grid;
  place-items: center;
}

#viewport.social-in-app #stage .envelope-scene {
  transform: scale(1.08);
  transform-origin: center;
}

#viewport.social-in-app #stage .main-bg-image,
#viewport.social-in-app #stage .page-foreground {
  object-fit: cover;
  object-position: center;
}

#viewport.social-in-app #stage .main-bg-image {
  height: var(--stage-height, var(--H));
}

#stage .splash-screen,
#stage .intro-screen {
  inset: auto;
  top: 0;
  left: 0;
  width: var(--DESIGN_W);
  height: var(--DESIGN_H);
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
  transform: none;
}

#stage .envelope-scene,
#stage .stage {
  width: var(--W);
  height: var(--H);
  max-width: none;
  aspect-ratio: auto;
}

#stage > .bottom-nav,
#stage > .audio-strip {
  z-index: 30;
}

#stage > .bottom-nav {
  right: 10px;
  bottom: 10px;
}

#stage > .audio-strip {
  right: 10px;
  top: 10px;
}

#viewport.desktop-scale #stage {
  --s: min(calc(100vh / 664px), calc(100vw / 390px));
}

#viewport.social-in-app:not(.tablet-stage) #stage {
  --stage-height: max(664px, calc(100lvh / var(--s, 1)));
}

@media (min-width: 600px) and (pointer: coarse) {
  html,
  body {
    margin: 0;
    min-height: 100vh;
    min-height: 100lvh;
    background: #25160e;
    overflow: hidden;
    overscroll-behavior: none;
  }

  #viewport.tablet-stage::before {
    content: '';
    position: fixed;
    inset: 0;
    background: url('img/Final.jpg') center / cover no-repeat;
    filter: blur(20px) brightness(0.6);
    transform: scale(1.1);
    z-index: 0;
    pointer-events: none;
  }

  #viewport.tablet-stage #stage {
    position: fixed;
    top: 0;
    left: 50%;
    width: min(100vw, calc(100vh * 9 / 16));
    width: min(100vw, calc(100lvh * 9 / 16));
    height: 100vh;
    height: 100lvh;
    margin: 0;
    padding: 0;
    transform: translateX(-50%);
    overflow: hidden;
    z-index: 1;
  }

  #viewport.tablet-stage #content {
    position: absolute;
    top: 0;
    left: 50%;
    width: 390px;
    height: calc(100% / var(--s));
    margin-left: -195px;
    transform: scale(var(--s));
    transform-origin: top center;
    z-index: 1;
  }

  #viewport.tablet-stage #stage .page-shell {
    position: static;
    width: 390px;
    height: 100%;
    min-height: 0;
    max-height: none;
    margin: 0;
    padding: 0;
  }

  #viewport.tablet-stage #stage .main-content {
    position: absolute;
    inset: 0;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    padding-top: max(100px, calc(env(safe-area-inset-top) + 24px));
    padding-bottom: calc(env(safe-area-inset-bottom) + 24px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    z-index: 3;
  }

  #viewport.tablet-stage #stage .page-background-layer,
  #viewport.tablet-stage #stage .page-foreground {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    transform: none;
  }

  #viewport.tablet-stage #stage .page-background-layer {
    overflow: hidden;
    z-index: 0;
  }

  #viewport.tablet-stage #stage .main-bg-image,
  #viewport.tablet-stage #stage .page-foreground {
    object-fit: fill;
  }

  #viewport.tablet-stage #stage .main-bg-image {
    width: 100%;
    height: 100%;
    max-width: none;
  }

  #viewport.tablet-stage #stage .page-foreground {
    z-index: 2;
    pointer-events: none;
  }

  #viewport.tablet-stage #stage .fireflies,
  #viewport.tablet-stage #stage .flying-butterflies {
    position: absolute;
    inset: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: none;
  }

  #viewport.tablet-stage #stage > .audio-strip,
  #viewport.tablet-stage #stage > .bottom-nav {
    position: absolute;
    right: 4%;
    z-index: 30;
  }

  #viewport.tablet-stage #stage > .audio-strip {
    top: calc(env(safe-area-inset-top) + 24px);
  }

  #viewport.tablet-stage #stage > .bottom-nav {
    bottom: calc(env(safe-area-inset-bottom) + 24px);
  }

  #viewport.tablet-stage #stage .hero-countdown-wrapper {
    position: relative;
  }

  #viewport.tablet-stage #stage .khmer-invitation {
    margin-bottom: 8rem;
  }

  #viewport.tablet-stage #stage #calendarButton {
    position: absolute;
    top: 6rem;
    right: 4%;
    margin: 0;
  }
}

@media (max-width: 599px) {
  .khmer-invitation-couple-label {
    display: grid;
    justify-items: center;
  }

  #viewport:not(.tablet-stage) #stage {
    --stage-height: calc(100vh / var(--s, 1));
    --stage-height: calc(100svh / var(--s, 1));
  }

  #viewport:not(.tablet-stage) #stage .page-shell,
  #viewport:not(.tablet-stage) #stage .main-content,
  #viewport:not(.tablet-stage) #stage .splash-screen,
  #viewport:not(.tablet-stage) #stage .intro-screen,
  #viewport:not(.tablet-stage) #stage .page-background-layer,
  #viewport:not(.tablet-stage) #stage .page-foreground {
    height: var(--stage-height);
  }

  #viewport:not(.tablet-stage) #stage .page-shell,
  #viewport:not(.tablet-stage) #stage .main-content {
    min-height: var(--stage-height);
    max-height: var(--stage-height);
  }

  #viewport:not(.tablet-stage) #stage .main-bg-image {
    height: var(--stage-height);
  }
}

/* "អុឹង" stacks two vowels (ុ + ឹ) on one letter. Windows draws it fine, but
   phones (iOS/Android) split it and add a dotted circle. Draw "អឹង" and lay
   "អុ" exactly on top so the ុ sits under អ on every device. */
.khmer-invitation-family .khmer-stacked-name {
  position: relative;
  display: inline-block;
  font: inherit;
  margin: 0 !important;
}

.khmer-invitation-family .khmer-stacked-name-u {
  position: absolute;
  top: 0;
  left: 0;
  font: inherit;
  margin: 0 !important;
  white-space: nowrap;
  pointer-events: none;
}
