@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,500;0,600;1,500;1,600&display=swap');

:root {
  color-scheme: light;
  --paper: #f8fbfd;
  --ink: #193d53;
  --accent: #356989;
  --mist: #e6f0f7;
  --rule: #cedfe9;
  --muted: #435f72;
  --white: #fff;
  --sans: 'Be Vietnam Pro', system-ui, sans-serif;
  --serif: 'Playfair Display', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.7 var(--sans); }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
p, h1, h2, h3, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; text-wrap: balance; }
h1 em, h2 em { color: var(--accent); }
h2 { font-size: clamp(2.25rem, 4.5vw, 3.65rem); }
.shell { width: min(100% - 3rem, 68rem); margin-inline: auto; }
.eyebrow { color: var(--accent); font-size: .875rem; font-weight: 600; letter-spacing: .15em; text-transform: uppercase; }
.button {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  padding: .65rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 600 .875rem/1.3 var(--sans);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.button-primary { background: var(--ink); color: var(--white); }
.button-primary:hover { background: var(--accent); }
.button-outline { border-color: #abc7d9; background: transparent; color: var(--ink); }
.button-outline:hover { background: var(--mist); }

.cover {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  text-align: center;
  background: radial-gradient(ellipse at 50% 46%, #fff 4%, #f5f9fc 48%, #e0edf5 100%);
}
.cover-inner { position: relative; padding-block: clamp(2.5rem, 7vh, 4.75rem); }
.cover-name { display: inline-flex; align-items: center; gap: .9rem; }
.cover-name::before, .cover-name::after { content: ''; width: 1.6rem; height: 1px; background: #a8c5d7; }
.cover h1 { margin-top: .65rem; font-size: clamp(2.7rem, 7vw, 5.05rem); letter-spacing: -.045em; }
.access-denied .access-title { margin-top: .4rem; font-size: clamp(1.85rem, 4vw, 2.75rem); letter-spacing: -.02em; }
.cover .button { min-height: 3.25rem; min-width: 10.5rem; margin-top: 1.25rem; box-shadow: 0 .5rem 1.2rem #193d5326; }
.demo { margin-top: 1rem; color: var(--muted); font-size: .875rem; }
.recipient { display: grid; gap: .28rem; min-width: 0; }
.recipient strong { font: 500 clamp(1.55rem, 4vw, 2.35rem)/1.16 var(--serif); overflow-wrap: anywhere; }

.sprig {
  position: absolute;
  z-index: -1;
  width: min(32vw, 24rem);
  aspect-ratio: 1;
  pointer-events: none;
  opacity: .75;
}
.sprig-left { top: -7%; left: -5%; transform: rotate(-20deg); }
.sprig-right { right: -6%; bottom: -9%; transform: rotate(159deg) scale(.88); }
.sprig::before {
  position: absolute;
  content: '';
  inset: 11% 26% 4% 11%;
  border-right: 1px solid #7daac5;
  border-radius: 0 100% 60% 0;
  transform: rotate(-29deg);
}
.sprig i, .sprig b { position: absolute; display: block; }
.sprig i {
  width: 26%;
  height: 12%;
  border: 1px solid #91b7cd;
  border-radius: 100% 0 100% 0;
  background: linear-gradient(150deg, #b3d1e3a8, #e7f3fa55);
}
.sprig i:nth-child(1) { top: 26%; left: 28%; transform: rotate(-46deg); }
.sprig i:nth-child(2) { top: 45%; left: 48%; transform: rotate(24deg); }
.sprig i:nth-child(3) { top: 58%; left: 26%; transform: rotate(-73deg); }
.sprig i:nth-child(4) { top: 70%; left: 56%; transform: rotate(34deg) scale(.72); }
.sprig b {
  width: 24%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #c1a96a 0 5%, transparent 6%),
    radial-gradient(ellipse 29% 42% at 50% 27%, #c0d9e9 0%, #eaf4fa 64%, #94b9cf 70%, transparent 74%),
    radial-gradient(ellipse 42% 29% at 27% 50%, #c0d9e9 0%, #eaf4fa 64%, #94b9cf 70%, transparent 74%),
    radial-gradient(ellipse 42% 29% at 73% 50%, #c0d9e9 0%, #eaf4fa 64%, #94b9cf 70%, transparent 74%),
    radial-gradient(ellipse 29% 42% at 50% 73%, #c0d9e9 0%, #eaf4fa 64%, #94b9cf 70%, transparent 74%);
}
.sprig b:nth-of-type(1) { top: 22%; left: 49%; transform: rotate(18deg); }
.sprig b:nth-of-type(2) { top: 41%; left: 22%; transform: rotate(42deg) scale(.87); }
.sprig b:nth-of-type(3) { top: 64%; left: 39%; transform: rotate(72deg) scale(.53); }

.envelope-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  width: min(100%, 31rem);
  aspect-ratio: 1.47;
  margin: -.45rem auto .4rem;
  place-items: center;
  overflow: hidden;
}
.envelope-stage canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.envelope-stage:not([data-opening]) canvas { visibility: hidden; }
.envelope-stage[data-opening][data-rendered] .envelope-static { visibility: hidden; }
.envelope-stage[data-opening][data-rendered]::before {
  content: '';
  position: absolute;
  inset: 79% 20% 3%;
  background: radial-gradient(ellipse at center, #335c804a, transparent 72%);
  filter: blur(.5rem);
  transform: rotate(4deg);
}

[data-cover-pending] .invitation-cover[hidden] { display: grid !important; }
[data-cover-pending] .invitation-cover .recipient strong,
[data-cover-pending] .invitation-cover [data-open-envelope] { visibility: hidden; }
.envelope-static {
  position: relative;
  display: grid;
  place-items: center;
  width: 62%;
  aspect-ratio: 1.55;
  overflow: hidden;
  border: 1px solid #a9c5da;
  border-radius: .24rem;
  background: linear-gradient(145deg, #e1ecf5, #c6dceb);
  box-shadow: 0 1rem 2.3rem #193d5333, 0 .25rem .55rem #193d531c;
  transform: perspective(850px) translateY(9%) rotateY(-18deg) rotateX(9deg) rotate(-5deg);
}
.envelope-static::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(134deg, transparent 49%, #8eb0c780 50%, transparent 51%) left / 50% 100% no-repeat,
              linear-gradient(226deg, transparent 49%, #8eb0c780 50%, transparent 51%) right / 50% 100% no-repeat;
}
.envelope-static-flap {
  position: absolute;
  inset: 0 0 27%;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: linear-gradient(162deg, #edf6fb, #bfd7e9);
  transform-origin: top center;
}
.envelope-static-insert { display: none; }
.envelope-static-seal {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 14%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid #b5d2e5;
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 2px 3px #193d5340;
  transform: translateY(55%);
}

.envelope-stage[data-opening-fallback] .envelope-static { overflow: visible; }
.envelope-stage[data-opening-fallback] .envelope-static::after {
  content: '';
  position: absolute;
  z-index: 2;
  inset: 0;
  border-radius: inherit;
  clip-path: polygon(0 37%, 50% 71%, 100% 37%, 100% 100%, 0 100%);
  background: linear-gradient(155deg, #e1edf5, #c6dceb);
}
.envelope-stage[data-opening-fallback] .envelope-static-flap {
  z-index: 3;
  animation: envelope-flap-open 1.12s ease-out both;
}
.envelope-stage[data-opening-fallback] .envelope-static-seal {
  z-index: 4;
  animation: envelope-seal-release .23s ease-out both;
}
.envelope-stage[data-opening-fallback] .envelope-static-insert {
  position: absolute;
  display: block;
  z-index: 1;
  inset: 13% 10%;
  border: 1px solid #adc8db;
  border-radius: .2rem;
  background: linear-gradient(180deg, #f9fcff, #e7f2f9);
  animation: envelope-letter-rise 1.12s cubic-bezier(.25, .65, .35, 1) both;
}
@keyframes envelope-flap-open {
  0% { transform: rotateX(0); z-index: 3; }
  47%, 100% { transform: rotateX(-180deg); z-index: 0; }
}
@keyframes envelope-seal-release {
  to { opacity: 0; }
}
@keyframes envelope-letter-rise {
  0%, 38% { opacity: 0; transform: translateY(0); }
  49% { opacity: 1; }
  100% { opacity: 1; transform: translateY(-77%) rotate(-3deg); }
}

.invitation-cover[data-dismissing] {
  position: fixed;
  z-index: 3;
  inset: var(--cover-offset, 0px) 0 auto;
  pointer-events: none;
  animation: cover-dissolve .72s ease-in-out both;
}
.invitation-cover[data-dismissing] .envelope-stage {
  animation: envelope-withdraw .72s cubic-bezier(.3, .65, .35, 1) both;
}

.invitation-content { background: var(--paper); overflow-x: clip; }
.opening { display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; gap: clamp(2rem, 8vw, 6rem); padding-block: clamp(4rem, 9vw, 8rem); }
.opening h1 { margin-top: 1.65rem; font-size: clamp(2.6rem, 5.2vw, 4.75rem); }
.opening h1 em { display: block; }
.opening-venue { max-width: 30rem; margin-top: 1.1rem; color: var(--muted); font-size: 1.05rem; }
.opening .button { margin-top: 1.4rem; }
.date-card {
  position: relative;
  width: min(82%, 23rem);
  aspect-ratio: .95;
  justify-self: center;
  margin-block: 1rem;
}
.invitation-content[data-entering] .opening-copy {
  animation: opening-copy-enter .62s cubic-bezier(.2, .65, .3, 1) .1s both;
}
.invitation-content[data-entering] .date-card {
  animation: opening-card-enter .72s cubic-bezier(.19, .65, .3, 1) both;
}
@keyframes cover-dissolve {
  to { opacity: 0; }
}
@keyframes envelope-withdraw {
  to { transform: translateY(1.8rem) scale(.94); }
}
@keyframes opening-copy-enter {
  from { opacity: 0; transform: translateY(1.4rem); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes opening-card-enter {
  from { opacity: .15; transform: perspective(850px) translateY(1.6rem) rotateX(-14deg) rotateY(-12deg) scale(.91); }
  to { opacity: 1; transform: perspective(850px) translateY(0) rotateX(0) rotateY(0) scale(1); }
}
.date-card-back,
.date-card-front {
  position: absolute;
  inset: 0;
  border: 1px solid #B8D3E4;
  border-radius: 4px;
}
.date-card-back {
  z-index: 0;
  background: #DCEBF4;
  box-shadow: 0 6px 16px rgba(25, 62, 82, .06);
  transform: rotate(-9deg);
}
.date-card-front {
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 1.05rem;
  padding: 2.25rem 1.75rem;
  background: radial-gradient(ellipse at 50% 25%, #fff, #F7FAFC 72%);
  box-shadow: 0 10px 24px rgba(25, 62, 82, .09), 0 2px 6px rgba(25, 62, 82, .04);
  text-align: center;
  transform: rotate(1.5deg);
}
.date-card-frame {
  position: absolute;
  inset: 18px;
  border: 1px solid #B8D3E4;
  pointer-events: none;
}
.date-card-body { position: relative; z-index: 1; display: grid; justify-items: center; gap: .25rem; }
.date-card-weekday { color: #193E52; font: italic 500 clamp(1.25rem, 2.3vw, 1.62rem)/1.2 var(--serif); }
.date-card-day {
  color: #193E52;
  font: italic 600 clamp(5.35rem, 11.5vw, 8.2rem)/.9 var(--serif);
  font-variant-numeric: lining-nums;
  letter-spacing: -.03em;
}
.date-card-month {
  margin-top: 1.05rem;
  color: #193E52;
  font: 600 clamp(.72rem, 1vw, .82rem)/1.4 var(--sans);
  letter-spacing: .24em;
  text-transform: uppercase;
}
.date-card-mark {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: .75rem;
  width: min(64%, 12.5rem);
  color: #5485A0;
}
.date-card-mark svg { width: .85rem; height: .85rem; flex-shrink: 0; }
.date-card-mark::before,
.date-card-mark::after { content: ''; flex: 1; height: 1px; background: #B8D3E4; }

#thu-moi, #thong-tin { scroll-margin-top: 1rem; }
.letter, .details, .countdown, .thanks { padding-block: clamp(3.4rem, 8vw, 6.5rem); }
.section-kicker {
  display: inline-block;
  margin-bottom: .95rem;
  padding: .28rem .85rem;
  border-radius: .35rem;
  background: rgb(53 105 137 / .11);
  color: var(--accent);
  font: 600 .75rem/1.4 var(--sans);
  letter-spacing: .16em;
  text-transform: uppercase;
}
.section-title {
  max-width: 44rem;
  margin-inline: auto;
  color: var(--ink);
  font: 500 clamp(1.75rem, 3.4vw, 2.45rem)/1.3 var(--serif);
  text-align: center;
  text-wrap: balance;
}
.section-copy { max-width: 40rem; margin: 1.45rem auto 0; color: var(--muted); }
.letter {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--rule);
  background: radial-gradient(ellipse at 50% 45%, var(--white) 42%, #f4f9fc 100%);
  text-align: center;
}
.letter-inner { position: relative; max-width: 44rem; }
.letter .section-title { max-width: 34rem; font-style: italic; }
.letter-copy { margin-top: 1.75rem; }
.letter-copy p + p { margin-top: 1.1rem; }
.letter-copy .letter-signature, .letter-signature { margin-top: 1.45rem; color: var(--accent); font: 500 1.4rem/1.5 var(--serif); }
.letter-copy .letter-signature { margin-top: 1.75rem; font-size: 1.25rem; }
.letter-petals { position: absolute; inset: 0; pointer-events: none; }
.letter-petals i {
  position: absolute;
  width: .55rem;
  height: .95rem;
  border-radius: 100% 0 100% 0;
  background: #bfd8e9;
  opacity: .55;
}
.letter-petals i:nth-child(1) { top: 14%; left: 3%; transform: rotate(22deg); }
.letter-petals i:nth-child(2) { top: 38%; left: 9%; transform: rotate(-28deg) scale(.8); }
.letter-petals i:nth-child(3) { top: 72%; left: 5%; background: #dfd0ae; transform: rotate(35deg); }
.letter-petals i:nth-child(4) { top: 20%; right: 8%; background: #dfd0ae; transform: rotate(28deg); }
.letter-petals i:nth-child(5) { top: 56%; right: 4%; transform: rotate(-18deg) scale(.85); }
.letter-petals i:nth-child(6) { top: 82%; right: 10%; transform: rotate(24deg) scale(.9); }

.details { background: #edf5fa; }
.details .section-kicker { display: block; width: fit-content; margin: 0 auto 1.75rem; }
.details-card { max-width: 56rem; margin-inline: auto; box-shadow: 0 .35rem 1.25rem #193d530a; }
.event-card { min-width: 0; padding: clamp(1.25rem, 3.5vw, 2.4rem); border: 1px solid var(--rule); border-radius: 1rem; background: var(--paper); }
.event-card h3 { margin-top: .4rem; font-size: clamp(1.45rem, 3vw, 2.35rem); }
.venue-section h3 { margin-top: 0; }
.event-card p:not(.eyebrow) { margin-top: .6rem; color: var(--muted); }
.venue-address { display: flex; align-items: flex-start; gap: .45rem; }
.inline-icon { width: 1rem; height: 1rem; flex-shrink: 0; }
.venue-address .inline-icon { margin-top: .32rem; }
.button { gap: .45rem; }
.venue-map { display: block; width: 100%; height: clamp(14rem, 36vw, 22rem); margin-top: 1.25rem; border: 1px solid var(--rule); border-radius: .75rem; background: var(--mist); }
.event-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; margin-top: 1.25rem; }
.copy-status { flex-basis: 100%; color: var(--muted); font-size: .875rem; }
.copy-status:empty { display: none; }
.time-section { margin-top: 1.75rem; padding-top: 1.75rem; border-top: 1px solid var(--rule); }
.time-section .guest-time { font-size: clamp(1.45rem, 2.7vw, 2rem); font-variant-numeric: lining-nums; }

.countdown { text-align: center; }
.countdown-copy p + p,
.thanks-copy p + p { margin-top: .35rem; }
.countdown-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(.45rem, 2vw, 1rem); width: min(100%, 31rem); margin: 1.75rem auto 0; }
.countdown-grid > div {
  display: grid;
  gap: .45rem;
  padding: 1.15rem .35rem;
  border: 1px solid var(--rule);
  border-radius: .85rem;
  background: var(--white);
  box-shadow: 0 .35rem 1.1rem #193d530d;
}
.countdown-grid dd { grid-row: 1; font: 500 clamp(1.6rem, 5vw, 2.65rem)/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.countdown-grid dt { color: var(--muted); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.countdown-quote { margin-top: 2rem; color: var(--accent); font: italic 500 clamp(1.1rem, 2.2vw, 1.35rem)/1.5 var(--serif); }
.thanks { border-top: 1px solid var(--rule); background: radial-gradient(ellipse at 50% 20%, #f9fcfe, var(--mist)); text-align: center; }
.thanks .section-title { max-width: none; text-wrap: auto; }
.thanks .letter-signature { margin-top: 1.85rem; font-size: 1.45rem; }
.site-footer {
  padding-block: 1.5rem;
  border-top: 1px solid var(--rule);
  background: var(--mist);
  color: #6b8394;
  font-size: .625rem;
  letter-spacing: .22em;
  text-align: center;
  text-transform: uppercase;
}

.music-button {
  position: fixed;
  z-index: 2;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  display: grid;
  width: 3.25rem;
  height: 3.25rem;
  place-items: center;
  padding: 0;
  border: .22rem solid var(--white);
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 .35rem 1rem #193d5330;
  cursor: pointer;
}
.music-button:hover { background: var(--accent); }
.music-button::before {
  content: '';
  border: .44rem solid transparent;
  border-right: 0;
  border-left: .66rem solid currentColor;
  transform: translateX(.08rem);
}
.music-button[data-playing]::before {
  width: .58rem;
  height: .85rem;
  border: solid currentColor;
  border-width: 0 .14rem;
  transform: none;
}

@media (max-width: 45rem) {
  .shell { width: min(100% - 2rem, 35rem); }
  .cover { background: radial-gradient(ellipse at 50% 39%, #fff, #e4eff7); }
  .cover-inner { padding-block: 3rem; }
  .sprig { width: min(47vw, 14rem); opacity: .55; }
  .sprig-left { top: -2%; left: -16%; }
  .sprig-right { right: -11%; bottom: -4%; }
  .opening { grid-template-columns: 1fr; gap: 2.5rem; }
  .date-card { width: min(80%, 20.5rem); margin-block: 1.25rem; }
  .date-card-frame { inset: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .invitation-cover[data-dismissing] { animation-duration: .2s; }
  .invitation-cover[data-dismissing] .envelope-stage,
  .invitation-content[data-entering] .opening-copy,
  .invitation-content[data-entering] .date-card { animation: none; }
}

