:root {
  --cream: #fbf7f0;
  --cream-deep: #f2eadc;
  --ink: #14234b;
  /* Couleur principale : change ces lignes pour changer toute la palette. */
  --accent: #0743ce;
  --accent-dark: #0537ad;
  --accent-rgb: 7, 67, 206;
  --ink-rgb: 20, 35, 75;
  --error: #9c322f;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html, body {
  background: var(--cream);
  min-height: 100%;
  margin: 0;
}
body, button, input { font-family: Quicksand, system-ui, sans-serif; }
body { color: var(--ink); -webkit-font-smoothing: antialiased; }

.sr-only, .bot-field {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Canvas ---------- */

.canvas {
  min-height: 100svh;
  padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 38%, #fff9, transparent 34rem), var(--cream);
  place-items: center;
  display: grid;
  overflow: hidden;
}

.scene {
  width: min(100%, 620px);
  min-height: min(700px, 100svh - 56px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stages { width: 100%; }

.stage {
  text-align: center;
  flex-direction: column;
  align-items: center;
  width: 100%;
  display: flex;
  animation: stage-in 0.62s var(--ease) both;
}
.stage[hidden] { display: none; }

/* ---------- Face ---------- */

.face-float {
  filter: drop-shadow(0 13px 18px rgba(var(--accent-rgb), 0.1));
  width: clamp(205px, 53vw, 276px);
  margin-bottom: 34px;
  color: var(--accent);
  animation: float 5s ease-in-out infinite;
}

.face-tilt { transition: transform 0.3s ease-out; will-change: transform; }

.face {
  position: relative;
  width: 100%;
  aspect-ratio: 3.4 / 1;
}
.face.is-bounce { animation: bounce 0.5s var(--spring); }

.eye {
  position: absolute;
  top: 0;
  width: 15.5%;
  aspect-ratio: 1;
  transition: transform 0.2s ease-out;
  will-change: transform;
}
.eye--left { left: 0; }
.eye--right { right: 0; }
.lid {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: currentColor;
  transition: transform 0.09s ease-in, border-radius 0.25s;
}
.face.is-blink .lid { transform: scaleY(0.08); }
.face.is-happy .lid { transform: scaleY(0.42) translateY(-20%); border-radius: 50% 50% 12% 12%; }

.cheek {
  position: absolute;
  top: 62%;
  width: 13%;
  aspect-ratio: 1.7;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.22;
  filter: blur(3px);
}
.cheek--left { left: 3%; }
.cheek--right { right: 3%; }

.mouth {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 30%;
  transform: translateX(-50%);
  transition: transform 0.3s var(--spring);
}
.face.is-happy .mouth { transform: translateX(-50%) scale(1.14); }

/* ---------- Intro copy ---------- */

.intro-copy {
  letter-spacing: -0.03em;
  white-space: pre-line;
  width: min(100%, 520px);
  min-height: 4.2em;
  color: var(--accent);
  place-items: center;
  margin: 0;
  padding: 0 4px;
  font-size: clamp(1rem, 5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.38;
  display: grid;
}
.caret {
  background: var(--accent);
  vertical-align: -0.08em;
  border-radius: 999px;
  width: 0.1em;
  height: 0.9em;
  margin-left: 0.08em;
  animation: blink 0.9s steps(2, start) infinite;
  display: inline-block;
}

/* ---------- Waitlist ---------- */

.waitlist-reveal {
  opacity: 0;
  pointer-events: none;
  width: 100%;
  min-height: 126px;
  margin-top: 14px;
  transition: opacity 0.52s, transform 0.52s var(--ease);
  transform: translateY(12px);
}
.waitlist-reveal--visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

.waitlist-form { width: min(100%, 520px); margin: 0 auto; }
.waitlist-form[hidden] { display: none; }

.email-row { align-items: stretch; gap: 8px; display: flex; }
.email-row input {
  min-width: 0;
  height: 54px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.52);
  border: 1.5px solid rgba(var(--ink-rgb), 0.2);
  border-radius: 16px;
  outline: none;
  flex: 1 1 0%;
  padding: 0 18px;
  font-size: 1rem;
  font-weight: 600;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.email-row input::placeholder { color: rgba(var(--ink-rgb), 0.45); }
.email-row input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.12);
}

.email-row button {
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  border: 0;
  border-radius: 16px;
  place-items: center;
  min-height: 54px;
  padding: 0 22px;
  font-size: 0.94rem;
  font-weight: 700;
  transition: transform 0.18s, background 0.18s, box-shadow 0.18s;
  display: inline-grid;
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.22);
}
.email-row button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 13px 28px rgba(var(--accent-rgb), 0.28);
}
.email-row button:active { transform: translateY(1px); }
.email-row button:disabled { cursor: wait; opacity: 0.72; }

.form-note { color: rgba(var(--ink-rgb), 0.52); margin: 10px 0 0; padding-left: 6px; text-align: left; font-size: 0.76rem; font-weight: 600; }
.form-error { min-height: 20px; color: var(--error); margin: 6px 0 0; font-size: 0.78rem; font-weight: 600; }

.skip-button {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(22px, env(safe-area-inset-bottom));
  color: rgba(var(--ink-rgb), 0.42);
  cursor: pointer;
  background: none;
  border: 0;
  font-size: 0.76rem;
  font-weight: 600;
}
.skip-button:hover { color: var(--ink); }
.skip-button[hidden] { display: none; }

/* ---------- Keyframes ---------- */

@keyframes stage-in { 0% { opacity: 0; transform: translateY(9px); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
@keyframes bounce {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-9px) scale(1.03, 0.96); }
  100% { transform: translateY(0) scale(1); }
}

@media (max-width: 560px) {
  .scene { min-height: calc(100svh - 56px); }
  .email-row { flex-direction: column; }
  .email-row input, .email-row button { width: 100%; flex: none; }
  .waitlist-reveal { min-height: 190px; }
  .face-float { margin-bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .face-float, .face.is-bounce, .stage, .caret { animation: none; }
}
