:root {
  --bg: #0d0c0b;
  --panel: #171513;
  --panel-soft: #221e19;
  --text: #fff8e9;
  --muted: #c7bda9;
  --gold: #d6b45f;
  --gold-soft: #f1d997;
  --border: rgba(214, 180, 95, 0.34);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

html,
body {
  min-height: 100%;
  font-size: 16px;
}

body {
  min-height: 100dvh;
  font-family: "Poppins", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(214, 180, 95, 0.22), transparent 36rem),
    linear-gradient(135deg, rgba(13, 12, 11, 0.96), rgba(33, 28, 22, 0.94)),
    url("../assets/flower.png") center/900px auto;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  touch-action: manipulation;
}

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

.page-shell {
  position: relative;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.page-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../assets/flower.png") center/cover;
  opacity: 0.05;
  pointer-events: none;
}

.invitation-app {
  position: relative;
  width: min(100%, 540px);
  height: min(94dvh, 900px);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    linear-gradient(160deg, rgba(23, 21, 19, 0.98), rgba(12, 11, 10, 0.98)),
    url("../assets/flower.png") top right/390px auto no-repeat;
  box-shadow: var(--shadow);
}

.cover {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.76)),
    url("../assets/flower.png") center/cover,
    url("../img/cover.JPG") center/cover;
  transition: opacity 0.8s ease, visibility 0.8s ease, transform 0.8s ease;
}

.cover::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(241, 217, 151, 0.42);
  border-radius: 24px;
  pointer-events: none;
}

.cover.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.04);
  pointer-events: none;
}

.cover-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(214, 180, 95, 0.08), rgba(0, 0, 0, 0.56));
}

.cover-content {
  position: relative;
  z-index: 1;
  width: min(100%, 380px);
  text-align: center;
}

.eyebrow,
.section-label {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--gold-soft);
}

.cover-title,
.hero-title,
.card-heading h3,
.couple-card h3 {
  font-family: "Playfair Display", serif;
  font-weight: 800;
  line-height: 1.08;
}

.cover-title {
  margin-bottom: 18px;
  font-size: clamp(2.1rem, 11vw, 4.4rem);
  text-wrap: balance;
}

.cover-label {
  margin-bottom: 6px;
  color: var(--muted);
}

.guest-name {
  margin-bottom: 18px;
  color: var(--gold-soft);
  font-size: 1.05rem;
  font-weight: 700;
}

.btn-open,
.btn-submit,
.whatsapp-link,
.event-box a {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-open {
  padding: 12px 22px;
  color: #19140d;
  background: linear-gradient(135deg, #ffe9a8, #c7952f);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.btn-open:hover,
.btn-submit:hover,
.whatsapp-link:hover,
.event-box a:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(214, 180, 95, 0.24);
}

.main-content {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 16px 34px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  transition: opacity 0.8s ease, visibility 0.8s ease, transform 0.8s ease;
  -webkit-overflow-scrolling: touch;
}

.main-content.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hero {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(214, 180, 95, 0.08));
}

.hero-media {
  position: relative;
  height: 390px;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(13, 12, 11, 0.72));
}

.hero-media img {
  height: 100%;
  object-fit: cover;
}

.hero-inner {
  padding: 22px 20px 24px;
  text-align: center;
}

.hero-title {
  margin: 8px 0 10px;
  color: var(--text);
  font-size: clamp(2rem, 10vw, 4rem);
  text-wrap: balance;
}

.hero-date {
  margin-bottom: 10px;
  color: var(--gold-soft);
  font-weight: 700;
}

.hero-text {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.75;
}

.countdown-card,
.story-card,
.event-card,
.gallery-card,
.message-card,
.rsvp-card,
.couple-card {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(214, 180, 95, 0.08));
}

.card-heading {
  margin-bottom: 16px;
  text-align: center;
}

.card-heading h3 {
  margin-top: 6px;
  color: var(--text);
  font-size: 1.62rem;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.countdown-item {
  min-width: 0;
  padding: 12px 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
}

.countdown-item strong {
  display: block;
  color: var(--gold-soft);
  font-size: 1.2rem;
}

.countdown-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-grid {
  display: grid;
  gap: 10px;
}

.story-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 2px 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.story-item span {
  grid-row: span 2;
  color: var(--gold);
  font-family: "Playfair Display", serif;
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1;
}

.story-item h4 {
  font-size: 0.98rem;
}

.story-item p,
.parents,
.event-box p,
.message-list,
.form-note {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.couples {
  display: grid;
  gap: 12px;
  align-items: center;
}

.couple-card {
  text-align: center;
}

.couple-card img {
  width: 150px;
  height: 150px;
  margin: 0 auto 14px;
  border: 4px solid var(--gold);
  border-radius: 999px;
  object-fit: cover;
  box-shadow: 0 0 28px rgba(214, 180, 95, 0.18);
}

.couple-card h3 {
  margin-bottom: 8px;
  color: var(--gold-soft);
  font-size: 1.7rem;
}

.separator {
  color: var(--gold);
  font-family: "Playfair Display", serif;
  font-size: 2.4rem;
  line-height: 1;
  text-align: center;
}

.event-stack {
  display: grid;
  gap: 12px;
}

.event-box {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.event-box span {
  display: block;
  margin-bottom: 8px;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.event-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  line-height: 1.5;
}

.event-box a,
.whatsapp-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 10px 15px;
  color: #17120b;
  background: linear-gradient(135deg, #ffe9a8, #c7952f);
  font-size: 0.9rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gallery-thumb {
  overflow: hidden;
  aspect-ratio: 1 / 1.12;
  border: none;
  border-radius: 16px;
  background: var(--panel-soft);
  cursor: zoom-in;
}

.gallery-thumb img {
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-thumb:hover img {
  transform: scale(1.06);
}

.message-list {
  display: grid;
  gap: 10px;
  list-style: none;
}

.message-list li {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.message-list strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

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

.rsvp-form label {
  display: grid;
  gap: 7px;
}

.rsvp-form label span {
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rsvp-form input,
.rsvp-form select,
.rsvp-form textarea {
  width: 100%;
  border: 1px solid rgba(214, 180, 95, 0.22);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.rsvp-form input:focus,
.rsvp-form select:focus,
.rsvp-form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(214, 180, 95, 0.14);
}

.btn-submit {
  width: 100%;
  padding: 12px 18px;
  color: #17120b;
  background: linear-gradient(135deg, #ffe9a8, #c7952f);
}

.whatsapp-link {
  width: 100%;
  margin-top: 0;
}

.music-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: #17120b;
  background: linear-gradient(135deg, #ffe9a8, #c7952f);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
  cursor: pointer;
}

.music-toggle.is-muted {
  color: var(--text);
  background: #4c4640;
}

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.gallery-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.gallery-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(8px);
}

.gallery-modal-content {
  position: relative;
  width: min(92vw, 760px);
}

.gallery-modal-content img {
  max-height: 82dvh;
  border: 1px solid rgba(214, 180, 95, 0.44);
  border-radius: 20px;
  object-fit: contain;
  background: #080706;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

.gallery-close,
.gallery-nav {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  color: #17120b;
  background: linear-gradient(135deg, #ffe9a8, #c7952f);
  cursor: pointer;
}

.gallery-close {
  top: 12px;
  right: 12px;
}

.gallery-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
}

.gallery-nav-prev {
  left: 12px;
}

.gallery-nav-next {
  right: 12px;
}

@media (max-width: 380px) {
  .countdown-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-media {
    height: 330px;
  }
}

@media (max-height: 700px) {
  .invitation-app {
    min-height: 560px;
  }

  .cover-title {
    font-size: clamp(2rem, 10vw, 3.2rem);
  }
}

@media (min-width: 700px) {
  .page-shell {
    padding: 28px;
  }

  .invitation-app {
    width: min(100%, 700px);
    border-radius: 32px;
  }

  .main-content {
    padding: 22px;
  }

  .hero {
    display: grid;
    grid-template-columns: 0.95fr 1fr;
    align-items: stretch;
  }

  .hero-media {
    height: auto;
    min-height: 450px;
  }

  .hero-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .couples {
    grid-template-columns: 1fr 54px 1fr;
  }

  .event-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
