* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  height: 100vh;
  max-width: 90vw;
  overflow-x: hidden;
  display: flex;
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
  align-items: center;
  font-family: sans-serif;
  background-image: url("ecardImages/natural-paper.png");
  background-color: #f8ded7;
  
}

.wrapper{
  position: relative;
  display: flex;
  
  background-color: transparent;
  min-height: auto;
  max-width: 98%;
  aspect-ratio: 1/1;
  margin-left: auto;
  margin-right: auto;
  justify-content: center;
  align-items: center;
  z-index: 0;
  
}
@media (width >= 768px) {
  .wrapper {
    min-width: 40rem;
    aspect-ratio: 1/.8;
    
  }
}
/*Text above image*/
.instruction{
  position: absolute;
  /*align-self: start;*/
  top: -3%;
  width: 100%;
  background-color: transparent;
  font-size: 1.5rem;
  font-family: "Oregano";
  color: rgb(103, 101, 101); 
  text-align: center;
  transition: transform 0.10s ease-in-out; 
  
}

.one::before {
  content: "Hello Ann, tap the envelope to see your card."
}

 @media (width >= 768px) {
  .one::before {
  content: "Hello Ann, click or tap on the envelope to see your card." 
  }
}

.two::before{
  content: "Tap on image to see your greeting."
}

@media (width >= 768px) {
  .two::before {
  content: "Click or tap on image to see your greeting." 
  }
}

.three::before{
  
    content: "Tap below to begin again."
  
}

@media (width >= 768px) {
  .three::before {
  content:  "Click or tap below to begin again."
  }
}
  

.move{
  animation: move-up 0.6s ease-in-out forwards;
}

@keyframes move-up {
  from {
    transform: translatey(0px);
  }
  to {
    transform: translatey(-150px); 
  }
}
@media (min-width: 768px) {
  @keyframes move-up {
    from { transform: translatey(0); }
    to { transform: translatey(-195px); }
  }
}

/*@media (width >= 768px) {
  .move {
    animation: move-up-big 0.6s ease-in-out forwards;
    
  }
}
  @keyframes move-up-big {
  from {
    transform: translatey(0px);
  }
  to {
    transform: translatey(-300px); 
  }
}*/

/*EVERYTHING IN THE ENVELOPE*/
.envelope{
  position: relative;
  display: grid;
  grid-row: 1 / -1;
  background-color: transparent;
  box-shadow: 3px 3px 3px  #d6c0ba;
  align-self: end;
  min-width: 28rem;
  aspect-ratio: 1.4/1;
  justify-content: center;
  align-items: center;
  z-index: 1;
}
@media (width >= 768px) {
  .envelope {
    min-width: 40rem;
    box-shadow: 0px 0px 0px  transparent;
    
  }
}

.lid-down {
  position: absolute;
  height: 50%;
  width: 100%;
  top: 0;
  left: 0;
  transform-origin: top;
  opacity: 1;
  transition: opacity .5s ease-in;
  /*transform: rotateX(0deg);*/
  /*align-self: start;*/
  clip-path: polygon(0% 0%, 100% 0%, 50% 100%);
 background-color: #D3AF37;
  /* Defines the three points of the triangle */
  z-index: 5;
  
}

.state-up {
animation: flipVertical 0.6s ease-in-out forwards;
}

/*Makes the lid flip smoothly*/
@keyframes flipVertical {
  from {
    transform: rotateX(0deg);
  }
  to {
    transform: rotateX(180deg);
  }
}
  
.bottom-env{
  position: absolute;
  opacity: 1;
  transition: opacity .5s ease-in;
  width: 100%;
  height: 50%;
  align-self: end;
  background-color: #D3AF37;
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  z-index: 4
}

.right-env {
  position: absolute;
  opacity: 1;
  transition: opacity .5s ease-in;
  width: 50%;
  height: 100%;
  place-self: end end;
  background-color: #d6b23c;
  clip-path: polygon(100% 0, 0 50%, 100% 100%);
  
  z-index: 2;
}

.left-env {
  position: absolute;
  opacity: 1;
  transition: opacity .5s ease-in;
  width: 50%;
  height: 100%;
  place-self: start start;
  background-color: #d6b23c;
  clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
  z-index: 3;
}

/*Seal on envelope*/
.btn {
  position: absolute; /* Positions the button relative to the .wrapper */
  top: 50%;           /* Move down 50% from the top */
  left: 50%;          /* Move right 50% from the left */
   height: 100px;
   width: 100px;
   background: transparent;
   border: none;
   transform: translate(-50%, -50%); /* Perfectly centers the button */
   z-index:6;
   opacity: 1;
   transition: opacity 0.3s ease-in;
   /*transition-delay: 1s;*/
}
.seal{
  
  width: 100%;
  height: auto;
  
  opacity: 1;
  transition: opacity 0.6s ease-in;
  transition-delay: 4s;
  z-index: 6;
  
 
}

.dissolve {
  opacity: 0;
  transition: opacity 0.9s ease-in-out;

  pointer-events: none; /* Prevents clicks on the hidden element */
}

/*END OF ENVELOPE*/
/*BEGINNING OF IMAGE*/

.img-in{
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 1;
  transition: opacity .3s ease-in;
  background-color: #d6b23c;
  transition: transform 0.5s ease-in-out;
  
}

.img-rise{
  transform: translateY(-170px);
   transition-delay: 0s;
   /*animation: riseAndFall 3s ease-in-out;*/
}

.grow {
  height: 630px;
  transition: height 0.9s ease-in-out;
}

@media (width >= 768px) {
  .grow {
    width: 38rem;
    height: auto;
    aspect-ratio: 1/1.40;
    transform: translateY(-3vw);
    margin-top: 7rem;
  }
}

/*This is the greeting*/
  .card {
    z-index:8;
    background-color: white; 
    display: flex;
    justify-content: center; /* Centers horizontally */
    align-items: center;
    background-image: url("ecardImages/card-background.png");
    background-repeat: no-repeat;
    background-color:transparent;
    background-size: cover;
    background-position: center;
    color: #64200e;
    font-family: "Baumans", system-ui;
    font-size: 2rem;
    font-style: normal;
    text-align: center;
    line-height: 1.1; 
    padding: 5%; 
    /*min-height: 300px;*/
    min-width: 85vw;
    
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease, visibility 0.5s ease;
    
  }
  @media (width >= 768px) {
  .card {
    min-width: 50rem;
    

  }
}


  .card.isVisible {
    opacity: 1;
    visibility: visible;
    transition: opacity .5s ease, visibility 0.5s ease;
  }


/*.grow2{
  transform: translateY(10px);
  transition: transform 0.9s ease-out;

}



.moveBack{
transform: translatey(500px); 
transition: transform 0.5s ease-in-out; 
}*/





