:root {
  --bg: #f2f1ec;
  --ink: #141414;
  --muted: rgba(20, 20, 20, 0.5);
  --faint: rgba(20, 20, 20, 0.28);
  --line: rgba(20, 20, 20, 0.12);
  --accent: #3d4a42;
  --plane: #e4e2da;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Syne", sans-serif;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden;
}

.wash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 55% at 80% -10%, rgba(61, 74, 66, 0.1), transparent 55%),
    radial-gradient(ellipse 70% 50% at 0% 100%, rgba(180, 170, 150, 0.18), transparent 50%),
    linear-gradient(165deg, #f5f4ef 0%, #ebeae3 45%, #e7e5de 100%);
}

.back {
  position: fixed;
  top: max(0.9rem, env(safe-area-inset-top));
  left: 1rem;
  z-index: 50;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.3s ease;
}

.back:hover {
  color: var(--ink);
}

.seal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 80% 50% at 50% 30%, rgba(61, 74, 66, 0.35), transparent 55%),
    linear-gradient(165deg, #1c1f1d 0%, #111 100%);
  transition: opacity 0.65s ease, visibility 0.65s ease;
}

.seal.is-opening { opacity: 0; }
.seal.is-gone {
  visibility: hidden;
  pointer-events: none;
}

.seal-open {
  appearance: none;
  border: 1px solid rgba(242, 241, 236, 0.28);
  background: transparent;
  color: #f2f1ec;
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  padding: 1.4rem 1.8rem;
}

.seal-text {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.seal-sub {
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: rgba(242, 241, 236, 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: 1px solid var(--line);
  background: rgba(242, 241, 236, 0.82);
  backdrop-filter: blur(8px);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.music-icon {
  width: 10px;
  height: 10px;
  border-left: 2px solid var(--ink);
  border-right: 2px solid var(--ink);
  opacity: 0.55;
}

.music-btn.is-on .music-icon {
  opacity: 1;
  animation: music-bar 0.8s ease-in-out 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: 5px;
  height: 5px;
  border: 0;
  padding: 0;
  background: rgba(20, 20, 20, 0.2);
  cursor: pointer;
  transition: height 0.25s ease, background 0.25s ease;
}

.dot.is-active {
  height: 14px;
  background: var(--ink);
}

.scroller {
  position: relative;
  z-index: 1;
  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;
  padding: 4.5rem 1.5rem 3.5rem;
  overflow: hidden;
}

/* Cover — full-bleed poster */
.cover {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
  background: #1a1a1a;
}

.poster {
  position: relative;
  margin: 0;
  overflow: hidden;
  background:
    linear-gradient(145deg, #3d4540 0%, #2a302c 45%, #1c1f1d 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.45rem;
  text-align: center;
  pointer-events: none;
}

.poster-slot-title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(242, 241, 236, 0.72);
}

.poster-slot-hint {
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: rgba(242, 241, 236, 0.38);
}

.poster-hero {
  position: absolute;
  inset: 0;
}

.cover-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(20, 20, 20, 0.08) 0%,
    rgba(20, 20, 20, 0.15) 40%,
    rgba(20, 20, 20, 0.78) 78%,
    rgba(20, 20, 20, 0.92) 100%
  );
  pointer-events: none;
}

.cover-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  min-height: 100dvh;
  padding: 4.5rem 1.5rem 3.2rem;
  color: #f2f1ec;
}

.cover-content .eyebrow {
  color: rgba(242, 241, 236, 0.7);
}

.cover-content .lede {
  color: rgba(242, 241, 236, 0.62);
}

.cover-content .scroll-cue {
  color: #f2f1ec;
}

.cover-content .scroll-cue i {
  background: #f2f1ec;
}

.cover-content .scroll-cue i::after {
  border-color: #f2f1ec;
}

.cover-plane {
  display: none;
}

.eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.brand {
  font-size: clamp(4.5rem, 24vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 0.9;
  max-width: 8ch;
}

.lede {
  margin-top: 1.25rem;
  max-width: 14rem;
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.15rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.5;
  color: var(--muted);
}

.scroll-cue {
  margin-top: auto;
  padding-top: 3rem;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: "Syne", sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
}

.scroll-cue i {
  width: 2.5rem;
  height: 1px;
  background: var(--ink);
  position: relative;
  animation: line-grow 2s ease-in-out infinite;
}

.scroll-cue i::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  transform: translateY(-60%) rotate(-45deg);
}

.poster-page {
  gap: 1.25rem;
}

.poster-full {
  width: min(100%, 22rem);
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
}

.poster-full .poster-slot-title {
  color: var(--muted);
}

.poster-full .poster-slot-hint {
  color: var(--faint);
}

/* Content screens */
.section-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 1.75rem;
}

.display {
  font-size: clamp(2.8rem, 14vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1;
  margin-bottom: 2rem;
}

.pair {
  display: grid;
  gap: 1.5rem;
  width: 100%;
  max-width: 22rem;
}

.pair .role {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.pair .name {
  font-size: clamp(2rem, 10vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.divider {
  width: 100%;
  height: 1px;
  background: var(--line);
  transform-origin: left center;
}

.screen.couple.in-view .divider {
  animation: draw-line 1s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

.invite-line {
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.rsvp-points {
  list-style: none;
  width: min(100%, 22rem);
  margin-bottom: 0.5rem;
}

.rsvp-points li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.countdown {
  margin-top: 2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  width: min(100%, 22rem);
}

.count-item {
  display: grid;
  gap: 0.35rem;
  padding: 0.85rem 0.2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.count-item strong {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.count-item span {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.flow {
  list-style: none;
  width: min(100%, 22rem);
  display: grid;
}

.flow li {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: 1.1rem;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.flow-time {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.flow-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.action-row {
  margin-top: 1.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.action-btn {
  appearance: none;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #f2f1ec;
  text-decoration: none;
  font-family: "Syne", sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.8rem 1.05rem;
  cursor: pointer;
}

.action-btn.ghost {
  background: transparent;
  color: var(--ink);
}

.action-btn.is-empty {
  animation: shake 0.35s ease;
}

.rsvp-form {
  width: min(100%, 22rem);
  display: grid;
  gap: 1.1rem;
}

.rsvp-form label {
  display: grid;
  gap: 0.4rem;
}

.rsvp-form label span {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.rsvp-form input,
.rsvp-form select,
.rsvp-form textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 0.55rem 0;
  font-family: "Syne", sans-serif;
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  border-radius: 0;
}

.rsvp-form textarea {
  resize: vertical;
  min-height: 4rem;
  font-family: "Newsreader", Georgia, serif;
}

.rsvp-form .action-btn {
  justify-self: start;
  margin-top: 0.35rem;
}

.note,
.map-hint {
  margin-top: 2rem;
  font-family: "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--faint);
}

.meta {
  display: grid;
  gap: 1.75rem;
  width: 100%;
  max-width: 22rem;
}

.meta dt {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.meta dd {
  font-size: clamp(1.35rem, 6vw, 1.7rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.empty {
  color: var(--faint);
  border-bottom: 1px solid var(--line);
  display: inline-block;
  min-width: 6.5rem;
  padding-bottom: 0.2rem;
}

.thanks {
  margin-top: 2.5rem;
  max-width: 14rem;
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--muted);
}

.home {
  margin-top: 2.5rem;
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent);
  border-bottom: 1px solid rgba(61, 74, 66, 0.35);
  padding-bottom: 0.2rem;
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-1 { transition-delay: 0.08s; }
.delay-2 { transition-delay: 0.18s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.42s; }

@keyframes plane-drift {
  from { transform: scale(1) translateY(0); }
  to { transform: scale(1.04) translateY(-1.5%); }
}

@keyframes line-grow {
  0%, 100% { transform: scaleX(0.55); opacity: 0.5; }
  50% { transform: scaleX(1); opacity: 1; }
}

@keyframes draw-line {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes music-bar {
  0%, 100% { transform: scaleY(0.7); }
  50% { transform: scaleY(1.15); }
}

@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: #1a1a1a;
  }

  .wash,
  .seal {
    width: min(100vw, 430px);
    height: min(100dvh, 860px);
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 1.25rem;
  }

  .seal {
    inset: auto;
  }

  .scroller {
    width: min(100vw, 430px);
    height: min(100dvh, 860px);
    border-radius: 1.25rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    background: var(--bg);
  }

  .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);
  }
}
