/* ── Les maquettes mobiles ──────────────────────────────────────────────
   Une page par app (apps/<id>/index.html) : le prototype fait dans Claude
   Design, dans son téléphone, et autour, le langage du site — du texte et
   des filets, l'or des numéros, le fond au ton de l'app (celui de la
   vitrine : une nuance de noir en sombre, de blanc cassé en clair). À
   gauche ce qu'est l'app, ce qu'on peut toucher dans la maquette, sa
   direction de design, et hors du téléphone, « Voir la version web
   desktop ». Le téléphone garde sa taille (390 × 844) et se réduit pour
   tenir dans l'écran (--k, apps/maquette.js).
   Une feuille autonome : la page ne charge pas styles.css (son défilement
   bloqué, ses transitions entre documents ne la concernent pas).
   ------------------------------------------------------------------- */

@font-face {
  font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 500; font-display: swap;
  src: url('/fonts/space-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 500; font-display: swap;
  src: url('/fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/plex-mono-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* les jetons du site (styles.css), et le ton de l'app, posé par la page
   sur <body> (--app-d, --halo-d en sombre ; --app-l, --halo-l en clair) */
html.dark {
  --ink: #EEF1F6; --ink2: #A8B0BE; --ink3: #98A0AE; --ink4: #8B93A2;
  --line2: rgba(238, 241, 246, .14); --gold: #CDB27A; --sig: oklch(0.82 0.11 197);
  color-scheme: dark;
}
html.light {
  --ink: #0B0D12; --ink2: #3E4552; --ink3: #5A6270; --ink4: #7A8190;
  --line2: rgba(11, 13, 18, .14); --gold: #735A27; --sig: color-mix(in oklab, #4FD6E8 55%, #0B0D12);
  color-scheme: light;
}
:root {
  --sans: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --gutter: clamp(18px, 4vw, 64px);
}
html.dark body { --app: var(--app-d); --app-halo: var(--halo-d); }
html.light body { --app: var(--app-l); --app-halo: var(--halo-l); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* le runtime de la maquette pose « html, body { height: 100% } » : la page,
   elle, défile quand elle dépasse (un téléphone, une fenêtre basse) */
html, body { height: auto !important; min-height: 100%; }
/* « html body » : le gabarit de la maquette pose aussi un fond sur body
   (injecté après cette feuille) ; ici c'est le ton de l'app qui l'emporte */
html body {
  margin: 0; min-height: 100dvh;
  background: radial-gradient(48% 62% at 68% 50%, var(--app-halo), transparent), var(--app);
  color: var(--ink); font-family: var(--sans); font-weight: 300; font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; }
/* (le gabarit de la maquette colore tous les liens : hors du téléphone, ils restent à l'encre du site) */
.mq-bar a, .mq-text a { color: var(--ink); }
.mq-bar .u-brand { color: var(--ink2); }
:focus { outline: none; }
:focus-visible { outline: 1.5px solid var(--sig); outline-offset: 6px; }
::selection { background: color-mix(in oklab, var(--sig) 30%, transparent); }

/* le système du site, ce qui sert ici */
.u-brand { font-family: var(--mono); font-size: 10px; letter-spacing: .28em; text-transform: uppercase; color: var(--ink2); }
.u-rule { flex: 0 0 auto; width: 24px; height: 1px; background: var(--gold); }
.u-num { font-family: var(--mono); font-size: 10px; letter-spacing: .18em; color: var(--gold); font-variant-numeric: tabular-nums; }
.u-meta { font-family: var(--mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink3); }
.u-arrow {
  position: relative; display: inline-block; flex: 0 0 auto; width: .95em; height: 1px;
  margin-left: .25em; vertical-align: middle; background: currentColor;
}
.u-arrow::before, .u-arrow::after {
  content: ''; position: absolute; right: 0; top: 0; width: .42em; height: 1px;
  background: currentColor; transform-origin: 100% 50%; transform: rotate(40deg);
}
.u-arrow::after { transform: rotate(-40deg); }
.u-close {
  position: relative; flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid var(--line2); border-radius: 50%;
  color: var(--ink2); transition: border-color .45s var(--ease), color .45s var(--ease);
}
.u-close::before, .u-close::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 1px; margin: -.5px 0 0 -6px;
  background: currentColor; transform: rotate(45deg);
}
.u-close::after { transform: rotate(-45deg); }

/* ── la barre : la signature et le chemin du retour, la langue, la croix ── */
.mq-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: max(clamp(18px, 2.8vh, 30px), env(safe-area-inset-top)) var(--gutter) 0;
}
.mq-mark { display: flex; align-items: center; gap: 14px; min-width: 0; white-space: nowrap; }
.mq-mark > .u-num { color: var(--ink4); letter-spacing: .2em; }
.mq-apps { font-size: 15px; letter-spacing: -.01em; }
.mq-tools { display: flex; align-items: center; gap: 22px; }
.mq-lang {
  display: inline-flex; gap: 6px; padding: 6px 0; border: 0; background: none; cursor: pointer;
  font-family: var(--mono); font-size: 10px; letter-spacing: .22em; color: var(--ink4);
}
.mq-lang .is-cur { color: var(--ink); }

/* ── la page : le texte à gauche, le téléphone à droite ── */
.mq {
  display: grid; grid-template-columns: minmax(300px, 400px) auto; justify-content: center; align-items: center;
  column-gap: clamp(40px, 7vw, 120px);
  min-height: 100dvh; padding: clamp(84px, 12vh, 120px) var(--gutter) clamp(32px, 6vh, 64px);
}
.mq-text { grid-column: 1; grid-row: 1; animation: mq-rise .9s var(--ease) .1s backwards; }
.mq-more { grid-column: 1; grid-row: 2; align-self: start; animation: mq-rise .9s var(--ease) .25s backwards; }
/* le téléphone reste en vue, collé en haut, quand la colonne du texte défile */
.mq-phone {
  grid-column: 2; grid-row: 1 / span 2; align-self: start;
  position: sticky; top: clamp(84px, 12vh, 120px);
  animation: mq-rise 1s var(--ease) backwards;
}

.mq-kicker { margin: 0 0 18px; }
.mq-name { display: flex; align-items: baseline; gap: 16px; margin: 0; font-size: clamp(40px, 4.6vw, 64px); font-weight: 300; line-height: 1.02; letter-spacing: -.045em; }
.mq-tag { margin: 14px 0 0; }
.mq-about { margin: 20px 0 0; max-width: 40ch; font-size: 15px; line-height: 1.65; color: var(--ink2); text-wrap: pretty; }
.mq-facts { margin: 16px 0 0; line-height: 1.7; }

/* hors du téléphone : la version web, en grand, comme « Entrer → » dans la vitrine */
.mq-web {
  display: inline-flex; align-items: center; gap: .3em; margin-top: clamp(26px, 4vh, 40px);
  font-size: clamp(20px, 1.8vw, 26px); line-height: 1.2; letter-spacing: -.025em; color: var(--ink);
}
.mq-web-t { position: relative; }
.mq-web-t::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor;
  transform: scaleX(var(--u, .35)); transform-origin: 0 50%; transition: transform .5s var(--ease);
}
.mq-web .u-arrow { margin: 0; transition: translate .5s var(--ease); }
.mq-web:focus-visible { --u: 1; }

/* ce qu'on peut toucher, en lignes séparées par des filets ; la direction de design */
.mq-more { margin-top: clamp(28px, 5vh, 48px); }
.mq-h { margin: 0 0 10px; }
.mq-try { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line2); }
.mq-try li { display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line2); font-size: 14px; line-height: 1.5; color: var(--ink2); }
.mq-dir { margin: 26px 0 0; }
.mq-dir-t { margin: 0; max-width: 44ch; font-size: 13.5px; line-height: 1.6; color: var(--ink3); text-wrap: pretty; }
.mq-note { margin: 14px 0 0; font-size: 13px; color: var(--ink3); }
.mq-note:empty { display: none; }
/* d'où viennent les images : en bas, discret */
.mq-credits { margin: 22px 0 0; max-width: 46ch; font-size: 11.5px; line-height: 1.55; color: var(--ink4); text-wrap: pretty; }
.mq-credits:empty { display: none; }

/* le téléphone : sa taille réelle (--pw × --ph, 390 × 844 ; une maquette
   qui dessine son contour au-dehors donne sa marge, --pp), réduite par --k
   pour tenir dans l'écran — la boîte prend la taille réduite, le contenu se
   réduit dedans */
.mq-phone { --k: .8; width: calc(var(--pw, 390px) * var(--k)); height: calc(var(--ph, 844px) * var(--k)); }
.mq-phone-in {
  width: var(--pw, 390px); height: var(--ph, 844px); padding: var(--pp, 0px);
  transform: scale(var(--k)); transform-origin: 0 0;
}

/* un grand écran : trois colonnes — ce qu'est l'app, le téléphone, ce qu'on
   peut y toucher et sa direction — tout tient sans défiler */
@media (min-width: 1200px) {
  .mq { grid-template-columns: minmax(280px, 380px) auto minmax(240px, 320px); }
  .mq-text { grid-row: 1 / span 2; }
  .mq-phone { grid-column: 2; grid-row: 1 / span 2; }
  .mq-more { grid-column: 3; grid-row: 1 / span 2; align-self: center; margin-top: 0; }
}

@keyframes mq-rise { from { opacity: 0; transform: translateY(10px); } }

/* ── la prise : la main de robot qui tient le téléphone (apps/prise/) ──
   Sa toile est posée sur le téléphone (fixe, sous la barre) et ne capte
   aucun clic. En arrivant de la vitrine, le téléphone et le texte attendent
   sous le voile (prise-attend) : le téléphone tombe, le texte vient quand il
   est rattrapé (prise-texte) ; il s'efface quand on repart (prise-part).
   Sans la main (écran étroit, pas de WebGL), le téléphone tombe seul et se
   pose (mq-tombe). */
.prise-toile {
  position: fixed; z-index: 5; pointer-events: none; opacity: 0; transition: opacity .45s var(--ease);
  /* la brume du bas, comme dans la vidéo : le poignet s'y dissout (prise.js
     règle --sous, ce que la toile dépasse sous la fenêtre, et --brume) */
  -webkit-mask-image: linear-gradient(to top, transparent var(--sous, 24px), #000 calc(var(--sous, 24px) + var(--brume, 80px)));
  mask-image: linear-gradient(to top, transparent var(--sous, 24px), #000 calc(var(--sous, 24px) + var(--brume, 80px)));
}
.prise-toile.is-on { opacity: 1; }
html.prise .mq-phone { animation: none; }
/* Le studio de l'arrivée : la main sort d'abord seule du bas de l'écran, sur
   un fond neutre, comme dans la vidéo de référence (demande du 2026-10-17) —
   un blanc doux en clair, un graphite en sombre, plus clair derrière la main
   (--fx : le centre du téléphone). Ni la barre ni le texte : le téléphone
   tombe par-dessus le studio (prise-studio), puis le studio s'efface et la
   page vient. */
.prise-fond {
  position: fixed; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(60% 62% at var(--fx, 50%) 52%, var(--fond-lumiere), transparent 72%), linear-gradient(var(--fond-haut), var(--fond-bas));
  transition: opacity .8s var(--ease);
}
html.dark .prise-fond { --fond-haut: #131315; --fond-bas: #0C0C0E; --fond-lumiere: #26272A; }
html.light .prise-fond { --fond-haut: #E8E8E7; --fond-bas: #F7F7F6; --fond-lumiere: #FFFFFF; }
.prise-fond.is-out { opacity: 0; }
html.prise-studio .mq-phone { z-index: 4; }
html.prise-attend .mq-bar { visibility: hidden; }
html.prise-texte .mq-bar { animation: mq-fondu .8s var(--ease) backwards; }
@keyframes mq-fondu { from { opacity: 0; } }
/* le pouce et le poignet débordent à gauche du téléphone : plus d'air entre lui et le texte */
html.prise .mq { column-gap: clamp(80px, 10vw, 160px); }
/* (le téléphone, lui, n'est pas caché : prise.js le pose au-dessus de la
   fenêtre, où le navigateur le dessine pendant que la main monte — caché, il
   n'était peint qu'au début de sa chute, ≈ 110 ms d'accroc) */
html.prise-attend .mq-text, html.prise-attend .mq-more { visibility: hidden; }
html.prise-texte .mq-text { animation: mq-rise-2 .9s var(--ease) backwards; }
html.prise-texte .mq-more { animation: mq-rise-2 .9s var(--ease) .12s backwards; }
html.prise-part .mq-text, html.prise-part .mq-more { opacity: 0; transition: opacity .35s var(--ease); }
/* (un autre nom que mq-rise : le même relancerait l'animation déjà jouée sous le voile) */
@keyframes mq-rise-2 { from { opacity: 0; transform: translateY(10px); } }

.mq-tombe { animation: mq-tombe 1.05s .2s backwards; }
@keyframes mq-tombe {
  0% { transform: translateY(calc(-100vh - 100%)) rotate(-6deg); animation-timing-function: cubic-bezier(.55, 0, 1, .45); }
  60% { transform: translateY(0) rotate(0deg); animation-timing-function: cubic-bezier(.2, .7, .3, 1); }
  76% { transform: translateY(12px) rotate(.4deg); animation-timing-function: cubic-bezier(.4, 0, .2, 1); }
  90% { transform: translateY(-3px) rotate(0deg); }
  100% { transform: none; }
}

@media (hover: hover) {
  .mq-web:hover { --u: 1; color: var(--ink); }
  .mq-web:hover .u-arrow { translate: .12em 0; }
  .mq-apps:hover, .u-brand:hover { color: var(--ink); }
  .u-close:hover { border-color: var(--ink2); color: var(--ink); }
  .mq-lang:hover { color: var(--ink2); }
}

/* ── un écran étroit : le texte, le lien vers la version web, puis le
   téléphone, puis ce qu'on peut y toucher ── */
@media (max-width: 899px) {
  .mq { grid-template-columns: minmax(0, 1fr); justify-items: center; row-gap: 32px; padding-top: 92px; }
  .mq-text, .mq-more { grid-column: 1; width: 100%; max-width: 520px; }
  .mq-phone { grid-column: 1; grid-row: 2; position: static; }
  .mq-more { grid-row: 3; margin-top: 0; }
  .mq-bar { --gutter: 18px; }
  .mq-mark .u-brand, .mq-mark .u-rule { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: .001ms !important; }
}
