/* ==================================================
   RESET
================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;

  background: #ffffff;

  color: #4b382b;

  font-family: "Montserrat", sans-serif;

  overflow: hidden;
}

button,
a {
  font: inherit;
}

/* ==================================================
     VARIABLES
  ================================================== */

:root {
  --brown-dark: #3f2c1f;
  --brown: #523a29;
  --brown-light: #6d503a;

  --paper: #fdfbf7;
  --paper-dark: #f3eee7;

  --gold: #9b7b4f;
  --gold-light: #c3a878;

  --text: #49382c;
}

/* ==================================================
     OPENING SCREEN
  ================================================== */

.opening-screen {
  position: fixed;

  inset: 0;

  z-index: 100;

  display: flex;

  justify-content: center;

  align-items: center;

  background: #ffffff;

  transition: opacity 1s ease, visibility 1s ease;
}

.opening-screen.is-hidden {
  opacity: 0;

  visibility: hidden;

  pointer-events: none;
}

.opening-content {
  width: min(700px, 90vw);

  display: flex;

  flex-direction: column;

  align-items: center;

  text-align: center;
}

/* ==================================================
     OPENING TYPOGRAPHY
  ================================================== */

.intro-label {
  margin-bottom: 24px;

  color: #6b5848;

  font-family: "Cormorant Garamond", serif;

  font-size: 16px;

  font-weight: 400;

  letter-spacing: 1.8px;
}

.couple-name {
  margin-bottom: 38px;

  color: #3f3024;

  font-family: "Great Vibes", cursive;

  font-size: clamp(58px, 8vw, 88px);

  font-weight: 400;

  line-height: 0.95;
}

.couple-name span {
  margin: 0 10px;

  font-family: "Cormorant Garamond", serif;

  font-size: 0.65em;

  font-style: italic;
}

/* ==================================================
     ENVELOPE
  ================================================== */

.envelope-wrapper {
  position: relative;

  width: min(430px, 80vw);

  aspect-ratio: 1.48 / 1;

  cursor: pointer;

  perspective: 1600px;

  outline: none;
}

.envelope {
  position: absolute;

  inset: 0;

  transform-style: preserve-3d;

  transition: transform 0.5s ease;
}

.envelope-wrapper:hover .envelope {
  transform: translateY(-5px);
}

/* ==================================================
     ENVELOPE BACK
  ================================================== */

.envelope-back {
  position: absolute;

  inset: 0;

  z-index: 1;

  border-radius: 3px;

  background: linear-gradient(135deg, #604532, #4a3323 50%, #3c291d);

  box-shadow: 0 24px 50px rgba(48, 31, 20, 0.25);
}

/* Subtle paper texture */

.envelope-back::after {
  content: "";

  position: absolute;

  inset: 0;

  opacity: 0.12;

  background-image: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.1) 0,
    rgba(255, 255, 255, 0.1) 1px,
    transparent 1px,
    transparent 4px
  );
}

/* ==================================================
     CARD INSIDE ENVELOPE
  ================================================== */

.inside-card {
  position: absolute;

  left: 8%;

  top: 7%;

  width: 84%;

  height: 88%;

  z-index: 2;

  padding: 12px;

  background: #f8f5ef;

  transition: transform 1.25s cubic-bezier(0.22, 0.61, 0.36, 1);

  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
}

.inside-card-border {
  width: 100%;

  height: 100%;

  border: 1px solid rgba(155, 123, 79, 0.55);

  display: flex;

  flex-direction: column;

  justify-content: center;

  align-items: center;

  gap: 8px;

  color: var(--brown-dark);

  font-family: "Cormorant Garamond", serif;
}

.inside-card-border span {
  font-family: "Great Vibes", cursive;

  font-size: 35px;
}

.inside-card-border small {
  font-size: 7px;

  letter-spacing: 2px;
}

/* ==================================================
     ENVELOPE FRONT
  ================================================== */

.envelope-front {
  position: absolute;

  inset: auto 0 0;

  height: 65%;

  z-index: 5;

  background: linear-gradient(150deg, #604532, #493223);

  clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%);
}

/* ==================================================
     ENVELOPE FLAP
  ================================================== */

.envelope-flap {
  position: absolute;

  inset: 0 0 auto;

  width: 100%;

  height: 65%;

  z-index: 6;

  background: linear-gradient(145deg, #69503b, #4a3323);

  clip-path: polygon(0 0, 100% 0, 50% 78%);

  transform-origin: top center;

  transition: transform 1.05s cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ==================================================
     WAX SEAL
  ================================================== */

.wax-seal {
  position: absolute;

  left: 50%;

  top: 53%;

  z-index: 10;

  width: 72px;

  height: 72px;

  transform: translate(-50%, -50%);

  border-radius: 50%;

  background: radial-gradient(circle at 35% 30%, #c6aa79, #8d6d42 60%, #6f532f);

  color: #f6ead3;

  display: flex;

  align-items: center;

  justify-content: center;

  gap: 2px;

  border: 2px solid rgba(240, 220, 180, 0.7);

  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.25);

  font-family: "Cormorant Garamond", serif;

  transition: opacity 0.45s ease, transform 0.5s ease;
}

.wax-seal span {
  font-size: 18px;
}

.wax-seal i {
  font-size: 13px;

  font-style: normal;
}

/* ==================================================
     OPEN ENVELOPE ANIMATION
  ================================================== */

.envelope-wrapper.is-open .envelope-flap {
  transform: rotateX(180deg);

  z-index: 1;
}

.envelope-wrapper.is-open .inside-card {
  transform: translateY(-78%);

  z-index: 8;
}

.envelope-wrapper.is-open .wax-seal {
  opacity: 0;

  transform: translate(-50%, -50%) scale(0.7);
}

/* ==================================================
     TAP TEXT
  ================================================== */

.tap-text {
  margin-top: 32px;

  color: #6d5948;

  font-family: "Cormorant Garamond", serif;

  font-size: 15px;

  letter-spacing: 2px;

  animation: gentlePulse 2.5s ease-in-out infinite;
}

@keyframes gentlePulse {
  0%,
  100% {
    opacity: 0.45;
  }

  50% {
    opacity: 1;
  }
}

/* ==================================================
     INVITATION SCREEN
  ================================================== */

.invitation-screen {
  position: fixed;

  inset: 0;

  z-index: 50;

  display: flex;

  justify-content: center;

  align-items: flex-start;

  padding: 45px 20px;

  overflow-y: auto;

  background: #ffffff;

  opacity: 0;

  visibility: hidden;

  transform: translateY(40px);

  transition: opacity 1.2s ease,
    transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 1.2s ease;
}

.invitation-screen.is-visible {
  opacity: 1;

  visibility: visible;

  transform: translateY(0);
}

/* ==================================================
     INVITATION PAPER
  ================================================== */

.invitation-paper {
  position: relative;

  width: min(470px, 100%);

  min-height: 850px;

  padding: 58px 46px;

  background: linear-gradient(180deg, #fffefa, #f8f4ed);

  box-shadow: 0 20px 70px rgba(50, 35, 25, 0.13);

  border: 1px solid rgba(130, 105, 75, 0.12);
}

.paper-top-line {
  position: absolute;

  top: 22px;

  left: 50%;

  width: 65px;

  height: 1px;

  transform: translateX(-50%);

  background: var(--brown-dark);
}

/* ==================================================
     PAPER HEADER
  ================================================== */

.paper-header {
  text-align: center;
}

.paper-eyebrow {
  margin-bottom: 20px;

  font-size: 8px;

  letter-spacing: 2.6px;

  color: #756453;
}

.paper-script {
  color: #49392c;

  font-family: "Great Vibes", cursive;

  font-size: 62px;

  font-weight: 400;

  line-height: 0.85;
}

.paper-script span {
  display: block;

  margin: 5px 0;

  font-family: "Cormorant Garamond", serif;

  font-size: 30px;

  font-style: italic;
}

.paper-description {
  margin-top: 24px;

  color: #766656;

  font-family: "Cormorant Garamond", serif;

  font-size: 12px;

  letter-spacing: 0.9px;

  line-height: 1.8;
}

/* ==================================================
     VISUAL COLLAGE
  ================================================== */

.visual-collage {
  position: relative;

  height: 265px;

  margin: 35px auto 20px;

  max-width: 330px;
}

/* Main photo */

.photo-main {
  position: absolute;

  left: 50%;

  top: 15px;

  width: 155px;

  height: 195px;

  transform: translateX(-50%) rotate(-4deg);

  z-index: 3;

  padding: 8px;

  background: #fff;

  box-shadow: 0 7px 18px rgba(50, 35, 25, 0.16);
}

/* Small photos */

.photo-small {
  position: absolute;

  width: 82px;

  height: 100px;

  padding: 5px;

  background: #fff;

  box-shadow: 0 5px 15px rgba(50, 35, 25, 0.13);
}

.photo-one {
  left: 8px;

  top: 50px;

  transform: rotate(-8deg);
}

.photo-two {
  right: 8px;

  top: 70px;

  transform: rotate(8deg);
}

/* Photo placeholder */

.photo-placeholder {
  width: 100%;

  height: 100%;

  display: flex;

  justify-content: center;

  align-items: center;

  background: linear-gradient(145deg, #8a7564, #c8b7a5 50%, #655344);

  color: rgba(255, 255, 255, 0.75);

  font-size: 8px;

  letter-spacing: 2px;
}

/* ==================================================
     GOLD STAMP
  ================================================== */

.gold-stamp {
  position: absolute;

  left: 2px;

  bottom: 5px;

  width: 75px;

  height: 75px;

  border: 1px solid var(--gold);

  border-radius: 50%;

  display: flex;

  flex-direction: column;

  align-items: center;

  justify-content: center;

  color: var(--gold);

  font-family: "Cormorant Garamond", serif;

  font-size: 13px;

  line-height: 0.85;

  transform: rotate(-12deg);

  z-index: 5;
}

/* Number */

.decorative-number {
  position: absolute;

  right: 15px;

  bottom: 15px;

  color: #a48760;

  font-family: "Cormorant Garamond", serif;

  font-size: 40px;

  font-weight: 300;

  z-index: 5;
}

/* ==================================================
     DATE
  ================================================== */

.date-section {
  padding: 25px 0;

  text-align: center;

  border-top: 1px solid rgba(100, 75, 50, 0.18);

  border-bottom: 1px solid rgba(100, 75, 50, 0.18);
}

.section-label {
  color: #8b755f;

  font-size: 8px;

  letter-spacing: 3px;
}

.date {
  display: flex;

  align-items: center;

  justify-content: center;

  gap: 15px;

  margin-top: 12px;

  color: #4b392c;

  font-family: "Cormorant Garamond", serif;
}

.date strong {
  font-size: 54px;

  line-height: 0.8;

  font-weight: 400;
}

.date-month,
.date-year {
  font-size: 12px;

  letter-spacing: 1px;
}

.date-note {
  margin-top: 10px;

  color: #8b755f;

  font-size: 8px;

  letter-spacing: 3px;
}

/* ==================================================
     VENUE
  ================================================== */

.venue-section {
  padding: 35px 15px 20px;

  text-align: center;
}

.venue-ornament {
  margin-bottom: 15px;

  color: var(--gold);

  font-size: 13px;
}

.venue-section h3 {
  margin-top: 10px;

  color: #49382b;

  font-family: "Cormorant Garamond", serif;

  font-size: 31px;

  font-weight: 500;
}

.venue-description {
  max-width: 320px;

  margin: 12px auto 0;

  color: #796a5c;

  font-family: "Cormorant Garamond", serif;

  font-size: 15px;

  line-height: 1.7;
}

/* ==================================================
     FOOTER
  ================================================== */

.paper-footer {
  margin-top: 25px;

  text-align: center;
}

.footer-line {
  width: 50px;

  height: 1px;

  margin: 0 auto 18px;

  background: #8d765b;
}

.paper-footer p {
  color: #8b755f;

  font-size: 8px;

  letter-spacing: 3px;
}

.paper-footer h4 {
  margin-top: 8px;

  color: #49382b;

  font-family: "Great Vibes", cursive;

  font-size: 32px;

  font-weight: 400;
}

.footer-mark {
  display: block;

  margin-top: 18px;

  color: var(--gold);

  font-family: "Cormorant Garamond", serif;

  font-size: 13px;
}

/* ==================================================
     MOBILE
  ================================================== */

@media (max-width: 600px) {
  body {
    overflow: hidden;
  }

  .opening-content {
    width: 100%;
  }

  .intro-label {
    font-size: 12px;

    letter-spacing: 1.4px;

    margin-bottom: 20px;
  }

  .couple-name {
    font-size: 62px;

    margin-bottom: 32px;
  }

  .envelope-wrapper {
    width: 82vw;

    max-width: 360px;
  }

  .wax-seal {
    width: 62px;

    height: 62px;
  }

  .tap-text {
    margin-top: 26px;

    font-size: 13px;
  }

  .invitation-screen {
    padding: 20px 12px;
  }

  .invitation-paper {
    width: 100%;

    min-height: 800px;

    padding: 50px 24px 40px;
  }

  .paper-script {
    font-size: 52px;
  }

  .visual-collage {
    height: 235px;
  }

  .photo-main {
    width: 135px;

    height: 170px;
  }

  .photo-small {
    width: 70px;

    height: 88px;
  }

  .gold-stamp {
    width: 65px;

    height: 65px;
  }
}

/* ==================================================
     VERY SMALL MOBILE
  ================================================== */

@media (max-width: 380px) {
  .couple-name {
    font-size: 54px;
  }

  .envelope-wrapper {
    width: 88vw;
  }

  .paper-script {
    font-size: 46px;
  }

  .invitation-paper {
    padding-left: 18px;

    padding-right: 18px;
  }
}
