/* ==========================================================================
   Discover — l'écran d'accès aux maquettes Twineo
   Porté depuis la maquette validée (discover-maquette/assets/css/discover.css).
   Écarts : l'encart de revue est retiré ; le champ du code a son cadre au repos
   sur le téléphone (cf. media query < 900 px).
   Charte : celle du site Twineo (twineo3rd/assets/css/main.css), sans écart.
   Règle : monochrome, sauf ce qui vous tient. Ici, ce qui tient : la corde
   orange et le mousqueton bleu qui portent l'étiquette du code.
   Mouvement : tout ce qui tombe est retenu. Rien ne glisse de côté.
   ========================================================================== */

:root {
  --brume: #edf1f4;
  --brume-3: #c7d0d8;
  --granit: #8b96a1;
  --ardoise: #56616c;
  --encre: #252524;
  --ardoise-nuit: #121922;
  --nuit: #0a1220;

  --corde: #f4801f;
  --corde-texte: #b0520a;
  --mousqueton: #1698cd;
  --mousqueton-texte: #0d6f98;

  --erreur: #b3261e;
  --papier: #fbfaf7;

  --f-structure: "Mona Sans", ui-sans-serif, system-ui, sans-serif;
  --f-voix: "Newsreader", Georgia, "Times New Roman", serif;

  --marge: clamp(20px, 5vw, 88px);
  --tete-h: 72px;
  --retenu: cubic-bezier(.22, .9, .25, 1);
  --hisse: cubic-bezier(.5, 0, .75, 0);

  --corde-x: 64%;       /* là où pend la corde sur l'ordinateur, comme sur l'accueil du site */
  --etiquette-l: 400px;
}

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

html {
  font-family: var(--f-structure);
  font-size: 100%;
  color: #fff;
  background: #2d3747;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body { margin: 0; min-height: 100svh; font-size: 1.0625rem; line-height: 1.6; background: #2d3747; overflow-x: clip; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
p { margin: 0; }
h1 { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
.insecable { white-space: nowrap; }

:focus-visible { outline: 2px solid var(--mousqueton); outline-offset: 3px; border-radius: 2px; }

/* --------------------------------------------------------------------------
   La scène : l'heure bleue, la mer de nuages
   -------------------------------------------------------------------------- */

.scene {
  position: relative; z-index: 8;
  min-height: 100svh;
  display: grid; grid-template-rows: auto 1fr;
  overflow: hidden;
}
.scene__fond { position: absolute; inset: 0; overflow: hidden; background: #2d3747; }
.scene__fond img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%;
  transform-origin: 50% 70%;
}
.scene__fond::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(14, 20, 32, .6) 0%, rgba(14, 20, 32, .25) 44%, rgba(14, 20, 32, .05) 70%),
    linear-gradient(180deg, rgba(14, 20, 32, .35) 0%, rgba(14, 20, 32, 0) 24%, rgba(14, 20, 32, 0) 64%, rgba(14, 20, 32, .5) 100%);
}

/* le grain, fin comme une photo argentique */
.scene::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.12  0 0 0 0 0.15  0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  opacity: .22; mix-blend-mode: multiply;
}

/* --------------------------------------------------------------------------
   En-tête : le logo, et un lien discret vers le site
   -------------------------------------------------------------------------- */

.tete {
  position: relative; z-index: 3;
  height: var(--tete-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--marge);
}
.tete__logo { display: inline-flex; align-items: center; gap: 12px; }
.symbole { width: 34px; height: auto; }
.symbole__bleu { fill: var(--mousqueton); }
.symbole__encre { fill: #fff; }
.logotype {
  display: block; width: 112px; aspect-ratio: 1400 / 201;
  background: url(../img/logotype-clair.png) center / contain no-repeat;
}
.tete__site {
  font-size: .92rem; font-weight: 560; opacity: .86;
  text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: .35em; text-decoration-color: rgba(255, 255, 255, .4);
  transition: opacity .3s, text-decoration-color .3s, text-underline-offset .3s;
  padding: .6em 0;
}
.tete__site:hover { opacity: 1; text-decoration-color: #fff; text-underline-offset: .25em; }

/* --------------------------------------------------------------------------
   L'accès : le texte à gauche, l'étiquette qui pend à la corde à droite
   -------------------------------------------------------------------------- */

.acces {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--etiquette-l);
  grid-template-areas: "texte accroche" "aide accroche";
  grid-template-rows: 1fr auto;
  column-gap: clamp(32px, 6vw, 110px);
  padding: 0 var(--marge) 40px;
  /* l'étiquette est centrée sur la corde : sa colonne commence là où la corde pend, moins la moitié de sa largeur */
  padding-right: max(var(--marge), calc(100% - var(--corde-x) - var(--etiquette-l) / 2));
}

.acces__texte { grid-area: texte; align-self: center; max-width: 40rem; padding-bottom: 2vh; }
.acces__lieu { font-size: .95rem; font-weight: 560; letter-spacing: .01em; opacity: .88; margin-bottom: 1.4rem; }
.acces__titre {
  font-size: clamp(2.7rem, 6.2vw, 6.6rem);
  font-weight: 620; font-stretch: 112%;
  line-height: .92; letter-spacing: -.028em;
  text-wrap: balance;
}
.ligne { display: block; }
.acces__promesse {
  margin-top: 1.6rem;
  font-size: clamp(1.3rem, 1.9vw, 1.9rem); font-weight: 560; font-stretch: 106%;
  line-height: 1.15; letter-spacing: -.012em;
}
.acces__phrase {
  margin-top: .55rem;
  font-family: var(--f-voix); font-style: italic; font-weight: 400; font-variation-settings: "opsz" 24;
  font-size: clamp(1.15rem, 1.5vw, 1.5rem); line-height: 1.3; color: #cfe6f2;
}

.acces__aide { grid-area: aide; align-self: end; font-size: .95rem; line-height: 1.6; color: #dfe6ee; max-width: 40ch; }
.acces__aide a {
  font-weight: 620; color: #fff;
  text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: .25em; text-decoration-color: var(--corde);
}
.acces__aide a:hover { text-decoration-thickness: 2px; }

/* --------------------------------------------------------------------------
   La corde, le mousqueton, l'étiquette
   -------------------------------------------------------------------------- */

.accroche {
  grid-area: accroche;
  position: relative;
  align-self: center;
  width: 100%;
  padding-top: 104px;         /* la place du mousqueton */
  align-self: start;
  margin-top: max(16px, calc(50svh - var(--tete-h) - 250px));
}

/* la corde tombe du haut de l'écran : gaine orange tressée, fils témoins bleu et anthracite */
.corde {
  position: absolute; left: 50%; bottom: calc(100% - 20px);
  width: 12px; height: 140vh; margin-left: -6px;
  border-radius: 6px;
  background:
    repeating-linear-gradient(150deg, transparent 0 21px, rgba(22, 152, 205, .75) 21px 22.5px, transparent 22.5px 43px, rgba(37, 37, 36, .45) 43px 44.5px, transparent 44.5px 52px),
    repeating-linear-gradient(35deg, rgba(255, 220, 180, .22) 0 1.5px, transparent 1.5px 4.5px),
    repeating-linear-gradient(-35deg, rgba(110, 45, 0, .3) 0 1.5px, transparent 1.5px 4.5px),
    linear-gradient(90deg, #c4600f 0%, var(--corde) 32%, #ff9a45 50%, var(--corde) 68%, #b8580c 100%);
  box-shadow: 4px 6px 10px -4px rgba(0, 0, 0, .45);
}

.attache {
  position: absolute; left: 50%; top: 0;
  width: 64px; height: 124px; margin-left: -32px; z-index: 2;
  overflow: visible;
  filter: drop-shadow(3px 5px 4px rgba(0, 0, 0, .35));
}
.attache__boucle { fill: none; stroke: url(#tresse); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.attache__noeud { fill: url(#tresse); stroke: #b0520a; stroke-width: 1.2; }
.attache__reflet { fill: none; stroke: rgba(255, 255, 255, .45); stroke-width: 1.4; stroke-linecap: round; }
.attache__mousqueton { fill: none; stroke: var(--mousqueton); stroke-width: 6; }
.attache__doigt { fill: none; stroke: #dfe6ee; stroke-width: 3.5; stroke-linecap: round; }

.etiquette {
  position: relative;
  background: var(--papier);
  color: var(--encre);
  border-radius: 3px;
  border-top: 5px solid var(--corde);
  padding: 30px 30px 28px;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7), 0 1px 1px rgba(0, 0, 0, .1);
}
/* l'œillet percé dans l'étiquette */
.etiquette::before {
  content: ""; position: absolute; left: 50%; top: -1px;
  width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: #1d2733; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .7), 0 0 0 2px #c9d2db;
}

.etiquette__label { display: block; font-size: 1rem; font-weight: 620; font-stretch: 104%; margin-bottom: .9rem; }

/* six cases en deux groupes de trois, au-dessus d'un vrai champ (collage, clavier, lecteur d'écran) */
.cases {
  position: relative;
  display: flex; justify-content: space-between; gap: 18px;
  border-radius: 4px;
}
.cases__groupe { display: flex; gap: 8px; flex: 1; }
.cases__champ {
  position: absolute; inset: 0; z-index: 2;
  width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0;
  font-size: 16px;          /* pas de zoom automatique sur iPhone */
  cursor: text;
}
.cases:focus-within { outline: 2px solid var(--mousqueton); outline-offset: 6px; }
.case {
  position: relative; flex: 1;
  height: 68px;
  display: grid; place-items: center;
  border-bottom: 2px solid var(--brume-3);
  font-size: 2.3rem; font-weight: 620; font-stretch: 112%; letter-spacing: -.01em;
  line-height: 1;
  font-variant-numeric: lining-nums;
  transition: border-color .3s, color .3s;
}
.case.est-plein { border-bottom-color: var(--encre); }
.case.est-plein .car { display: inline-block; animation: retenu-leger .45s var(--retenu) both; }
/* le curseur, dans la case suivante, quand le champ a le focus */
.cases:focus-within .case.est-courant::after {
  content: ""; position: absolute; left: 50%; top: 18px; bottom: 16px;
  width: 2px; margin-left: -1px; background: var(--encre);
  animation: curseur 1.1s steps(1) infinite;
}
@keyframes curseur { 50% { opacity: 0; } }

.etiquette__aide { margin-top: .9rem; font-size: .9rem; color: var(--ardoise); }
.etiquette__message { font-size: .92rem; line-height: 1.45; color: var(--ardoise); }
.etiquette__message:not(:empty) { margin-top: .7rem; }
.etiquette__message strong { display: block; font-weight: 640; color: var(--erreur); font-size: 1rem; }
.etiquette__message .reste { display: block; margin-top: .35rem; color: var(--ardoise); }

.etiquette.a-erreur .case { border-bottom-color: var(--erreur); }
.etiquette.a-erreur .cases__champ ~ .cases__groupe .case { color: var(--encre); }

.bouton {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: .9em 1.45em;
  background: var(--encre); color: #fff;
  border: 0; border-radius: 3px;
  font-weight: 620; font-stretch: 104%; font-size: 1rem; letter-spacing: .005em;
  text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .14);
  transition: transform .5s var(--retenu), filter .3s, font-stretch .5s var(--retenu);
}
.bouton:hover { transform: translateY(-2px); filter: brightness(1.15); font-stretch: 110%; }
.bouton:active { transform: translateY(1px); transition-duration: .08s; }
.etiquette__bouton { width: 100%; margin-top: 1.4rem; }
.etiquette__bouton[aria-busy="true"] { cursor: progress; filter: none; transform: none; }

/* les états qui remplacent la saisie */
.etiquette__etat {
  font-size: clamp(1.9rem, 2.6vw, 2.4rem); font-weight: 620; font-stretch: 112%;
  line-height: 1; letter-spacing: -.02em;
  outline: none;
}
.etiquette__texte { margin-top: .8rem; font-size: .98rem; line-height: 1.5; color: var(--ardoise); }
.etiquette__texte a { color: var(--encre); font-weight: 620; text-decoration-color: var(--corde); text-underline-offset: .2em; }
.etiquette__voix {
  margin-top: .6rem;
  font-family: var(--f-voix); font-style: italic; font-weight: 400; font-variation-settings: "opsz" 24;
  font-size: 1.2rem; line-height: 1.35; color: var(--ardoise);
}
.compte {
  margin-top: 1.1rem; padding: .8rem 0 .8rem 1rem;
  border-left: 4px solid var(--granit);
  font-size: 1rem; color: var(--encre);
}
.compte strong { font-weight: 640; font-variant-numeric: tabular-nums; }

/* en pause : la corde a pris la chute, l'étiquette reste plus bas, le mousqueton au repos */
.accroche { translate: 0 0; transition: translate .6s var(--retenu); }
.accroche.est-en-pause { translate: 0 18px; }
.accroche.est-en-pause .etiquette { border-top-color: var(--granit); }

/* accepté : le mousqueton se verrouille, l'étiquette prend le bleu du « oui » */
.accroche.est-ouverte .etiquette { border-top-color: var(--mousqueton); }
.accroche.est-ouverte .attache__doigt { transform: translateY(-2px); }

/* --------------------------------------------------------------------------
   Mouvement : tout ce qui tombe est retenu
   -------------------------------------------------------------------------- */

@keyframes retenu {
  0%   { opacity: 0; transform: translateY(-22px); }
  48%  { opacity: 1; transform: translateY(6px); }
  70%  { transform: translateY(-2px); }
  100% { opacity: 1; transform: none; }
}
@keyframes retenu-leger {
  0%   { transform: translateY(-8px); }
  55%  { transform: translateY(2px); }
  100% { transform: none; }
}
@keyframes titre-retenu {
  0%   { opacity: 0; transform: translateY(-26px); font-stretch: 100%; }
  40%  { opacity: 1; transform: translateY(5px); font-stretch: 125%; }
  62%  { transform: translateY(-2px); font-stretch: 108%; }
  80%  { font-stretch: 114%; }
  100% { opacity: 1; transform: none; font-stretch: 112%; }
}
/* l'étiquette arrive du haut, au bout de sa corde, et la corde l'arrête */
@keyframes descente {
  0%   { transform: translateY(-70vh); }
  58%  { transform: translateY(14px); }
  76%  { transform: translateY(-4px); }
  90%  { transform: translateY(2px); }
  100% { transform: none; }
}
/* le code ne passe pas : l'étiquette tombe, la corde s'étire et la retient */
@keyframes chute {
  0%   { transform: none; }
  30%  { transform: translateY(34px); }
  52%  { transform: translateY(12px); }
  70%  { transform: translateY(20px); }
  86%  { transform: translateY(15px); }
  100% { transform: none; }
}
/* la gaine absorbe la chute : le code s'élargit puis se pose */
@keyframes tension {
  0%   { font-stretch: 112%; }
  30%  { font-stretch: 125%; }
  60%  { font-stretch: 106%; }
  100% { font-stretch: 112%; }
}

.js .acces__texte > * { opacity: 0; }
.js .est-arrivee .acces__texte > * { animation: retenu 1s var(--retenu) both; }
.js .est-arrivee .acces__titre { animation-name: titre-retenu; animation-duration: 1.3s; }
.js .est-arrivee .acces__promesse { animation-delay: .2s; }
.js .est-arrivee .acces__phrase { animation-delay: .4s; }
.js .est-arrivee .acces__lieu { animation-duration: .7s; }
.js .accroche { visibility: hidden; }
.js .est-arrivee .accroche { visibility: visible; animation: descente 1.25s var(--retenu) .35s both; }
.js .acces__aide { opacity: 0; }
.js .est-arrivee .acces__aide { animation: retenu .9s var(--retenu) .8s both; }
/* filet de sécurité : si le script échoue, tout s'affiche quand même */
.js .scene:not(.est-arrivee) .acces__texte > *, .js .scene:not(.est-arrivee) .acces__aide { animation: filet .01s 3s forwards; }
.js .scene:not(.est-arrivee) .accroche { animation: filet-v .01s 3s forwards; }
@keyframes filet { to { opacity: 1; } }
@keyframes filet-v { to { visibility: visible; } }

.js .est-arrivee .accroche.chute { animation: chute .95s var(--retenu) both; }
.accroche.chute .case .car { animation: tension .95s var(--retenu) both; }

/* --------------------------------------------------------------------------
   La montée : la corde hisse l'étiquette, on traverse la brume, la maquette est là
   -------------------------------------------------------------------------- */

.scene__fond img { transition: transform 1.6s var(--retenu); }
.monte .scene__fond img { transform-origin: 50% 100%; transform: translateY(7%) scale(1.16); }
.monte .acces__texte, .monte .acces__aide, .monte .tete {
  transition: transform 1.2s var(--hisse), opacity .9s ease-in;
  transform: translateY(26vh); opacity: 0;
}
.js .scene.monte .accroche { animation: hisse 1.05s var(--hisse) both; }
@keyframes hisse { from { transform: none; } to { transform: translateY(-130vh); } }
@keyframes vue-qui-descend { from { transform: none; opacity: 1; } to { transform: translateY(30vh); opacity: 0; } }

.traversee {
  position: fixed; inset: -30vh 0; z-index: 20;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(237, 241, 244, 0) 0%, var(--brume) 22%, var(--brume) 78%, rgba(237, 241, 244, 0) 100%);
  transform: translateY(-100%);
  visibility: hidden;
}
.traversee::after {
  content: ""; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1  0 0 0 0 0.12  0 0 0 0 0.15  0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
  opacity: .28; mix-blend-mode: multiply;
}
.traversee.entre { visibility: visible; transform: translateY(0); transition: transform 1s cubic-bezier(.45, 0, .3, 1); }
.traversee.sort { visibility: visible; transform: translateY(100%); transition: transform 1.6s cubic-bezier(.45, .05, .35, 1); }

/* la maquette, en plein écran pur : rien d'autre qu'elle */
.maquette {
  position: fixed; inset: 0; z-index: 5;
  width: 100%; height: 100%;
  border: 0; display: block; background: #fff;
}
html.sur-maquette, html.sur-maquette body { overflow: hidden; background: #fff; }

/* --------------------------------------------------------------------------
   Téléphone d'abord… et ordinateur ensuite : sous 900 px, une seule colonne
   -------------------------------------------------------------------------- */

@media (max-width: 899px) {
  :root { --tete-h: 64px; }
  .scene__fond img { object-position: 64% 58%; }
  .scene__fond::after {
    background: linear-gradient(180deg, rgba(14, 20, 32, .55) 0%, rgba(14, 20, 32, .3) 40%, rgba(14, 20, 32, .25) 70%, rgba(14, 20, 32, .6) 100%);
  }
  .acces {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "texte" "accroche" "aide";
    grid-template-rows: auto auto auto;
    padding: 12px var(--marge) 32px;
    padding-right: var(--marge);
    row-gap: 0;
  }
  .acces__texte { padding-bottom: 0; }
  .acces__lieu { margin-bottom: .9rem; }
  .acces__promesse { margin-top: 1.1rem; }
  .accroche { max-width: 440px; width: 100%; justify-self: center; margin-top: 10px; padding-top: 148px; }
  /* sur le téléphone, la corde part d'un point vissé dans la paroi, juste au-dessus */
  .corde { height: 64px; bottom: auto; top: 0; border-radius: 6px 6px 6px 6px; }
  .accroche::before {
    content: ""; position: absolute; left: 50%; top: -6px; z-index: 1;
    width: 26px; height: 18px; margin-left: -13px;
    border-radius: 10px 10px 6px 6px;
    background: linear-gradient(180deg, #c9d2db, #8b96a1);
    box-shadow: 0 2px 3px rgba(0, 0, 0, .4), inset 0 0 0 4px rgba(255, 255, 255, .0);
  }
  .accroche::after {
    content: ""; position: absolute; left: 50%; top: -1px; z-index: 2;
    width: 8px; height: 8px; margin-left: -4px; border-radius: 50%;
    background: #56616c;
  }
  .attache { top: 44px; }
  .acces__aide { margin-top: 2rem; }
  /* sur le téléphone, la corde part d'un point vissé : l'étiquette ne remonte pas à travers lui ; c'est nous qui montons, la paroi défile vers le bas */
  .js .scene.monte .accroche { animation: vue-qui-descend 1.2s var(--hisse) both; }
  .etiquette { padding: 26px 22px 24px; }
  .case { height: 60px; font-size: 2rem; }
  .cases { gap: 14px; }
  .cases__groupe { gap: 6px; }
  /* au doigt, le champ n'a pas le focus en arrivant : au repos, il porte le cadre
     des champs de la charte (.champ : 1.5px solid #c7d0d8), que le focus remplace par le bleu */
  .cases::before {
    content: ""; position: absolute; inset: -6px; z-index: 1; pointer-events: none;
    border: 1.5px solid var(--brume-3); border-radius: 8px;
  }
  .cases:focus-within::before { display: none; }
}

@media (max-width: 360px) {
  .case { font-size: 1.7rem; }
}

/* sur un écran bas d'ordinateur, on resserre */
@media (min-width: 900px) and (max-height: 760px) {
  .acces__titre { font-size: clamp(2.6rem, 5.2vw, 5.2rem); }
}

/* --------------------------------------------------------------------------
   Mouvement réduit : rien ne tombe, rien ne monte ; les états changent sur place
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .acces__texte > *, .js .acces__aide { opacity: 1; }
  .js .accroche { visibility: visible; }
  .cases:focus-within .case.est-courant::after { animation: none; }
}
