:root {
  --bg: #F8F3E9;
  --ink: #4B3A2E;
  --accent: #5F6B45;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.7s;
  animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Cormorant Garamond', Georgia, serif;
}

a {
  color: inherit;
}

strong {
  font-weight: 700;
  color: var(--ink);
}

.page {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 28px calc(36px + env(safe-area-inset-bottom, 0px));
  text-align: center;
}

.ornament {
  display: flex;
  justify-content: center;
}

.ornament-flip svg {
  transform: scaleX(-1) scaleY(-1);
}

.center {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-title-group {
  display: contents;
}

.hero-title-group.is-personalized {
  display: inline-block;
  text-align: left;
}

.invite-greeting {
  margin: 0 0 22px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--ink);
  opacity: 0.75;
}

.eyebrow {
  margin: 16px 0 22px;
  font-size: 13px;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.62;
}

.names {
  margin: 0;
  font-weight: 500;
  font-size: clamp(3.2rem, 13vw, 4.8rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.amp {
  font-family: 'Great Vibes', cursive;
  font-weight: 400;
  font-size: 1.4em;
  color: var(--accent);
  padding: 0 0.12em;
  display: inline-block;
  transform: translateY(0.08em);
}

.tagline {
  margin: 14px 0 0;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink);
  opacity: 0.62;
}

.divider {
  width: 56px;
  height: 1px;
  background: var(--ink);
  opacity: 0.35;
  margin: 26px auto;
}

.date {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink);
}

.bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--ink);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}

/* ---- Details page (page 2) ---- */

.details-page {
  min-height: 100vh;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 28px 56px;
  text-align: center;
  position: relative;
}

.back-link {
  position: absolute;
  top: 28px;
  left: 28px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  opacity: 0.62;
}

.info-link {
  position: absolute;
  top: 22px;
  right: 28px;
  width: 26px;
  height: 26px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: none;
  color: var(--ink);
  opacity: 0.62;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.info-link:hover,
.info-link:focus-visible {
  opacity: 1;
}

.monogram {
  display: block;
  width: 96px;
  height: auto;
  margin: 48px auto 0;
}

.center .monogram {
  margin: 4px auto 20px;
}

.page-closing {
  margin-top: 72px;
  text-align: center;
}

.closing-monogram {
  width: 60px;
  margin: 0 auto 10px;
}

.closing-sub {
  margin: 0;
  font-size: 0.7rem;
}

.closing-date {
  margin: 8px 0 0;
  font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.7;
}

.closing-sub.is-typing::after {
  content: '|';
  margin-left: 2px;
  animation: closing-caret-blink 0.8s steps(1) infinite;
}

@keyframes closing-caret-blink {
  50% {
    opacity: 0;
  }
}

.page-sub {
  margin: 6px 0 40px;
  font-size: 0.85rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.62;
}

.section-divider {
  width: 40px;
  height: 1px;
  background: var(--ink);
  opacity: 0.25;
  margin: 40px auto;
}

.detail-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.detail-eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
}

.detail-heading {
  margin: 0;
  font-weight: 500;
  font-size: 1.7rem;
  line-height: 1.25;
}

.detail-sub {
  margin: 4px 0 0;
  font-size: 1rem;
  color: var(--ink);
  opacity: 0.7;
}

.detail-note {
  margin: 16px 0 0;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  opacity: 0.85;
  max-width: 360px;
}

.detail-time {
  margin: 14px 0 0;
  font-family: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(75, 58, 46, 0.85);
}

.detail-time strong {
  color: var(--ink);
}

.swatches {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 1px rgba(75, 58, 46, 0.15);
}

.btn-outline {
  display: inline-block;
  margin-top: 22px;
  padding: 12px 26px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: none;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

button.btn-outline {
  cursor: pointer;
}

.btn-outline:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.attire-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}

.attire-links .btn-small {
  margin-top: 0;
  padding: 9px 18px;
  font-size: 0.72rem;
}

.view[hidden] {
  display: none;
}

/* ---- Vinyl audio player ---- */

.vinyl-player {
  position: fixed;
  bottom: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: none;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  background: none;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  z-index: 60;
}

@media (min-width: 480px) {
  .vinyl-player {
    bottom: 24px;
    right: 24px;
    width: 68px;
    height: 68px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  }
}

.vinyl-disc {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, #262019 0px, #262019 3px, #171310 3px, #171310 6px);
  animation: vinyl-spin 3.5s linear infinite;
  animation-play-state: paused;
}

.vinyl-player.is-playing .vinyl-disc {
  animation-play-state: running;
}

.vinyl-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 38%;
  height: 38%;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Great Vibes', cursive;
  font-size: 0.6rem;
  color: var(--accent);
}

@media (min-width: 480px) {
  .vinyl-label {
    font-size: 0.85rem;
  }
}

@keyframes vinyl-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .vinyl-disc {
    animation: none;
  }
}

/* ---- Reminders modal ---- */

.reminders-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248, 243, 233, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.3s ease;
  overscroll-behavior-x: none;
}

.reminders-overlay[hidden] {
  display: none;
}

.reminders-overlay.is-closing {
  opacity: 0;
}

.reminders-card {
  position: relative;
  width: min(460px, 100%);
  background: var(--bg);
  border: 1px solid rgba(75, 58, 46, 0.14);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(75, 58, 46, 0.22);
  padding: 20px 34px 30px;
  overflow: hidden;
  text-align: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--ink);
}

.reminders-monogram {
  width: 76px;
  margin: 0 auto 6px;
}

.reminders-track-wrap {
  overflow: hidden;
  width: 100%;
}

.reminders-track {
  display: flex;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action: pan-y;
}

@media (prefers-reduced-motion: reduce) {
  .reminders-track,
  .reminders-overlay {
    transition: none;
  }
}

.reminder-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  padding: 10px 6px 18px;
}

.reminder-count {
  margin: 0 0 16px;
  font-size: 0.85rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
}

.reminder-title {
  margin: 0 0 16px;
  font-weight: 500;
  font-size: 1.7rem;
}

.reminder-text {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.65;
  color: rgba(75, 58, 46, 0.85);
  max-width: 340px;
}

.reminder-text strong {
  color: var(--ink);
}

.reminder-slide-final .ornament {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.reminder-promise {
  font-style: italic;
  font-size: 1.35rem;
  margin-bottom: 26px;
}

.reminders-footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
}

.reminders-dots {
  display: flex;
  gap: 7px;
}

.reminders-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.25;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.reminders-dots .dot.is-active {
  opacity: 1;
  transform: scale(1.3);
}

.reminders-next-btn,
.reminders-prev-btn {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(75, 58, 46, 0.3);
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
  padding: 0;
}

.reminders-next-btn {
  right: 0;
}

.reminders-prev-btn {
  left: 0;
}

.reminders-next-btn[hidden],
.reminders-prev-btn[hidden] {
  display: none;
}

/* ---- RSVP modal ---- */

.rsvp-alt-contact {
  display: block;
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--ink);
  opacity: 0.6;
  text-decoration: none;
}

.rsvp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248, 243, 233, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.rsvp-overlay[hidden] {
  display: none;
}

.rsvp-overlay.is-closing {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .rsvp-overlay {
    transition: none;
  }
}

.rsvp-card {
  position: relative;
  width: min(400px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid rgba(75, 58, 46, 0.14);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(75, 58, 46, 0.22);
  padding: 40px 30px 32px;
  text-align: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
  color: var(--ink);
}

.rsvp-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--ink);
  opacity: 0.6;
  cursor: pointer;
  padding: 4px;
}

.rsvp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  margin-bottom: 20px;
}

.rsvp-label {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.65;
}

.rsvp-label em {
  font-style: italic;
  opacity: 0.8;
}

.rsvp-field input,
.rsvp-field select,
.rsvp-field textarea {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.1rem;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(75, 58, 46, 0.3);
  padding: 8px 2px;
  outline: none;
  border-radius: 0;
}

.rsvp-field input:focus,
.rsvp-field select:focus,
.rsvp-field textarea:focus {
  border-bottom-color: var(--ink);
}

.rsvp-field textarea {
  resize: none;
  overflow: hidden;
  line-height: 1.4;
}

.rsvp-submit {
  width: 100%;
  margin-top: 6px;
  cursor: pointer;
}

.rsvp-success {
  padding: 10px 0;
}

/* ---- Photo gallery ---- */

.gallery {
  width: 100%;
  margin-top: 32px;
  column-count: 2;
  column-gap: 8px;
}

.gallery img {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  border-radius: 8px;
  break-inside: avoid;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.gallery img:hover {
  opacity: 0.85;
}

.gallery img:nth-child(3n) {
  aspect-ratio: 3 / 4;
  object-fit: cover;
  height: 100%;
}

.gallery img:nth-child(5n + 2) {
  aspect-ratio: 1 / 1;
  object-fit: cover;
  height: 100%;
}

@media (min-width: 640px) {
  .gallery {
    column-count: 3;
  }
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30, 22, 16, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 110;
  opacity: 1;
  transition: opacity 0.25s ease;
  touch-action: pan-y;
  overscroll-behavior-x: none;
}

.lightbox-overlay[hidden] {
  display: none;
}

.lightbox-overlay.is-closing {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .lightbox-overlay {
    transition: none;
  }
}

.lightbox-image {
  max-width: min(90vw, 640px);
  max-height: 80vh;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 22px;
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: #F8F3E9;
  opacity: 0.85;
  cursor: pointer;
  padding: 6px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(248, 243, 233, 0.4);
  background: rgba(248, 243, 233, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox-prev {
  left: 14px;
}

.lightbox-next {
  right: 14px;
}

.details-page .ornament {
  margin: 40px 0 0;
}

.ornament-end-gap {
  margin-bottom: 32px;
}
