:root {
  color-scheme: light;
  --wine: #741c2c;
  --wine-deep: #531624;
  --ink: #51252a;
  --paper: #f9edd9;
  --light: #fff6e5;
  --gold: #b68c60;
  --edge: #c8a681;
  --serif: "Crimson Text", Georgia, serif;
  --display: "Cormorant Garamond", Georgia, serif;
  --script: "Explora", Georgia, serif;
  --stationery-background: url("assets/nen-hoa-ruy-bang.jpg");
  --invitation-paper: linear-gradient(#fff4e140, #fff1dc70), var(--stationery-background) center / 100% 100% no-repeat, #f6e9d1;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 1.18rem/1.4 var(--serif); }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }
.eyebrow { font-size: .82rem; font-weight: 600; line-height: 1.45; letter-spacing: .19em; text-transform: uppercase; }
.script { font: 400 clamp(4rem, 8vw, 6.5rem)/.9 var(--script); }
.cover {
  position: relative;
  padding: 0;
  height: 100svh;
  overflow: hidden;
  background: #d6b383;
}
.cover-grid {
  position: absolute; top: 50%; left: 50%;
  width: max(100vw, 80svh);
  margin: 0; transform: translate(-50%, -50%);
  container-type: inline-size;
}
.cover-art {
  position: relative;
  display: block;
  overflow: hidden;
  isolation: isolate;
  width: 100%;
  text-decoration: none;
}
.envelope-photo { position: relative; z-index: 1; width: 100%; height: auto; aspect-ratio: 4 / 5; }
.cover-copy {
  position: absolute; z-index: 5;
  top: 25%; left: 50%; width: 66%;
  text-align: center;
  color: #f7dbab;
  transform: translateX(-50%);
  pointer-events: none;
  text-shadow: 0 1px 2px #4a1c18;
}
.cover-copy .eyebrow {
  font-size: clamp(.68rem, 1.15cqi, 1rem);
  letter-spacing: .25em; padding-left: .25em; font-weight: 400;
}
.cover h1 {
  display: grid;
  justify-items: center;
  font: italic 500 clamp(2.25rem, 5.4cqi, 4.8rem)/.98 var(--display);
  letter-spacing: 0;
  margin: .23em 0 0;
}
.cover h1 > span { white-space: nowrap; }
.cover .amp { font: italic 400 .55em/1 var(--display); margin: .07em 0 .1em; }
.cover-date {
  margin-top: 1.05em;
  text-align: center; color: #f7dbab;
  font-size: clamp(.85rem, 1.4cqi, 1.15rem);
  letter-spacing: .17em; padding-left: .17em; pointer-events: none;
}
.open-letter {
  position: absolute; z-index: 6; left: 50%; bottom: max(1.4rem, 4svh); transform: translateX(-50%);
  color: #5a1a27; background: #fff0d6ec; border: 1px solid #b58a61;
  padding: .72rem 1.65rem; border-radius: .1rem; min-height: 2.8rem;
  font-size: .79rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  white-space: nowrap; box-shadow: 0 2px 9px #4b1a161f;
}
.open-letter span { margin-left: .3rem; }
.open-letter[aria-disabled="true"] { cursor: progress; }
.opening-invitation .cover-copy, .invitation-opened .cover-copy,
.opening-invitation .cover-date, .invitation-opened .cover-date { opacity: 0; transition: opacity .3s ease; }
.opened-envelope-photo, .envelope-pocket-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; opacity: 0;
}
.opened-envelope-photo { z-index: 2; }
.opened-envelope-photo img, .envelope-pocket-photo img { width: 100%; height: 100%; object-fit: cover; }
.envelope-pocket-photo {
  z-index: 4;
  clip-path: polygon(0 25%, 7.5% 28.6%, 44.6% 52.2%, 52% 51.4%, 83.5% 26.8%, 100% 25%, 100% 100%, 0 100%);
}
.photo-letter {
  position: absolute; z-index: 3; top: 43%; left: 15%; width: 68%; height: 36%;
  display: grid; align-content: center; justify-items: center; text-align: center; gap: .65rem;
  color: var(--ink); background: var(--invitation-paper); border: 1px solid #c8a681;
  box-shadow: 0 2px 9px #37101038; opacity: 0; pointer-events: none;
  transform: translateY(14%) rotate(0);
}
.photo-letter-note { font: italic 400 clamp(.7rem, 1.5vw, 1.15rem)/1.24 var(--serif); padding: 0 .35rem; }
.photo-letter-names { font: italic 600 clamp(1.75rem, 4vw, 3rem)/.86 var(--display); }
.photo-letter-names i { font: 400 .7em/.85 var(--script); }
.photo-letter > span:last-child { font-size: clamp(.65rem, 1.3vw, .9rem); letter-spacing: .15em; }
.opening-invitation .cover-art { pointer-events: none; }
.invitation-opened .opened-envelope-photo,
.invitation-opened .envelope-pocket-photo { opacity: 1; }
.invitation-opened .envelope-photo { opacity: 0; }
.invitation-opened .photo-letter { opacity: 1; transform: translateY(-78%) rotate(-1deg); }

@media (min-aspect-ratio: 1/1) {
  .cover { height: auto; min-height: 0; display: block; }
  .cover-grid { position: relative; top: auto; left: auto; width: 100%; transform: none; }
  .open-letter { bottom: max(.8rem, 3svh); }
  .envelope-photo { aspect-ratio: 3 / 2; }
  .cover-copy { top: 22%; width: 48%; }
  .cover-copy .eyebrow { font-size: clamp(.65rem, 1.05cqi, 1rem); }
  .cover h1 { font-size: clamp(2rem, 4.05cqi, 4.5rem); }
  .cover .amp { font-size: .55em; }
  .cover-date { margin-top: .7em; font-size: clamp(.85rem, 1.32cqi, 1.2rem); }
  .photo-letter { top: 43%; left: 22%; width: 56%; height: 48%; gap: .9rem; }
  .photo-letter-note { font-size: clamp(1rem, 1.65cqi, 1.4rem); }
  .photo-letter-names { font-size: clamp(2.25rem, 5cqi, 4.25rem); }
  .photo-letter > span:last-child { font-size: clamp(.85rem, 1.4cqi, 1.15rem); }
  .envelope-pocket-photo { clip-path: polygon(0 14%, 17.5% 14%, 50% 64.5%, 82.5% 14%, 100% 14%, 100% 100%, 0 100%); }
}

.cream {
  background: var(--invitation-paper);
}
.invitation { text-align: center; padding: clamp(4.4rem, 10vw, 8rem) 1.15rem; }
.card-stack { width: min(100%, 56rem); margin: auto; }
.lace-card { padding: 0; background: transparent; border: 0; box-shadow: none; }
.lace-card > .eyebrow { color: var(--wine); }
.lace-card h2 { font: 500 clamp(3rem, 8vw, 5.75rem)/.98 var(--display); color: var(--wine); margin: .18em 0 .1em; }
.invitation-subtitle { font-style: italic; font-size: 1.24rem; }
.families {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 44rem;
  margin: 2.2rem auto 0;
}
.families section { min-width: 0; padding-inline: clamp(.25rem, 2vw, 1.5rem); }
.families section + section { border-left: 1px solid #af8c6d85; }
.families .parents { margin: .55rem 0 .65rem; font-size: clamp(.88rem, 2.9vw, 1.22rem); line-height: 1.3; }
.families h3 { font: italic 600 clamp(1.65rem, 4.7vw, 3.3rem)/.95 var(--display); color: var(--wine); }
.role { margin-top: .3rem; font-style: italic; font-size: 1.03rem; }
.divider, .flourish { display: flex; justify-content: center; align-items: center; gap: .7rem; color: var(--gold); }
.divider { margin: 1.9rem 0 1rem; }
.divider::before, .divider::after, .flourish::before, .flourish::after { content: ""; width: 2.7rem; height: 1px; background: currentColor; }
.invitation-message { font-size: clamp(1.15rem, 3.3vw, 1.44rem); }
.invitation-message strong { color: var(--wine); font-style: italic; }

.details { text-align: center; padding: clamp(3rem, 7vw, 5rem) 1rem; }
.month { font-size: clamp(1.5rem, 4.8vw, 2.3rem); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--wine); margin: .5rem 0 .8rem; }
.date-row { display: flex; align-items: center; justify-content: center; gap: clamp(.6rem, 4vw, 2rem); color: var(--wine); }
.date-row > span { font-size: clamp(1rem, 3.5vw, 1.4rem); min-width: 4.2rem; }
.date-row time { font: 500 clamp(5rem, 16vw, 7.5rem)/.8 var(--display); padding: 0 .2em; border-inline: 1px solid var(--gold); }
.year { letter-spacing: .2em; font-size: 1.8rem; margin-top: .85rem; color: var(--wine); }
.lunar { font-style: italic; }
.room { font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--wine); }
.venue { font: 400 clamp(1.4rem, 4vw, 2.2rem)/1.16 var(--display); margin: .7rem auto .6rem; }
.venue strong { font-size: 1.55em; text-transform: uppercase; letter-spacing: .06em; }
.address { font-size: 1.1rem; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1.3rem; }
.button {
  display: inline-flex; justify-content: center; align-items: center;
  min-height: 2.75rem; padding: .5rem 1.2rem;
  border: 1px solid var(--wine); border-radius: 99rem;
  color: var(--wine); background: #fff5e4; font-size: 1.02rem; font-weight: 600; text-decoration: none;
}
.button:hover { background: #eed8be; }
.button.primary { color: var(--light); background: var(--wine); }
.button.primary:hover { background: var(--wine-deep); }
.button.outline { background: transparent; }
.dress { width: min(100%, 38rem); margin: 2.8rem auto 0; padding: 1.5rem 0 0; border-top: 1px solid #b78d6e7d; container-type: inline-size; }
.dress .script { font-size: clamp(4rem, 10vw, 5.5rem); }
.swatches { display: flex; justify-content: center; gap: 2.4rem; margin: 1rem 0 .85rem; }
.swatches > div { display: grid; justify-items: center; gap: .35rem; }
.swatch { width: 2.6rem; height: 2.6rem; display: block; border-radius: 50%; border: 1px solid #60454055; box-shadow: inset 0 0 0 3px #ffffff55; }
.swatch.blue { background: #3d72ac; }
.swatch.pink { background: #e8a0b2; }
.dress-note { white-space: nowrap; font-size: clamp(.6rem, 3.38cqi, 1.15rem); }

.schedule {
  display: grid; grid-template-columns: .8fr 1fr; align-items: center; gap: clamp(2rem, 5vw, 5rem);
  padding: clamp(3rem, 7vw, 6rem) max(1.5rem, calc((100vw - 62rem) / 2));
  color: #fff0d8;
  background: linear-gradient(#571b2be8, #6a2030ed), var(--stationery-background) center / cover;
}
.schedule-photo { padding: .45rem .45rem 1rem; background: #f8e4c6; transform: rotate(-4deg); box-shadow: .3rem .8rem 1.6rem #2c071d66; }
.schedule-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.schedule-card { min-width: 0; }
.schedule h2 { font-size: clamp(4rem, 7vw, 6.4rem); margin-bottom: .3em; }
.times div { position: relative; display: grid; grid-template-columns: 1fr 1.3fr; align-items: center; gap: .9rem; padding: 1rem 0; border-bottom: 1px solid #e0b39155; }
.times div:last-child { border-bottom: 0; }
.times dt { white-space: nowrap; font-size: clamp(.96rem, 2.5vw, 1.12rem); color: #f3d0a4; }
.times dd { font-size: 1.16rem; line-height: 1.2; }

.gallery {
  text-align: center;
  padding: clamp(3rem, 7vw, 6rem) max(1.1rem, calc((100vw - 67rem) / 2));
  background: linear-gradient(#fff4e0c9, #f6e2c8c2), var(--stationery-background) center / cover;
}
.gallery .eyebrow { color: var(--wine); }
.gallery h2 { font-size: clamp(4rem, 9vw, 7rem); color: var(--wine); margin: .2em 0 .5em; }
.gallery-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: center; gap: clamp(1rem, 2.4vw, 1.8rem); }
.gallery-grid figure { grid-column: span 4; }
.gallery-grid figure:nth-child(4) { grid-column: span 4; }
.gallery-grid figure:nth-child(5) { grid-column: span 8; }
.gallery-grid figure:first-child { transform: rotate(-3deg); }
.gallery-grid figure:nth-child(3) { transform: rotate(3deg); }
.gallery-grid figure:nth-child(4) { transform: rotate(-1.5deg); }
.gallery-grid figure:nth-child(5) { transform: rotate(2deg); }
.photo-button { display: block; width: 100%; padding: .4rem .4rem .9rem; background: #fff8e9; border: 1px solid #ba9a7650; box-shadow: .1rem .4rem 1rem #59302c30; cursor: zoom-in; }
.photo-button img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 28%; }
.gallery-grid figure:nth-child(n+4) img { aspect-ratio: 3 / 2; }
.gallery-grid figure:nth-child(4) img { aspect-ratio: auto; height: auto; }
.gallery-grid figure:first-child img { aspect-ratio: 4 / 5; height: auto; object-position: center 40%; }

.response {
  display: grid; grid-template-columns: .85fr 1.15fr; align-items: center; gap: clamp(1.6rem, 5vw, 4rem);
  width: 100%; margin: 0;
  padding: clamp(3.3rem, 8vw, 6rem) max(1.3rem, calc((100vw - 65rem) / 2));
  background: linear-gradient(#fff5e1a6, #fff0dba6), var(--stationery-background) center / cover;
}
.response-photo { padding: .5rem .5rem 1.4rem; background: #fff9ee; transform: rotate(-3deg); box-shadow: .1rem .7rem 1.5rem #672c3333; }
.response-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 25%; }
.response-copy { min-width: 0; text-align: center; }
.response h2, .guestbook h2 { font: 500 clamp(2.8rem, 5vw, 4.2rem)/.94 var(--display); margin: .3em 0 .4em; }
.response-intro { max-width: 30rem; margin: auto; }
.deadline { margin-top: .8rem; font-size: 1.08rem; }
.form { display: grid; gap: .4rem; text-align: left; margin-top: 1.4rem; }
.form label, legend { font-weight: 600; }
.form input:not([type="radio"]), textarea {
  width: 100%; min-height: 2.8rem; padding: .48rem .7rem;
  color: var(--ink); background: #fffaf1e6; border: 1px solid #bd9c7a; border-radius: .2rem;
}
.form fieldset { padding: 0; margin: .6rem 0 0; border: 0; min-width: 0; }
.form input[type="radio"] { accent-color: var(--wine); width: 1.05rem; height: 1.05rem; margin: 0 .35rem 0 0; flex: none; }
.choices { display: grid; gap: .38rem; margin: .35rem 0; }
.choices label { display: flex; align-items: center; font-weight: 400; }
.companions { display: grid; gap: .3rem; margin-top: .4rem; }
.companions input { max-width: 6rem; }
.form .button { justify-self: start; margin-top: .7rem; }
.form-note { font-size: .94rem; color: #72584b; margin-top: .25rem; }
.feedback { padding: .65rem .8rem; margin: .6rem 0 0; background: #fff5df; color: var(--wine); border-left: 2px solid var(--gold); }
.optional { font-size: .9em; font-weight: 400; }
#wish-file { font-size: .9rem; }
#wish-file::file-selector-button { font: inherit; color: var(--wine); border: 1px solid var(--edge); border-radius: .2rem; background: #f1ddc0; padding: .2rem .4rem; margin-right: .5rem; }

.guestbook {
  width: 100%; text-align: center;
  color: #ffefd9;
  padding: clamp(3rem, 7vw, 5.5rem) 1rem;
  background: linear-gradient(#5c1b2ae6, #4c1727ed), var(--stationery-background) center / cover;
}
.guestbook > p { width: min(100%, 36rem); margin-inline: auto; }
.guestbook > .eyebrow { color: #eac9a0; }
.guestbook > .button, .wish-nav .button, #more-wishes { color: #ffedce; border-color: #d8b38b; margin-top: 1.2rem; }
.guestbook .feedback { width: min(100%, 35rem); margin-inline: auto; }
.ruled { display: inline-flex; align-items: center; gap: .7rem; }
.ruled::before, .ruled::after { content: ""; width: 1.6rem; height: 1px; background: currentColor; }
.wish-carousel { max-width: 104rem; margin-inline: auto; }
#new-wishes {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(14rem, 21vw, 17rem);
  align-items: stretch; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 1.7rem .45rem .8rem; scrollbar-color: #c29976 #451122; scrollbar-width: thin;
}
#new-wishes:empty { display: none; }
.wish-card {
  display: flex; flex-direction: column; gap: .7rem; scroll-snap-align: start; min-height: 18rem;
  padding: .65rem .7rem .9rem; text-align: left; color: var(--ink);
  border: 1px solid #be925e80; border-radius: .8rem;
  background: radial-gradient(circle at 2px 1px, #c387512a .6px, transparent 1px) 0 0 / 5px 5px, linear-gradient(130deg, #ffedc8, #fff7e3 40%, #f5dbb3);
  box-shadow: 0 .3rem .6rem #210c1a4f;
}
.wish-message { flex: 1; margin: .08rem .18rem 0; font-style: italic; font-size: 1.04rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.wish-author { margin: .18rem .18rem 0; font-size: 1rem; overflow-wrap: anywhere; }
.wish-media { position: relative; overflow: hidden; background: #f3d9ab; aspect-ratio: 1.52; }
.wish-media::after {
  content: ""; position: absolute; inset: auto 0 -1px; height: .65rem; pointer-events: none;
  background: #ffedca;
  clip-path: polygon(0 39%, 5% 16%, 11% 54%, 18% 33%, 26% 61%, 32% 42%, 41% 77%, 48% 39%, 54% 52%, 61% 22%, 70% 54%, 79% 36%, 85% 66%, 91% 45%, 100% 13%, 100% 100%, 0 100%);
}
.wish-media.is-video::after { display: none; }
.wish-image, .wish-media video { display: block; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; }
.wish-image { cursor: zoom-in; }
.wish-image img { width: 100%; height: 100%; object-fit: cover; object-position: center 31%; }
.wish-media video { object-fit: contain; }
.wish-media.text-only { display: grid; place-items: center; color: #a55556; background: linear-gradient(145deg,#ffddbe,#fff1c8); font-size: 3rem; }
.wish-nav { display: flex; justify-content: center; gap: .6rem; }
.wish-nav .button { min-width: 2.6rem; padding: .28rem; border-radius: 50%; }
.wish-nav .button:disabled { opacity: .45; cursor: default; }
footer { text-align: center; color: #f6e1c5; background: #421521; padding: 2.2rem 3.4rem; }
.response-photo img { aspect-ratio: auto; height: auto; }
.footer-mark { font: 400 3.6rem/.9 var(--script); margin-bottom: .5rem; }
.footer-date { font-size: .9rem; letter-spacing: .2em; margin-top: .5rem; }

.music-button, .close { min-width: 2.8rem; height: 2.8rem; border: 1px solid var(--edge); border-radius: 99rem; color: var(--wine); background: var(--light); }
.music-button { position: fixed; z-index: 7; right: .8rem; bottom: max(.8rem, env(safe-area-inset-bottom)); padding-inline: .8rem; font-size: .98rem; box-shadow: 0 3px 10px #39121e25; }
.audio-notice { position: fixed; z-index: 7; right: .8rem; bottom: 4rem; max-width: min(22rem, calc(100% - 1.6rem)); padding: .6rem .8rem; font-size: .96rem; color: var(--wine); background: var(--light); border: 1px solid var(--edge); border-radius: .3rem; }
dialog { max-height: 92svh; border: 1px solid var(--edge); background: var(--paper); color: var(--ink); }
dialog::backdrop { background: #250b1ac7; }
.panel { width: min(100% - 2rem, 29rem); padding: 1.5rem; }
.panel h2 { font: 500 clamp(2.5rem, 7vw, 3.4rem)/.98 var(--display); padding-right: 2.5rem; }
.close { position: absolute; top: .6rem; right: .6rem; font-size: 1.5rem; }
.photo-dialog { max-width: 94vw; padding: 0; }
.photo-dialog img { max-height: 90svh; width: auto; height: auto; margin: auto; }

.content-pending { opacity: 0; transform: translateY(1rem); }
.content-pending.content-visible { opacity: 1; transform: none; transition: opacity .8s ease, transform .8s ease; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media (prefers-reduced-motion: reduce) { .content-pending { opacity: 1; transform: none; transition: none; } }
@media (max-width: 700px) {
  .photo-letter { gap: .45rem; }
  .photo-letter-names { font-size: clamp(1.8rem, 9.3vw, 3rem); }
  .photo-letter-note { font-size: clamp(.8rem, 3.6vw, 1.05rem); }
  .photo-letter > span:last-child { font-size: .85rem; }
  .cream { background-size: auto, auto 100%; }
  .families { margin-top: 1.6rem; }
  .families .eyebrow { font-size: .74rem; }
  .role { font-size: .95rem; }
  .schedule { grid-template-columns: 1fr; padding: 3rem 1.5rem; gap: 2.2rem; }
  .schedule-photo { width: min(76%, 22rem); margin: auto; }
  .schedule h2 { text-align: center; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-grid figure:nth-child(n) { grid-column: auto; }
  .gallery-grid figure:nth-child(5) { grid-column: 1 / -1; width: 82%; margin: .3rem auto 0; }
  .response { grid-template-columns: 1fr; padding: 3.2rem 1.4rem; gap: 2.4rem; }
  .response-photo { width: min(75%, 21rem); margin: auto; }
  .response h2 { font-size: clamp(2.5rem, 9vw, 3.8rem); }
  .guestbook h2 { font-size: 3.4rem; }
  #new-wishes { grid-auto-columns: min(76vw, 17rem); gap: .8rem; }
}
