:root {
  --ice: #fff6df;
  --blue: #b8964f;
  --deep: #5d4421;
  --ink: #3f2f18;
  --silver: #fffaf0;
  --gold: #c89d31;
  --soft-gold: #f2d891;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #e6c777;
  font-family: "Playfair Display", Georgia, serif;
  overflow: hidden;
}

.music-toggle {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 20;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(255,255,255,.52);
  border-radius: 999px;
  color: #fffaf0;
  background: rgba(93, 68, 33, .62);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px rgba(92, 61, 12, .2);
  font: 600 10px "Cinzel", serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.music-toggle[hidden] {
  display: none;
}

.invite {
  height: 100svh;
  overflow-y: hidden;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}

.invite.is-open {
  overflow-y: auto;
}

.panel {
  position: relative;
  min-height: 100svh;
  scroll-snap-align: start;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  isolation: isolate;
  overflow: hidden;
}

.envelope-panel {
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,.72), transparent 34%),
    linear-gradient(160deg, #fff3ce, #c49a38 58%, #f8e6ae);
}

.envelope {
  position: relative;
  width: min(88vw, 390px);
  aspect-ratio: 9 / 15.5;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(92, 61, 12, .34), inset 0 0 0 1px rgba(255,255,255,.55);
  background: linear-gradient(145deg, #ffe9ad, #bd8f2e);
  transform: translateY(0) scale(1);
  transition: transform 1200ms cubic-bezier(.72, -.02, .14, 1), opacity 700ms ease;
}

.envelope.opening {
  transform: translateX(-120vw) rotate(-10deg) scale(.92);
  opacity: 0;
}

.envelope-pattern,
.details-panel::before {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 22% 18%, rgba(95, 66, 20, .2) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 28%, rgba(255, 255, 255, .28) 0 2px, transparent 3px),
    repeating-radial-gradient(ellipse at 50% 50%, transparent 0 18px, rgba(113, 79, 24, .15) 19px 21px, transparent 22px 42px);
  opacity: .65;
}

.flap {
  position: absolute;
  inset-inline: 0;
  height: 48%;
  background: linear-gradient(135deg, rgba(255,255,255,.42), rgba(129, 88, 21, .18));
  border: 1px solid rgba(255,255,255,.34);
}

.flap-top {
  top: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.flap-left {
  bottom: 0;
  clip-path: polygon(0 0, 50% 52%, 0 100%);
}

.flap-right {
  bottom: 0;
  clip-path: polygon(100% 0, 50% 52%, 100% 100%);
}

.envelope-copy {
  position: absolute;
  inset: auto 24px 92px;
  text-align: center;
  color: rgba(255,255,255,.92);
  text-shadow: 0 2px 12px rgba(83, 53, 10, .35);
}

.tiny,
.eyebrow {
  margin: 0 0 12px;
  font: 500 11px/1.3 "Cinzel", serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.envelope h1 {
  margin: 0;
  font: 400 clamp(42px, 12vw, 66px)/1 "Great Vibes", cursive;
}

.hint {
  margin: 42px 0 0;
  font-style: italic;
  font-size: 17px;
}

.seal {
  position: absolute;
  left: 50%;
  top: 47%;
  width: 94px;
  height: 94px;
  border: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  color: var(--deep);
  font: 600 18px "Cinzel", serif;
  background: radial-gradient(circle at 35% 30%, white, #fff0bd 52%, #d0a13c);
  box-shadow: 0 0 0 9px rgba(255,255,255,.45), 0 12px 35px rgba(96, 62, 8, .35);
  cursor: pointer;
  animation: pulse 1800ms infinite;
}

@keyframes pulse {
  50% { transform: translate(-50%, -50%) scale(1.06); }
}

.hero-panel {
  background: linear-gradient(#fff2cc 0 36%, #fffaf0 68%, #ecd28a);
  color: white;
}

.sky-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 22%, rgba(255,255,255,.9), transparent 26%);
}

.floral-arch {
  position: absolute;
  width: min(94vw, 460px);
  height: 58svh;
  bottom: 19svh;
  border: 8px solid rgba(238, 248, 247, .8);
  border-bottom: 0;
  border-radius: 48% 48% 0 0;
  box-shadow: 0 0 36px rgba(83,128,117,.18);
}

.floral-arch span {
  position: absolute;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 40%, #fff 0 11px, transparent 12px),
    radial-gradient(circle at 60% 55%, #d7eee9 0 15px, transparent 16px),
    radial-gradient(circle at 45% 62%, #f7fbf8 0 18px, transparent 19px),
    radial-gradient(circle at 50% 50%, #8daea0 0 32px, transparent 33px);
  filter: drop-shadow(0 8px 12px rgba(40,70,66,.12));
}

.floral-arch span:nth-child(1) { left: -22px; bottom: 22px; }
.floral-arch span:nth-child(2) { right: -24px; bottom: 26px; }
.floral-arch span:nth-child(3) { left: 12%; top: 18%; }
.floral-arch span:nth-child(4) { right: 13%; top: 15%; }
.floral-arch span:nth-child(5) { left: 42%; top: -32px; }

.couple-scene {
  position: absolute;
  width: min(84vw, 370px);
  height: 46svh;
  bottom: 6svh;
}

.aisle {
  position: absolute;
  inset: 28% 24% 0;
  background: linear-gradient(to bottom, rgba(255,255,255,.95), rgba(211,225,233,.86));
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
}

.bride,
.groom {
  position: absolute;
  bottom: 14%;
}

.bride {
  left: 41%;
  width: 72px;
  height: 160px;
  background: linear-gradient(to bottom, #fff, #e5eef4);
  clip-path: polygon(47% 0, 62% 7%, 70% 38%, 100% 100%, 0 100%, 32% 38%, 38% 7%);
  filter: drop-shadow(0 10px 12px rgba(60,80,95,.16));
}

.groom {
  left: 55%;
  width: 38px;
  height: 128px;
  background: #162433;
  border-radius: 24px 24px 6px 6px;
}

.groom::before {
  content: "";
  position: absolute;
  left: 9px;
  top: -18px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1d2d3c;
}

.hero-text {
  align-self: start;
  margin-top: 8svh;
  text-align: center;
  text-shadow: 0 2px 20px rgba(90, 62, 15, .34);
  z-index: 2;
}

.hero-text p {
  margin: 0 0 8px;
  font: 500 11px "Cinzel", serif;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero-text h2 {
  margin: 0;
  font: 400 clamp(52px, 15vw, 82px)/.9 "Great Vibes", cursive;
}

.hero-text span,
.and {
  color: var(--gold);
}

.divider {
  width: 150px;
  height: 1px;
  margin: 16px auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.date-panel {
  background:
    linear-gradient(rgba(255,250,240,.72), rgba(255,247,220,.9)),
    repeating-linear-gradient(135deg, #d1a33d 0 18px, #efd287 18px 36px);
}

.date-card {
  width: min(88vw, 390px);
  text-align: center;
  padding: 34px 20px;
  border: 1px solid rgba(143, 99, 22, .28);
  background: rgba(255,250,235,.62);
  backdrop-filter: blur(8px);
}

.date-card h2,
.venue-copy h2 {
  margin: 0;
  font: 400 clamp(38px, 11vw, 56px) "Great Vibes", cursive;
  color: var(--deep);
}

.date-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  margin: 24px 0 12px;
  font-family: "Cinzel", serif;
  color: var(--deep);
}

.date-row strong {
  font-size: 76px;
  line-height: .9;
  color: var(--gold);
}

.date-row span {
  min-width: 0;
  padding-block: 10px;
  border-block: 1px solid rgba(126, 84, 15, .4);
  font-size: clamp(12px, 3.4vw, 16px);
  overflow-wrap: anywhere;
}

.time {
  margin: 0 0 26px;
  font-style: italic;
}

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

.countdown div {
  min-width: 0;
  padding: 12px 4px;
  background: rgba(255,250,235,.72);
  border: 1px solid rgba(151, 105, 28, .2);
}

.countdown strong {
  display: block;
  font: 600 clamp(21px, 7vw, 32px) "Cinzel", serif;
  color: var(--deep);
}

.countdown span {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  text-transform: uppercase;
}

.details-panel {
  background: linear-gradient(#fffaf0, #ead187);
}

.details-panel::before {
  content: "";
  opacity: .34;
}

.paper {
  position: relative;
  width: min(88vw, 390px);
  min-height: 72svh;
  padding: 52px 28px;
  display: grid;
  align-content: center;
  text-align: center;
  background: rgba(255,252,242,.76);
  border: 1px solid rgba(126, 86, 20, .26);
  box-shadow: 0 28px 70px rgba(92, 61, 12, .22);
}

.paper h2 {
  margin: 4px 0;
  font: 600 25px/1.2 "Playfair Display", serif;
  color: var(--deep);
}

.and {
  margin: 10px 0;
  font: 400 38px "Great Vibes", cursive;
}

.invitation-text {
  margin: 24px auto 18px;
  max-width: 27ch;
  line-height: 1.65;
}

.dua {
  margin: 10px 0 0;
  font-size: 20px;
  color: var(--gold);
}

.dua-translation {
  max-width: 28ch;
  margin: 12px auto 0;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(38, 55, 70, .78);
}

.corner {
  position: absolute;
  width: 95px;
  height: 95px;
  border-color: rgba(168, 122, 35, .68);
}

.corner-a { top: 18px; left: 18px; border-top: 2px solid; border-left: 2px solid; border-radius: 18px 0 0 0; }
.corner-b { top: 18px; right: 18px; border-top: 2px solid; border-right: 2px solid; border-radius: 0 18px 0 0; }
.corner-c { bottom: 18px; left: 18px; border-bottom: 2px solid; border-left: 2px solid; border-radius: 0 0 0 18px; }
.corner-d { bottom: 18px; right: 18px; border-bottom: 2px solid; border-right: 2px solid; border-radius: 0 0 18px 0; }

.map-panel {
  align-content: center;
  gap: 18px;
  background: linear-gradient(180deg, #f3db91, #fffaf0);
  text-align: center;
}

.venue-copy p {
  margin: 8px 0 0;
}

.map-frame {
  width: min(90vw, 420px);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid rgba(137,95,22,.24);
  box-shadow: 0 20px 50px rgba(92, 61, 12, .18);
}

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

.maps-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 50px;
  width: min(90vw, 420px);
  color: white;
  text-decoration: none;
  font: 600 13px "Cinzel", serif;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #7a571f, #c6972d);
  box-shadow: 0 12px 26px rgba(92, 61, 12, .24);
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,.28);
  color: white;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
}

.scroll-cue.dark {
  color: var(--deep);
  border-color: rgba(52,77,93,.28);
}

.panel > * {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 800ms ease, transform 900ms ease;
}

.panel.in-view > * {
  opacity: 1;
  transform: translateY(0);
}

.envelope-panel > *,
.map-panel.in-view > .map-frame {
  opacity: 1;
}

@media (max-width: 360px) {
  .panel { padding-inline: 14px; }
  .paper { padding-inline: 20px; }
  .countdown { gap: 5px; }
  .countdown span { font-size: 9px; }
}
