:root {
  --m4-den: var(--thiep-chu, #23201d);
  --m4-kem: var(--thiep-nen, #f7f4ef);
  --m4-trang: #ffffff;
  --m4-xam: var(--thiep-phu, #8a817a);
  --m4-la: var(--thiep-nhan, #365046);
  --m4-la-nhat: var(--thiep-nhan-mo, #8b9c8f);
  --m4-chu: var(--thiep-than, "Be Vietnam Pro", system-ui, sans-serif);
  --m4-to: var(--thiep-de, "Montserrat", "Be Vietnam Pro", sans-serif);
  --m4-tua: var(--thiep-de, "Cormorant Garamond", Georgia, serif);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  background: #e9e5df;
  color: var(--m4-den);
  font-family: var(--m4-chu);
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

.m4 {
  position: relative;
  max-width: 470px;
  margin: 0 auto;
  min-height: 100svh;
  background: var(--m4-kem);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(35, 32, 29, 0.14);
}

/* ---------- nền ảnh chạy chậm ---------- */

.m4-nen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #221d19;
}

.m4-nen img {
  position: absolute;
  left: 0;
  top: -13%;
  width: 100%;
  height: 126%;
  object-fit: cover;
  will-change: transform;
}

/* ---------- chữ chung ---------- */

.m4-nhan {
  margin: 0 0 6px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--m4-la-nhat);
}

.m4-tua {
  margin: 0 0 24px;
  font-family: var(--m4-tua);
  font-size: 1.86rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--m4-la);
}

.m4-nhan--sang {
  color: rgba(255, 255, 255, 0.78);
}

.m4-main section {
  padding: 68px 26px;
}

.m4-nut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 26px;
  border: 1px solid var(--m4-den);
  border-radius: 0;
  background: none;
  color: var(--m4-den);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.m4-nut--dac {
  width: 100%;
  background: var(--m4-den);
  color: #fff;
}

.m4-nut--sang {
  margin-top: 26px;
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
}

/* ---------- cổng ---------- */

.m4-gate {
  position: absolute;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  background: #14110f;
  transition: opacity 0.7s ease;
}

.m4-gate--gone {
  opacity: 0;
  pointer-events: none;
}

.m4-gate__anh {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.m4-gate__anh img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.12);
  transition: transform 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.m4-gate--mo .m4-gate__anh img {
  transform: scale(1);
}

.m4-gate__phu {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 17, 15, 0.42), rgba(20, 17, 15, 0.12) 38%, rgba(20, 17, 15, 0.82));
}

.m4-gate__noi {
  position: absolute;
  inset: auto 0 0;
  padding: 0 26px 42px;
  color: #fff;
}

.m4-gate__nhan {
  margin: 0 0 10px;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.m4-gate__to,
.m4-hero__to,
.m4-cuoi__to {
  margin: 0;
  font-family: var(--m4-to);
  font-weight: 800;
  font-size: clamp(2.7rem, calc(19vw * var(--thiep-ti, 1)), 4.9rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  white-space: nowrap;
  color: #fff;
}

.m4-gate__ten {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.m4-gate__ten i {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.45);
}

.m4-gate__ngay {
  margin: 10px 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.26em;
  color: rgba(255, 255, 255, 0.72);
}

.m4-gate__nut {
  margin-top: 26px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.m4-gate__nut svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: m4-nhun 2.2s ease-in-out infinite;
}

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

.m4-gate--mo .m4-gate__noi {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- tên khách ---------- */

.m4-moi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 18px 0 0;
}

.m4-moi__loi {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.m4-moi__ten {
  font-family: var(--m4-to);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.m4-moi--trong .m4-moi__loi {
  color: var(--m4-xam);
}

.m4-moi--trong .m4-moi__ten {
  color: var(--m4-den);
}

/* ---------- ảnh lớn ---------- */

.m4-hero {
  position: relative;
  aspect-ratio: 3 / 4;
  max-height: 96svh;
  padding: 0 !important;
  overflow: hidden;
}

.m4-hero__phu {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 17, 15, 0.3), rgba(20, 17, 15, 0.05) 42%, rgba(20, 17, 15, 0.78));
}

.m4-hero__noi {
  position: absolute;
  inset: auto 0 0;
  padding: 0 26px 46px;
}

.m4-hero__ten {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
}

/* ---------- đếm ngược ---------- */

.m4-dem-khoi {
  background: var(--m4-trang);
  text-align: center;
}

.m4-dem {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.m4-dem div {
  padding: 15px 4px;
  border: 1px solid #e3ded6;
}

.m4-dem b {
  display: block;
  font-family: var(--m4-to);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--m4-la);
}

.m4-dem span {
  display: block;
  margin-top: 6px;
  font-size: 0.56rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--m4-xam);
}

/* ---------- thư mời ---------- */

.m4-thu {
  text-align: center;
}

.m4-thu__chu {
  margin: 0;
  font-family: var(--m4-to);
  font-size: 1.36rem;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--m4-den);
}

.m4-thu .m4-moi {
  align-items: center;
  margin-top: 26px;
}

/* ---------- hai họ ---------- */

.m4-ho {
  display: grid;
  gap: 26px;
  background: var(--m4-trang);
  text-align: center;
}

.m4-ho__nhan {
  margin: 0 0 10px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--m4-la-nhat);
}

.m4-ho__ten {
  margin: 0;
  font-family: var(--m4-to);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.m4-ho__vai {
  margin: 4px 0 12px;
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--m4-xam);
}

.m4-ho__cha {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.8;
  font-weight: 300;
}

.m4-ho__que {
  margin: 8px 0 0;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--m4-xam);
}

.m4-ho__giua {
  height: 1px;
  background: #e6ded5;
}

/* ---------- tiệc ---------- */

.m4-tiec {
  position: relative;
  min-height: 78svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  text-align: center;
}

.m4-tiec__phu {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 17, 15, 0.62), rgba(20, 17, 15, 0.72));
}

.m4-tiec__noi {
  position: relative;
  width: 100%;
  color: #fff;
}

.m4-tiec__so {
  margin: 0;
  font-family: var(--m4-to);
  font-size: clamp(5rem, calc(30vw * var(--thiep-ti, 1)), 7.5rem);
  font-weight: 800;
  line-height: 0.82;
  letter-spacing: -0.05em;
}

.m4-tiec__thang {
  margin: 12px 0 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.m4-tiec__gio {
  margin: 18px 0 0;
  font-size: 0.86rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.86);
}

.m4-tiec__am {
  margin: 6px 0 0;
  font-size: 0.74rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.6);
}

.m4-tiec__noi-ten {
  margin: 26px 0 0;
  font-family: var(--m4-to);
  font-size: 1.16rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.m4-tiec__dia-chi {
  margin: 8px auto 0;
  max-width: 28ch;
  font-size: 0.84rem;
  font-weight: 300;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.82);
}

/* ---------- bản đồ ---------- */

.m4-ban-do {
  padding: 0 !important;
  background: var(--m4-kem);
}

.m4-map iframe {
  display: block;
  width: 100%;
  height: 260px;
  border: 0;
  filter: grayscale(0.25);
}

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

.m4-album {
  background: var(--m4-trang);
  text-align: center;
}

.m4-album__lon {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #ece7e0;
  cursor: pointer;
}

.m4-album__lon img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: opacity 0.35s ease;
}

.m4-album__lon--doi img {
  opacity: 0;
}

.m4-album__nho {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-bottom: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.m4-album__nho::-webkit-scrollbar {
  display: none;
}

.m4-album__nho button {
  flex: 0 0 62px;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #ece7e0;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.3s ease;
}

.m4-album__nho button[aria-current="true"] {
  opacity: 1;
  outline: 2px solid var(--m4-la);
  outline-offset: -2px;
}

.m4-album__nho img {
  width: 62px;
  height: 62px;
  object-fit: cover;
}

/* ---------- chuyện của chúng mình ---------- */

.m4-story {
  background: var(--m4-trang);
}

.m4-story__lead {
  margin: -14px 0 26px;
  max-width: 30ch;
  font-size: 0.88rem;
  font-weight: 300;
  line-height: 1.75;
  color: #6d645d;
}

.m4-story__list {
  display: grid;
  gap: 34px;
}

.m4-story__item {
  display: grid;
  gap: 12px;
}

.m4-story__moc {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--m4-la-nhat);
}

.m4-story__td {
  margin: -6px 0 0;
  font-family: var(--m4-to);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.m4-story__anh {
  overflow: hidden;
}

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

.m4-story__text {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 300;
  line-height: 1.8;
  color: #6d645d;
}

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

.m4-lich {
  background: var(--m4-kem);
}

.m4-lich__list {
  display: grid;
}

.m4-lich__item {
  display: grid;
  grid-template-columns: 74px 1fr;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid #e2d9cf;
}

.m4-lich__item:last-child {
  border-bottom: 1px solid #e2d9cf;
}

.m4-lich__gio {
  font-family: var(--m4-to);
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.m4-lich__ten {
  font-size: 0.88rem;
  font-weight: 300;
}

/* ---------- lịch tháng ---------- */

.m4-save {
  background: var(--m4-trang);
  text-align: center;
}

.m4-lich-bang {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.m4-lich-bang th {
  padding: 8px 0;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--m4-xam);
}

.m4-lich-bang td {
  padding: 9px 0;
  font-weight: 300;
  color: #4b433d;
}

.m4-hom-nay span {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--m4-la);
  color: #fff;
  font-weight: 600;
}

/* ---------- form ---------- */

.m4-rsvp,
.m4-wish {
  background: var(--m4-kem);
}

.m4-rsvp__chu {
  margin: -14px 0 22px;
  max-width: 32ch;
  font-size: 0.88rem;
  font-weight: 300;
  line-height: 1.75;
  color: #6d645d;
}

.m4-form {
  display: grid;
  gap: 12px;
}

.m4-input {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid #ded4c9;
  border-radius: 0;
  background: #fff;
  color: var(--m4-den);
  font: inherit;
  font-size: 0.9rem;
}

.m4-input:focus {
  outline: 0;
  border-color: var(--m4-den);
}

.m4-input--area {
  resize: vertical;
}

.m4-chon {
  display: grid;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 300;
}

.m4-chon label {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
}

.m4-form__status {
  margin: 0;
  min-height: 18px;
  font-size: 0.8rem;
  color: var(--m4-la);
}

.m4-wish__list {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.m4-wish__the {
  padding: 16px 18px;
  background: #fff;
  border-left: 2px solid var(--m4-la);
}

.m4-wish__ten {
  margin: 0;
  font-family: var(--m4-to);
  font-size: 0.92rem;
  font-weight: 700;
}

.m4-wish__chu {
  margin: 6px 0 0;
  font-size: 0.86rem;
  font-weight: 300;
  line-height: 1.7;
  color: #6d645d;
}

/* ---------- quà mừng ---------- */

.m4-qua {
  background: var(--m4-kem);
}

.m4-qua__list {
  display: grid;
  gap: 14px;
}

.m4-qua__the {
  padding: 22px 20px;
  border: 1px solid #e3ded6;
  background: #fff;
  text-align: center;
}

.m4-qua__ben {
  margin: 0 0 14px;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--m4-la-nhat);
}

.m4-qua__ma {
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

.m4-qua__ma canvas,
.m4-qua__ma img {
  width: 150px;
  height: 150px;
  padding: 8px;
  border: 1px solid #ece7e0;
  background: #fff;
}

.m4-qua__ngan-hang {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--m4-xam);
}

.m4-qua__stk {
  margin: 6px 0 0;
  font-family: var(--m4-to);
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--m4-la);
}

.m4-qua__chu-tk {
  margin: 4px 0 0;
  font-size: 0.78rem;
  font-weight: 300;
  color: #6d645d;
}

.m4-qua__luu {
  margin-top: 14px;
  padding: 10px 20px;
  border: 1px solid #ded7cd;
  background: none;
  color: var(--m4-den);
  font: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
}

/* ---------- chân thiệp ---------- */

.m4-cuoi {
  position: relative;
  aspect-ratio: 3 / 4;
  max-height: 96svh;
  overflow: hidden;
}

.m4-cuoi__phu {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 17, 15, 0.26), rgba(20, 17, 15, 0.82));
}

.m4-cuoi__noi {
  position: absolute;
  inset: auto 0 0;
  padding: 0 26px 52px;
}

.m4-cuoi__ten {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
}

.m4-cuoi__ngay {
  margin: 12px 0 0;
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  color: rgba(255, 255, 255, 0.66);
}

/* ---------- nút nhạc ---------- */

.m4-nhac {
  position: fixed;
  right: calc(50% - 235px + 16px);
  bottom: 18px;
  z-index: 40;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 17, 15, 0.78);
  cursor: pointer;
  backdrop-filter: blur(6px);
}

@media (max-width: 500px) {
  .m4-nhac {
    right: 16px;
  }
}

.m4-nhac svg {
  width: 22px;
  height: 22px;
  margin: 0 auto;
  fill: #fff;
}

.m4-nhac[aria-pressed="true"] svg rect {
  animation: m4-song 1s ease-in-out infinite alternate;
}

.m4-nhac svg rect:nth-child(2) {
  animation-delay: 0.18s;
}

.m4-nhac svg rect:nth-child(3) {
  animation-delay: 0.36s;
}

.m4-nhac svg rect:nth-child(4) {
  animation-delay: 0.54s;
}

@keyframes m4-song {
  from {
    transform: scaleY(0.6);
    transform-origin: 50% 85%;
  }
  to {
    transform: scaleY(1.25);
    transform-origin: 50% 85%;
  }
}

/* ---------- xem ảnh ---------- */

.m4-xem {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(13, 11, 10, 0.94);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.m4-xem--mo {
  opacity: 1;
}

.m4-xem img {
  max-width: 100%;
  max-height: 86svh;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
}

.m4-xem--mo img {
  transform: none;
  opacity: 1;
}

.m4-xem__dong,
.m4-xem__di {
  position: absolute;
  border: 0;
  background: none;
  color: #fff;
  line-height: 1;
  cursor: pointer;
}

.m4-xem__dong {
  top: 16px;
  right: 18px;
  font-size: 1.875rem;
}

.m4-xem__di {
  top: 50%;
  margin-top: -20px;
  font-size: 2.125rem;
}

.m4-xem__di--truoc {
  left: 14px;
}

.m4-xem__di--sau {
  right: 14px;
}

.m4-xem__dem {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  margin: 0;
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.6);
}

@media (prefers-reduced-motion: reduce) {
  .m4-gate__anh img,
  .m4-gate__nut svg,
  .m4-nhac svg rect,
  .m4-album__luoi img,
  .m4-xem img {
    animation: none;
    transition: none;
  }
}

/* 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;
}
