:root {
  --bg: #0d0907;
  --panel: rgba(31, 23, 18, .72);
  --panel-soft: rgba(255, 250, 242, .075);
  --gold: #c7a35c;
  --gold-soft: rgba(199, 163, 92, .45);
  --ivory: #fff7ea;
  --muted: rgba(255, 247, 234, .72);
  --line: rgba(199, 163, 92, .28);
  --shadow: 0 24px 70px rgba(0, 0, 0, .38);
  color-scheme: dark;
  font-family: "Montserrat", "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 50% 0%, rgba(199, 163, 92, .14), transparent 36rem),
    linear-gradient(180deg, #160f0b, #0d0907 52%, #100b08);
  color: var(--ivory);
}

body.is-locked {
  overflow: hidden;
}

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

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.invitation-shell {
  min-height: 100vh;
  overflow-x: hidden;
}

.loading-view {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: .75rem;
  text-align: center;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.loading-view span {
  color: var(--gold);
  font-weight: 800;
}

.loading-view p {
  margin: 0;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: none;
}

.welcome,
.video-gate {
  min-height: 100svh;
  position: relative;
  display: grid;
  place-items: end start;
  padding: clamp(2rem, 6vw, 4.75rem);
  isolation: isolate;
  overflow: hidden;
}

.welcome::before,
.video-gate::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--cover-image);
  background-size: cover;
  background-position: center;
  z-index: -3;
}

.welcome::before {
  background-image: url("../../media/cover.png");
  filter: saturate(1.04) contrast(1.04);
  transform: scale(1.01);
}

.welcome::after,
.video-gate::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(13, 9, 7, .08), rgba(13, 9, 7, .82)),
    linear-gradient(90deg, rgba(13, 9, 7, .78), rgba(13, 9, 7, .18) 58%, rgba(13, 9, 7, .52));
  z-index: -2;
}

.welcome::after {
  background:
    linear-gradient(180deg, rgba(13, 9, 7, .04), rgba(13, 9, 7, .68)),
    linear-gradient(90deg, rgba(13, 9, 7, .62), rgba(13, 9, 7, .12) 58%, rgba(13, 9, 7, .38));
}

.welcome__content {
  width: min(35rem, 100%);
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
  animation: fadeUp .8s ease both;
}

.eyebrow {
  display: block;
  margin-bottom: 1rem;
  color: var(--gold);
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .28em;
  text-transform: uppercase;
}

.welcome h1,
.cover-title,
.section-title,
.final-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: 0;
}

.welcome h1 {
  max-width: 11ch;
  font-size: clamp(3.1rem, 9vw, 6.4rem);
  line-height: .88;
  text-shadow: 0 8px 28px rgba(0, 0, 0, .48);
}

.welcome p {
  margin: 1rem 0 1.65rem;
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.16rem);
  line-height: 1.65;
}

.primary-button,
.ghost-button,
.link-button,
.gallery-button,
.music-toggle {
  border: 1px solid var(--gold);
  background: rgba(255, 247, 234, .08);
  color: var(--ivory);
  text-decoration: none;
  transition: transform .22s ease, background .22s ease, border-color .22s ease;
}

.primary-button,
.ghost-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: .85rem 1.25rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.primary-button:hover,
.ghost-button:hover,
.link-button:hover,
.gallery-button:hover,
.music-toggle:hover {
  transform: translateY(-2px);
  background: rgba(199, 163, 92, .22);
}

.video-gate {
  display: none;
  place-items: center;
  padding: 0;
  background: #050403;
}

.video-gate.is-active {
  display: grid;
}

.video-gate__media {
  width: min(100vw, 34rem);
  height: 100svh;
  max-height: 100svh;
  object-fit: contain;
  background: #050403;
  animation: cinematicOpen 2.8s ease both;
}

.video-gate__controls {
  position: absolute;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  z-index: 2;
  display: flex;
  gap: .75rem;
  transform: translateX(-50%);
  width: min(92%, 26rem);
  justify-content: center;
}

.ghost-button {
  backdrop-filter: blur(16px);
  background: rgba(13, 9, 7, .45);
}

.content {
  display: none;
}

.content.is-active {
  display: block;
}

.cover {
  min-height: 100svh;
  position: relative;
  display: grid;
  place-items: stretch;
  background: #090605;
}

.cover img {
  width: 100%;
  min-height: 100svh;
  object-fit: cover;
  object-position: center;
  opacity: .92;
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--gold-soft);
  margin: clamp(1rem, 2.5vw, 1.85rem);
  pointer-events: none;
}

.cover__overlay {
  position: absolute;
  inset: auto 0 0;
  padding: clamp(2rem, 6vw, 5rem);
  background: linear-gradient(180deg, transparent, rgba(13, 9, 7, .86));
}

.cover-title {
  max-width: 12ch;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: .88;
}

.cover-date {
  margin: 1rem 0 .35rem;
  color: var(--ivory);
  font-size: clamp(.86rem, 2vw, 1rem);
  font-weight: 800;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.cover-place {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  font-style: italic;
}

.sections {
  width: min(60rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 5rem) 0;
}

.invite-section {
  position: relative;
  margin: 0 0 clamp(1.25rem, 3vw, 2rem);
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background:
    linear-gradient(145deg, rgba(255, 247, 234, .08), rgba(255, 247, 234, .025)),
    rgba(16, 11, 8, .72);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.invite-section::before {
  content: "";
  display: block;
  width: 7rem;
  height: 1px;
  margin: 0 auto 1.15rem;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.section-title {
  color: var(--gold);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  text-align: center;
}

.message {
  max-width: 42rem;
  margin: 1.25rem auto 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  line-height: 1.45;
  text-align: center;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-top: 1.35rem;
}

.time-card {
  min-width: 0;
  padding: 1rem .55rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel-soft);
  text-align: center;
}

.time-card b {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.75rem, 5vw, 3rem);
  font-weight: 600;
}

.time-card span {
  color: var(--gold);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.location-grid,
.dress-grid,
.link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.35rem;
}

.info-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--panel-soft);
}

.info-card strong {
  display: block;
  margin-bottom: .45rem;
  color: var(--ivory);
}

.info-card p,
.info-card span {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: .9rem;
}

.link-button {
  min-height: 2.55rem;
  padding: .68rem 1rem;
  font-size: .72rem;
}

.calendar-block {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: center;
}

.date-emblem {
  width: 5.4rem;
  min-height: 5.4rem;
  display: grid;
  place-items: center;
  border-left: 1px solid var(--gold-soft);
  border-right: 1px solid var(--gold-soft);
  color: var(--gold);
  text-align: center;
}

.date-emblem b {
  display: block;
  color: var(--ivory);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.gallery-shell {
  margin-top: 1.35rem;
}

.gallery-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  min-height: 24rem;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: #090605;
  overflow: hidden;
}

.gallery-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: scale(.985);
  transition: opacity .5s ease, transform .5s ease;
}

.gallery-frame img.is-active {
  opacity: 1;
  transform: scale(1);
}

.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.gallery-button {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgba(255, 247, 234, .08);
}

.gallery-count {
  color: var(--gold);
  font-weight: 800;
  letter-spacing: .16em;
}

.dress-grid img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 1rem;
}

.rsvp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  justify-content: center;
  margin-top: 1.35rem;
}

.signature {
  padding: 3rem 1rem 6rem;
  color: var(--muted);
  text-align: center;
}

.signature strong {
  color: var(--gold);
}

.music-toggle {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 20;
  display: none;
  align-items: center;
  gap: .55rem;
  min-height: 2.75rem;
  padding: .65rem .9rem;
  border-radius: 999px;
  backdrop-filter: blur(16px);
  background: rgba(13, 9, 7, .7);
  font-size: .78rem;
  font-weight: 800;
}

.music-toggle.is-visible {
  display: inline-flex;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: 1rem;
  background: rgba(5, 4, 3, .92);
}

.lightbox.is-active {
  display: grid;
}

.lightbox img {
  max-width: 100%;
  max-height: 90svh;
  object-fit: contain;
}

.lightbox button {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

@keyframes cinematicOpen {
  0% { opacity: 0; clip-path: circle(6% at 50% 50%); transform: scale(.985); }
  100% { opacity: 1; clip-path: circle(78% at 50% 50%); transform: scale(1); }
}

@media (min-width: 900px) {
  .cover {
    min-height: 78vh;
  }

  .cover img {
    min-height: 78vh;
  }

  .cover__overlay {
    width: 56%;
    inset: 0 auto 0 0;
    display: grid;
    align-content: center;
    background: linear-gradient(90deg, rgba(13, 9, 7, .88), rgba(13, 9, 7, .3), transparent);
  }

  .cover-title {
    font-size: clamp(4rem, 7vw, 8rem);
  }
}

@media (max-width: 760px) {
  .welcome,
  .cover__overlay {
    padding: 2rem 1.35rem calc(2rem + env(safe-area-inset-bottom));
  }

  .welcome h1,
  .cover-title {
    font-size: clamp(2.8rem, 14vw, 4.6rem);
  }

  .video-gate__controls {
    flex-direction: column;
  }

  .countdown {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .location-grid,
  .dress-grid,
  .link-grid,
  .calendar-block {
    grid-template-columns: 1fr;
  }

  .gallery-frame {
    min-height: 21rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
