/* ==========================================================================
   Ystoriée — page d'accueil (liste d'attente)

   Charte : Cormorant Infant pour les titres et citations, Quattrocento Sans
   pour le texte et les sur-titres (en capitales). Palette tirée du brand book :
   crèmes et terres, lavandes, pêches. Beaucoup d'air : la page doit respirer
   comme l'expérience qu'elle annonce.

   Aucun style en ligne dans le HTML : la CSP du site n'autorise pas
   `unsafe-inline`.
   ========================================================================== */

:root {
  /* Crèmes et terres */
  --creme: #FEF8F0;
  --lin: #F7E6D7;
  --sable: #EBD4BF;
  --ocre: #D7B190;
  --or: #BF8C61;
  --terre: #7E5E4B;
  /* Encre : la terre la plus sombre de la charte, encore assombrie pour que le
     texte courant dépasse largement le contraste AA sur fond crème. */
  --encre: #3B2E27;
  --encre-douce: #5E4A3E;

  /* Lavandes et pêches */
  --lavande-pale: #E8DEFE;
  --lavande: #B2A2D5;
  --lavande-profonde: #77679F;
  --peche: #FBC3A3;
  --peche-vive: #F7B38A;

  --danger: #9A3B2E;

  --titre: 'Cormorant Infant', 'Cormorant Garamond', Garamond, 'Times New Roman', serif;
  --texte: 'Quattrocento Sans', 'Gill Sans', 'Segoe UI', Helvetica, Arial, sans-serif;

  --largeur: 72rem;
  --gouttiere: clamp(1.25rem, 5vw, 3rem);
  --respiration: clamp(5rem, 12vw, 9rem);

  color-scheme: light;
}

/* --- Socle ---------------------------------------------------------------- */

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--creme);
  color: var(--encre);
  font-family: var(--texte);
  font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* `hidden` doit l'emporter sur un `display` posé par une classe (la ligne du
   formulaire, en grille, que le script masque après l'inscription). */
[hidden] {
  display: none !important;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

p {
  margin: 0 0 1.1em;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--titre);
  font-weight: 400;
  line-height: 1.12;
  text-wrap: balance;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--lavande-profonde);
  outline-offset: 4px;
}

::selection {
  background: var(--peche);
  color: var(--encre);
}

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

.lien-evitement {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--creme);
  color: var(--encre);
  border-radius: 2px;
  transform: translateY(-200%);
  transition: transform 0.2s ease;
}

.lien-evitement:focus {
  transform: none;
}

/* --- Éléments partagés ------------------------------------------------------ */

.surtitre {
  margin: 0 0 1.1rem;
  font-family: var(--texte);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--lavande-profonde);
}

.titre-section {
  font-size: clamp(2.1rem, 1.5rem + 2.4vw, 3.25rem);
  font-weight: 300;
  color: var(--encre);
}

/* Filet doré : un trait de pinceau plutôt qu'une bordure. */
.filet {
  display: block;
  width: 4.5rem;
  height: 1px;
  margin: 1.6rem 0 1.9rem;
  background: linear-gradient(90deg, var(--or), var(--ocre) 60%, transparent);
}

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.85rem 2.1rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--texte);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, transform 0.35s ease;
}

.bouton:hover {
  transform: translateY(-1px);
}

.bouton--clair {
  color: var(--encre);
  background: rgba(254, 248, 240, 0.92);
  border-color: rgba(254, 248, 240, 0.92);
}

.bouton--clair:hover {
  background: var(--creme);
  color: var(--terre);
}

.bouton--plein {
  color: var(--creme);
  background: var(--terre);
  border-color: var(--terre);
}

.bouton--plein:hover {
  background: var(--encre);
  border-color: var(--encre);
}

.bouton--plein[disabled] {
  cursor: progress;
  opacity: 0.7;
  transform: none;
}

.bouton--contour {
  color: var(--terre);
  background: transparent;
}

.bouton--contour:hover {
  color: var(--creme);
  background: var(--terre);
  border-color: var(--terre);
}

/* --- Bloc 1 : bannière ---------------------------------------------------- */

.banniere {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(5rem, 12vh, 8rem) var(--gouttiere) clamp(6rem, 14vh, 9rem);
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  text-align: center;
}

.banniere__fond,
.banniere__fond img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.banniere__fond {
  z-index: -2;
}

.banniere__fond img {
  object-fit: cover;
  object-position: center 60%;
  animation: respiration 28s ease-in-out infinite alternate;
}

/* Voile chaud : assez dense pour la lisibilité du texte blanc, assez léger
   pour laisser vivre le rose des nuages. */
.banniere::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse at center, rgba(59, 46, 39, 0.28) 0%, rgba(59, 46, 39, 0.08) 70%),
    linear-gradient(180deg, rgba(59, 46, 39, 0.18) 0%, rgba(59, 46, 39, 0.05) 40%, rgba(59, 46, 39, 0.32) 100%);
}

.banniere__contenu {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 50rem;
  text-shadow: 0 1px 24px rgba(59, 46, 39, 0.35);
}

.banniere__logo {
  width: min(35vw, 13rem);
  height: auto;
  margin-bottom: clamp(2.5rem, 7vh, 4rem);
  filter: drop-shadow(0 2px 18px rgba(59, 46, 39, 0.25));
}

.banniere__titre {
  font-size: clamp(2.3rem, 1.4rem + 3.8vw, 4.4rem);
  font-weight: 300;
  line-height: 1.08;
}

.banniere__titre span {
  display: block;
}

.banniere__titre span + span {
  font-style: italic;
}

.banniere__accroche {
  margin: 1.6rem 0 0;
  font-family: var(--texte);
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.6rem);
  font-weight: 500;
}

.banniere__lieu {
  max-width: 34rem;
  margin: 1.1rem 0 0;
  font-family: var(--titre);
  /* Cormorant a des minuscules plus basses que le texte courant : à taille
     égale, elle paraît plus petite — d'où ce corps un peu plus généreux. */
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.6;
  opacity: 0.95;
}

.banniere__matieres {
  margin: 2rem 0 2.6rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.banniere__matieres span {
  display: inline-block;
  margin: 0 0.6em;
  color: var(--peche);
}

/* Sur un écran étroit, les trois matières tiennent sur une ligne plutôt que de
   laisser une puce orpheline en bout de ligne. */
@media (max-width: 30rem) {
  .banniere__matieres {
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    white-space: nowrap;
  }

  .banniere__matieres span {
    margin: 0 0.35em;
  }
}

.banniere__suite {
  position: absolute;
  bottom: clamp(1.5rem, 4vh, 2.5rem);
  left: 50%;
  display: block;
  width: 2.75rem;
  height: 2.75rem;
  transform: translateX(-50%);
}

.banniere__suite span {
  position: absolute;
  top: 0.4rem;
  left: 50%;
  width: 1px;
  height: 2rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff);
  animation: goutte 2.8s ease-in-out infinite;
}

@keyframes respiration {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

@keyframes goutte {
  0% { opacity: 0; transform: translateY(-0.6rem); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateY(0.6rem); }
}

/* --- Bloc 2 : l'intention -------------------------------------------------- */

.intention {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
  max-width: var(--largeur);
  margin: 0 auto;
  padding: var(--respiration) var(--gouttiere);
}

.intention__image {
  position: relative;
  /* Laisse la place au liseré décalé : il ne doit pas toucher le bord de l'écran. */
  margin-right: 1.1rem;
}

.intention__image img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 999px 999px 0 0;
}

/* Un liseré décalé, comme le cadre d'une page enluminée. */
.intention__image::after {
  content: '';
  position: absolute;
  inset: 1.1rem -1.1rem -1.1rem 1.1rem;
  z-index: -1;
  border: 1px solid var(--ocre);
  border-radius: 999px 999px 0 0;
}

.intention__texte {
  max-width: 32rem;
}

.intention__envoi {
  margin-top: 1.6rem;
  font-family: var(--titre);
  font-size: clamp(1.35rem, 1.15rem + 0.7vw, 1.65rem);
  font-style: italic;
  line-height: 1.4;
  color: var(--terre);
}

@media (min-width: 52rem) {
  .intention {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }
}

/* --- Les matières ------------------------------------------------------------ */

.matieres {
  padding: 0 var(--gouttiere) var(--respiration);
}

.matieres__liste {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.75rem, 2.5vw, 2rem);
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.matiere img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 2px;
}

.matiere:nth-child(2) {
  transform: translateY(clamp(1rem, 4vw, 3rem));
}

/* --- Bloc 3 : les valeurs ----------------------------------------------- */

.valeurs {
  padding: var(--respiration) var(--gouttiere);
  background:
    linear-gradient(180deg, var(--creme) 0%, var(--lin) 22%, var(--lin) 78%, var(--creme) 100%);
}

.valeurs__grille {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.valeur {
  position: relative;
  padding-top: 2.4rem;
  text-align: center;
}

/* Losange doré : le point d'or posé sur le parchemin. */
.valeur::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 0.55rem;
  height: 0.55rem;
  background: linear-gradient(135deg, var(--ocre), var(--or));
  transform: translateX(-50%) rotate(45deg);
}

.valeur__nom {
  margin-bottom: 1rem;
  font-size: clamp(1.7rem, 1.4rem + 1vw, 2.1rem);
  font-weight: 400;
  color: var(--encre);
}

.valeur p {
  max-width: 19rem;
  margin: 0 auto;
  color: var(--encre-douce);
}

@media (min-width: 40rem) {
  .valeurs__grille {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3.5rem 3rem;
  }
}

/* Grand écran : la grille reste en 2 × 2, resserrée au centre, plutôt qu'une
   ligne de quatre colonnes étroites — comme la croix des valeurs de la charte. */
@media (min-width: 64rem) {
  .valeurs__grille {
    max-width: 56rem;
    gap: 4.5rem 6rem;
  }

  .valeur p {
    max-width: 22rem;
  }

  /* Filet vertical entre les deux colonnes, posé par la colonne de droite. */
  .valeur:nth-child(even)::after {
    content: '';
    position: absolute;
    top: 2.4rem;
    bottom: 0;
    left: -3rem;
    width: 1px;
    background: linear-gradient(180deg, transparent, var(--sable) 20%, var(--sable) 80%, transparent);
  }
}

/* --- Bloc 4 : liste d'attente --------------------------------------------- */

.attente {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 5rem);
  align-items: center;
  max-width: var(--largeur);
  margin: 0 auto;
  padding: var(--respiration) var(--gouttiere);
  scroll-margin-top: 1rem;
}

.attente__image img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 60% center;
  border-radius: 2px;
}

.attente__carte {
  position: relative;
  padding: clamp(2rem, 5vw, 3.5rem);
  background: #fff;
  border: 1px solid var(--sable);
  border-radius: 2px;
  box-shadow: 0 30px 60px -40px rgba(126, 94, 75, 0.35);
}

.attente__intro {
  font-family: var(--titre);
  font-size: clamp(1.3rem, 1.15rem + 0.6vw, 1.55rem);
  font-style: italic;
  line-height: 1.4;
  color: var(--terre);
}

.attente__promesse {
  margin: 1.4rem 0 0;
  font-family: var(--titre);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--terre);
}

.attente__rgpd {
  margin: 0.8rem 0 0;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--encre-douce);
}

@media (min-width: 56rem) {
  .attente {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }

  .attente__carte {
    margin-left: -4rem;
  }
}

/* --- Formulaire ------------------------------------------------------------- */

.inscription {
  margin-top: 2rem;
}

.inscription__ligne {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
}

.inscription__libelle {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--encre-douce);
}

.inscription__champ {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 1.4rem;
  border: 1px solid var(--ocre);
  border-radius: 999px;
  background: var(--creme);
  color: var(--encre);
  font: inherit;
  /* 16 px minimum : en deçà, iOS zoome sur le champ à la saisie. */
  font-size: max(1rem, 16px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.inscription__champ::placeholder {
  color: #9C8676;
}

.inscription__champ:focus {
  outline: none;
  border-color: var(--lavande-profonde);
  background: #fff;
  box-shadow: 0 0 0 4px var(--lavande-pale);
}

.inscription__champ[aria-invalid='true'] {
  border-color: var(--danger);
}

@media (min-width: 30rem) {
  .inscription__ligne {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .inscription__libelle {
    grid-column: 1 / -1;
  }
}

/* Champ piège : hors de l'écran plutôt que `display: none`, que certains
   robots savent repérer. */
.inscription__piege {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.inscription__etat {
  min-height: 1.5em;
  margin: 1rem 0 0;
  font-size: 0.95rem;
}

.inscription__etat:empty {
  margin: 0;
  min-height: 0;
}

.inscription__etat.est-erreur {
  color: var(--danger);
}

.inscription__etat.est-succes {
  padding: 1.1rem 1.3rem;
  background: var(--lin);
  border-left: 2px solid var(--or);
  font-family: var(--titre);
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.45;
  color: var(--encre);
}

/* --- Bloc 5 : pied de page ----------------------------------------------- */

.pied {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem var(--gouttiere) 3rem;
  border-top: 1px solid var(--sable);
  text-align: center;
}

.pied__logo {
  width: 9rem;
  height: auto;
}

.pied__mention {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--encre-douce);
}

/* --- Pages simples (merci, 404, réponse sans JavaScript) ----------------- */

.page-message {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 3rem var(--gouttiere);
  background:
    radial-gradient(ellipse at top, var(--lin), var(--creme) 60%);
}

.message {
  max-width: 34rem;
  text-align: center;
}

.message__logo {
  display: inline-block;
  margin-bottom: 3rem;
}

.message__logo img {
  width: 13rem;
  height: auto;
}

.message__titre {
  margin-bottom: 1.4rem;
  font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.2rem);
  font-weight: 300;
}

.message__texte {
  margin-bottom: 2.4rem;
  font-family: var(--titre);
  font-size: 1.35rem;
  font-style: italic;
  line-height: 1.5;
  color: var(--terre);
}

/* --- Apparition au défilement ---------------------------------------------
   Seuls les éléments situés SOUS la ligne de flottaison au chargement sont
   masqués (classe posée par main.js) : sans JavaScript, ou pour ce qui est
   déjà à l'écran, rien ne clignote ni ne reste invisible. */

.revele.est-en-attente {
  opacity: 0;
  transform: translateY(1.5rem);
}

.revele {
  transition: opacity 1.1s ease, transform 1.1s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.matiere.revele:nth-child(2) {
  transition-delay: 0.12s;
}

.matiere.revele:nth-child(3) {
  transition-delay: 0.24s;
}

.matiere:nth-child(2).est-en-attente {
  transform: translateY(calc(clamp(1rem, 4vw, 3rem) + 1.5rem));
}

@media (prefers-reduced-motion: reduce) {
  .banniere__fond img,
  .banniere__suite span {
    animation: none;
  }

  .revele,
  .revele.est-en-attente {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .matiere:nth-child(2),
  .matiere:nth-child(2).est-en-attente {
    transform: translateY(clamp(1rem, 4vw, 3rem));
  }
}
