@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
@import url(https://fonts.googleapis.com/css?family=Lato:300italic);

:root {
	--primary: #fff;
	--bg-color: rgb(204, 174, 136);
	--bg-envelope-color: #f5edd1;
	--envelope-tab: #ecdeb8;
	--envelope-cover: #e6cfa7;
	--shadow-color: rgba(0, 0, 0, 0.2);
	--txt-color: #444;
	--heart-color: rgb(252, 8, 231);
	--button-color: rgb(248, 145, 165);
}

.fade-box {
  opacity: 1;
  transition: opacity 0.5s ease; /* durasi animasi */
}

.fade-out {
  opacity: 0;
}

.fade-in {
  opacity: 1;
  transition: opacity 1s ease;
}

.button {
    background: var(--button-color);
}

*{
    box-sizing: border-box;
	
}

#step1 {
	font-family: "Poppins", sans-serif;
}

body {
	background: var(--bg-color);
}


.container {
    height: 100vh;
    width: 100vw;
	overflow: hidden;
	
}

.flipbook {
	user-select: none;
	scale: 0.9;
}

.flipbook .hard {
    background: rgb(255, 241, 241) !important;
    font-weight: bold;
    border: none; 
}

.flipbook .hard small{
	font-style: italic;
	font-weight: lighter;
	opacity: 0.7;
	font-size: 14px;
	user-select: none;
}

.flipbook .page {
    background: white;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
    gap: 10px;
    border: 1px solid rgba(0, 0, 0, 0.11);
}

.page img{
	width: 100%;
	height: 100%;
	object-fit: cover;
	margin: auto;
	user-select: none;
}

.flipbook .page small{
	font-size: 14px;
    margin-bottom: 10px;
}


.glass {
	/* From https://css.glass */
background: rgba(255, 255, 255, 0.2);
border-radius: 16px;
box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
backdrop-filter: blur(5px);
-webkit-backdrop-filter: blur(5px);
border: 1px solid rgba(255, 255, 255, 0.3);
}

body{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background: var(--bg-color);
  display: flex;
  align-items: center;
  justify-content: center;
}
#step2 {
  height: 100vh;
  place-items: center;
}
#step2 > .envelope-wrapper {
  background: var(--bg-envelope-color);
  box-shadow: 0 0 40px var(--shadow-color);
}



.envelope-wrapper > .envelope {
  position: relative;
  width: 300px;
  height: 230px;
}
.envelope-wrapper > .envelope::before {
  content: "";
  position: absolute;
  top: 0;
  z-index: 2;
  border-top: 130px solid var(--envelope-tab);
  border-right: 150px solid transparent;
  border-left: 150px solid transparent;
  transform-origin: top;
  transition: all 0.5s ease-in-out 0.7s;
}
.envelope-wrapper > .envelope::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 0px;
  height: 0px;
  border-top: 130px solid transparent;
  border-right: 150px solid var(--envelope-cover);
  border-bottom: 100px solid var(--envelope-cover);
  border-left: 150px solid var(--envelope-cover);
}
.envelope > .letter {
  position: absolute;
  right: 20%;
  bottom: 0;
  width: 54%;
  height: 80%;
  background: var(--primary);
  text-align: center;
  transition: all 1s ease-in-out;
  box-shadow: 0 0 5px var(--shadow-color);
  padding: 20px 10px;
}

.envelope > .letter > .textLetter {
  font-family: "Just Another Hand", cursive;
  font-weight: 400;
  font-style: normal;
  color: var(--txt-color);
  text-align: left;
  font-size: 0.8rem;
}
.heart {
  position: absolute;
  top: 22rem;
  left: 45%;
  font-size: 2rem;
  z-index: 4;
  transition: transform 0.5s ease-in-out 1s;
  cursor: pointer;
}
.flap > .envelope:before {
  transform: rotateX(180deg);
  z-index: 0;
}
.flap > .envelope > .letter {
  bottom: 150px;
  transform: scale(1.5);
  transition-delay: 1s;
}
.flap > .heart {
  transform: rotate(90deg);
  transition-delay: 0.4s;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* container yang bisa lu geser */
.flower-object {
  position: relative;
  width: 200px;
  height: 300px;
  transform: translate(0,0); /* bebas lu modif */
}

/* flower root */
.flower {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  transform-origin: bottom center;
  z-index: 10;
  --fl-speed: 0.8s;
}

/* bunga */
.flower__leafs {
  position: relative;
  animation: blooming-flower 2s backwards;
}

.flower__leaf {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 30px;
  height: 45px;
  border-radius: 51% 49% 47% 53% / 44% 45% 55% 69%;
  background-color: #a7ffee;
  background-image: linear-gradient(to top, #54b8aa, #a7ffee);
  transform-origin: bottom center;
  opacity: 0.9;
  box-shadow: inset 0 0 10px rgba(255,255,255,0.5);
}

.flower__leaf--1 {
  transform: translate(-10%, 1%) rotateY(40deg) rotateX(-50deg);
}

.flower__leaf--2 {
  transform: translate(-50%, -4%) rotateX(40deg);
}

.flower__leaf--3 {
  transform: translate(-90%, 0%) rotateY(45deg) rotateX(50deg);
}

.flower__leaf--4 {
  width: 30px;
  height: 30px;
  transform-origin: bottom left;
  border-radius: 15px 30px 15px 15px;
  transform: translate(0, 18%) rotateX(70deg) rotate(-43deg);
  background-image: linear-gradient(to top, #39c6d6, #a7ffee);
  z-index: 1;
  opacity: 0.8;
}

/* white circle center */
.flower__white-circle {
  position: absolute;
  left: -12px;
  top: -12px;
  width: 40px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
}

/* batang */
.flower__line {
  height: 150px;
  width: 6px;
  background-image: linear-gradient(
    to top,
    transparent 10%, 
    #14757a, 
    #39c6d6
  );
  box-shadow: inset 0 0 2px rgba(0,0,0,0.5);
  animation: grow-flower-tree 4s backwards;
  position: relative;
}

/* daun batang */
.flower__line__leaf {
  --w: 30px;
  --h: 50px;
  position: absolute;
  top: 20%;
  left: 100%;
  width: var(--w);
  height: var(--h);
  border-top-right-radius: var(--h);
  border-bottom-left-radius: var(--h);
  background-image: linear-gradient(
    to top,
    rgba(20,117,122,0.4),
    #39c6d6
  );
}

.flower__line__leaf--1 {
  transform: rotate(70deg) rotateY(30deg);
}

.flower__line__leaf--2 {
  top: 45%;
  transform: rotate(70deg) rotateY(30deg);
}

.flower__line__leaf--3 {
  left: -170%;
  top: 12%;
  transform: rotate(-70deg) rotateY(30deg);
}

.flower__line__leaf--4 {
  left: -170%;
  top: 40%;
  transform: rotate(-70deg) rotateY(30deg);
}

/* light bloom */
.flower__light {
  position: absolute;
  bottom: 0;
  width: 8px;
  height: 8px;
  background: #fff300;
  border-radius: 50%;
  filter: blur(1px);
  animation: light-ans 4s linear infinite;
}
.flower__light:nth-child(odd) { background: #23f0ff; }

.flower__light--1 { left: -15px; animation-delay: 1s; }
.flower__light--2 { left: 20px; animation-delay: 0.5s; }
.flower__light--3 { left: -30px; animation-delay: 0.3s; }
.flower__light--4 { left: 35px; animation-delay: 0.9s; }
.flower__light--5 { left: -5px; animation-delay: 1.5s; }
.flower__light--6 { left: -22px; animation-delay: 3s; }
.flower__light--7 { left: 12px; animation-delay: 2s; }
.flower__light--8 { left: -28px; animation-delay: 3.5s; }

/* Animations */
@keyframes blooming-flower {
  0% { transform: scale(0); }
}

@keyframes grow-flower-tree {
  0% { height: 0; border-radius: 5px; }
}

@keyframes light-ans {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  25% {
    opacity: 1;
    transform: translateY(-20px) translateX(-5px);
  }
  50% {
    transform: translateY(-60px) translateX(5px);
  }
  75% {
    transform: translateY(-80px) translateX(-5px);
  }
  100% {
    transform: translateY(-120px);
    opacity: 0;
    filter: blur(3px);
  }
}

.flower-object {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 10;
}



#cake {
  display: block;
  position: relative;
  margin: -10em auto 0 auto;
}

/* ============================================== Candle
*/

.velas {
	
  background: #ffffff;
  border-radius: 10px;
  position: absolute;
  top: 228px;
  left: 50%;
  margin-left: -2.4px;
  margin-top: -8.33333333px;
  width: 5px;
  height: 35px;
  transform: translateY(-300px);
  backface-visibility: hidden;
  animation: in 500ms 6s ease-out forwards;
}
.velas:after,
.velas:before {
  background: rgba(255, 0, 0, 0.4);
  content: "";
  position: absolute;
  width: 100%;
  height: 2.22222222px;
}
.velas:after {
  top: 25%;
  left: 0;
}
.velas:before {
  top: 45%;
  left: 0;
}

/* ============================================== Fire
*/

.fuego {
  border-radius: 100%;
  position: absolute;
  top: -20px;
  left: 50%;
  margin-left: -2.6px;
  width: 6.66666667px;
  height: 18px;
}
.fuego:nth-child(1) {
  animation: fuego 2s 6.5s infinite;
}
.fuego:nth-child(2) {
  animation: fuego 1.5s 6.5s infinite;
}
.fuego:nth-child(3) {
  animation: fuego 1s 6.5s infinite;
}
.fuego:nth-child(4) {
  animation: fuego 0.5s 6.5s infinite;
}
.fuego:nth-child(5) {
  animation: fuego 0.2s 6.5s infinite;
}

/* ============================================== Animation Fire
*/

@keyframes fuego {
  0%, 100% {
    background: rgba(254, 248, 97, 0.5);
    box-shadow: 0 0 40px 10px rgba(248, 233, 209, 0.2);
    transform: translateY(0) scale(1);
  }
  50% {
    background: rgba(255, 50, 0, 0.1);
    box-shadow: 0 0 40px 20px rgba(248, 233, 209, 0.2);
    transform: translateY(-20px) scale(0);
  }
}

@keyframes in {
  to {
    transform: translateY(0);
  }
}

.textLetter {
  color: #8b6a60;
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  font-style:italic;
  text-align: center;
  h1 {
    font-size: 1.4em;
  }
}  

.night {
  position: fixed;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 100%;
  height: 100%;
  filter: blur(0.1vmin);
  background-image: radial-gradient(
      ellipse at top,
      transparent 0%,
      #000
    ),
    radial-gradient(
      ellipse at bottom,
      #000,
      rgba(145, 233, 255, 0.2)
    ),
    repeating-linear-gradient(
      220deg,
      rgb(0, 0, 0) 0px,
      rgb(0, 0, 0) 19px,
      transparent 19px,
      transparent 22px
    ),
    repeating-linear-gradient(
      189deg,
      rgb(0, 0, 0) 0px,
      rgb(0, 0, 0) 19px,
      transparent 19px,
      transparent 22px
    ),
    repeating-linear-gradient(
      148deg,
      rgb(0, 0, 0) 0px,
      rgb(0, 0, 0) 19px,
      transparent 19px,
      transparent 22px
    ),
    linear-gradient(90deg, rgb(0, 255, 250), rgb(240, 240, 240));
}

#night {
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease, visibility 0s linear 1s;
}

#night.show {
  opacity: 1;
  visibility: visible;
  transition: opacity 1s ease;
}

#flower.dormant * {
  animation-play-state: paused !important;
}

#flower {
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease, visibility 0s linear 1s;
}

#flower.show {
  opacity: 1;
  visibility: visible;
  transition: opacity 1s ease;
}


.text {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 9999;
  color: var(--bg-color);
}
