/* Smelte — page d'attente de smelte.xyz : une seule scène, le logo imprimé en 3D en plein écran,
   dans le coloris choisi (une ambiance par coloris, D-011 ; couleurs dans ambiances.css).
   Charte : boutons en pilule toujours en aplat ; ici le champ e-mail est aussi en pilule (demande de Maxime,
   2026-10-10, exception à « champs à angles droits » de D-013), accroche en Affinik
   (dessinée en SVG par scripts/construire.mjs), texte Arial (D-013, D-015). */

/* Couleurs animées au changement de coloris (valeurs initiales : Forêt) */
@property --fond { syntax: "<color>"; inherits: true; initial-value: #B8E270; }
@property --texte { syntax: "<color>"; inherits: true; initial-value: #213832; }
@property --champ { syntax: "<color>"; inherits: true; initial-value: #EEF7F4; }
@property --champ-texte { syntax: "<color>"; inherits: true; initial-value: #213832; }
@property --bouton { syntax: "<color>"; inherits: true; initial-value: #213832; }
@property --bouton-texte { syntax: "<color>"; inherits: true; initial-value: #EEF7F4; }

:root {
  --font-text: Arial, Arimo, "Helvetica Neue", Helvetica, sans-serif;
  --gutter: 16px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

html {
  background: var(--fond);
  touch-action: manipulation; /* pas de zoom au double tap */
  transition:
    --fond 0.8s var(--ease), --texte 0.8s var(--ease), --champ 0.8s var(--ease),
    --champ-texte 0.8s var(--ease), --bouton 0.8s var(--ease), --bouton-texte 0.8s var(--ease);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, p { margin: 0; }
a { color: inherit; text-underline-offset: 3px; }
button, input { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--texte); outline-offset: 3px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- la scène ----------
   L'image couvre l'écran (object-fit: cover) et le mot y est centré : --s (pixels d'écran par pixel du rendu)
   donne sa taille à l'écran. La rangée du milieu réserve sa hauteur ; accroche et coloris se posent au-dessus,
   le formulaire en dessous. Rendus en largeur : 2000 × 1125 px, mot de 1240 × 328 px, centré. */

.scene {
  --s: max(100vw / 2000, 100dvh / 1125);
  --mot-l: calc(1236 * var(--s));
  --mot-h: calc(360 * var(--s));
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr var(--mot-h) 1fr;
  justify-items: center;
  padding: 0 var(--gutter);
  text-align: center;
}

/* ---------- fond et changement de coloris ----------
   Au changement de coloris, le nouveau rendu se pose sur l'ancien et apparaît en fondu (app.js),
   choix de Maxime du 2026-10-10. */

.fond { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.fond picture, .fond img { position: absolute; inset: 0; width: 100%; height: 100%; }
.fond img { display: block; object-fit: cover; }
html.chargement .fond__image { visibility: hidden; } /* coloris mémorisé : pas d'éclair de Forêt avant l'échange */

.calque { opacity: 0; transition: opacity 0.8s var(--ease); }
.calque.visible { opacity: 1; }

/* ---------- accroche et coloris ---------- */

.haut {
  grid-row: 1; align-self: end;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  margin-bottom: clamp(14px, calc(40 * var(--s)), 44px);
}
.haut .texte { display: block; width: clamp(240px, calc(var(--mot-l) * 0.5), 620px); height: auto; fill: currentColor; }

.coloris { display: flex; flex-direction: column; align-items: center; gap: 8px; }
/* Écart : l'anneau du coloris choisi (4 px) et l'agrandissement au survol (×1,1) ne touchent jamais la voisine */
.coloris__piste { display: inline-flex; gap: 12px; padding: 8px; border-radius: 999px; background: var(--champ); }
.pastille {
  width: 32px; height: 32px; padding: 0; border: 0; border-radius: 999px;
  background: var(--pastille);
  box-shadow: inset 0 0 0 1.5px var(--pastille-bord, transparent);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.pastille:hover { transform: scale(1.1); }
.pastille:active { transform: scale(0.94); }
.pastille[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1.5px var(--pastille-bord, transparent), 0 0 0 2px var(--champ), 0 0 0 4px var(--champ-texte);
}
.pastille:focus-visible { outline-offset: 5px; }
.coloris__nom { font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }

/* ---------- liste d'attente ---------- */

.dessous {
  grid-row: 3; align-self: stretch;
  display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 28px;
  width: min(100%, 480px);
  padding-top: clamp(20px, calc(56 * var(--s)), 56px);
}

.bas__texte { font-size: 17px; }

.inscription { margin-top: 14px; }
.champ { display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 999px; background: var(--champ); }
.champ:focus-within { outline: 3px solid var(--texte); outline-offset: 2px; }
.champ input[type="email"] {
  flex: 1; min-width: 0; height: 48px; padding: 0 16px 0 20px; border: 0; border-radius: 0;
  background: transparent; color: var(--champ-texte); font-size: 17px; outline: none;
}
.champ input[type="email"]::placeholder { color: var(--champ-texte); opacity: 0.5; }
.bouton {
  flex: none; height: 48px; padding: 0 24px; border: 0; border-radius: 999px;
  background: var(--bouton); color: var(--bouton-texte);
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: transform 0.15s var(--ease), filter 0.15s;
}
.bouton:hover { filter: brightness(1.15); }
.bouton:active { transform: scale(0.97); }
.bouton:disabled { cursor: progress; opacity: 0.7; }
.piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.inscription__message { margin-top: 12px; font-weight: 700; }
/* Information au moment de la saisie (RGPD, art. 13) et lien vers la page Confidentialité */
.inscription__note { margin-top: 12px; font-size: 13px; line-height: 1.4; text-wrap: balance; }
.inscription__message:empty { display: none; }

/* Adresse mal saisie : champ cerclé qui tremble, message en pilule inversée (lisible dans toutes les ambiances) */
.inscription__message[data-etat="erreur"] {
  display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%;
  margin: 12px auto 0; padding: 9px 16px 9px 9px; border-radius: 999px;
  background: var(--texte); color: var(--fond);
  font-size: 14px; line-height: 1.35; text-align: left;
}
.inscription__message[data-etat="erreur"]::before {
  content: "!"; flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 999px;
  background: var(--fond); color: var(--texte); font-weight: 700;
}
.champ.erreur { box-shadow: 0 0 0 3px var(--texte); animation: secousse 0.4s var(--ease); }
@keyframes secousse {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}
.inscrit .champ { display: none; }
.inscrit .inscription__message { margin-top: 0; font-size: 20px; }

/* ---------- réseaux et contact ---------- */

.pied {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 14px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.reseau {
  width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center;
  background: var(--texte); color: var(--fond);
  transition: transform 0.15s var(--ease), filter 0.15s;
}
.reseau:hover { filter: brightness(1.2); }
.reseau:active { transform: scale(0.95); }
.reseau svg { width: 20px; height: 20px; }
.pied__contact { margin-left: 6px; font-size: 14px; font-weight: 700; }

/* ---------- écrans en hauteur : rendus story (1125 × 2000 px, mot de 781 × 204 px, centré) ---------- */

@media (max-aspect-ratio: 6/5) {
  .scene {
    --s: max(100vw / 1125, 100dvh / 2000);
    --mot-l: calc(781 * var(--s));
    --mot-h: calc(230 * var(--s));
  }
  .haut .texte { width: clamp(220px, calc(var(--mot-l) * 0.8), 520px); }
}

/* ---------- téléphone : plus d'air, champ plus fin, place pour la barre d'adresse de Safari en bas ---------- */

@media (max-width: 600px) {
  /* accroche et coloris remontés : au milieu de l'espace au-dessus du mot */
  .haut { align-self: center; gap: 22px; margin-bottom: 0; }
  .coloris { gap: 10px; }
  .dessous { padding-top: 36px; gap: 28px; }
  .bas__texte { font-size: 15px; text-wrap: balance; }
  .inscription { margin-top: 20px; }
  .champ { width: min(100%, 320px); margin: 0 auto; padding: 3px; }
  .champ input[type="email"] { height: 36px; padding: 0 10px 0 14px; font-size: 16px; } /* 16 px : Safari ne zoome pas */
  .bouton { height: 36px; padding: 0 16px; font-size: 14px; }
  .inscription__message { margin-top: 14px; }
  .inscription__note { margin-top: 10px; font-size: 12px; }
  .reseau { width: 40px; height: 40px; }
  .reseau svg { width: 18px; height: 18px; }
  .pied__contact { font-size: 13px; }
  .pied { padding-bottom: calc(max(env(safe-area-inset-bottom), 12px) + 56px); }
}

@media (max-width: 380px) {
  .coloris__piste { gap: 9px; padding: 7px; }
  .pastille { width: 30px; height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  html, .pastille, .bouton, .reseau, .calque { transition: none; }
  .champ.erreur { animation: none; }
}
