:root {
  --page-bg: #02060d;
  --navy-deep: #071c43;
  --navy-card: rgba(5, 16, 39, 0.2);
  --navy-card-border: rgba(201, 166, 92, 0.16);
  --shadow-soft: 0 24px 80px rgba(0, 0, 0, 0.42);
  --text-gold: #dcb55b;
  --content-width: min(78vw, 680px);
  --viewport-height: 100vh;
  --card-height: var(--viewport-height);
  --card-padding: 0;
  --header-width: 100%;
  --details-width: 100%;
  --carousel-duration: 30s;
  --motion-duration: 30s;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  height: -webkit-fill-available;
}

body {
  min-height: var(--viewport-height);
  margin: 0;
  overflow: hidden;
  background: var(--page-bg);
  color: #fff;
  font-family: "Georgia", "Times New Roman", serif;
  min-height: -webkit-fill-available;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  position: relative;
  min-height: var(--viewport-height);
  overflow: clip;
  isolation: isolate;
  background:
    radial-gradient(circle at top, rgba(31, 58, 113, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(2, 6, 13, 0.28), rgba(2, 6, 13, 0.5));
}

.background-carousel {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: linear-gradient(180deg, #06122f, #030811);
}

.background-carousel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(14, 28, 71, 0.38), rgba(2, 4, 10, 0.56)),
    radial-gradient(circle at center, rgba(7, 28, 67, 0.08), rgba(2, 6, 13, 0.4));
}

.carousel-slide {
  position: absolute;
  inset: -12% 0;
  opacity: 0;
  animation: reel-fade var(--carousel-duration) linear infinite;
  will-change: opacity;
  overflow: hidden;
}

.carousel-slide:nth-child(1) {
  animation-delay: 0s;
}

.carousel-slide:nth-child(2) {
  animation-delay: 10s;
}

.carousel-slide:nth-child(3) {
  animation-delay: 20s;
}

.slide-image {
  position: absolute;
  inset: 0;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  transform: scale(1.08) translate3d(0, -6%, 0);
  animation: reel-drift var(--motion-duration) ease-in-out infinite alternate;
  will-change: transform;
}

.slide-one .slide-image {
  /* Uses ./1.jpg now. If you move assets into /images later, update this path. */
  background-image: url("./1.jpg");
}

.slide-two .slide-image {
  /* Uses ./2.jpg now. If you move assets into /images later, update this path. */
  background-image: url("./2.jpg");
}

.slide-three .slide-image {
  /* Uses ./3.jpg now. If you move assets into /images later, update this path. */
  background-image: url("./3.jpg");
}

.slide-two .slide-image {
  animation-duration: 22s;
}

.slide-three .slide-image {
  animation-duration: 24s;
}

.invitation-stage {
  min-height: var(--viewport-height);
  display: grid;
  place-items: center;
  padding:
    max(1rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
}

.invitation-card {
  width: var(--content-width);
  height: var(--card-height);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--card-padding);
}

.invitation-content {
  width: 100%;
  height: 100%;
  display: grid;
  justify-items: center;
  align-content: start;
  justify-content: center;
  gap: 0;
  padding-block: clamp(1.25rem, 4vh, 2rem);
}

.header-art {
  width: var(--header-width);
  height: auto;
  max-width: 100%;
  max-height: min(38vh, 24rem);
  object-fit: contain;
}

.details-art {
  width: var(--details-width);
  height: auto;
  max-width: 100%;
  max-height: min(50vh, 34rem);
  object-fit: contain;
}

.footer-note {
  margin: 0.35rem 0 0;
  color: var(--text-gold);
  font-size: clamp(0.7rem, 1.1vw, 0.95rem);
  font-style: italic;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  text-align: center;
  transform: translateX(5%);
}

@keyframes reel-fade {
  0% {
    opacity: 0;
  }

  8% {
    opacity: 1;
  }

  25% {
    opacity: 1;
  }

  33.333% {
    opacity: 0;
  }

  100% {
    opacity: 0;
  }
}

@keyframes reel-drift {
  from {
    transform: scale(1.08) translate3d(0, -6%, 0);
  }

  to {
    transform: scale(1.08) translate3d(0, 6%, 0);
  }
}

@media (max-width: 900px) {
  :root {
    --content-width: min(88vw, 38rem);
  }

  .invitation-card {
    min-height: var(--viewport-height);
  }

  .header-art {
    width: 100%;
    max-height: min(34vh, 21rem);
  }

  .details-art {
    width: 100%;
    max-height: min(48vh, 30rem);
  }

  .footer-note {
    font-size: clamp(0.68rem, 1.4vw, 0.85rem);
  }
}

@media (max-width: 640px) {
  :root {
    --content-width: min(92vw, 32rem);
    --card-padding: clamp(1.25rem, 6vw, 2rem);
  }

  .invitation-stage {
    padding:
      max(0.75rem, env(safe-area-inset-top))
      max(0.75rem, env(safe-area-inset-right))
      max(1rem, env(safe-area-inset-bottom))
      max(0.75rem, env(safe-area-inset-left));
  }

  .invitation-card {
    min-height: var(--viewport-height);
  }

  .invitation-content {
    gap: 0;
    padding-block: clamp(0.85rem, 3.5vh, 1.5rem);
  }

  .header-art,
  .details-art {
    width: 100%;
  }

  .header-art {
    max-height: 26vh;
  }

  .details-art {
    width: min(110%, 30rem);
    max-width: 110%;
    max-height: 52vh;
  }

  .footer-note {
    font-size: 0.68rem;
    letter-spacing: 0.18em;
  }
}

@media (max-height: 760px) {
  .header-art {
    max-height: 29vh;
  }

  .details-art {
    max-height: 43vh;
  }

  .footer-note {
    font-size: 0.64rem;
  }
}

@media (max-width: 640px) and (max-height: 760px) {
  .header-art {
    max-height: 22vh;
  }

  .details-art {
    width: min(108%, 28rem);
    max-width: 108%;
    max-height: 49vh;
  }
}

@supports (height: 100svh) {
  :root {
    --viewport-height: 100svh;
  }
}

@supports (height: 100dvh) {
  :root {
    --viewport-height: 100dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .carousel-slide,
  .slide-image {
    animation: none;
  }

  .carousel-slide {
    opacity: 0;
  }

  .carousel-slide:first-child {
    opacity: 1;
  }
}
