@import url('https://fonts.googleapis.com/css2?family=Baskervville:ital@0;1&family=Noto+Sans+Thai:wght@400;500;600&display=swap');

:root {
  color: #382c33;
  background: #fbf5ec;
  font: 100%/1.8 "Noto Sans Thai", sans-serif;
  --ink: #382c33;
  --brass: #785a32;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: linear-gradient(#fbf5ece8, #fbf5ece8),
    url("images/decoration/wedding-page-background.jpg") center top / min(100%, 65rem) auto repeat-y;
}
img { display: block; width: 100%; height: auto; }
.cover {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.cover-photo {
  height: 100%;
  max-height: 42rem;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 39%;
}
.invitation {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  padding: clamp(1.5rem, 5vw, 4rem) 1rem;
}
.invitation > p:first-child { color: var(--brass); margin: 0; }
h1 { font: 400 clamp(3.3rem, 7.5vw, 7.2rem)/1 "Baskervville", Georgia, serif; margin: .22em 0 0; }
h1 em { color: var(--brass); font-size: .74em; }
h2 { font-weight: 500; line-height: 1.4; font-size: clamp(1.55rem, 3vw, 2.4rem); margin: 0 0 .75rem; }
.date { font-weight: 500; margin: .5rem 0 1.35rem; }
.actions { display: grid; justify-items: center; gap: .65rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .65rem 1.55rem;
  background: var(--ink);
  color: white;
  text-decoration: none;
  border-radius: 2px;
  font-weight: 600;
}
.button:hover { background: #56404c; }
.map { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; color: var(--brass); text-underline-offset: .25em; }
a:focus-visible { outline: 2px solid var(--brass); outline-offset: 4px; }
.venue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: center;
  justify-content: center;
}
.venue-photo { grid-area: 1 / 2; align-self: stretch; height: 100%; max-height: 44rem; object-fit: cover; }
.venue-logo { width: 8rem; margin: 0 auto .85rem; border-radius: 50%; background: #fff; }
.venue > div { grid-area: 1 / 1; width: min(100%, 36rem); justify-self: center; padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem); text-align: center; }
.reply { padding: clamp(3rem, 8vw, 7rem) 1rem; text-align: center; }
.staff {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: min(8rem, 100%);
  margin: 0 auto 1.5rem;
  color: var(--brass);
  font-size: .95rem;
}
.staff::before, .staff::after {
  content: "";
  width: 2.2rem;
  height: 1px;
  background: #b59b79;
}
@media (max-width: 42rem) {
  .cover, .venue { grid-template-columns: 1fr; }
  .cover-photo { aspect-ratio: 4 / 3; height: auto; max-height: 38svh; }
  .invitation { padding-block: 1.25rem; }
  .invitation .date { margin-bottom: .8rem; }
  .invitation .countdown { margin-bottom: .85rem; }
  .venue-photo, .venue > div { grid-area: auto; }
  .venue-photo { height: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .staff { animation: arrive 600ms ease-out; }
  @keyframes arrive {
    from { opacity: .35; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

.thai-names { margin: 0; font-size: clamp(1.05rem, 2.6vw, 1.45rem); }
.thai-names span { color: var(--brass); }
.schedule, .artists {
  padding: clamp(3rem, 8vw, 7rem) clamp(1rem, 4vw, 3rem);
  text-align: center;
}
.schedule-events {
  max-width: 56rem;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1.25rem;
}
.schedule h3, .schedule p, .artists h3, .artists p { margin: .3rem 0; }
.event-time { color: var(--brass); font-size: clamp(1.45rem, 4vw, 2.2rem); font-weight: 600; font-variant-numeric: tabular-nums; }

.cover-staff { width: min(12rem, 100%); margin: .65rem 0 .25rem; }
html:has(.wedding-intro[open]) { overflow: hidden; }
.wedding-intro {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: transparent;
}
.wedding-intro::backdrop { background: transparent; }
.intro-curtain-backdrop, .intro-hydrangea-panel, .intro-brass-score {
  position: absolute;
  pointer-events: none;
  animation: 2550ms cubic-bezier(.45, .05, .2, 1) both;
}
.intro-curtain-backdrop {
  inset: 0;
  background: radial-gradient(ellipse at center, #fffaf3 48%, #efe5ef);
  animation-name: fade-curtain;
}
.intro-hydrangea-panel {
  top: 50%;
  width: max(76vw, 76vh);
  aspect-ratio: 1;
  background: url("images/decoration/intro-hydrangea-panel.png") center / contain no-repeat;
}
.intro-hydrangea-left { left: 31%; --angle: 45deg; --exit: -145vw; animation-name: part-flowers; }
.intro-hydrangea-right { left: 69%; --angle: -45deg; --exit: 65vw; animation-name: part-flowers; }
.intro-brass-score {
  inset: 0;
  background: url("images/decoration/intro-brass-score.png") center / min(86vw, 58rem) auto no-repeat;
  animation-name: fade-curtain;
}
.intro-photo-montage {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  grid-auto-flow: dense;
  gap: clamp(.22rem, 1vmin, .65rem);
  padding: clamp(.45rem, 2.6vmin, 1.75rem);
  background:
    url("images/decoration/gallery-storybook-background.jpg") center / cover no-repeat,
    linear-gradient(135deg, #f8dce7, #ece0f5 55%, #d7e8fa);
}
.intro-photo-montage.intro-montage-fading { animation: montage-out 450ms ease-in-out both; }
.intro-photo-montage img {
  min-width: 0;
  min-height: 0;
  place-self: center;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  --print-edge: clamp(3px, .65vmin, 7px);
  translate: var(--print-x, 0) var(--print-y, 0);
  padding: var(--print-edge);
  padding-bottom: calc(var(--print-edge) * 2.5);
  border: 0;
  background: #fff;
  box-shadow: 0 1px 3px #382c3330;
  animation: wall-photo-in 4100ms var(--delay) cubic-bezier(.32, .1, .25, 1) both;
}
.intro-photo-montage img:nth-child(5n + 1) { grid-column: span 2; grid-row: span 2; }
.intro-photo-montage img:nth-child(5n + 3) { grid-column: span 2; }
.intro-photo-montage img:nth-child(5n + 4) { grid-row: span 2; }
.intro-photo-montage img:nth-child(11) { grid-column: span 3; }
.intro-skip-button {
  position: absolute;
  right: 1rem;
  top: calc(1rem + env(safe-area-inset-top));
  padding-inline: 1rem;
  min-height: 44px;
  border: 1px solid var(--brass);
  border-radius: 2rem;
  color: white;
  background: var(--ink);
  font: inherit;
  cursor: pointer;
}
.intro-revealing-cover .cover { overflow: hidden; }
.intro-revealing-cover .cover-photo { animation: portrait-arrive 450ms ease-out both; }
@keyframes part-flowers {
  0%, 24% { transform: translate(-50%, -50%) rotate(var(--angle)); }
  to { transform: translate(var(--exit), -50%) rotate(var(--angle)); opacity: 0; }
}
@keyframes fade-curtain {
  0%, 29% { opacity: 1; }
  to { opacity: 0; }
}
@keyframes wall-photo-in {
  0% { opacity: 0; transform: rotate(var(--print-tilt, 0deg)) scale(.93); }
  26%, 66% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--print-tilt, 0deg)) scale(1.095); }
}
@keyframes montage-out { to { opacity: 0; transform: scale(1.035); } }
@keyframes portrait-arrive {
  from { transform: scale(.98); }
  to { transform: scale(1); }
}
@media (orientation: portrait) and (max-width: 48rem) {
  .wedding-intro { height: 100dvh; }
  .intro-hydrangea-panel { width: 116vw; }
  .intro-hydrangea-left { --exit: -155vw; }
  .intro-hydrangea-right { --exit: 72vw; }
  .intro-brass-score { background-size: 94vw auto; }
  .intro-photo-montage {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(.2rem, 1vw, .5rem);
    padding: calc(4rem + env(safe-area-inset-top)) 6vw calc(3rem + env(safe-area-inset-bottom));
    background-image:
      url("images/decoration/gallery-storybook-portrait.jpg"),
      linear-gradient(160deg, #f8dce7, #ece0f5 55%, #d7e8fa);
    background-size: cover;
  }
  .intro-photo-montage img {
    --print-edge: clamp(2px, .65vw, 4px);
    translate: calc(var(--print-x, 0%) * .45) calc(var(--print-y, 0%) * .45);
  }
  .intro-skip-button { z-index: 1; }
}
@media (max-width: 30rem) {
  .invitation h1 { font-size: clamp(2.65rem, 11vw, 3.5rem); }
  .invitation .actions { display: flex; flex-wrap: wrap; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .intro-curtain-backdrop, .intro-hydrangea-panel, .intro-brass-score, .intro-photo-montage.intro-montage-fading, .intro-photo-montage img,
  .intro-revealing-cover .cover-photo { animation: none; }
}

.countdown:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 19rem);
  gap: .4rem;
  margin: 0 0 1.35rem;
  color: var(--brass);
  font-size: .8rem;
  text-align: center;
}
.countdown strong {
  display: block;
  font: 400 clamp(1.4rem, 4vw, 2.15rem)/1.15 "Baskervville", Georgia, serif;
  font-variant-numeric: tabular-nums;
}

.page-break {
  width: min(70%, 26rem);
  margin: clamp(1.75rem, 5vw, 4rem) auto;
  border: 0;
  border-block-start: 1px solid #ad906e;
}

.production-credit { margin-top: clamp(2rem, 6vw, 4rem); }
.production-credit img { width: min(100%, 12rem); height: auto; padding: .75rem; background: #000; margin: .85rem auto .35rem; }
.production-credit nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1.25rem; }

.color-theme { margin-bottom: 1.15rem; }
.color-theme p { margin: 0 0 .35rem; font-size: .85rem; }
.color-swatches {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.color-swatches span {
  display: block;
  width: 1.15rem;
  aspect-ratio: 1;
  border: 1px solid #ad906e;
  border-radius: 50%;
  background: var(--swatch);
}
.ceremony-order {
  width: fit-content;
  max-width: min(100%, 35rem);
  margin: 1.25rem auto 0;
  padding: 0;
  list-style: none;
  text-align: start;
}
.ceremony-order li {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: clamp(.65rem, 3vw, 1.5rem);
  padding-block: .55rem;
}
.ceremony-time {
  color: var(--brass);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cover-monogram { width: clamp(3.75rem, 7vw, 5rem); margin-top: -.25rem; }
.closing-monogram { width: 6.25rem; margin: 1rem auto 0; }

@media (width > 42rem) {
  .cover { position: relative; min-height: 36rem; }
  .cover-photo {
    position: absolute;
    inset: 0 auto 0 0;
    width: 50%;
    max-height: none;
  }
  .invitation { grid-column: 2; }
}

.garden-replay {
  margin-top: .25rem;
  padding-inline: .6rem;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.garden-replay[hidden] { display: none; }
.intro-garden-gateway {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(84vw, 76dvh, 43rem);
  aspect-ratio: 1;
  perspective: 1000px;
  pointer-events: none;
  animation: garden-gateway-in 3800ms ease-in-out both;
}
.intro-garden-arch {
  position: absolute;
  inset: 0;
  background: url("images/decoration/intro-garden-arch.webp") center / contain no-repeat;
}
.intro-garden-door {
  position: absolute;
  top: 22%;
  bottom: 11%;
  width: 25%;
  background: url("images/decoration/intro-garden-gates.webp") left center / 200% 100% no-repeat;
  animation: garden-door-open 3050ms cubic-bezier(.4, .1, .25, 1) both;
}
.intro-garden-door-left {
  left: 25%;
  transform-origin: left center;
  --gate-turn: 83deg;
}
.intro-garden-door-right {
  right: 25%;
  background-position: right center;
  transform-origin: right center;
  --gate-turn: -83deg;
}
.intro-garden-mist {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 52% 80%, #fff5f8d9, transparent 63%),
    radial-gradient(ellipse at 25% 64%, #d9d9ffad, transparent 44%),
    radial-gradient(ellipse at 75% 62%, #fff9e2ad, transparent 44%);
  animation: garden-mist-drift 4200ms ease-in-out both;
}
@keyframes garden-gateway-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.84); }
  24%, 53% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.95); }
}
@keyframes garden-door-open {
  0%, 30% { transform: rotateY(0); }
  to { transform: rotateY(var(--gate-turn)); }
}
@keyframes garden-mist-drift {
  0%, 22% { opacity: 0; transform: translateY(9%) scale(.92); }
  58% { opacity: .8; }
  100% { opacity: 0; transform: translateY(-12%) scale(1.18); }
}
@media (orientation: portrait) and (max-width: 48rem) {
  .intro-garden-gateway { width: min(96vw, 73dvh); }
}
@media (prefers-reduced-motion: reduce) {
  .intro-curtain-backdrop, .intro-hydrangea-panel, .intro-brass-score,
  .intro-garden-gateway, .intro-garden-mist { display: none; }
}
