:root {
  --page-bg-image: url("https://s3.vn-hcm-1.vietnix.cloud/cuoiroine/background-916.webp");
  --page-bg-position: center top;
  --intro-overlay-tint-top: rgba(255, 248, 242, 0.38);
  --intro-overlay-tint-bottom: rgba(243, 229, 216, 0.34);
}

body {
  background-image: none !important;
}

body::before {
  content: none;
}

.page-backdrop {
  background-position: var(--page-bg-position);
  background-attachment: scroll;
}

@media (max-width: 1056px) {
  .hero-script {
    font-size: calc(clamp(58px, 8.2vw, 82px) * 0.5) !important;
  }
}

@media (max-width: 768px) {
  .intro-card {
    width: min(100%, 36rem);
    max-width: calc(100vw - 16px);
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .intro-note {
    max-width: 100%;
    margin-inline: auto;
    font-size: clamp(20px, 5.2vw, 30px) !important;
    line-height: 1.15;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
  }

  .site {
    width: 100%;
    max-width: 100%;
    padding: 12px 10px 24px;
  }

  .site-card {
    border-radius: 18px;
    padding: 18px 14px;
    margin-bottom: 14px;
  }

  .hero.site-card {
    height: min(76vh, 680px);
    margin-bottom: 18px;
  }

  .hero-overlay-text {
    padding: 14px 12px 16px;
  }

  .story-canvas {
    width: 100%;
    aspect-ratio: 5 / 4;
  }

  .story-photo {
    width: min(48%, 176px);
    padding: 6px 6px 18px;
  }

  .story-photo-left {
    left: 24%;
    top: 11%;
  }

  .story-photo-right {
    right: 10%;
    top: 8%;
  }

  .family-grid {
    max-width: min(100%, 392px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
  }

  .family-grid::after {
    top: 4px;
    bottom: 4px;
  }

  .family-box {
    font-size: 12px;
    line-height: 1.35;
  }

  .family-box p:not(.family-label) {
    font-size: 16px;
    line-height: 1.28;
    margin-bottom: 5px;
  }

  .family-label {
    font-size: 16px !important;
    letter-spacing: 0.09em !important;
    line-height: 1;
    margin-bottom: 5px;
  }

  .invite-text br {
    display: none;
  }

  .timeline-board {
    width: 100%;
    max-width: 100%;
    min-height: 320px;
    padding: 16px 4px;
    column-gap: 8px;
  }

  .timeline-item.left,
  .timeline-item.right {
    width: min(100%, 136px);
    transform: none;
  }

  .timeline-item.left {
    justify-self: center;
    padding-right: 0;
    text-align: center;
  }

  .timeline-item.right {
    justify-self: center;
    padding-left: 0;
    text-align: center;
  }

  .timeline-center-icon {
    width: 72px;
    height: 72px;
  }

  .timeline-item h4 {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    text-wrap: balance;
    line-height: 1.12;
  }

  .gallery {
    width: min(calc(100% - 8px), 430px);
    border-radius: 16px;
  }

  .nav-btn {
    width: 42px;
    height: 58px;
  }

  .nav-btn svg {
    width: 22px;
    height: 22px;
  }

  .thumbs-wrap {
    width: 100%;
    gap: 6px;
  }

  .thumbs {
    gap: 6px;
  }

  .thumbs button {
    width: 46px;
    min-width: 46px;
    border-radius: 10px;
  }

  .site-btn,
  .rsvp-choice span,
  .invite-map,
  .gift-title,
  .hero-names,
  .family-label,
  .intro-note {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .site-btn {
    min-height: 48px;
  }

  .form-control,
  .form-select {
    font-size: 16px !important;
    min-height: 48px;
  }

  .section-title {
    font-size: 30px !important;
  }

  .hero-names {
    font-size: 10px !important;
  }

  .hero-date {
    font-size: 28px !important;
  }

  .story-title {
    font-size: 56px !important;
  }

  .story-copy {
    font-size: 15px !important;
    line-height: 1.72 !important;
  }

  .invite-text {
    font-size: 22px !important;
  }

  .invite-name {
    font-size: 36px !important;
  }

  .invite-day {
    font-size: 64px !important;
  }

  .countdown-note {
    font-size: 20px !important;
  }

  .countdown-part b {
    font-size: 48px !important;
  }

  .timeline-item h4 {
    font-size: 24px !important;
  }

  .gift-title {
    font-size: 30px !important;
  }

  .gift-copy,
  .form-grid label,
  .form-status,
  .form-note {
    font-size: 14px !important;
  }

  .quote {
    font-size: 28px !important;
  }
}

@media (max-width: 640px) {
  .intro-card {
    width: min(100%, 22rem);
    max-width: calc(100vw - 24px);
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .site {
    padding: 10px 8px 22px;
  }

  .site-card {
    padding: 16px 12px;
    border-radius: 16px;
  }

  .lightbox {
    padding: 24px 28px;
  }

  .lightbox-image {
    max-width: min(84vw, 420px);
    max-height: 86vh;
  }

  .lightbox-close {
    top: 18px;
    right: 18px;
  }

  .gift-modal-card {
    padding-left: 22px !important;
    padding-right: 22px !important;
  }

  .gift-grid {
    justify-items: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .gift-grid .event-box {
    width: calc(100% - 16px) !important;
    max-width: 320px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .qr-bank {
    width: min(188px, 100%) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .rsvp-choice-group {
    grid-template-columns: 1fr;
  }

  .rsvp-choice {
    width: 100%;
    border-radius: 18px;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .site-btn {
    width: 100%;
    justify-content: center;
  }

  .family-grid {
    max-width: min(100%, 336px);
    gap: 8px;
  }

  .family-box {
    font-size: 11px;
  }

  .family-box p:not(.family-label) {
    font-size: 14px;
  }

  .family-label {
    font-size: 14px !important;
    letter-spacing: 0.06em !important;
  }
}

@media (max-width: 480px) {
  .timeline-board {
    min-height: 280px;
    padding: 14px 2px;
    column-gap: 4px;
  }

  .timeline-item.left,
  .timeline-item.right {
    width: min(100%, 118px);
  }

  .timeline-item.left {
    padding-right: 0;
  }

  .timeline-item.right {
    padding-left: 0;
  }

  .timeline-center-icon {
    width: 56px;
    height: 56px;
  }

  .timeline-item h4 {
    font-size: 16px !important;
  }
}

@media (max-width: 375px) {
  .invite-couple-block {
    transform: scale(0.82);
    transform-origin: center top;
  }

  .family-grid {
    max-width: min(100%, 320px);
    gap: 8px;
  }

  .family-box {
    font-size: 11px;
    line-height: 1.3;
  }

  .family-box p:not(.family-label) {
    font-size: 13px;
    margin-bottom: 4px;
  }

  .family-label {
    font-size: 13px !important;
    letter-spacing: 0.05em !important;
  }

  .section-title,
  .center.section-title {
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    font-size: clamp(18px, 5.8vw, 24px) !important;
    line-height: 1.04;
    letter-spacing: 0.01em !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero-script {
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    font-size: 48px !important;
    line-height: 0.94;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .countdown-note {
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    font-size: clamp(12px, 3.9vw, 15px) !important;
    line-height: 1.1 !important;
    letter-spacing: 0.01em !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .invite-text {
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    font-size: clamp(11px, 3.5vw, 14px) !important;
    line-height: 1.15;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .invite-name,
  .invite-name-bride {
    width: fit-content;
    max-width: 100%;
    margin-inline: auto;
    font-size: clamp(20px, 6.4vw, 26px) !important;
    line-height: 0.94;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .intro-overlay {
    padding: 14px;
  }

  .intro-card {
    width: min(100%, 19rem);
    max-width: calc(100vw - 28px);
    padding-left: 12px !important;
    padding-right: 12px !important;
    overflow: hidden;
  }

  .intro-card h1 {
    max-width: 100%;
    margin-inline: auto;
    font-size: clamp(24px, 8vw, 34px);
    line-height: 1.12;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
  }

  .intro-card p {
    max-width: 100%;
    margin-inline: auto;
    font-size: 14px;
    line-height: 1.55;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: pretty;
  }

  .heart-btn.envelope-btn {
    width: 68px;
    height: 68px;
    margin-top: 12px;
  }

  .envelope-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.6;
  }

  .intro-note {
    margin-top: 10px;
    max-width: 100%;
    margin-inline: auto;
    font-size: clamp(18px, 6vw, 24px) !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-wrap: balance;
    line-height: 1.18;
  }
}

@media (max-width: 340px) {
  .invite-couple-block {
    transform: scale(0.74);
  }

  .family-grid {
    max-width: min(100%, 290px);
    gap: 6px;
  }

  .family-box p:not(.family-label) {
    font-size: 12px;
  }

  .family-label {
    font-size: 12px !important;
    letter-spacing: 0.04em !important;
  }

  .section-title,
  .center.section-title {
    font-size: 17px !important;
  }

  .hero-script {
    font-size: 18px !important;
  }

  .countdown-note {
    font-size: 11px !important;
  }

  .invite-text {
    font-size: 10px !important;
  }

  .invite-name,
  .invite-name-bride {
    font-size: 18px !important;
  }

  .intro-overlay {
    padding: 12px;
  }

  .intro-card {
    width: min(100%, 17.25rem);
    max-width: calc(100vw - 24px);
  }

  .intro-card h1 {
    font-size: 22px;
  }

  .heart-btn.envelope-btn {
    width: 62px;
    height: 62px;
  }

  .envelope-btn svg {
    width: 22px;
    height: 22px;
  }

  .intro-note {
    font-size: 18px !important;
  }
}

@media (max-width: 375px) {
  .countdown-note {
    display: inline-block !important;
    width: max-content !important;
    max-width: none !important;
    margin-left: 50% !important;
    margin-right: 0 !important;
    font-size: 18px !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    text-align: center !important;
    transform: translateX(-50%) scale(0.56) !important;
    transform-origin: center top !important;
  }
}

@media (max-width: 340px) {
  .countdown-note {
    font-size: 18px !important;
    transform: translateX(-50%) scale(0.5) !important;
  }
}
