:root {
  --ivory: #f6f0e4;
  --champagne: #e5d3b0;
  --gold: #b8943f;
  --gold-bright: #d4b56a;
  --ink: #2a2216;
  --ink-soft: rgba(42, 34, 22, 0.62);
  --empty: rgba(42, 34, 22, 0.32);
  --foil: linear-gradient(
    115deg,
    #8f6f2a 0%,
    #d8bc74 28%,
    #f0e2b8 48%,
    #c9a84c 68%,
    #8f6f2a 100%
  );
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--ink);
  background: var(--ivory);
  overflow: hidden;
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0.35;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

.back {
  position: fixed;
  top: max(0.85rem, env(safe-area-inset-top));
  left: 1rem;
  z-index: 50;
  font-family: "Cinzel", serif;
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.back:hover {
  color: var(--ink);
  border-color: var(--gold);
}

/* Seal / open */
.seal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 70% 50% at 50% 40%, rgba(216, 188, 116, 0.28), transparent 60%),
    linear-gradient(165deg, #2a2216 0%, #1a1510 100%);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.seal.is-opening {
  opacity: 0;
}

.seal.is-gone {
  visibility: hidden;
  pointer-events: none;
}

.seal-open {
  appearance: none;
  border: 0;
  background: transparent;
  color: #f6f0e4;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 0.7rem;
  position: relative;
  padding: 2.5rem;
}

.seal-ring {
  position: absolute;
  width: 7.5rem;
  height: 7.5rem;
  border: 1px solid rgba(212, 181, 106, 0.55);
  border-radius: 50%;
  animation: seal-pulse 2.4s ease-in-out infinite;
}

.seal-text {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.8rem;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  background: var(--foil);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: foil-shift 6s ease-in-out infinite;
}

.seal-sub {
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(246, 240, 228, 0.55);
}

.music-btn {
  position: fixed;
  top: max(0.75rem, env(safe-area-inset-top));
  right: 1rem;
  z-index: 50;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid rgba(184, 148, 63, 0.45);
  background: rgba(246, 240, 228, 0.72);
  backdrop-filter: blur(8px);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.music-icon {
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid var(--gold);
  border-radius: 50%;
  position: relative;
}

.music-icon::before {
  content: "";
  position: absolute;
  inset: 2px;
  border: 2px solid transparent;
  border-top-color: var(--gold);
  border-radius: 50%;
}

.music-btn.is-on .music-icon {
  animation: music-spin 1.2s linear infinite;
}

.music-btn.is-missing {
  animation: shake 0.35s ease;
}

.dots {
  position: fixed;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: grid;
  gap: 0.45rem;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(184, 148, 63, 0.28);
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease;
}

.dot.is-active {
  background: var(--gold);
  transform: scale(1.35);
}

.scroller {
  height: 100dvh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.screen {
  position: relative;
  min-height: 100dvh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4.5rem 1.6rem 3.5rem;
  overflow: hidden;
}

/* Cover — full-bleed poster */
.cover {
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
  background: #1c1812;
}

.poster {
  position: relative;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 50% 40%, rgba(216, 188, 116, 0.22), transparent 65%),
    linear-gradient(160deg, #3a3226 0%, #1c1812 55%, #2a2216 100%);
}

.poster-img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.poster.has-image .poster-img {
  display: block;
}

.poster.has-image .poster-slot {
  display: none;
}

.poster-slot {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 0.55rem;
  text-align: center;
  pointer-events: none;
}

.poster-slot-title {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(232, 211, 176, 0.78);
}

.poster-slot-hint {
  font-size: 0.95rem;
  font-style: italic;
  color: rgba(232, 211, 176, 0.4);
}

.poster-hero {
  position: absolute;
  inset: 0;
}

.cover-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(28, 24, 18, 0.15) 0%, rgba(28, 24, 18, 0.2) 35%, rgba(28, 24, 18, 0.82) 78%, rgba(28, 24, 18, 0.94) 100%),
    radial-gradient(ellipse 80% 50% at 50% 100%, rgba(184, 148, 63, 0.22), transparent 60%);
  pointer-events: none;
}

.cover-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 100dvh;
  text-align: center;
  padding: 4.5rem 1.6rem 3.2rem;
  color: #f6f0e4;
}

.cover-content .eyebrow {
  color: var(--gold-bright);
}

.cover-content .lede {
  color: rgba(246, 240, 228, 0.72);
}

.cover-content .scroll-cue {
  color: rgba(246, 240, 228, 0.7);
}

.cover-bg {
  display: none;
}

.ornament {
  width: min(46vw, 11rem);
  height: 1px;
  background: var(--foil);
  background-size: 200% 100%;
  animation: foil-shift 6s linear infinite;
  position: relative;
}

.ornament.top {
  margin-bottom: 2rem;
}

.ornament.bottom {
  margin-top: 2.4rem;
}

.ornament::before,
.ornament::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  border: 1px solid var(--gold-bright);
  transform: translateY(-50%) rotate(45deg);
}

.ornament::before {
  left: -10px;
}

.ornament::after {
  right: -10px;
}

.eyebrow {
  font-family: "Cinzel", serif;
  font-size: 0.68rem;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.1rem;
}

.brand {
  font-family: "Cormorant Garamond", serif;
  font-weight: 400;
  font-size: clamp(4.2rem, 22vw, 5.6rem);
  line-height: 0.92;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  background: var(--foil);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: foil-shift 7s ease-in-out infinite;
}

.lede {
  margin-top: 1.25rem;
  max-width: 16rem;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--ink-soft);
  line-height: 1.55;
}

.scroll-cue {
  margin-top: 2.75rem;
  background: none;
  border: none;
  cursor: pointer;
  display: grid;
  gap: 0.55rem;
  justify-items: center;
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.scroll-cue i {
  width: 1px;
  height: 2.2rem;
  background: linear-gradient(180deg, var(--gold-bright), transparent);
  position: relative;
  animation: cue-pulse 1.8s ease-in-out infinite;
}

.scroll-cue i::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 6px;
  height: 6px;
  border-right: 1px solid var(--gold-bright);
  border-bottom: 1px solid var(--gold-bright);
  transform: translateX(-50%) rotate(45deg);
}

/* Poster full page */
.poster-page {
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(216, 188, 116, 0.16), transparent 60%),
    linear-gradient(180deg, #f4ecde 0%, #f8f2e7 48%, #efe5d2 100%);
  gap: 1.25rem;
}

.poster-full {
  width: min(100%, 22rem);
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(184, 148, 63, 0.4);
  box-shadow: 0 18px 40px rgba(42, 34, 22, 0.12);
}

.poster-full .poster-slot-title {
  color: var(--gold);
}

.poster-full .poster-slot-hint {
  color: var(--empty);
}

/* Shared content screens */
.couple,
.when,
.where,
.contact,
.timeline,
.rsvp {
  background:
    radial-gradient(ellipse 70% 45% at 50% 0%, rgba(216, 188, 116, 0.16), transparent 60%),
    linear-gradient(180deg, #f4ecde 0%, #f8f2e7 48%, #efe5d2 100%);
}

.invite-line {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
  letter-spacing: 0.12em;
}

.rsvp-points {
  list-style: none;
  width: min(100%, 18rem);
  margin: 0 auto 0.5rem;
  text-align: left;
}

.rsvp-points li {
  position: relative;
  padding: 0.65rem 0 0.65rem 1.2rem;
  border-bottom: 1px solid rgba(184, 148, 63, 0.22);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.rsvp-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1.15rem;
  width: 6px;
  height: 6px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
}

.countdown {
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
  width: min(100%, 20rem);
}

.count-item {
  display: grid;
  gap: 0.3rem;
  padding: 0.7rem 0.2rem;
  border: 1px solid rgba(184, 148, 63, 0.28);
  background: rgba(255, 252, 246, 0.45);
}

.count-item strong {
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.count-item span {
  font-family: "Cinzel", serif;
  font-size: 0.55rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.flow {
  list-style: none;
  width: min(100%, 20rem);
  display: grid;
  gap: 0;
  text-align: left;
}

.flow li {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 0.95rem 0;
  border-bottom: 1px solid rgba(184, 148, 63, 0.22);
}

.flow li:first-child {
  border-top: 1px solid rgba(184, 148, 63, 0.22);
}

.flow-time {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--gold);
}

.flow-title {
  font-size: 1.2rem;
  letter-spacing: 0.12em;
}

.action-row {
  margin-top: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
}

.action-btn {
  appearance: none;
  border: 1px solid rgba(184, 148, 63, 0.55);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.75rem 1.1rem;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.action-btn.solid,
.action-btn:hover {
  background: linear-gradient(120deg, #b8943f, #d4b56a);
  color: #fffaf0;
  border-color: transparent;
}

.action-btn.ghost:hover {
  background: rgba(184, 148, 63, 0.12);
  color: var(--ink);
}

.action-btn.is-empty {
  animation: shake 0.35s ease;
}

.rsvp-form {
  width: min(100%, 20rem);
  display: grid;
  gap: 1rem;
  text-align: left;
}

.rsvp-form label {
  display: grid;
  gap: 0.4rem;
}

.rsvp-form label span {
  font-family: "Cinzel", serif;
  font-size: 0.58rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.rsvp-form input,
.rsvp-form select,
.rsvp-form textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(184, 148, 63, 0.4);
  background: transparent;
  padding: 0.55rem 0.1rem;
  font-family: "Cormorant Garamond", serif;
  font-size: 1.15rem;
  color: var(--ink);
  outline: none;
  border-radius: 0;
}

.rsvp-form textarea {
  resize: vertical;
  min-height: 4rem;
}

.rsvp-form .action-btn {
  margin-top: 0.5rem;
  justify-self: center;
}

.section-label {
  font-family: "Cinzel", serif;
  font-size: 0.64rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.6rem;
}

.display {
  font-weight: 400;
  font-size: clamp(2.6rem, 12vw, 3.4rem);
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  margin-bottom: 2rem;
  color: var(--ink);
}

.names {
  min-width: 12rem;
}

.role {
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.45rem;
}

.name {
  font-size: clamp(2rem, 9vw, 2.6rem);
  font-weight: 500;
  letter-spacing: 0.12em;
}

.ampersand {
  font-family: "Great Vibes", cursive;
  font-size: 2.8rem;
  background: var(--foil);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0.55rem 0 0.7rem;
  animation: foil-shift 6s ease-in-out infinite;
  line-height: 1;
}

.note,
.map-hint {
  margin-top: 1.8rem;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--empty);
}

.info-block {
  width: min(100%, 18rem);
  margin-bottom: 1.15rem;
}

.info-block .key {
  font-family: "Cinzel", serif;
  font-size: 0.6rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.4rem;
}

.info-block .value {
  font-size: 1.55rem;
  letter-spacing: 0.08em;
  line-height: 1.35;
}

.value.address {
  font-size: 1.25rem;
}

.gold-rule {
  width: 3.5rem;
  height: 1px;
  background: var(--foil);
  background-size: 200% 100%;
  margin: 0.35rem auto 1.35rem;
  animation: foil-shift 5s linear infinite;
}

.empty {
  color: var(--empty);
  border-bottom: 1px dashed rgba(184, 148, 63, 0.45);
  display: inline-block;
  min-width: 7rem;
  padding: 0 0.35rem 0.15rem;
}

.closing {
  margin-top: 2.4rem;
}

.script {
  font-family: "Great Vibes", cursive;
  font-size: 2.4rem;
  background: var(--foil);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: foil-shift 6s ease-in-out infinite;
}

.thanks {
  margin-top: 0.55rem;
  font-size: 1.05rem;
  font-style: italic;
  color: var(--ink-soft);
}

.home {
  margin-top: 2.4rem;
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold);
  border-bottom: 1px solid rgba(184, 148, 63, 0.35);
  padding-bottom: 0.2rem;
}

/* Reveal motion */
.reveal {
  opacity: 0;
  transform: translateY(1.1rem);
  transition:
    opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.32s; }
.delay-4 { transition-delay: 0.44s; }

@keyframes foil-shift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes cue-pulse {
  0%, 100% { opacity: 0.35; transform: scaleY(0.85); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
}

@keyframes seal-pulse {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes music-spin {
  to { transform: rotate(360deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

@media (min-width: 768px) {
  body {
    display: grid;
    place-items: center;
    background: #1c1812;
  }

  .scroller {
    width: min(100vw, 430px);
    height: min(100dvh, 860px);
    border-radius: 1.25rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  }

  .grain,
  .seal {
    width: min(100vw, 430px);
    height: min(100dvh, 860px);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 1.25rem;
  }

  .seal {
    inset: auto;
  }

  .back {
    left: calc(50% - min(50vw, 215px) + 1rem);
  }

  .music-btn {
    right: calc(50% - min(50vw, 215px) + 1rem);
  }

  .dots {
    right: calc(50% - min(50vw, 215px) + 0.65rem);
  }
}
