/* The welcome of a first visit (welcome.js, 25 Nov 2026). Four calm screens: the whole page takes the flat colour of
   the screen's clip, and the clip's edges fade into it, so no square edge shows. Words in Francois One (the app's font since 25 Nov, faces in world.css),
   as in the Figma design. Layout from Figma (390 px wide): words 38 px from the left, the clip centred, the button at the bottom. */
.welcome.wl { --wl-bg:#f8dee6; --wl-font:"Francois One", "Arial Narrow", system-ui, sans-serif;
  background:var(--wl-bg); overflow:hidden;   /* no colour fade: the clip changes at once, so the page does too */ font-family:var(--wl-font); font-weight:400; }
.wl-in { position:relative; width:min(100%, 480px); height:100%; margin:0 auto; box-sizing:border-box; display:flex; flex-direction:column;
  padding:calc(18px + env(safe-area-inset-top)) 28px calc(22px + env(safe-area-inset-bottom)); }

/* top: the progress bar and "Passer" */
.wl-top { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:34px; }
.wl-bar { width:140px; height:6px; border-radius:99px; background:rgba(39,50,74,.12); overflow:hidden; }
.wl-bar i { display:block; height:100%; width:25%; border-radius:99px; background:var(--ink); transition:width .45s cubic-bezier(.3,.8,.3,1); }
.wl-skip { border:0; background:none; padding:8px 4px; font:400 15px/1 var(--wl-font); color:var(--ink); opacity:.55; cursor:pointer; }
.wl-skip:hover { opacity:.8; }
.wl[data-stop="3"] .wl-skip { visibility:hidden; }   /* the last screen: only "Commencer" (as in Figma) */

/* the words, the clip, the buttons */
.wl-body { flex:1; min-height:0; display:flex; flex-direction:column; }
.wl-body > * { animation:wl-in .5s cubic-bezier(.2,.9,.3,1.1) both; animation-delay:calc(var(--k, 0) * 60ms); }
.wl-title { margin:24px 0 8px 10px; font:400 clamp(30px, 9.2vw, 38px)/1.04 var(--wl-font); color:var(--ink); max-width:330px; text-wrap:balance; }
.wl-title:focus { outline:none; }
.wl-lead { margin:0 0 0 10px; font:400 clamp(16px, 4.6vw, 18.5px)/1.35 var(--wl-font); color:var(--ink); opacity:.82; max-width:310px; }

/* the clip: as wide as the screen allows, a little bigger than in Figma; its edges fade into the page colour */
.wl-clip { flex:1; min-height:0; display:grid; place-items:center; margin:6px -28px 0; }
.wl-clip canvas { width:min(100%, 440px, var(--wl-clip, 52dvh)); aspect-ratio:1; height:auto; object-fit:contain; display:block;
  -webkit-mask-image:linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-composite:source-in; mask-image:linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 4%, #000 96%, transparent);
  mask-composite:intersect; transition:transform .45s cubic-bezier(.3,.8,.3,1); }
.wl-clip.flip canvas { transform:scaleX(-1); }
.wl[data-stop="1"] { --wl-clip:42dvh; }   /* the hand choice needs room under the clip */

/* which hand: the hands are the buttons; the chosen (or hovered) one grows and its word turns pink, the other fades */
.wl-hands { display:flex; justify-content:center; gap:52px; margin:4px 0 14px; }
.wl-hand { display:flex; flex-direction:column; align-items:center; gap:6px; min-width:88px; padding:6px; border:0; background:none; cursor:pointer;
  font:400 18px/1 var(--wl-font); color:var(--ink); opacity:.5; -webkit-tap-highlight-color:transparent; transition:opacity .25s, color .25s; }
.wl-hand img { width:58px; height:auto; filter:saturate(.45); transition:transform .3s cubic-bezier(.34,1.56,.64,1), filter .25s; }
.wl-hand.left img { transform:scaleX(-1); }
.wl-hand.on { opacity:1; color:var(--pink); }
.wl-hand.on img { filter:none; transform:scale(1.25); }
.wl-hand.left.on img { transform:scaleX(-1) scale(1.25); }
@media (hover:hover) {
  .wl-hands:hover .wl-hand { opacity:.5; color:var(--ink); }
  .wl-hands:hover .wl-hand img { filter:saturate(.45); transform:none; }
  .wl-hands:hover .wl-hand.left img { transform:scaleX(-1); }
  .wl-hands .wl-hand:hover { opacity:1; color:var(--pink); }
  .wl-hands .wl-hand:hover img { filter:none; transform:scale(1.25); }
  .wl-hands .wl-hand.left:hover img { transform:scaleX(-1) scale(1.25); }
}
.wl-hand:focus-visible { outline:3px solid var(--ink); outline-offset:4px; border-radius:14px; }

.wl-actions { display:flex; flex-direction:column; align-items:stretch; gap:6px; }
.wl-go { width:100%; height:60px; border:0; border-radius:99px; background:var(--ink); color:#fff; font:400 19px/1 var(--wl-font); letter-spacing:.01em; cursor:pointer;
  box-shadow:0 4px 0 rgba(0,0,0,.22); transition:transform .12s, box-shadow .12s; -webkit-tap-highlight-color:transparent; }
.wl-go.pink { background:var(--pink); box-shadow:0 4px 0 var(--pink-d); }
.wl-go:active { transform:translateY(3px); box-shadow:0 1px 0 rgba(0,0,0,.22); }
.wl-go:focus-visible, .wl-later:focus-visible, .wl-skip:focus-visible { outline:3px solid var(--ink); outline-offset:3px; }
.wl-later { border:0; background:none; padding:10px; font:400 16px/1 var(--wl-font); color:var(--ink); opacity:.6; cursor:pointer; }

@keyframes wl-in { from { transform:translateY(14px); opacity:0; } }
@media (prefers-reduced-motion:reduce) { .wl-body > * { animation:none; } }
/* short screens (an old phone sideways, a small laptop window): smaller words, the clip shrinks first */
@media (max-height:640px) { .wl-title { margin-top:12px; font-size:28px; } .wl-lead { font-size:15.5px; } .wl-go { height:52px; } }
