body {
  margin: 0;
  font-family: 'Josafronde', sans-serif;
  color: white;
  height: 100vh;

  background: linear-gradient(120deg, #d6a4a4, #c0b6f2, #a1c4fd);
  background-size: 200% 200%;

  animation: gradientMove 12s ease infinite;

  overflow: hidden;
}

/* léger voile violet à gauche */
body::before {
  content: "";

  position: fixed;
  top: 0;
  left: 0;

  width: 200px;
  height: 100vh;

  background: linear-gradient(
    90deg,
    rgba(75, 46, 131, 0.25) 0%,
    rgba(75, 46, 131, 0.1) 50%,
    rgba(75, 46, 131, 0) 100%
  );

  pointer-events: none;
  z-index: 1;
}

/* animation du fond */
@keyframes gradientMove {

  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* ===== HEADER ===== */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;

  z-index: 20;
}

/* ===== MENU BAR ===== */

.menu-bar {
  position: fixed;

  top: 0;
  left: 0;

  width: 60px;
  height: 100vh;

  display: flex;
  justify-content: center;
  align-items: center;

  z-index: 30;
  cursor: pointer;
}

.menu-bar span {
  transform: rotate(-90deg);

  color: white;
  letter-spacing: 2px;
  font-size: 0.9rem;
}

/* fade gauche */
#menu-fade {
  position: fixed;

  top: 0;
  left: 0;

  width: 180px;
  height: 100vh;

  background: linear-gradient(
    90deg,
    rgba(75, 46, 131, 0.25) 0%,
    rgba(75, 46, 131, 0.15) 40%,
    rgba(75, 46, 131, 0.05) 70%,
    rgba(75, 46, 131, 0) 100%
  );

  pointer-events: none;
  z-index: 5;
}

/* ===== MENU ===== */

#side-menu {
  position: fixed;

  top: 0;
  left: 0;

  width: 50%;
  height: 100vh;

  background: linear-gradient(
    90deg,
    rgba(75, 46, 131, 0.95) 0%,
    rgba(75, 46, 131, 0.6) 60%,
    rgba(75, 46, 131, 0) 100%
  );

  transform: translateX(-100%);
  transition: transform 0.4s ease;

  z-index: 25;

  display: flex;
  align-items: center;

  padding-left: 100px;
}

#side-menu.open {
  transform: translateX(0);
}

#side-menu nav {
  display: flex;
  flex-direction: column;
}

#side-menu a {
  color: white;
  font-size: 1.5rem;
  text-decoration: none;
  margin: 0.8rem 0;
}

#side-menu a:hover {
  opacity: 0.6;
}

/* ===== MAIN ===== */

/* ===== FIX LAYOUT ===== *
/* éviter que le contenu passe sous la barre */

h1 {
  font-size: 1.3rem;
  font-weight: 300;
  padding-left: 2vw;
  padding-top: 1vh;
}

main {
  width: 100vw;
  height: 100vh;

  position: relative;

  display: flex;
  justify-content: center;
  align-items: center;
}

/* bloc central */

.guestbook-box {

  position: relative;
  z-index: 5;

  width: 420px;

  padding: 2rem;

  border-radius: 28px;

  background: rgba(255,255,255,0.08);

  backdrop-filter: blur(14px);

  box-shadow:
    0 10px 40px rgba(0,0,0,0.15);

  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.guestbook-box h2 {
  margin: 0;

  font-weight: 300;
  font-size: 2rem;

  letter-spacing: -0.03em;
}

/* textarea */

textarea {

  width: 100%;
  height: 140px;

  border: none;
  outline: none;
  resize: none;

  border-radius: 18px;

  padding: 1rem;

  box-sizing: border-box;

  background: rgba(255,255,255,0.12);

  color: white;

  font-size: 1rem;
  font-family: inherit;

  backdrop-filter: blur(10px);
}

textarea::placeholder {
  color: rgba(255,255,255,0.6);
}

/* bouton */

button {

  align-self: flex-end;

  border: none;

  padding: 0.8rem 1.4rem;

  border-radius: 999px;

  background: rgba(255,255,255,0.15);

  color: white;

  cursor: pointer;

  font-size: 0.95rem;

  transition:
    transform 0.25s ease,
    background 0.25s ease;
}

button:hover {
  background: rgba(255,255,255,0.22);

  transform: scale(1.05);
}

/* messages flottants */

.message {

  position: absolute;

  color: rgba(255,255,255,0.9);

  font-size: 1rem;

  font-weight: 300;

  pointer-events: none;

  animation: floatMessage linear infinite;
}

/* flottement */

@keyframes floatMessage {

  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-20px);
  }

  100% {
    transform: translateY(0px);
  }
}

#burger {
  display: none;
}

@media (max-width: 768px) {

  html, body {
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: scroll;
  }

  main {
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 6rem 1rem 2rem 1rem;
    height: auto;
  }

  /* ---- TITLE SUR 2 LIGNES ---- */
  h1 {
    font-size: 1.1rem;
    line-height: 1.3;
    padding-left: 3rem;
    padding-right: 1rem;
    max-width: 90%;
    font-weight: 900;
  }

  /* FORCER 2 LIGNES */
  h1 br {
    display: block;
  }

  /* ---- BURGER ---- */
  #burger {
    display: block;
    position: fixed;
    top: 1rem;
    left: 1rem;
    font-size: 2rem;
    z-index: 999;
  }

  #burger:hover {
    color: #944BBB;
    cursor: pointer;
  }

  .menu-bar {
    display: none;
  }


  /* BOX EN HAUT */
  .guestbook-box {
    order: 1;
    width: 100%;
    max-width: 240px;
    margin-bottom: 2rem;
    margin-right: 10vw;
  }

  /* IMPORTANT : on neutralise le position absolute des messages */
  #floating-messages {
    order: 2;
    position: static;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  /* messages deviennent normaux (plus de float aléatoire) */
  .message {
    position: relative !important;
    left: auto !important;
    top: auto !important;

    animation: none; /* sinon ça part dans tous les sens */
  }
}