@font-face {
  font-family: "Reika";
  src: url("/fonts/reika-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Chainprinter";
  src: url("/fonts/chainprinter-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("/fonts/poppins-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --plantes: #4a8a63;
  --plantes-fonce: #2f6245;
  --vent: #fef1ec;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--vent);
  color: var(--plantes-fonce);
  font-family: "Poppins", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/* Accueil */
.accueil {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 32px max(24px, env(safe-area-inset-right)) 32px max(24px, env(safe-area-inset-left));
  text-align: center;
}

/* Logo */
.logo {
  display: block;
  width: min(84vw, 78vh, 660px);
  margin: 0;
}

.logo img,
.logo-dessin {
  display: block;
  width: 100%;
  height: auto;
}

.logo-dessin {
  overflow: visible;
}

.logo-vert,
.coeur {
  fill: var(--plantes);
}

.logo-clair {
  fill: var(--vent);
}

.tige {
  fill: none;
  stroke: #fff;
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 1 2;
  stroke-dashoffset: 0;
}

.feuille,
.rond,
.fin {
  fill: #fff;
}

.cache {
  fill: #000;
}

/* Textes */
.accroche {
  margin: clamp(12px, 3vh, 28px) 0 0;
  color: var(--plantes);
  font-family: "Reika", Georgia, serif;
  font-size: clamp(30px, 5vw, 56px);
  font-weight: 400;
  line-height: 1.1;
}

.lieu {
  margin: 14px 0 0;
  color: var(--plantes);
  font-family: "Chainprinter", "Courier New", monospace;
  font-size: clamp(13px, 1.9vw, 17px);
  letter-spacing: 0.06em;
  line-height: 1.6;
}

/* Formulaire */
.alerte {
  width: 100%;
  max-width: 420px;
  margin: clamp(20px, 4vh, 36px) 0 0;
  font-size: 14px;
}

.alerte label {
  display: block;
  text-wrap: balance;
}

.alerte-ligne {
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

.alerte-ligne {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.alerte input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--plantes);
  border-radius: 22px;
  background: #fff;
  color: var(--plantes-fonce);
  font: inherit;
  font-size: 16px;
}

.alerte input[type="email"]::placeholder {
  color: #6c8f7b;
}

.alerte button {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 22px;
  background: var(--plantes-fonce);
  color: var(--vent);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.alerte button:hover {
  background: #26503a;
}

.alerte button[disabled] {
  opacity: 0.6;
  cursor: default;
}

.alerte input[type="email"]:focus-visible,
.alerte button:focus-visible,
.logo-fixe:focus-visible {
  outline: 3px solid var(--plantes);
  outline-offset: 3px;
}

.alerte-piege {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.alerte-retour {
  margin: 8px 0 0;
}

.alerte-retour:empty {
  margin: 0;
}

/* Abeille */
.abeille {
  pointer-events: none;
  transform-origin: 995px 76px;
  will-change: transform;
}

.abeille-ailes {
  transform-origin: 990px 73px;
}

.abeille-sillage path {
  transition: opacity 0.2s ease;
}

.envol .abeille-sillage path {
  opacity: 0;
}

.envol .abeille-sillage path:nth-child(5) { transition-delay: 0.16s; }
.envol .abeille-sillage path:nth-child(4) { transition-delay: 0.32s; }
.envol .abeille-sillage path:nth-child(3) { transition-delay: 0.48s; }
.envol .abeille-sillage path:nth-child(2) { transition-delay: 0.64s; }
.envol .abeille-sillage path:nth-child(1) { transition-delay: 0.8s; }
.envol .abeille-sillage path:nth-child(n+7) { transition-delay: 0.96s; }

.vole .abeille-ailes {
  animation: battre 0.09s ease-in-out infinite alternate;
}

@keyframes battre {
  from { transform: rotate(7deg) scaleY(1); }
  to { transform: rotate(-9deg) scaleY(0.5); }
}

/* La pousse : un petit point au départ, la tige, les feuilles, les pétales, puis le point passe au vert */
@media (prefers-reduced-motion: no-preference) {
  #pousse-1,
  .plante-1 { --depart: 0.5s; }
  #pousse-2,
  .plante-2 { --depart: 1.1s; }
  #pousse-3,
  .plante-3 { --depart: 1.7s; }

  .tige {
    animation: tige 3s cubic-bezier(0.45, 0, 0.4, 1) var(--depart) both;
  }
  .feuille {
    animation: eclore 1s cubic-bezier(0.3, 0, 0.2, 1) both;
  }
  .f1 { animation-delay: calc(var(--depart) + 3s); }
  .f2 { animation-delay: calc(var(--depart) + 3.35s); }
  .f3 { animation-delay: calc(var(--depart) + 3.7s); }
  .f4 { animation-delay: calc(var(--depart) + 4.05s); }

  .petale {
    animation: ouvrir 1.5s cubic-bezier(0.25, 0.7, 0.3, 1) both;
  }
  .p1 { animation-delay: calc(var(--depart) + 4.8s); }
  .p2 { animation-delay: calc(var(--depart) + 5s); }
  .p3 { animation-delay: calc(var(--depart) + 5.2s); }
  .p4 { animation-delay: calc(var(--depart) + 5.4s); }
  .p5 { animation-delay: calc(var(--depart) + 5.6s); }
  .p6 { animation-delay: calc(var(--depart) + 5.8s); }

  .coeur {
    animation: paraitre 0.5s ease calc(var(--depart) + 7.3s) both;
  }
  .fin {
    animation: paraitre 0.3s ease calc(var(--depart) + 7.6s) both;
  }
}

@keyframes tige {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes eclore {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

@keyframes ouvrir {
  from { transform: rotate(-28deg) scale(0); }
  to { transform: rotate(0deg) scale(1); }
}

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

@media (max-width: 520px) {
  .lieu-suite {
    display: block;
  }
}
