/* Base Setup */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background-image: url('https://res.cloudinary.com/druwgiz9r/image/upload/v1760363234/AdobeStock_731223888_mkwvrb.jpg'); 
  background-size: cover;       /* scales to fill screen */
  background-repeat: no-repeat; /* prevents tiling */
  background-position: center;  /* centers image */
  background-attachment: fixed;
}


body::before {
  content: "";
  position: fixed; /* full screen */
  inset: 0;
  background: rgba(255,255,255,0.3); 
  z-index: 1; /* keeps it behind your content */
}

.page-container {
  display: flex;
  min-height: 100vh;
}

/* Desktop Layout */
.image-panel {
  position: sticky;
  top: 0;
  flex: 1;
  overflow: hidden;
}

.image-panel img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.image-panel img.active {
  opacity: 1;
}

.content {
  flex: 1;
  padding: 50px;
}

section {
  min-height: 100vh;
  margin-bottom: 50px;
}

/* Mobile Layout */
@media (max-width: 768px) {
  .page-container {
    flex-direction: column;
  }
  .image-panel {
    position: relative;
    width: 100%;
    height: auto;
  }
  .image-panel img {
    position: relative;
    width: 100%;
    height: auto;
  }
  section {
    padding-top: 0;
  }

  .envelope-wrapper {
    width: 90vw !important;   /* make it span most of screen width */
    height: auto !important;  /* let height scale naturally */
    aspect-ratio: 4 / 3 !important; /* keeps a landscape (horizontal) envelope shape */
  }

  .letter {
    width: 90vw !important;
    height: auto !important;
    aspect-ratio: 4 / 3 !important;
    padding: 20px; /* reduce padding so content fits */
    box-sizing: border-box;
  }

  .modal-content {
    width: 90%;
    max-width: 400px; /* keeps it centered and not too wide */
    padding: 20px;
  }

  .modal-content input {
    font-size: 18px; /* bigger than 16px prevents zoom */
    padding: 12px;
  }

  .modal-content button {
    font-size: 18px;
    padding: 12px 24px;
  }

  .container {
    display: flex;
    justify-content: center;  /* center horizontally */
    align-items: center;      /* center vertically */
    width: 100%;
    height: 100vh;            /* full viewport height */
    position: relative;       /* keeps triangles/flap inside */
    overflow: hidden;
  }

  .seal {
    width: 60px;
  }

  body, html {
    background-image: url('https://res.cloudinary.com/druwgiz9r/image/upload/v1760363265/AdobeStock_750135551_nqfa5i.jpg'); 
  }

  .seal-hint {
    font-size: 0.5rem;
  }  
  
}


/* Layout */
.container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.invite-heading {
  text-align: center;
  margin-bottom: -10vh; /* adjust as needed */
  font-size: 2rem;
  font-family: "Prata" ;
}

.invite-heading.invisible {
  opacity: 0;
  transition: transform 1s ease, opacity 0.5s ease;
}

/* Envelope */
.envelope-wrapper {
  position: relative;
  width: 60vw;
  height: 70vh;
  background-image: url('https://res.cloudinary.com/druwgiz9r/image/upload/v1760363473/natural-paper_z270oj.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-color: #f0e0ca;
  border: 2px solid #f0e0ca;
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  /*overflow: hidden;*/
  transition: transform 1s ease;
  z-index: 2;
}

.triangle {
  position: absolute;
  width: 100%;
  height: 50%;
  background-image: url('https://res.cloudinary.com/druwgiz9r/image/upload/v1760363473/natural-paper_z270oj.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-color: #f0e0ca;
  transition: transform 0.8s ease-in-out;
  will-change: transform;
}

/* Bottom triangle */
.triangle.bottom {
  bottom: 0;
  clip-path: polygon(0% 100%, 50% 0%, 100% 100%);
  border-color: bisque;
  z-index: 4;
}

/* Left triangle */
.triangle.left {
  left: 0;
  top: 0%;
  width: 50%;
  height: 100%;
  clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
  border-color: burlywood;
  z-index: 4;
}

/* Right triangle */
.triangle.right {
  right: 0;
  top: 0%;
  width: 50%;
  height: 100%;
  clip-path: polygon(100% 0%, 0% 50%, 100% 100%);
  border-color: burlywood;
  z-index: 4;
}

/* Top background triangle (sits behind flap) */
.triangle.top {
  top: 0;
  height: 50%;
  clip-path: polygon(0% 0%, 50% 100%, 100% 0%);
  border-color: burlywood;
  z-index: 2;
}

.container {
  transition: transform 1s ease, opacity 0.8s ease;
}

.container.fade {
  opacity: 0;
}


/* Flap */
.flap {
  width: 100%;
  height: 60%;
  background-image: url('https://res.cloudinary.com/druwgiz9r/image/upload/v1760363473/natural-paper_z270oj.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-color: #e8d0ab;
  position: absolute;
  top: 0;
  left: 0;
  clip-path: polygon(0% 0%, 50% 100%, 100% 0%);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
  transform-origin: top center;
  z-index: 5;
  transition: transform 0.8s ease-in-out;
  will-change: transform;
}

.flap.open {
  transform: rotateX(180deg);
  z-index: 5; /* Goes behind the letter */
}

.flap.move {
  z-index: 2;
  transform: rotateX(180deg) translateY(-200vh);
}

/* Body */
.body {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 50%;
  background: #f0e0ca;
  z-index: 2;
}

/* Seal */
.seal {
  width: 80px;  /* smaller than 100px */
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  cursor: pointer;
}

.seal.remove {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}


/* Letter */
.letter {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60vw;
  height: 70vh;
  background: white;
  box-shadow: 0 5px 20px rgba(0,0,0,0.2);
  padding: 30px;
  box-sizing: border-box;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  z-index: 3;
  transition: transform 1s ease, opacity 0.8s ease;
  display: flex;
  justify-content: center;  /* centers horizontally */
  align-items: center; 
}

.letter.visible {
  opacity: 1;
}

.letter.invisible {
  opacity: 0
}

.letter.zoomed {
  transform: translate(-50%, -50%) scale(1.67); /* 100vw / 60vw ≈ 1.67 */
  z-index: 100;
}

.letter.fade {
  z-index: 100;
  opacity: 0;
}


/* Modal */
.modal {
   position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;

  /* Fix for transformed parents */
  transform: none !important;
  -webkit-transform: none !important;
}

.modal-content {
  background: white;
  padding: 24px;
  border-radius: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;   /* stack input, button, error vertically */
  gap: 16px;                /* consistent spacing */
  align-items: stretch;     /* make children fill width */
  max-width: 400px;
  width: 90%;
  box-sizing: border-box;
  position: relative;
  z-index: 2001;
}


.modal-content input {
  font-size: 18px;
  padding: 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
}

.modal-content button {
  font-size: 18px;         /* bigger text = bigger button box */
  padding: 14px 20px;      /* more vertical padding */
  min-height: 48px;        /* ensures >=44px touch target */
  width: 100%;             /* full width makes it easy to hit */
  background: #d1a377;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-sizing: border-box;
}

.modal-content button:active {
  transform: scale(0.97);  /* nice feedback */
}


.modal-content .error {
  color: red;
  margin-top: 10px;
}

body.modal-open {
  overflow: hidden;
  /* position: fixed;
  width: 100%; */
}

.hidden {
  display: none;
}
.seal-wrapper {
  position: absolute;
  top: 55%;   /* original seal position */
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
}

.seal {
  width: 80px;
  cursor: pointer;
  display: block;
  margin: 0 auto;
}

.seal-hint {
  position: absolute;
  bottom: 100%;   /* sit directly above the seal */
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  text-align: center;
  z-index: 11;
  animation: float 2s ease-in-out infinite;
  pointer-events: none; /* clicks pass through */
}

.hint-text {
  font-family: 'Prata', serif;
  font-size: 1.2rem;
  white-space: nowrap;   /* prevents wrapping "Click me" */
  background: rgba(255, 255, 255, 0.85);
  padding: 4px 10px;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  display: inline-block;
}

.arrow {
  margin: 6px auto 0 auto;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 14px solid #333;
  animation: bounce 1.2s infinite;
}


/* floating animation */
@keyframes float {
  0%, 100% { transform: translate(-50%, -110%); }
  50% { transform: translate(-50%, -130%); }
}

/* bouncing arrow */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* Hide smoothly */
.seal-hint.hidden {
  opacity: 0;
  transition: opacity 0.5s ease;
}
