:root {
  --red: var(--thiep-nhan, #511419);
  --cream: #ece4d8;
  --cream-dim: rgba(236, 228, 216, 0.7);
  --paper: var(--thiep-nen, #fff7eb);
  --ink-dim: var(--thiep-phu, rgba(81, 20, 25, 0.8));
  --savedate: var(--thiep-nhan-dam, #590310);
  --gold: #b58b2f;
  --serif: var(--thiep-than, Baskerville, "Times New Roman", serif);
  --title: var(--thiep-de, "Times New Roman", serif);
  --display: var(--thiep-tay, "Viaoda Libre", "The Nautigal", cursive);
  --card-radius: 10px;
  --heart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21c-5.6-4.3-9-7.3-9-11a5 5 0 0 1 9-3 5 5 0 0 1 9 3c0 3.7-3.4 6.7-9 11z'/%3E%3C/svg%3E");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #fff;
  color: var(--red);
  font-family: var(--serif);
  font-weight: 300;
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

.m2-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.m2-page {
  position: relative;
  max-width: 480px;
  margin-inline: auto;
  background: var(--paper);
  overflow: hidden;
}

.m2-paper {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background: url("./paper.webp") repeat-y center top / 100% auto;
}

.m2-castle {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  width: 170%;
  max-width: none;
  opacity: 0.1;
  pointer-events: none;
  z-index: 0;
}

.m2-main {
  position: relative;
  z-index: 1;
}

.m2-main[hidden] {
  display: none;
}

/* ---------- cổng mở thiệp ---------- */

.m2-gate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(to bottom right, #6e1a20, #511419, #380a0e);
}

.m2-gate--gone {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}

.m2-gate__hearts {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.m2-gate__heart {
  position: absolute;
  bottom: -40px;
  color: rgba(236, 228, 216, 0.16);
  animation: m2-float linear infinite;
}

@keyframes m2-float {
  to {
    transform: translateY(-110vh) rotate(25deg);
  }
}

.m2-gate__card {
  position: relative;
  width: min(310px, 100% - 80px);
  padding: 21px 24px 56px;
  border-radius: 8px;
  background: rgba(255, 250, 243, 0.96);
  text-align: center;
  overflow: hidden;
}

.m2-gate__spray {
  position: absolute;
  width: 115px;
  height: 156px;
  object-fit: contain;
  pointer-events: none;
}

.m2-gate__spray--tl {
  top: -28px;
  left: -40px;
}

.m2-gate__spray--br {
  bottom: -28px;
  right: -40px;
  rotate: 180deg;
}

.m2-gate__badge {
  display: grid;
  place-items: center;
  width: 57px;
  height: 57px;
  margin: 0 auto 34px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 6px 16px rgba(81, 20, 25, 0.28);
}

.m2-gate__badge svg {
  width: 26px;
  height: 26px;
  color: var(--paper);
}

.m2-gate__name {
  margin: 0;
  font-family: var(--display);
  font-size: 1.875rem;
  line-height: 2.34375rem;
  color: var(--red);
}

.m2-gate__amp {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.125rem;
  color: var(--red);
}

.m2-gate__rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--red);
}

.m2-gate__rule span {
  width: 56px;
  height: 1px;
  background: rgba(81, 20, 25, 0.45);
}

.m2-gate__date {
  margin: 8px 0 0;
  font-family: var(--thiep-than, "Lora"), var(--serif);
  font-size: 1.125rem;
  line-height: 1.6875rem;
  color: rgba(81, 20, 25, 0.72);
}

.m2-gate__invite {
  margin: 22px 0 0;
  font-family: var(--thiep-than, "Lora"), var(--serif);
  font-size: 1.125rem;
  line-height: 1.6875rem;
  color: rgba(81, 20, 25, 0.72);
}

.m2-gate__khach {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: 1.75rem;
  line-height: 2.25rem;
  color: var(--red);
}

.m2-gate__open {
  margin-top: 22px;
  padding: 10px 32px;
  border-radius: 999px;
  background: var(--red);
  color: #f3e8de;
  font-family: var(--thiep-than, "Lora"), var(--serif);
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.75rem;
  box-shadow: 0 8px 20px rgba(56, 10, 14, 0.35);
}

/* ---------- hero ---------- */

.m2-hero {
  position: relative;
  padding: 60px 36px 0;
  overflow: hidden;
}

.m2-hero .m2-castle {
  top: 184px;
}

.m2-savedate {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--thiep-de, "Cormorant Garamond"), var(--title);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.40625rem;
  letter-spacing: 0.15rem;
  text-transform: uppercase;
  text-align: center;
  color: var(--savedate);
}

.m2-envelope {
  position: relative;
  z-index: 1;
  width: 82%;
  max-width: 330px;
  margin: 96px auto 0;
  aspect-ratio: 261 / 301;
}

.m2-envelope__back,
.m2-envelope__front,
.m2-envelope__spray {
  position: absolute;
  display: block;
}

.m2-envelope__back {
  inset: 0;
  width: 100%;
}

.m2-envelope__photo {
  position: absolute;
  left: 64.75%;
  top: 35.7%;
  width: 64%;
  aspect-ratio: 221 / 309;
  translate: -50% -50%;
  rotate: 12deg;
  border: 7px solid #fff;
  background: #fff;
  box-shadow: 0 10px 22px rgba(56, 10, 14, 0.28);
}

.m2-envelope__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.m2-envelope__front {
  left: 0;
  bottom: 0;
  width: 100%;
  z-index: 2;
}

.m2-envelope__spray {
  left: -15.71%;
  top: -15.61%;
  width: 69.35%;
  height: 93.69%;
  object-fit: contain;
  max-width: none;
  z-index: 3;
}

.m2-names {
  position: relative;
  z-index: 1;
  margin-top: 63px;
  padding-bottom: 56px;
  text-align: center;
}

.m2-names__line {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.375rem, calc(11vw * var(--thiep-ti, 1)), 2.875rem);
  line-height: 1;
  color: var(--red);
}

.m2-names__line + .m2-names__line {
  margin-top: 22px;
}

.m2-names__amp {
  position: absolute;
  top: -6px;
  left: 50%;
  translate: -50% 0;
  font-family: var(--thiep-tay, "The Nautigal"), cursive;
  font-size: 5.75rem;
  line-height: 5.75rem;
  color: rgba(81, 20, 25, 0.15);
  pointer-events: none;
}

/* ---------- thẻ đỏ ---------- */

.m2-khach {
  position: relative;
  z-index: 2;
  margin: 18px auto 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.m2-khach__loi {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(81, 20, 25, 0.66);
}

.m2-khach__ten {
  font-family: var(--display);
  font-size: 1.875rem;
  line-height: 2.375rem;
  color: var(--red);
}

.m2-card {
  position: relative;
  z-index: 1;
  width: 88%;
  max-width: 420px;
  margin: 0 auto;
  padding: 36px 20px;
  border-radius: var(--card-radius);
  background: var(--red);
  color: var(--cream);
  overflow: hidden;
  box-shadow: 4px 6px 18px rgba(56, 10, 14, 0.18);
}

.m2-ceremony {
  --card-radius: 13px;
  padding-bottom: 40px;
}

.m2-card__paper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.m2-card__spray {
  position: absolute;
  max-width: none;
  pointer-events: none;
}

.m2-ceremony .m2-card__spray {
  width: 40%;
  top: 32.7%;
  right: -22.1%;
}

.m2-party .m2-lunar {
  max-width: 85.5%;
  margin-inline: auto;
}

.m2-party .m2-card__spray {
  width: 32%;
  top: 14.2%;
  left: -15.7%;
}

.m2-schedule .m2-card__spray {
  width: 30%;
  top: -1.9%;
  right: -16.3%;
}

.m2-card > :not(.m2-card__paper):not(.m2-card__spray) {
  position: relative;
  z-index: 1;
}

.m2-title {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin: 0;
  font-family: var(--title);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.875rem;
  letter-spacing: 0.03rem;
  text-transform: uppercase;
  text-align: center;
  color: var(--cream);
}

.m2-title--dark {
  color: var(--red);
  letter-spacing: 0.0375rem;
}

.m2-title--sm {
  font-size: 1rem;
  line-height: 1.5rem;
  letter-spacing: 0.03rem;
}

/* ---------- lễ cưới ---------- */

.m2-parents {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  margin-top: 26px;
  text-align: center;
}

.m2-parents::after {
  content: "";
  grid-column: 2;
  grid-row: 1;
  width: 1px;
  background: rgba(236, 228, 216, 0.28);
}

.m2-parents__col:last-child {
  grid-column: 3;
}

.m2-parents__label {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.125rem;
  color: var(--cream-dim);
}

.m2-parents__name {
  margin: 3px 0 0;
  font-weight: 600;
  font-size: 0.75rem;
  line-height: 1.125rem;
  color: var(--cream);
}

.m2-parents__where {
  margin: 5px 0 0;
  font-size: 0.625rem;
  line-height: 0.78125rem;
  color: var(--cream-dim);
}

.m2-announce {
  margin: 23px 0 0;
  font-size: 0.75rem;
  line-height: 1.125rem;
  text-transform: uppercase;
  text-align: center;
  color: var(--cream);
}

.m2-fullname {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80%;
  min-height: 80px;
  margin: 24px auto 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 2rem;
  line-height: 3.25rem;
  text-align: center;
  color: var(--cream);
}

.m2-role {
  margin: 10px 0 0;
  padding-bottom: 3px;
  font-family: var(--title);
  font-size: 0.625rem;
  line-height: 0.9375rem;
  letter-spacing: 0.0875rem;
  text-transform: uppercase;
  text-align: center;
  color: var(--cream-dim);
}

.m2-amp + .m2-fullname {
  margin-top: 12px;
}

.m2-amp {
  margin: 11px 0 0;
  font-family: var(--thiep-tay, "Ms Madi"), cursive;
  font-size: 2.1875rem;
  line-height: 3.28125rem;
  text-align: center;
  color: var(--cream);
}

.m2-hosted {
  margin: 26px 0 0;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1.5rem;
  text-transform: uppercase;
  text-align: center;
  color: var(--cream-dim);
}

.m2-when {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 14px 0 0;
  font-size: 0.8125rem;
  line-height: 1.21875rem;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.m2-when > span + span {
  padding-left: 16px;
  border-left: 1px solid rgba(236, 228, 216, 0.3);
}

.m2-bigdate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 18px 0 0;
  color: var(--cream);
}

.m2-bigdate__day {
  font-family: var(--title);
  font-size: 2.5rem;
  line-height: 2.5rem;
}

.m2-bigdate__bar {
  width: 1px;
  height: 42px;
  background: rgba(236, 228, 216, 0.4);
}

.m2-bigdate__rest {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-family: var(--title);
  text-transform: uppercase;
}

.m2-bigdate__month {
  font-size: 0.875rem;
  line-height: 1.3125rem;
}

.m2-bigdate__month--sm {
  font-size: 0.75rem;
  line-height: 1.125rem;
}

.m2-bigdate__year {
  font-size: 0.875rem;
  line-height: 1.3125rem;
}

.m2-bigdate__year--lg {
  font-size: 1.125rem;
  line-height: 1.6875rem;
}

.m2-lunar {
  margin: 19px 0 0;
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.09rem;
  text-transform: uppercase;
  text-align: center;
  color: var(--cream-dim);
}

/* ---------- album ---------- */

.m2-album {
  position: relative;
  padding: 43px 24px 0;
  overflow: hidden;
}

.m2-album .m2-castle {
  top: 0;
}

.m2-coverflow {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 340px;
  margin-top: 17px;
  perspective: 1000px;
  touch-action: pan-y;
}

.m2-coverflow__item {
  position: absolute;
  height: 92%;
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 32px rgba(56, 10, 14, 0.28);
  transition: transform 0.45s ease, opacity 0.45s ease;
  cursor: pointer;
}

.m2-coverflow__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.m2-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 22px;
}

.m2-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border-radius: 999px;
  background: rgba(81, 20, 25, 0.25);
  transition: width 0.3s ease, background 0.3s ease;
}

.m2-dots button[aria-current="true"] {
  width: 18px;
  background: var(--red);
}

/* ---------- tiệc cưới ---------- */

.m2-party {
  margin-top: 22px;
}

.m2-lead {
  margin: 20px -4px 0;
  font-weight: 400;
  font-size: 1.25rem;
  line-height: 1.875rem;
  text-transform: uppercase;
  text-align: center;
  color: var(--cream);
}

.m2-slots {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 30px;
  text-align: center;
}

.m2-slots__label {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1rem;
  letter-spacing: 0.0375rem;
  text-transform: uppercase;
  color: var(--cream-dim);
}

.m2-slots__value {
  margin: 4px 0 0;
  font-weight: 500;
  font-size: 1.125rem;
  line-height: 1.75rem;
  color: var(--cream);
}

.m2-calendar {
  width: 97.7%;
  max-width: 345px;
  margin: 28px auto 0;
  padding: 10px 8px 12px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--red);
}

.m2-calendar__month {
  font-family: var(--thiep-tay, "The Nautigal"), cursive;
  font-size: 1.5625rem;
  line-height: 2.34375rem;
  letter-spacing: 0.0390625rem;
  text-align: center;
  padding: 10px 0;
}

.m2-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.m2-calendar__dow {
  padding: 6px 0;
  font-weight: 500;
  font-size: 0.625rem;
  line-height: 0.9375rem;
  text-align: center;
  opacity: 0.6;
}

.m2-calendar__cell {
  display: grid;
  place-items: center;
  height: 32px;
  font-size: 0.75rem;
  line-height: 1.125rem;
}

.m2-calendar__cell--day {
  position: relative;
  color: #fff;
  font-weight: 700;
  font-size: 0.6875rem;
  line-height: 1.03125rem;
}

.m2-calendar__cell--day::before {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  background: var(--red);
  mask: var(--heart) center / contain no-repeat;
  -webkit-mask: var(--heart) center / contain no-repeat;
}

.m2-calendar__cell span {
  position: relative;
}

.m2-linkbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 24px auto 0;
  padding: 0;
  font-family: var(--title);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--cream);
  border-bottom: 1px solid rgba(236, 228, 216, 0.5);
  text-decoration: none;
}

.m2-linkbtn svg {
  width: 16px;
  height: 16px;
}

.m2-linkbtn--dark {
  color: var(--ink-dim);
  border-bottom-color: rgba(81, 20, 25, 0.4);
  font-family: var(--serif);
  font-weight: 600;
}

.m2-pill {
  display: block;
  margin: 32px auto 0;
  padding: 10px 26px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--red);
  font-size: 0.875rem;
  line-height: 1.25rem;
  letter-spacing: 0.021875rem;
  text-transform: uppercase;
  box-shadow: 0 6px 14px rgba(56, 10, 14, 0.22);
}

.m2-pill--dark {
  padding: 8px 24px;
  background: var(--red);
  color: #ded9d7;
  font-family: var(--title);
  font-weight: 600;
  text-transform: uppercase;
}

/* ---------- địa điểm ---------- */

.m2-venue {
  position: relative;
  padding: 32px 24px;
  text-align: center;
  overflow: hidden;
}

.m2-venue .m2-castle {
  top: 60px;
}

.m2-venue__address {
  position: relative;
  z-index: 1;
  max-width: 250px;
  margin: 8px auto 0;
  font-size: 0.75rem;
  line-height: 1.21875rem;
  color: var(--ink-dim);
}

.m2-venue__map {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 338px;
  height: 268px;
  margin: 12px auto 0;
  border-radius: 15px;
  overflow: hidden;
}

.m2-venue__map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.m2-venue .m2-linkbtn {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  width: fit-content;
}

/* ---------- dress code ---------- */

.m2-dress {
  padding: 20px 24px 28px;
  text-align: center;
}

.m2-dress__note {
  margin: 10px 0 0;
  font-family: var(--title);
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--ink-dim);
}

.m2-dress__row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
}

.m2-dress__dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: 0 3px 8px rgba(56, 10, 14, 0.2);
}

/* ---------- lịch trình ---------- */

.m2-schedule {
  padding: 36px 24px;
}

.m2-schedule .m2-title {
  letter-spacing: 0.0375rem;
}

.m2-timeline {
  position: relative;
  margin-top: 12px;
}

.m2-timeline::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 50%;
  width: 1px;
  background: rgba(236, 228, 216, 0.35);
}

.m2-timeline__row {
  display: grid;
  grid-template-columns: 1fr 24px 1fr;
  align-items: center;
  column-gap: 8px;
  padding: 17px 0;
}

.m2-timeline__left {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.m2-timeline__icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 auto;
}

.m2-timeline__time {
  font-family: var(--title);
  font-size: 1rem;
  line-height: 1.375rem;
  letter-spacing: 0.025rem;
  color: var(--cream);
}

.m2-timeline__dot {
  justify-self: center;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cream);
}

.m2-timeline__label {
  font-family: var(--title);
  font-size: 0.8125rem;
  line-height: 1.21875rem;
  color: var(--cream-dim);
}

/* ---------- sổ lưu bút ---------- */

.m2-wishes {
  position: relative;
  padding: 74px 24px 32px;
  overflow: hidden;
}

.m2-wishes__note {
  position: absolute;
  top: -15px;
  left: 50%;
  translate: -50% 0;
  width: 120%;
  max-width: none;
  opacity: 0.95;
  pointer-events: none;
}

.m2-wishes__panel {
  position: relative;
  z-index: 1;
}

.m2-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 248px;
  margin: 22px auto 0;
}

.m2-input {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--red);
  border-radius: 8px;
  background: transparent;
  color: var(--red);
  font-family: var(--title);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.m2-input::placeholder {
  color: rgba(81, 20, 25, 0.5);
}

.m2-input:focus-visible {
  outline: 2px solid rgba(81, 20, 25, 0.5);
  outline-offset: 1px;
}

.m2-input--area {
  height: 56px;
  padding: 12px 16px;
  resize: vertical;
}

.m2-form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: -4px;
}

.m2-magic {
  padding: 8px;
  border-radius: 8px;
  background: rgba(81, 20, 25, 0.1);
  font-size: 1rem;
  line-height: 1rem;
}

.m2-form__row .m2-pill {
  margin: 0;
}

.m2-form__status {
  margin: 0;
  min-height: 18px;
  font-size: 0.75rem;
  line-height: 1.125rem;
  color: var(--ink-dim);
}

.m2-wishlist {
  position: relative;
  z-index: 1;
  max-height: 540px;
  margin-top: 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.m2-wish {
  padding: 16px;
  border: 1px solid rgba(81, 20, 25, 0.333);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

.m2-wish__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--title);
}

.m2-wish__name {
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--red);
}

.m2-wish__time {
  font-size: 0.75rem;
  line-height: 1rem;
  opacity: 0.7;
}

.m2-wish__body {
  margin: 8px 0 0;
  font-family: var(--title);
  font-size: 0.875rem;
  line-height: 1.421875rem;
  color: var(--red);
}

/* ---------- hộp quà ---------- */

.m2-gift {
  position: relative;
  padding: 28px 24px 34px;
  text-align: center;
  overflow: hidden;
}

.m2-gift .m2-castle {
  top: 0;
}

.m2-gift__trigger {
  position: relative;
  z-index: 1;
  display: block;
  width: 235px;
  height: 304px;
  margin: 24px auto 0;
}

.m2-gift__env {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.5s ease;
}

.m2-gift__env--back {
  translate: 38px -27px;
  rotate: 15deg;
  scale: 0.8;
  filter: brightness(0.92);
}

.m2-gift__trigger:hover .m2-gift__env--back {
  translate: 52px -34px;
}

.m2-gift__spark {
  position: absolute;
  color: var(--gold);
  font-size: 0.9375rem;
  animation: m2-spark 2.6s ease-in-out infinite;
}

.m2-gift__spark--1 {
  top: 6%;
  left: 32%;
  animation-delay: 0s;
}

.m2-gift__spark--2 {
  top: 12%;
  right: 10%;
  font-size: 0.75rem;
  animation-delay: 0.6s;
}

.m2-gift__spark--3 {
  bottom: 28%;
  left: 18%;
  font-size: 0.8125rem;
  animation-delay: 1.2s;
}

.m2-gift__spark--4 {
  bottom: 38%;
  right: 20%;
  font-size: 0.6875rem;
  animation-delay: 1.8s;
}

@keyframes m2-spark {
  0%,
  100% {
    opacity: 0.15;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.m2-gift__hint {
  position: relative;
  z-index: 1;
  margin: 18px 0 0;
  font-family: system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--red);
}

/* ---------- footer ---------- */

.m2-footer {
  position: relative;
  z-index: 1;
  padding: 10px 24px 34px;
  text-align: center;
}

.m2-footer__note {
  margin: 0;
  font-family: var(--title);
  font-size: 0.75rem;
  line-height: 1.125rem;
  color: var(--red);
}

.m2-footer__couple {
  margin: 16px 0 0;
  font-family: var(--display);
  font-size: 1.375rem;
  line-height: 1.75rem;
  color: var(--red);
}

.m2-footer__date {
  margin: 4px 0 0;
  font-size: 0.75rem;
  line-height: 1.125rem;
  letter-spacing: 0.075rem;
  color: var(--ink-dim);
}

/* ---------- nhạc ---------- */

.m2-music {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 8px 18px rgba(56, 10, 14, 0.3);
}

.m2-music svg {
  width: 22px;
  height: 22px;
  fill: var(--paper);
}

.m2-music[aria-pressed="true"] svg rect {
  animation: m2-eq 0.9s ease-in-out infinite alternate;
}

.m2-music svg rect:nth-child(2) {
  animation-delay: 0.15s;
}

.m2-music svg rect:nth-child(3) {
  animation-delay: 0.3s;
}

.m2-music svg rect:nth-child(4) {
  animation-delay: 0.45s;
}

@keyframes m2-eq {
  to {
    transform: scaleY(0.45);
    transform-origin: center bottom;
  }
}

/* ---------- modal ---------- */

.m2-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.m2-modal[hidden] {
  display: none;
}

.m2-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 8, 11, 0.6);
}

.m2-modal__sheet {
  position: relative;
  width: min(360px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  border-radius: 14px;
  background: var(--paper);
}

.m2-modal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--red);
}

.m2-modal__title {
  margin: 0;
  font-family: var(--title);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.875rem;
  letter-spacing: 0.0375rem;
  text-transform: uppercase;
  color: #fff;
}

.m2-modal__close {
  font-size: 1.375rem;
  line-height: 1;
  color: #fff;
}

.m2-modal__body {
  padding: 18px 16px 22px;
}

.m2-gift-card {
  text-align: center;
}

.m2-gift-card + .m2-gift-card {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(81, 20, 25, 0.15);
}

.m2-gift-card__who {
  margin: 0 0 8px;
  font-family: system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--red);
}

.m2-gift-card__qr {
  width: 128px;
  height: 128px;
  margin: 0 auto;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 14px rgba(56, 10, 14, 0.18);
}

.m2-gift-card__qr canvas,
.m2-gift-card__qr img {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}

.m2-gift-card p {
  margin: 2px 0 0;
  font-family: system-ui, sans-serif;
  font-size: 0.625rem;
  line-height: 0.9375rem;
  color: var(--red);
}

.m2-gift-card__bank {
  margin-top: 10px !important;
}

.m2-gift-card__acc {
  font-family: ui-monospace, "Courier New", monospace;
}

.m2-gift-card__holder {
  font-weight: 600;
}

.m2-gift-card__save {
  margin-top: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(81, 20, 25, 0.08);
  font-family: system-ui, sans-serif;
  font-weight: 500;
  font-size: 0.625rem;
  line-height: 0.9375rem;
  color: var(--red);
}

.m2-rsvp__lead {
  margin: 0 0 16px;
  font-family: var(--title);
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: var(--ink-dim);
}

.m2-label {
  font-family: var(--title);
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: var(--red);
}

.m2-choice {
  margin: 0;
  padding: 0;
  border: 0;
}

.m2-choice__item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-family: var(--title);
  font-size: 0.875rem;
  line-height: 1.25rem;
  cursor: pointer;
}

.m2-choice__item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.m2-choice__mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(81, 20, 25, 0.4);
  border-radius: 50%;
  font-size: 0.75rem;
  color: transparent;
}

.m2-choice__item input:checked + .m2-choice__mark {
  background: var(--red);
  border-color: var(--red);
  color: var(--paper);
}

.m2-choice__item input:focus-visible + .m2-choice__mark {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* ---------- lightbox ---------- */

.m2-lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  background: rgba(20, 5, 7, 0.94);
}

.m2-lightbox[hidden] {
  display: none;
}

.m2-lightbox__img {
  grid-row: 1;
  max-width: calc(100% - 96px);
  max-height: calc(100% - 40px);
  border-radius: 12px;
}

.m2-lightbox__count {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-family: system-ui, sans-serif;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.m2-lightbox__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
}

.m2-lightbox__nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
}

.m2-lightbox__nav--prev {
  left: 14px;
}

.m2-lightbox__nav--next {
  right: 14px;
}

.m2-lightbox__strip {
  grid-row: 2;
  display: flex;
  gap: 8px;
  width: 100%;
  padding: 8px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.m2-lightbox__strip img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  opacity: 0.55;
  cursor: pointer;
  flex: 0 0 auto;
}

.m2-lightbox__strip img[aria-current="true"] {
  opacity: 1;
  outline: 2px solid var(--paper);
}

@media (min-width: 768px) {
  .m2-page {
    max-width: 900px;
    border-inline: 1px solid rgba(81, 20, 25, 0.1);
  }

  .m2-card {
    max-width: 560px;
  }

  .m2-savedate {
    font-size: 1.125rem;
    line-height: 1.6875rem;
    letter-spacing: 0.18rem;
  }

  .m2-envelope {
    max-width: 420px;
    margin-top: 112px;
  }

  .m2-names {
    margin-top: 81px;
  }

  .m2-names__line {
    font-size: 3.625rem;
  }

  .m2-names__amp {
    top: -9px;
    font-size: 7.5rem;
    line-height: 7.5rem;
  }

  .m2-fullname {
    font-size: 2.875rem;
    line-height: 3.75rem;
  }

  .m2-bigdate__day {
    font-size: 2.875rem;
    line-height: 2.875rem;
  }

  .m2-bigdate__month,
  .m2-bigdate__month--sm,
  .m2-bigdate__year,
  .m2-bigdate__year--lg {
    font-size: 1.125rem;
    line-height: 1.6875rem;
  }

  .m2-lead {
    font-size: 1.625rem;
    line-height: 2.4375rem;
  }

  .m2-slots__value {
    font-size: 1.25rem;
  }

  .m2-coverflow {
    height: 420px;
  }

  .m2-dress__dot {
    width: 48px;
    height: 48px;
  }

  .m2-venue__map {
    max-width: 560px;
    height: 320px;
  }

  .m2-wishes__note {
    width: 80%;
  }

  .m2-form {
    max-width: 348px;
  }

  .m2-parents__name {
    font-size: 0.875rem;
    line-height: 1.3125rem;
  }

  .m2-announce {
    font-size: 0.8125rem;
    line-height: 1.21875rem;
  }

  .m2-role {
    margin-top: 14px;
  }

  .m2-amp {
    margin-top: 15px;
  }

  .m2-amp + .m2-fullname {
    margin-top: 15px;
  }

  .m2-hosted {
    margin-top: 26px;
    font-size: 1.125rem;
    line-height: 1.6875rem;
  }

  .m2-when {
    margin-top: 17px;
    font-size: 0.9375rem;
    line-height: 1.40625rem;
  }

  .m2-bigdate {
    margin-top: 26px;
  }

  .m2-lunar {
    margin-top: 20px;
    font-size: 0.875rem;
    line-height: 1.25rem;
    letter-spacing: 0.105rem;
  }

  .m2-calendar__dow {
    font-size: 0.6875rem;
    line-height: 1.03125rem;
  }

  .m2-venue__address {
    max-width: 420px;
    font-size: 0.875rem;
    line-height: 1.421875rem;
  }

  .m2-linkbtn--dark {
    font-size: 1rem;
    line-height: 1.5rem;
  }

  .m2-dress__note {
    font-size: 1rem;
    line-height: 1.5rem;
  }

  .m2-timeline__time {
    font-size: 1.0625rem;
    line-height: 1.4609375rem;
    letter-spacing: 0.0265625rem;
  }

  .m2-timeline__label {
    font-size: 0.9375rem;
    line-height: 1.40625rem;
  }

  .m2-footer__note {
    font-size: 0.8125rem;
    line-height: 1.21875rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .m2-gate__heart,
  .m2-gift__spark,
  .m2-music svg rect {
    animation: none;
  }

  .m2-coverflow__item {
    transition: none;
  }
}

.m2-story {
  position: relative;
  padding: 44px 22px 8px;
  text-align: center;
}

.m2-story__lead {
  margin: 10px auto 26px;
  max-width: 30ch;
  font-size: 0.92rem;
  line-height: 1.6;
  color: #6f5a52;
}

.m2-story__list {
  position: relative;
  display: grid;
  gap: 26px;
  text-align: left;
}

.m2-story__list::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(#c9a24a00, #c9a24a66 12%, #c9a24a66 88%, #c9a24a00);
}

.m2-story__item {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 0 0 0 calc(50% + 20px);
}

.m2-story__item--phai {
  padding: 0 calc(50% + 20px) 0 0;
  text-align: right;
}

.m2-story__item::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 11px;
  height: 11px;
  transform: translateX(-50%) rotate(45deg);
  background: #7b1420;
  box-shadow: 0 0 0 4px #f6efe6;
}

.m2-story__anh {
  overflow: hidden;
  border-radius: 12px;
  border: 3px solid #fff;
  box-shadow: 0 10px 22px rgba(80, 20, 20, 0.18);
}

.m2-story__anh img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.m2-story__moc {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #a8894a;
}

.m2-story__td {
  margin: 4px 0 0;
  font-family: var(--m2-serif, "Playfair Display", Georgia, serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: #7b1420;
}

.m2-story__text {
  margin: 6px 0 0;
  font-size: 0.88rem;
  line-height: 1.65;
  color: #6f5a52;
}

@media (max-width: 430px) {
  .m2-story__list::before {
    left: 7px;
  }

  .m2-story__item,
  .m2-story__item--phai {
    padding: 0 0 0 28px;
    text-align: left;
  }

  .m2-story__item::before {
    left: 7px;
  }
}

/* Nut va o nhap khong tu thua ke font, khong dat lai thi trinh duyet rot ve Arial */
button,
input,
select,
textarea {
  font-family: inherit;
}
