/* p3.css - prototype P3, le hero. Meme registre de nuit que P1. */
@font-face { font-family: Satoshi; font-weight: 400; font-display: block; src: url("../../_commun/fonts/satoshi-400.woff2") format("woff2"); }
@font-face { font-family: Satoshi; font-weight: 500; font-display: block; src: url("../../_commun/fonts/satoshi-500.woff2") format("woff2"); }
@font-face { font-family: Satoshi; font-weight: 700; font-display: block; src: url("../../_commun/fonts/satoshi-700.woff2") format("woff2"); }

:root {
  --teinte: #3C4148;
  --teinte-fond: #1d1f22;
  --teinte-texte: #d6d8dc;
  --nuit: #0e0d0b;
  --encre: #f1ede6;
  --encre-2: rgba(241, 237, 230, .62);
  /* le telephone : proportions d un iPhone (71,6 x 147,6 mm) */
  --tel-h: 72vh;
  --tel-l: calc(var(--tel-h) * .485);
  --tel-x: 66%;
  --tel-y: 20vh;
  /* la levre : cadre + ilot, en part de la hauteur du telephone */
  --levre: 7.4%;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--nuit); color: var(--encre);
  font-family: Satoshi, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

#p3-fond {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(70% 62% at 60% 42%, var(--teinte-fond) 0%, transparent 70%),
    radial-gradient(130% 110% at 50% 50%, transparent 38%, rgba(0, 0, 0, .62) 100%),
    var(--nuit);
  transition: background .8s ease;
}
.p3-barre {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; justify-content: space-between; padding: 18px 28px;
  font-size: 13px; letter-spacing: .02em; color: var(--encre-2);
}
.p3-barre strong { color: var(--encre); }

/* ------------------------------------------------------------ la scene */
#p3-scene { position: relative; height: 100vh; z-index: 1; overflow: hidden; touch-action: pan-y; }
#p3-toile { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 3; pointer-events: none; }
#p3-ombre {
  position: absolute; left: 50%; top: 78%; z-index: 2; pointer-events: none;
  width: 34vw; height: 5vw; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, .55), rgba(0, 0, 0, .2) 55%, transparent 100%);
  filter: blur(14px); transform: translate(-50%, 0);
}

/* ------------------------------------------------------------ le telephone */
.tel {
  position: absolute; z-index: 1; top: var(--tel-y); left: calc(var(--tel-x) - var(--tel-l) / 2);
  --tel-l: calc(var(--tel-h) * .485); /* recalcule par telephone : sinon un --tel-h local garde la largeur de la racine */
  width: var(--tel-l); height: var(--tel-h);
}
.tel-cadre {
  position: absolute; inset: 0; border-radius: 15% / 7.3%; padding: 3.4%;
  background: linear-gradient(140deg, #4a4c51 0%, #222326 22%, #17181a 60%, #34363a 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, .14),
    inset 0 0 0 3px #0b0b0c,
    0 40px 80px -20px rgba(0, 0, 0, .75),
    0 18px 30px -12px rgba(0, 0, 0, .6);
}
.tel-cadre::before, .tel-cadre::after {          /* les boutons du flanc */
  content: ""; position: absolute; width: 1.2%; border-radius: 2px; background: #2a2b2e;
}
.tel-cadre::before { left: -1%; top: 18%; height: 6%; }
.tel-cadre::after { right: -1%; top: 24%; height: 11%; }
.tel-ecran {
  position: relative; width: 100%; height: 100%; overflow: hidden;
  border-radius: 12% / 5.8%; background: #000;
}
.tel-statut {
  position: absolute; top: 1.9%; left: 9%; right: 9%; display: flex; justify-content: space-between; align-items: center;
  font-size: calc(var(--tel-h) * .021); font-weight: 600; color: #fff;
}
.tel-icones { display: flex; gap: .35em; align-items: center; }
.tel-icones svg { height: .72em; width: auto; fill: currentColor; display: block; }
.tel-ilot {
  position: absolute; top: 1.3%; left: 50%; transform: translateX(-50%);
  width: 33%; height: 4.3%; border-radius: 999px; background: #000;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .04);
}

/* la pile Wallet : deux passes generiques, sans marque reelle, puis le notre */
.tel-pile { position: absolute; left: 4.5%; right: 4.5%; top: 0; bottom: 0; }
.tel-generique, .tel-passe {
  position: absolute; left: 0; right: 0; aspect-ratio: 85.6 / 53.98; border-radius: 4.2% / 6.6%;
}
.tel-generique span + span { font-weight: 500; opacity: .75; }
/* largeur explicite : avec `left` et `right` seuls, le moteur de Safari deduit la largeur de `aspect-ratio` et rend
   ces deux cartes plus etroites que la notre (202 px contre 224, mesure le 08/10) */
.tel-generique { box-sizing: border-box; width: 100%; display: flex; justify-content: space-between; padding: 3.2% 5%; font-size: calc(var(--tel-h) * .017); font-weight: 600; color: rgba(255, 255, 255, .6); }
.tel-generique.g1 { top: 12.5%; background: linear-gradient(#242c36, #1d242c); }
.tel-generique.g2 { top: 18.5%; background: linear-gradient(#33272e, #291f25); box-shadow: 0 -6px 14px rgba(0, 0, 0, .35); }
.tel-passe { top: 24.5%; visibility: hidden; opacity: 0; }
.tel-passe canvas { width: 100%; height: 100%; display: block; border-radius: inherit; }
.tel-ombre {
  position: absolute; left: 6%; right: 6%; top: 27%; aspect-ratio: 85.6 / 53.98; border-radius: 10%;
  background: rgba(0, 0, 0, .9); filter: blur(18px); opacity: 0;
}

/* la levre : la meme silhouette, decoupee a son bandeau du haut, au-dessus du canvas */
.tel-levre { z-index: 4; pointer-events: none; clip-path: inset(0 0 calc(100% - var(--levre)) 0); }
.tel-levre .tel-cadre { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), inset 0 0 0 3px #0b0b0c; }
.tel-levre .tel-ecran::after {        /* le fin trait d ombre du bord haut de l ecran */
  content: ""; position: absolute; left: 0; right: 0; top: calc(var(--levre) - 3.4%); height: 1.2%;
  background: linear-gradient(rgba(0, 0, 0, .55), transparent);
}

/* ------------------------------------------------------------ le texte */
.p3-txt {
  position: absolute; z-index: 5; left: 7vw; top: 50%;
  max-width: 31vw; transform-origin: left center; translate: 0 -50%;
}
.p3-txt h1 { margin: 0 0 .45em; font-size: clamp(36px, 4.1vw, 64px); line-height: 1.03; font-weight: 700; letter-spacing: -.025em; }
.p3-txt h1 em { font-style: normal; color: var(--teinte-texte); transition: color .6s ease; }
.p3-txt p { margin: 0 0 1.6em; font-size: clamp(16px, 1.25vw, 19px); line-height: 1.5; color: var(--encre-2); max-width: 34ch; }
.p3-boutons-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 2em; }
.p3-btn {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 22px; border-radius: 999px;
  font-size: 15px; font-weight: 600; text-decoration: none; color: var(--encre);
  border: 1px solid rgba(255, 255, 255, .22); transition: background .2s ease, border-color .2s ease;
}
.p3-btn:hover { border-color: rgba(255, 255, 255, .5); }
.p3-btn.is-plein { background: var(--encre); color: var(--nuit); border-color: var(--encre); }
.p3-btn.is-plein:hover { background: #fff; }
.p3-btn:focus-visible, .p3-pastille:focus-visible { outline: 2px solid var(--encre); outline-offset: 3px; }
.p3-exemples { display: grid; gap: 10px; }
.p3-exemples small { font-size: 13px; color: var(--encre-2); }
#p3-pastilles { display: flex; gap: 10px; }
.p3-pastille {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; padding: 0; cursor: pointer;
  background: var(--p); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 2px 6px rgba(0, 0, 0, .5);
  transition: transform .18s ease, border-color .18s ease;
}
.p3-pastille:hover { transform: scale(1.15); }
.p3-pastille[aria-pressed="true"] { border-color: var(--encre); }

.p3-suite { position: relative; z-index: 1; min-height: 70vh; padding: 14vh 7vw; color: var(--encre-2); font-size: 15px; line-height: 1.6; max-width: 64ch; }
.p3-suite h2 { color: var(--encre); font-size: 20px; margin: 0 0 .6em; }

.p3-outils { position: fixed; right: 28px; bottom: 26px; z-index: 20; display: flex; gap: 8px; align-items: center; }
.p3-outils button {
  font: inherit; font-size: 12px; color: var(--encre-2); background: rgba(14, 13, 11, .62); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px; padding: 8px 14px; cursor: pointer;
}
#p3-mesure { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--encre); }

/* ------------------------------------------------------------ telephone (08/10) : meme seuil que ETROIT dans p3.js */
@media (max-width: 760px), (max-aspect-ratio: 4/5) {
  /* Paul, 08/10 (iPhone). Le haut est une page ordinaire, sans arret : le texte, la couleur et le nom, la carte
     dessous. Le telephone RESTE (« c est l ADN du site ») : il suit dans la page, et la carte y descend pendant qu on
     fait defiler. Ce qui a change, c est le raccord : la carte qui entre est une image posee dans la pile par CSS -
     donc toujours a la bonne taille -, plus la carte 3D qu il fallait aligner sur le telephone au pixel pres. */
  #p3-scene { height: auto; padding: 92px 20px 40px; overflow: visible; display: flex; flex-direction: column; }
  /* Paul, 15/10 : « le titre et apres direct la carte », trop de texte au premier ecran. Le bloc texte s efface
     (display: contents) pour que ses enfants se rangent un par un autour de la carte. */
  .p3-txt { display: contents; }
  .p3-txt h1 { order: 1; } .p3-zone-carte { order: 2; } .p3-exemples { order: 3; }
  .p3-txt > p { order: 4; margin-top: 1.4em; } .p3-boutons-cta { order: 5; } #p3-scene .tel:not(.tel-levre) { order: 6; }
  #p3-ombre, .p3-btn-choix, .p3-aide-pc { display: none; }
  /* la carte en vol : la case de la pile, sortie du telephone et posee dans la scene (p3.js la place et l anime).
     Elle passe SOUS la levre - la copie du haut du telephone - et par-dessus son ecran : elle entre par le haut. */
  .tel-passe.p3-vol { z-index: 5; right: auto; visibility: visible; opacity: 0; box-shadow: 0 22px 44px -14px rgba(0, 0, 0, .75); will-change: transform, opacity; }
  #p3-scene .tel-levre { z-index: 6; margin: 0; order: 9; }
  #p3-scene .tel:not(.tel-levre) { position: relative; top: auto; left: auto; margin: 32px auto 0; --tel-h: min(150vw, 82svh); }
  .p3-txt { position: relative; z-index: 4; left: auto; right: auto; top: auto; max-width: none; translate: none; }
  .p3-zone-carte { position: relative; height: 66vw; margin-top: 8px; flex: none; }   /* un peu plus haute qu une carte a pleine largeur */
  .p3-nom { display: grid; gap: 6px; margin-top: 18px; font-size: 14px; color: var(--encre-2); max-width: 420px; }   /* 420 : ecran vertical, le champ ne s etire plus sur toute la largeur */
  .p3-nom input { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; color: var(--encre); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px; padding: 11px 14px; }
  .p3-nom input::placeholder { color: rgba(241, 237, 230, .4); }
  .p3-nom input:focus-visible { outline: 2px solid var(--encre); outline-offset: 3px; }
  #p3-pastilles { gap: min(10px, 2.4vw); }   /* les sept tiennent sur une ligne */
  .p3-pastille { width: min(40px, 10.4vw); height: min(40px, 10.4vw); flex: none; }
  .p3-txt h1 { font-size: clamp(31px, 9vw, 40px); }
  .p3-txt p { max-width: none; margin-bottom: 1.2em; }
  .p3-boutons-cta { margin-bottom: 1.3em; }
  #p3-ombre { width: 60vw; height: 9vw; }
}
/* le nom et son aide n existent que sur telephone (le choix se fait plus bas sur PC) */
@media (min-width: 761px) and (min-aspect-ratio: 4001/5000) { .p3-nom, .p3-aide-tel, .p3-zone-carte { display: none; } }
