/* Page d'accueil 'Arrive bientôt' (fondiva.com et /en/). Reprend le design du futur site (nouveau-site/) :
   la brume animée du film en fond de toute la page, Switzer, titres serrés, bouton noir en pilule, symbole
   Fondiva en blanc. Tout tient sur un seul écran, du téléphone au grand écran. Les pages légales ont le même habillage (site.css). */

@font-face { font-family: "switzer"; src: url("/assets/ds/fonts/switzer-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "switzer"; src: url("/assets/ds/fonts/switzer-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --mist: #D9E3EE;
  --ink: #0E1012;
  --ink-2: #2A3036;
  --lead-grey: #7D858D;
  --danger: #A11A10;
  --gutter: clamp(20px, 4.4vw, 64px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Le fond de body prend la couleur de base de la brume : Safari iOS en peint la barre d'état et le bas de l'écran. */
html, body { margin: 0; background: var(--mist); }
body {
  color: var(--ink);
  font-family: "switzer", ui-sans-serif, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
::selection { background: rgba(14, 16, 18, .14); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* ---- Un seul écran : barre, contenu, pied, sur toute la hauteur visible ---- */
.page {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100svh;
  display: grid; grid-template-rows: auto 1fr auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.row { width: 100%; padding: 0 var(--gutter); }

/* ---- Barre du haut ---- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: clamp(64px, 10vh, 96px); }
.bar-logo { display: flex; color: var(--ink); }
.bar-logo svg { width: clamp(96px, 8vw, 116px); height: auto; aspect-ratio: 805 / 150; }
.lang { display: flex; gap: 4px; font-size: 14px; font-weight: 500; }
.lang > * { display: grid; place-items: center; min-width: 40px; height: 32px; padding: 0 10px; border-radius: 999px; text-decoration: none; }
.lang a { color: var(--ink-2); transition: background .2s ease, color .2s ease; }
.lang a:hover { background: rgba(255, 255, 255, .55); color: var(--ink); }
.lang [aria-current="page"] { background: var(--ink); color: #FFFFFF; }

/* ---- Contenu : le texte à gauche, le symbole en grand à droite ---- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  align-items: center; gap: clamp(32px, 5vw, 96px);
  padding-top: clamp(8px, 2vh, 24px); padding-bottom: clamp(24px, 5vh, 56px);
}
.hero-copy { max-width: 860px; }
.hero h1 {
  font-size: clamp(42px, 5.8vw, 100px); font-weight: 500; line-height: .98; letter-spacing: -0.045em;
  text-wrap: balance;
}
.lead {
  margin-top: clamp(20px, 3.4vh, 36px);
  max-width: 560px;
  font-size: clamp(18px, 1.55vw, 23px); line-height: 1.42; letter-spacing: -0.01em; color: var(--lead-grey);
  text-wrap: pretty;
}
.lead strong { font-weight: 500; }

/* Sous-texte en gris ; à la souris, une lumière suit le curseur et fonce les mots qu'elle touche.
   assets/accueil.js donne la position (--x, --y) ; le rayon (--r) s'ouvre au survol et se referme à la sortie.
   Sur écran tactile, ou sans background-clip: text, le texte reste simplement gris. */
@property --r { syntax: "<length>"; inherits: true; initial-value: 0px; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  @media (hover: hover) and (pointer: fine) {
    .lead {
      --x: 50%; --y: 50%;
      color: transparent;
      background: radial-gradient(var(--r) circle at var(--x) var(--y), var(--ink) 0%, var(--ink) 30%, var(--lead-grey) 100%);
      -webkit-background-clip: text; background-clip: text;
      transition: --r .35s var(--ease);
    }
    .lead:hover { --r: 64px; }
  }
}

/* Le symbole Fondiva, blanc, à la taille de l'écran : il tient la moitié droite. */
.mark {
  justify-self: center;
  width: min(100%, 52vh, 520px); aspect-ratio: 1;
  position: relative; overflow: hidden;
  background: #FFFFFF;
  -webkit-mask: url("/assets/accueil/symbole-masque.svg") center / contain no-repeat;
  mask: url("/assets/accueil/symbole-masque.svg") center / contain no-repeat;
}

/* Au survol du symbole, une lumière ouvre une fenêtre ronde, aux bords fondus, sur l'interface de l'app
   (assets/accueil/app.jpg, l'écran Factures du film, données fictives). Le masque du symbole découpe l'image ;
   accueil.js fait suivre la souris (--x, --y), --r ouvre et referme la lumière. Rien sur écran tactile. */
.mark-app { display: none; }
@media (hover: hover) and (pointer: fine) {
  .mark { --x: 50%; --y: 50%; transition: --r .45s var(--ease); }
  .mark:hover { --r: 150px; }
  .mark-app {
    display: block; position: absolute; inset: 0;
    background: #EEF2F6 url("/assets/accueil/app.jpg") 30% 30% / 230% auto no-repeat;
    -webkit-mask: radial-gradient(var(--r) circle at var(--x) var(--y), #000 0%, #000 45%, transparent 100%);
    mask: radial-gradient(var(--r) circle at var(--x) var(--y), #000 0%, #000 45%, transparent 100%);
  }
}

/* ---- Liste d'attente : champ blanc et bouton noir dans une même pilule ---- */
.waitlist { width: 100%; max-width: 560px; margin-top: clamp(28px, 4.6vh, 48px); }
.waitlist__form { position: relative; }
.waitlist__row {
  display: flex; align-items: center; gap: 8px;
  height: 64px; padding: 6px;
  border-radius: 999px; background: #FFFFFF;
  transition: box-shadow .2s ease;
}
.waitlist__row:focus-within { box-shadow: 0 0 0 3px rgba(14, 16, 18, .85); }
.waitlist__row:has(.is-error) { box-shadow: 0 0 0 2px var(--danger); }
.tf { flex: 1; min-width: 0; height: 100%; display: flex; }
.tf__input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; outline: none; background: transparent; padding: 0 0 0 20px; margin: 0;
  color: var(--ink); font: inherit; font-size: 17px;
}
.tf__input::placeholder { color: #6B7279; }
.tf__error { display: block; margin-top: 10px; padding-left: 20px; font-size: 14px; font-weight: 500; color: var(--danger); }

.btn {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 24px;
  border: 0; border-radius: 999px;
  background: var(--ink); color: #FFFFFF;
  font: inherit; font-size: 16px; font-weight: 500; white-space: nowrap;
  cursor: pointer;
  transition: transform .2s var(--ease), background .2s ease, opacity .2s ease;
}
.btn:hover { background: #2D3237; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: progress; transform: none; }
.btn svg { transition: transform .2s var(--ease); }
.btn:hover svg { transform: translateX(3px); }

.waitlist__challenge.is-interactive { margin-top: 16px; }
/* Champ piège anti-robots, hors écran */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.waitlist__done {
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 12px 24px 12px 12px;
  border-radius: 999px; background: #FFFFFF;
  font-size: 16px; line-height: 1.35; color: var(--ink-2);
  animation: rise .6s var(--ease) both;
}
.waitlist__done .icon { flex: none; width: 40px; height: 40px; padding: 10px; border-radius: 50%; background: var(--ink); color: #FFFFFF; }
.waitlist__done strong { font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }

/* ---- Pied : les pages légales ---- */
.foot { display: flex; align-items: center; padding-top: 16px; padding-bottom: clamp(20px, 4vh, 36px); }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 24px; }
/* En blanc sur la brume : présents, mais en retrait derrière le titre et le formulaire. */
.foot a { font-size: 14px; color: #FFFFFF; text-decoration: none; transition: color .2s ease; }
.foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---- Tablette et téléphone : une colonne, le symbole passe en petit au-dessus du titre ---- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; align-content: center; gap: 0; }
  .hero h1 { font-size: clamp(42px, 9.4vw, 84px); max-width: 15ch; }
  .lead { max-width: 560px; }
  .mark { order: -1; justify-self: start; width: clamp(56px, 9vh, 88px); margin-bottom: clamp(20px, 3.4vh, 32px); }
}
@media (max-width: 560px) {
  .hero h1 { font-size: clamp(38px, 11vw, 52px); }
  .waitlist__row { flex-direction: column; align-items: stretch; height: auto; gap: 10px; padding: 0; background: none; }
  .waitlist__row:focus-within, .waitlist__row:has(.is-error) { box-shadow: none; }
  .tf { flex: none; height: 56px; border-radius: 999px; background: #FFFFFF; transition: box-shadow .2s ease; }
  .tf:focus-within { box-shadow: 0 0 0 3px rgba(14, 16, 18, .85); }
  .tf.is-error { box-shadow: 0 0 0 2px var(--danger); }
  .btn { height: 56px; width: 100%; }
  .waitlist__done { border-radius: 28px; }
  .foot-links { gap: 4px 18px; }
  .foot a { font-size: 13px; }
}
/* Téléphone de petite taille (iPhone SE, 667 px) : le logo de la barre suffit, le symbole s'efface pour tenir sans défiler. */
@media (max-width: 560px) and (max-height: 760px) { .mark { display: none; } }
/* Écrans bas (ordinateur portable en paysage, téléphone couché) : on resserre pour tenir sans défiler. */
@media (max-height: 640px) and (min-width: 561px) {
  .hero h1 { font-size: clamp(36px, 5vw, 64px); }
  .lead { margin-top: 14px; }
  .waitlist { margin-top: 20px; }
}

/* ---- La brume : trois couches de taches de couleur qui dérivent lentement (dessin de nouveau-site) ---- */
.brume-fond, .brume-fond span { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.brume-fond { background: var(--mist); }
.brume-fond span::before, .brume-fond span::after, .brume-fond::before {
  content: ""; position: absolute; inset: -35%;
  animation: brume-a 26s ease-in-out infinite alternate;
  will-change: transform;
}
.brume-fond::before {
  background:
    radial-gradient(30% 34% at 22% 28%, rgb(126,166,210) 0%, rgba(126,166,210,0) 70%),
    radial-gradient(28% 30% at 78% 22%, rgb(140,200,166) 0%, rgba(140,200,166,0) 70%),
    radial-gradient(32% 30% at 50% 82%, rgb(196,184,166) 0%, rgba(196,184,166,0) 70%);
}
.brume-fond span::before {
  background:
    radial-gradient(26% 30% at 70% 64%, rgb(90,127,166) 0%, rgba(90,127,166,0) 70%),
    radial-gradient(24% 28% at 30% 60%, rgb(154,194,236) 0%, rgba(154,194,236,0) 70%);
  animation-name: brume-b; animation-duration: 32s; opacity: .8;
}
.brume-fond span::after {
  background:
    radial-gradient(30% 26% at 46% 38%, rgb(243,246,244) 0%, rgba(243,246,244,0) 70%),
    radial-gradient(22% 24% at 86% 80%, rgb(134,181,154) 0%, rgba(134,181,154,0) 70%);
  animation-duration: 21s; animation-direction: alternate-reverse; mix-blend-mode: soft-light;
}
/* En fond de page, la dérive du film (26 à 32 s) se voyait à peine : deux fois et demie plus vite, comme la brume
   de l'icône du nouveau site, pour que le fond bouge à l'œil. */
.page > .brume-fond::before { animation-duration: 11s; }
.page > .brume-fond span::before { animation-duration: 13s; }
.page > .brume-fond span::after { animation-duration: 9s; }
@keyframes brume-a { 0% { transform: translate(-12%, -8%) rotate(0deg); } 100% { transform: translate(12%, 10%) rotate(40deg); } }
@keyframes brume-b { 0% { transform: translate(10%, 8%) rotate(0deg); } 100% { transform: translate(-10%, -12%) rotate(-50deg); } }

/* ---- Apparition : le titre, puis le texte, puis le formulaire, puis le symbole ---- */
[data-rise] { animation: rise .9s var(--ease) both; animation-delay: var(--d, 0s); }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
.mark[data-rise] { animation-name: rise-mark; animation-duration: 1.4s; }
@keyframes rise-mark { from { opacity: 0; transform: scale(.92); } }

@media (prefers-reduced-motion: reduce) {
  [data-rise], .waitlist__done { animation: none; }
  .brume-fond::before, .brume-fond span::before, .brume-fond span::after { animation: none; }
  .btn, .waitlist__row, .tf, .lang a, .lead, .mark { transition: none; }
}
