#loader-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 251, 245, 0.95);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 0.5s ease-out;
  pointer-events: all;
}

#loader-page.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Content with paper and tree leaves */
#block-loading {
  position: relative;
  width: 300px;
  height: 400px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Paper ("poetry" format, like handwritten letter */
.letter {
  position: relative;
  width: 250px;
  height: 350px;
  background: #ffffff url("pictures/texture-hero.png") center/cover;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
  animation: tilt 4s ease-in-out infinite;
}

.loader-text {
  font-family: "Dancing Script", cursive;
  color: #5e3b3b;
  font-size: 24px;
  text-align: center;
  padding: 0 20px;
  margin: 0;
  line-height: 1.4;
}

/* Tree leaves */
.feuilles-printemps {
  position: absolute;
  width: 500px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  opacity: 0.8;
  z-index: 1;
  pointer-events: none;
}

.feuilles-1 {
  top: 50%;
  left: 50px;
  transform: translateY(-50%);
  animation: flutter-leaf-1 3s ease-in-out infinite;
}

.feuilles-2 {
  top: 50%;
  right: 140px;
  transform: translateY(-50%);
  animation: flutter-leaf-2 3.5s ease-in-out infinite;
}

/* Animations */
@keyframes tilt {
  0%,
  100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(3deg);
  }
}

@keyframes flutter-leaf-1 {
  0%,
  100% {
    transform: translateY(-50%) translateX(0) rotate(0deg);
  }
  50% {
    transform: translateY(-60%) translateX(10px) rotate(10deg);
  }
}

@keyframes flutter-leaf-2 {
  0%,
  100% {
    transform: translateY(-50%) translateX(0) rotate(0deg);
  }
  50% {
    transform: translateY(-40%) translateX(-10px) rotate(-8deg);
  }
}

header,
main,
footer {
  opacity: 1; /* visible by default; need to be sure it appears everytiùe */
  transition: opacity 0.5s ease;
}


@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* responsiveness */
@media (max-width: 768px) {
  #block-loading {
    width: 240px;
    height: 320px;
  }

  .letter {
    width: 180px;
    height: 260px;
  }

  .loader-text {
    font-size: 18px;
  }

  .feuilles-printemps {
    width: 300px;
  }

  .feuilles-1 {
    left: -170px;
  }

  .feuilles-2 {
    right: -80px;
  }
}

