:root {
  --burgundy: #6b1d2a;
  --burgundy-deep: #4a121c;
  --gold: #c9a44a;
  --gold-bright: #e8c97a;
  --cream: #f7efe3;
  --parchment: #fbf6ee;
  --ink: #3a2a24;
  --muted: #7a6558;
  --white: #fffdf8;
  --shadow: 0 24px 60px rgba(74, 18, 28, 0.18);
  --radius: 22px;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(201, 164, 74, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 20%, rgba(107, 29, 42, 0.12), transparent 50%),
    linear-gradient(180deg, #f4e6d4 0%, var(--cream) 40%, #efe2d0 100%);
  overflow-x: hidden;
}

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

h1,
h2 {
  margin: 0;
  font-weight: 500;
}

h2 {
  font-family: "Cinzel", serif;
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--burgundy);
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.petals {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.petal {
  position: absolute;
  top: -40px;
  width: 12px;
  height: 18px;
  border-radius: 80% 0 80% 0;
  background: linear-gradient(135deg, #e8c9cf, #c45c6a);
  opacity: 0.45;
  animation: fall linear infinite;
}

@keyframes fall {
  to {
    transform: translateY(110vh) rotate(360deg);
  }
}

/* Cover / envelope */
.cover {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  padding: 32px 20px 48px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(201, 164, 74, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 20%, rgba(107, 29, 42, 0.12), transparent 50%),
    linear-gradient(180deg, #f4e6d4 0%, var(--cream) 40%, #efe2d0 100%);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.cover.is-open {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
}

.cover[hidden] {
  display: none !important;
}

.cover__glow {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 201, 122, 0.35), transparent 70%);
  filter: blur(8px);
}

.envelope {
  position: relative;
  width: min(88vw, 340px);
  height: 220px;
  perspective: 900px;
  filter: drop-shadow(0 18px 30px rgba(74, 18, 28, 0.28));
  cursor: pointer;
}

.envelope__back,
.envelope__front,
.envelope__flap,
.envelope__letter {
  position: absolute;
  inset: 0;
}

.envelope__back {
  background: linear-gradient(180deg, #8a2434, var(--burgundy-deep));
  border-radius: 8px;
}

.envelope__letter {
  top: 18px;
  left: 14px;
  right: 14px;
  bottom: 18px;
  background: var(--parchment);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 1;
  transform: translateY(0);
  transition: transform 0.8s ease;
}

.envelope.is-opening .envelope__letter {
  transform: translateY(-70px);
}

.envelope__kicker,
.envelope__date {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

.envelope__names {
  margin: 0;
  font-family: "Great Vibes", cursive;
  font-size: 1.45rem;
  color: var(--burgundy);
  text-align: center;
  padding: 0 8px;
}

.envelope__front {
  background: linear-gradient(180deg, #7c2231 0%, var(--burgundy) 100%);
  clip-path: polygon(0 42%, 50% 100%, 100% 42%, 100% 100%, 0 100%);
  z-index: 3;
  border-radius: 0 0 8px 8px;
}

.envelope__flap {
  background: linear-gradient(180deg, #9a3142, #6b1d2a);
  clip-path: polygon(0 0, 50% 58%, 100% 0);
  z-index: 4;
  transform-origin: top center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform 0.7s ease;
}

.envelope.is-opening .envelope__flap {
  transform: rotateX(180deg);
  z-index: 0;
}

.seal {
  position: absolute;
  left: 50%;
  bottom: 46px;
  transform: translateX(-50%);
  z-index: 5;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #e8c97a, #b8862a 55%, #8a6418);
  color: var(--burgundy-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-family: "Cinzel", serif;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.seal small {
  font-family: "Great Vibes", cursive;
  font-size: 1rem;
}

.cover__btn {
  position: relative;
  z-index: 6;
  appearance: none;
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--burgundy-deep);
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 14px 22px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(201, 164, 74, 0.35);
}

.cover__btn:hover,
.cover__btn:focus-visible {
  transform: translateY(-1px);
}

/* Invitation */
.invitation {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 64px;
  animation: rise 0.9s ease;
}

.invitation[hidden] {
  display: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero {
  text-align: center;
  padding: 28px 8px 12px;
}

.ornament {
  color: var(--gold);
  width: min(280px, 80%);
  margin: 0 auto 12px;
  opacity: 0.9;
}

.ornament--flip {
  transform: scaleY(-1);
  margin: 16px auto 0;
}

.kicker {
  font-family: "Cinzel", serif;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  font-size: 0.68rem;
  color: var(--gold);
  margin: 0 0 10px;
}

.bismillah {
  font-size: 1.15rem;
  color: var(--burgundy);
  margin: 0 0 18px;
  direction: rtl;
}

.names {
  font-family: "Great Vibes", cursive;
  font-size: clamp(2.6rem, 10vw, 4rem);
  line-height: 1.15;
  color: var(--burgundy);
  font-weight: 400;
}

.amp {
  display: block;
  font-size: 0.55em;
  color: var(--gold);
}

.kelin-ota {
  display: block;
  margin-top: 6px;
  font-family: "Cinzel", serif;
  font-size: 0.28em;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.families {
  margin: 10px 0 0;
  font-size: 1.15rem;
  color: var(--muted);
  font-style: italic;
}

.families--hero {
  margin: 0;
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  line-height: 1.3;
  color: var(--burgundy);
  font-weight: 500;
}

.card {
  background: var(--white);
  border: 1px solid rgba(201, 164, 74, 0.35);
  border-radius: var(--radius);
  padding: 28px 22px;
  margin: 18px 0;
  box-shadow: var(--shadow);
}

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

.greeting {
  font-family: "Cinzel", serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--gold);
  margin: 22px 0 0;
}

.lead {
  font-size: 1.2rem;
  line-height: 1.7;
  margin: 0 0 22px;
  color: var(--ink);
}

.meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 480px) {
  .meta {
    grid-template-columns: repeat(3, 1fr);
  }
}

.meta__item {
  padding: 12px 8px;
  border-top: 1px solid rgba(201, 164, 74, 0.3);
}

.meta__label {
  display: block;
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.meta__value {
  font-size: 1.15rem;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.countdown__unit {
  background: linear-gradient(180deg, #fff8ec, #f3e4cc);
  border: 1px solid rgba(201, 164, 74, 0.4);
  border-radius: 16px;
  padding: 14px 4px;
  text-align: center;
}

.countdown__unit span {
  display: block;
  font-family: "Cinzel", serif;
  font-size: clamp(1.3rem, 5vw, 1.8rem);
  color: var(--burgundy);
}

.countdown__unit small {
  color: var(--muted);
  letter-spacing: 0.08em;
}

.countdown__done {
  text-align: center;
  margin: 16px 0 0;
  font-size: 1.15rem;
}

.venue-name {
  text-align: center;
  font-size: 1.5rem;
  margin: 16px 0 6px;
  color: var(--burgundy);
}

.venue-address {
  text-align: center;
  color: var(--muted);
  line-height: 1.7;
  margin: 0 0 18px;
}

.map-wrap {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(201, 164, 74, 0.35);
  height: 220px;
  margin-bottom: 16px;
}

.map-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.map-actions {
  display: grid;
  gap: 10px;
}

@media (min-width: 480px) {
  .map-actions {
    grid-template-columns: 1fr 1fr;
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-decoration: none;
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 14px 16px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--burgundy-deep);
  cursor: pointer;
}

.btn--ghost {
  background: transparent;
  color: var(--burgundy);
}

.btn--gold {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.rsvp-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  text-transform: none;
  font-style: italic;
  margin-bottom: 18px;
}

.rsvp input {
  width: 100%;
  margin: 8px 0 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(201, 164, 74, 0.45);
  background: #fffaf3;
  font-family: inherit;
  font-size: 1.1rem;
  color: var(--ink);
}

.rsvp input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.rsvp__actions {
  display: grid;
  gap: 10px;
}

.rsvp__thanks {
  text-align: center;
  font-size: 1.2rem;
  color: var(--burgundy);
  margin: 8px 0 0;
}

.footer {
  text-align: center;
  padding: 28px 8px 8px;
  color: var(--muted);
}

.names--small {
  font-size: 2.1rem;
  margin-bottom: 4px;
}

.music-btn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  width: 52px;
  height: 52px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--burgundy-deep);
  box-shadow: 0 10px 24px rgba(201, 164, 74, 0.4);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

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

.music-btn .music-btn__off {
  display: none;
}

.music-btn:not(.is-playing) .music-btn__on {
  display: none;
}

.music-btn:not(.is-playing) .music-btn__off {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .cover,
  .invitation,
  .envelope__flap,
  .envelope__letter,
  .petal {
    animation: none !important;
    transition: none !important;
  }
}
