/* Kit commun Archie — jetons et composants partagés par toutes les pages (chat, relier, erreur, espaces).
   Verre sombre sur ciel vivant, vert menthe + or, pastilles rondes, formes organiques.
   Aucune règle propre à une page ici : le chat vit dans app.css, la coque dans coque.css.
   Sommaire : 1 polices · 2 jetons · 3 socle · 4 ciel et décor · 5 en-tête · 6 composants · 7 pages d'espace · 8 mouvement */

/* 1 — polices auto-hébergées (OFL), axes de graisse variables */
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('assets/polices/bricolage-grotesque-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: 'Bricolage Grotesque'; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url('assets/polices/bricolage-grotesque-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: 'Funnel Display'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url('assets/polices/funnel-display-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: 'Funnel Display'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url('assets/polices/funnel-display-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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; }

/* 2 — jetons */
:root {
  /* couleurs */
  --encre: #F4EFDF;
  --encre-douce: rgba(244, 239, 223, 0.78);
  --encre-faible: rgba(244, 239, 223, 0.64);
  --menthe: #8FD8B8;
  --menthe-clair: #CFF2DE;
  --or: #D8B36A;
  --or-clair: #E9CE96;
  --terre: #C98A6A;          /* hors ligne, échec */
  --erreur: #F0B49A;
  --fond: #0C120C;
  /* couleurs signatures des voix (liseré de bulle, pastille, halo) */
  --voix-archie: var(--menthe);
  --voix-margot: #B3A6F0;  --voix-james: #F28F6B;   --voix-gaia: #9FDB7F;     --voix-diogene: #D1C4A0;
  --voix-rocafela: #E8BE55; --voix-oracle: #76D0E8;  --voix-socrates: #C9E265; --voix-cassandre: #E58FD0;
  --voix-belfort: #6FA2F0;  --voix-smith: #AEB8CC;   --voix-alex: #E0A27A;     --voix-eliott: #B58C6E;
  --voix-pathik: #F5A63C;   --voix-saul: #D97C7C;
  --voix: var(--menthe);    /* voix courante : posée par [data-voix] */
  /* verre : grain + reflet + fond. Le fond dense sert là où il n'y a pas de flou (bulles) */
  --grain: url('assets/grain.png');
  --verre-fond: rgba(8, 28, 22, 0.66);
  --verre-fond-dense: rgba(9, 27, 22, 0.84);
  --verre-reflet: linear-gradient(160deg, rgba(190, 255, 225, 0.13), rgba(190, 255, 225, 0.02) 58%);
  --verre: var(--grain), var(--verre-reflet), var(--verre-fond);
  --verre-dense: var(--grain), var(--verre-reflet), var(--verre-fond-dense);
  --verre-or: var(--grain), linear-gradient(160deg, rgba(233, 206, 150, 0.24), rgba(216, 179, 106, 0.08) 60%), rgba(44, 34, 14, 0.8);
  --verre-bord: rgba(170, 240, 210, 0.3);
  --verre-bord-fort: rgba(170, 240, 210, 0.42);
  --or-bord: rgba(216, 179, 106, 0.5);
  --liseré: inset 0 1px 0 rgba(210, 255, 232, 0.26);
  /* flous d'arrière-plan : coupés au palier sobre (voir boucle.js) */
  --flou-1: blur(10px);
  --flou-2: blur(18px) saturate(1.4);
  --flou-3: blur(26px) saturate(1.5);
  /* ombres portées : colorées, jamais grises */
  --ombre-1: 0 6px 18px -8px rgba(3, 26, 18, 0.7);
  --ombre-2: 0 14px 34px -14px rgba(3, 26, 18, 0.85), 0 2px 6px -2px rgba(3, 20, 14, 0.5);
  --ombre-3: 0 30px 70px -24px rgba(2, 22, 15, 0.95), 0 6px 16px -6px rgba(3, 20, 14, 0.6);
  --halo-menthe: 0 0 22px rgba(143, 216, 184, 0.38);
  --halo-or: 0 0 22px rgba(233, 206, 150, 0.36);
  /* formes : rayons volontairement inégaux (trace de main) */
  --rond: 999px;
  --rayon-carte: 30px 34px 30px 32px / 32px 30px 34px 30px;
  --rayon-tuile: 22px 26px 22px 24px / 24px 22px 26px 22px;
  --rayon-champ: 16px;
  --rayon-bulle-archie: 9px 24px 22px 25px / 9px 22px 25px 23px;
  --rayon-bulle-moi: 24px 9px 25px 22px / 22px 9px 23px 25px;
  /* texte */
  --police: 'Bricolage Grotesque', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --police-titre: 'Funnel Display', 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --t-xs: 11px; --t-s: 12.5px; --t-m: 14px; --t-corps: 15.5px; --t-l: 18px; --t-xl: 23px; --t-xxl: 30px;
  --il-serre: 1.2; --il-corps: 1.52;
  /* mouvement */
  --ressort: linear(0, 0.009, 0.035 2.1%, 0.141 4.4%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1.004 83.8%, 1);
  --ressort-doux: linear(0, 0.012 1.6%, 0.05 3.4%, 0.196 7.6%, 0.75 21.6%, 0.917 27.4%, 1.01 34%, 1.045 39.4%, 1.057 45.2%, 1.045 53.6%, 1.007 71%, 0.998 86.2%, 1);
  --sortie: cubic-bezier(0.22, 1, 0.36, 1);
  --d-appui: 0.16s; --d-1: 0.28s; --d-2: 0.5s; --d-3: 0.8s; --d-decale: 45ms;
  /* profondeur : un rôle par plan */
  --z-ciel: 0; --z-decor: 1; --z-voile: 2; --z-ecran: 3; --z-premier-plan: 4; --z-accueil: 5; --z-visionneuse: 9; --z-menu: 10;
  --marge-parallaxe: 28px;
  /* état du ciel, posé par ciel.js (0 à 1). Sans script : plein jour */
  --nuit: 0; --aube: 0; --dore: 0; --crepuscule: 0;
  /* icônes en masque CSS (là où le texte est réécrit par app.js) */
  --ic-horloge: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4a8 8 0 1 0 .1 0M12 8v4.5l3 2'/%3E%3C/svg%3E");
  --ic-alerte: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4.5 3.5 19h17zM12 10v4.5M12 17v.2'/%3E%3C/svg%3E");
  --ic-coche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --ic-fermer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E");
  color-scheme: dark;
}
:root[data-qualite="sobre"] { --flou-1: none; --flou-2: none; --flou-3: none; --verre-fond: rgba(8, 28, 22, 0.88); }
[data-voix="margot"] { --voix: var(--voix-margot); }     [data-voix="james"] { --voix: var(--voix-james); }
[data-voix="gaia"] { --voix: var(--voix-gaia); }         [data-voix="diogene"] { --voix: var(--voix-diogene); }
[data-voix="rocafela"] { --voix: var(--voix-rocafela); } [data-voix="oracle"] { --voix: var(--voix-oracle); }
[data-voix="socrates"] { --voix: var(--voix-socrates); } [data-voix="cassandre"] { --voix: var(--voix-cassandre); }
[data-voix="belfort"] { --voix: var(--voix-belfort); }   [data-voix="smith"] { --voix: var(--voix-smith); }
[data-voix="alex"] { --voix: var(--voix-alex); }         [data-voix="eliott"] { --voix: var(--voix-eliott); }
[data-voix="pathik"] { --voix: var(--voix-pathik); }     [data-voix="saul"] { --voix: var(--voix-saul); }

/* 3 — socle */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--fond); color: var(--encre);
  font-family: var(--police); font-size: var(--t-corps); line-height: var(--il-corps); font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
a { color: var(--or-clair); text-underline-offset: 3px; }
a:hover { color: #F6E3B4; }
:focus-visible { outline: 2px solid var(--or-clair); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 { font-family: var(--police-titre); text-wrap: balance; }
.tab, time { font-variant-numeric: tabular-nums; }
.ic { width: 1.25em; height: 1.25em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.25em; }

/* 4 — ciel et décor. Plans : ciel (0) · décor (1 : teinte, astres, nuages, rayons, brume, particules, feuillage) ·
   voile (2) · verre et contenu (3) · premier plan (4). Les couches du décor sont créées par decor.js. */
.ciel { position: fixed; inset: calc(var(--marge-parallaxe) * -1); z-index: var(--z-ciel); will-change: transform;
  background: #16261C image-set(url('assets/bg-day-1920.webp') type('image/webp'), url('assets/bg-day-1920.jpg') type('image/jpeg')) center 30% / cover no-repeat; }
.ciel-nuit { position: absolute; inset: 0; opacity: 0; transition: opacity 2s linear;
  background: image-set(url('assets/bg-night-1920.webp') type('image/webp'), url('assets/bg-night-1920.jpg') type('image/jpeg')) center 30% / cover no-repeat; }
@media (min-width: 900px) and (min-resolution: 1.5dppx), (min-width: 1700px) {
  .ciel { background-image: url('assets/bg-day-2880.webp'); }
  .ciel-nuit { background-image: url('assets/bg-night-2880.webp'); }
}
.voile { position: fixed; inset: 0; z-index: var(--z-voile); pointer-events: none;
  background: linear-gradient(180deg, rgba(6,14,10,.56) 0%, rgba(6,14,10,.36) 28%, rgba(6,14,10,.6) 68%, rgba(5,12,9,.88) 100%); }
.voile::after { content: ''; position: absolute; inset: 0; background: rgba(34, 36, 34, 0.42); opacity: 0; transition: opacity 1.2s linear; }
body:has(.etat.hors-ligne) .voile::after { opacity: 1; }                 /* hors ligne : le monde se ternit */

.decor { position: fixed; inset: 0; z-index: var(--z-decor); pointer-events: none; overflow: hidden; contain: strict; }
.decor > *, .decor-fond > * { position: absolute; }
.decor-fond { inset: calc(var(--marge-parallaxe) * -1); will-change: transform;
  -webkit-mask: url('assets/masque-ciel.webp') center 30% / cover no-repeat; mask: url('assets/masque-ciel.webp') center 30% / cover no-repeat; }
.decor-astres { inset: 0; width: 100%; height: 100%; }
.decor-nuages { inset: 0 0 40% 0; overflow: hidden; opacity: calc(0.62 - var(--nuit) * 0.44); }
.decor-nuages i { position: absolute; top: 4%; left: 0; width: 2048px; height: 384px; background: url('assets/nuages.webp') 0 0 / 1024px 384px repeat-x;
  animation: derive 190s linear infinite; }
.decor-teinte { inset: 0; }
.decor-teinte i { position: absolute; inset: 0; mix-blend-mode: soft-light; }
.decor-teinte .aube { opacity: var(--aube); background: linear-gradient(180deg, rgba(120,150,235,.5), rgba(255,160,150,.6) 42%, rgba(255,214,160,.4) 68%, rgba(255,214,160,0)); }
.decor-teinte .dore { opacity: var(--dore); background: linear-gradient(180deg, rgba(255,196,110,.42), rgba(255,170,80,.62) 46%, rgba(255,140,70,.32) 74%, rgba(255,140,70,0)); }
.decor-teinte .crepuscule { opacity: var(--crepuscule); mix-blend-mode: normal; background: linear-gradient(180deg, rgba(60,40,120,.4), rgba(190,90,130,.3) 44%, rgba(240,130,90,.16) 64%, rgba(240,130,90,0)); }
.decor-rayons { inset: -20% -40%; opacity: calc(var(--aube) * 0.9 + var(--dore) * 0.75); mix-blend-mode: screen; transform-origin: 30% 0;
  background: repeating-conic-gradient(from 118deg at 30% -4%, rgba(255,222,160,0) 0deg, rgba(255,222,160,.2) 2.5deg, rgba(255,222,160,0) 6deg, rgba(255,222,160,.12) 9deg, rgba(255,222,160,0) 14deg);
  -webkit-mask: radial-gradient(90% 80% at 30% 0%, #000 0, rgba(0,0,0,.5) 45%, transparent 78%); mask: radial-gradient(90% 80% at 30% 0%, #000 0, rgba(0,0,0,.5) 45%, transparent 78%);
  animation: rayons 22s ease-in-out infinite alternate; }
.decor-brume { left: -10%; right: -10%; top: 38%; height: 230px; overflow: hidden; opacity: calc(0.26 + var(--aube) * 0.5 + var(--crepuscule) * 0.2); will-change: transform; }
.decor-brume i { position: absolute; inset: 0 auto 0 0; width: 2048px; background: url('assets/brume.webp') 0 0 / 1024px 100% repeat-x; animation: derive 130s linear infinite reverse; }
.decor-particules { inset: calc(var(--marge-parallaxe) * -1); width: calc(100% + var(--marge-parallaxe) * 2); height: calc(100% + var(--marge-parallaxe) * 2); will-change: transform; }
.decor-feuillage { top: -64px; left: 50%; width: 760px; height: 197px; margin-left: -380px; will-change: transform;
  background: url('assets/feuillage-flou.webp') center / 100% 100% no-repeat; opacity: calc(0.9 - var(--nuit) * 0.25); }
.premier-plan { position: fixed; inset: 0; z-index: var(--z-premier-plan); pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(110% 55% at 0% 0%, rgba(255, 214, 150, 0.16), rgba(255, 214, 150, 0) 62%);
  opacity: calc(0.35 + var(--aube) * 0.65 + var(--dore) * 0.65 - var(--nuit) * 0.3); }
:root[data-qualite="sobre"] .decor-nuages, :root[data-qualite="sobre"] .decor-rayons, :root[data-qualite="sobre"] .premier-plan { display: none; }
:root[data-qualite="sobre"] .decor-brume i, :root[data-qualite="moyen"] .decor-rayons { animation: none; }

/* écran plein : colonne centrée, bornée */
.ecran { position: fixed; inset: 0; z-index: var(--z-ecran); display: flex; flex-direction: column;
  max-width: 720px; margin: 0 auto; }

/* 5 — en-tête : sceau + titre, pastille d'état à droite */
.entete { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 14px) 18px 10px; text-shadow: 0 1px 4px rgba(8,18,12,.7); }
.marque { display: flex; align-items: center; gap: 10px; min-width: 0; }
.marque h1 { margin: 0; font-size: var(--t-l); font-weight: 600; letter-spacing: -.015em; color: #F2EDDD; }
.sceau { position: relative; width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(216,179,106,.6); flex-shrink: 0;
  display: grid; place-items: center; background: rgba(255,255,255,.10); box-shadow: 0 0 0 3px rgba(216,179,106,.08), var(--ombre-1); }
.sceau span { width: 26px; height: 26px; border-radius: 50%; background: url('assets/hub-core.png') center / cover;
  animation: respire 6.5s ease-in-out infinite; }
.sceau::after { content: ''; position: absolute; inset: -7px; border-radius: 50%; pointer-events: none; opacity: 0;
  background: conic-gradient(from 0deg, rgba(143,216,184,0), rgba(143,216,184,.75), rgba(233,206,150,.7), rgba(143,216,184,0) 70%);
  -webkit-mask: radial-gradient(closest-side, transparent 78%, #000 80%, #000 96%, transparent); mask: radial-gradient(closest-side, transparent 78%, #000 80%, #000 96%, transparent); }
.sceau.grand { width: 82px; height: 82px; margin: 0 auto 10px; box-shadow: 0 0 0 6px rgba(216,179,106,.07), var(--halo-menthe), var(--ombre-2); }
.sceau.grand span { width: 62px; height: 62px; }
/* Archie pense : le sceau pulse et son anneau tourne (dérivé de #travail, sans script) */
.ecran:has(#travail:not([hidden])) .entete .sceau span { animation: pense 1.5s ease-in-out infinite; }
.ecran:has(#travail:not([hidden])) .entete .sceau::after { opacity: 1; animation: tourne 2.4s linear infinite; }
.etat { display: flex; align-items: center; gap: 8px; font-size: var(--t-xs); letter-spacing: .02em; color: rgba(242,237,221,.9); white-space: nowrap;
  padding: 7px 12px; border-radius: var(--rond); background: var(--verre); border: 1px solid var(--verre-bord);
  -webkit-backdrop-filter: var(--flou-1); backdrop-filter: var(--flou-1); box-shadow: var(--liseré), var(--ombre-1); text-shadow: none; }
.etat i { width: 7px; height: 7px; border-radius: 50%; background: var(--or-clair); box-shadow: 0 0 8px rgba(233,206,150,.8); animation: pouls 1.4s ease-in-out infinite; }
.etat.en-ligne i { background: var(--menthe); box-shadow: 0 0 8px rgba(143,216,184,.9); animation: pouls 3.5s ease-in-out infinite; }
.etat.hors-ligne { border-color: rgba(201,138,106,.55); color: #F1D5C6; }
.etat.hors-ligne i { background: var(--terre); box-shadow: 0 0 8px rgba(201,138,106,.8); animation: none; }

/* 6 — composants */
/* pastille ronde : avatar d'une voix (image), monogramme en repli, ou le sceau d'Archie */
.pastille { position: relative; width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--voix) 70%, transparent); font-family: var(--police-titre); font-size: 14px; font-weight: 600;
  color: color-mix(in srgb, var(--voix) 55%, #fff);
  background: radial-gradient(circle at 38% 30%, color-mix(in srgb, var(--voix) 42%, transparent), rgba(14, 34, 27, 0.92) 78%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--voix) 12%, transparent), 0 4px 14px -4px color-mix(in srgb, var(--voix) 55%, transparent); }
.pastille img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity var(--d-2) var(--sortie); }
.pastille img.pret { opacity: 1; }
.pastille.archie { background: url('assets/hub-core.png') center / cover; border-color: rgba(216,179,106,.6); }
.pastille.grande { width: 64px; height: 64px; font-size: 24px; }

/* boutons : menthe par défaut, .or pour l'action principale. Appui = compression + halo */
.rangee { display: flex; flex-wrap: wrap; gap: 8px; }
.bouton { position: relative; padding: 10px 17px; border-radius: var(--rond); font-size: var(--t-m); font-weight: 480; cursor: pointer; text-decoration: none; text-align: center;
  background: var(--grain), rgba(170,240,210,.09); border: 1px solid rgba(170,240,210,.34); color: rgba(244,239,223,.94);
  min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: var(--liseré), var(--ombre-1);
  transition: transform var(--d-2) var(--ressort), box-shadow var(--d-1) var(--sortie), opacity var(--d-1) linear; }
.bouton:hover { color: var(--encre); }
.bouton.or { background: var(--grain), linear-gradient(160deg, rgba(233,206,150,.26), rgba(216,179,106,.12)); border-color: var(--or-bord); color: var(--or-clair);
  box-shadow: inset 0 1px 0 rgba(255,236,190,.3), var(--ombre-1); }
.bouton:active { transform: scale(.955); transition-duration: var(--d-appui); box-shadow: var(--liseré), var(--halo-menthe); }
.bouton.or:active { box-shadow: inset 0 1px 0 rgba(255,236,190,.3), var(--halo-or); }
.bouton[disabled] { opacity: .45; cursor: default; box-shadow: none; }
.bouton.en-cours { opacity: 1; }
.bouton.en-cours::before, .bouton.choisi::before { content: ''; width: 15px; height: 15px; flex-shrink: 0; }
.bouton.en-cours::before { border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: tourne .8s linear infinite; }
.bouton.choisi { border-color: var(--menthe); color: var(--menthe-clair); opacity: 1; background: var(--grain), rgba(143,216,184,.2); box-shadow: var(--liseré), var(--halo-menthe); }
.bouton.choisi::before { background: currentColor; -webkit-mask: var(--ic-coche) center / contain no-repeat; mask: var(--ic-coche) center / contain no-repeat;
  animation: pose var(--d-2) var(--ressort) both; }

/* carte centrée (accueil, relier, erreur) et ses champs */
.carte { position: relative; width: 100%; max-width: 384px; padding: 30px 24px 24px; text-align: center; border-radius: var(--rayon-carte); background: var(--verre);
  border: 1px solid var(--verre-bord-fort); -webkit-backdrop-filter: var(--flou-3); backdrop-filter: var(--flou-3);
  box-shadow: var(--liseré), var(--ombre-3); animation: monte var(--d-3) var(--ressort-doux) both; }
.carte h2 { margin: 6px 0 10px; font-size: var(--t-xl); font-weight: 600; letter-spacing: -.02em; line-height: var(--il-serre); }
.carte p { margin: 0 0 18px; font-size: var(--t-m); line-height: 1.55; color: var(--encre-douce); text-wrap: pretty; }
.carte label { display: block; text-align: left; font-size: var(--t-s); color: var(--encre-douce); margin: 0 4px 6px; }
.carte input { width: 100%; padding: 13px 16px; border-radius: var(--rayon-champ); font: inherit; font-size: 16px; color: var(--encre); min-height: 48px;
  background: rgba(6,22,17,.6); border: 1px solid rgba(170,240,210,.28); outline: 0; margin-bottom: 12px; box-shadow: inset 0 2px 6px rgba(2,12,8,.5);
  transition: border-color var(--d-1) linear, box-shadow var(--d-1) linear; }
.carte input:focus { border-color: rgba(216,179,106,.7); box-shadow: inset 0 2px 6px rgba(2,12,8,.5), 0 0 0 3px rgba(216,179,106,.16); }
.carte .bouton { width: 100%; padding: 13px; min-height: 48px; font-size: var(--t-corps); }
.carte a.bouton { display: flex; }
.carte .bouton + .bouton { margin-top: 10px; }
.carte .bouton[disabled]::before { content: ''; width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: tourne .8s linear infinite; }
.carte .erreur { color: var(--erreur); margin: 14px 0 0; font-size: var(--t-s); }
.carte .note { margin: 16px 0 0; font-size: var(--t-xs); letter-spacing: .04em; color: var(--encre-faible); }
.carte .code { display: inline-block; margin-bottom: 4px; font-family: var(--police-titre); font-size: var(--t-xs); letter-spacing: .14em; text-transform: uppercase;
  color: var(--or-clair); padding: 4px 12px; border-radius: var(--rond); border: 1px solid var(--or-bord); background: rgba(216,179,106,.1); }
.carte:has(form[hidden]) .sceau.grand { animation: pose var(--d-3) var(--ressort) both; box-shadow: 0 0 0 6px rgba(143,216,184,.14), 0 0 44px rgba(143,216,184,.6); }
.scene-carte { position: fixed; inset: 0; z-index: var(--z-accueil); display: grid; place-items: center; padding: 24px; overflow-y: auto; }

/* 7 — pages d'espace (prototypes) : colonne défilante, tuiles de verre, lignes, jauges */
.page { flex: 1; overflow-y: auto; padding: 6px 16px calc(env(safe-area-inset-bottom) + 28px); display: flex; flex-direction: column; gap: 14px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 20px); mask-image: linear-gradient(180deg, transparent 0, #000 20px); }
.page > * { flex-shrink: 0; animation: monte var(--d-3) var(--ressort-doux) both; }
.page > :nth-child(2) { animation-delay: calc(var(--d-decale) * 1); } .page > :nth-child(3) { animation-delay: calc(var(--d-decale) * 2); }
.page > :nth-child(4) { animation-delay: calc(var(--d-decale) * 3); } .page > :nth-child(5) { animation-delay: calc(var(--d-decale) * 4); }
.page > :nth-child(n+6) { animation-delay: calc(var(--d-decale) * 5); }
.titre-page { padding: 10px 4px 2px; text-shadow: 0 1px 6px rgba(8,18,12,.8); }
.titre-page h2 { margin: 0; font-size: var(--t-xxl); font-weight: 600; letter-spacing: -.025em; line-height: 1.08; }
.titre-page p { margin: 6px 0 0; font-size: var(--t-m); color: var(--encre-douce); max-width: 46ch; }
.surtitre { font-size: var(--t-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--or-clair); }
.tuile { position: relative; display: block; padding: 16px 18px; border-radius: var(--rayon-tuile); background: var(--verre-dense); border: 1px solid var(--verre-bord);
  box-shadow: var(--liseré), var(--ombre-2); color: inherit; text-decoration: none; }
a.tuile, button.tuile { cursor: pointer; text-align: left; width: 100%; min-height: 44px; transition: transform var(--d-2) var(--ressort); }
a.tuile:active, button.tuile:active { transform: scale(.975); transition-duration: var(--d-appui); }
.tuile h3 { margin: 0 0 4px; font-size: var(--t-l); font-weight: 600; letter-spacing: -.01em; line-height: var(--il-serre); }
.tuile p { margin: 0; font-size: var(--t-m); color: var(--encre-douce); }
.tuile .chiffre { font-family: var(--police-titre); font-size: var(--t-xxl); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.lignes { display: grid; gap: 2px; margin: 8px -6px -6px; padding: 0; list-style: none; }
.ligne { display: flex; align-items: center; gap: 12px; padding: 10px 8px; min-height: 48px; border-radius: 14px; }
.ligne + .ligne { border-top: 1px solid rgba(170,240,210,.1); }
.ligne > div:not(.pastille) { flex: 1; min-width: 0; }
.ligne strong { display: block; font-size: var(--t-m); font-weight: 560; }
.ligne small { display: block; font-size: var(--t-s); color: var(--encre-faible); }
.ligne .fin { flex: none; font-size: var(--t-s); color: var(--encre-douce); font-variant-numeric: tabular-nums; }
.puce { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); letter-spacing: .04em; padding: 4px 10px; border-radius: var(--rond);
  border: 1px solid color-mix(in srgb, var(--voix) 50%, transparent); color: color-mix(in srgb, var(--voix) 60%, #fff); background: color-mix(in srgb, var(--voix) 12%, transparent); }
.puce.or { --voix: var(--or); } .puce.terre { --voix: var(--terre); }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.jauge { height: 8px; border-radius: var(--rond); background: rgba(6,22,17,.7); box-shadow: inset 0 1px 3px rgba(2,12,8,.7); overflow: hidden; }
.jauge i { display: block; height: 100%; width: calc(var(--v, .5) * 100%); border-radius: inherit; transform-origin: left; animation: remplit var(--d-3) var(--sortie) both .2s;
  background: linear-gradient(90deg, color-mix(in srgb, var(--voix) 60%, #0c120c), var(--voix)); box-shadow: 0 0 10px color-mix(in srgb, var(--voix) 60%, transparent); }
.interrupteur { appearance: none; -webkit-appearance: none; position: relative; width: 50px; height: 30px; margin: 0; flex: none; border-radius: var(--rond); cursor: pointer;
  background: rgba(6,22,17,.7); border: 1px solid var(--verre-bord); transition: background var(--d-1) linear, border-color var(--d-1) linear; }
.interrupteur::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--encre-douce);
  transition: transform var(--d-2) var(--ressort), background var(--d-1) linear; }
.interrupteur:checked { background: rgba(143,216,184,.3); border-color: var(--menthe); }
.interrupteur:checked::after { transform: translateX(20px); background: var(--menthe-clair); box-shadow: var(--halo-menthe); }
.prototype { align-self: center; margin-top: 6px; font-size: var(--t-xs); letter-spacing: .06em; color: var(--encre-faible); text-align: center; }

/* 8 — mouvement */
@view-transition { navigation: auto; }
.entete .sceau, .carte .sceau.grand { view-transition-name: sceau; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }
@keyframes pouls { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes rebond { 0%, 80%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-4px); opacity: 1; } }
@keyframes respire { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes pense { 0%, 100% { transform: scale(.94); } 50% { transform: scale(1.1); } }
@keyframes tourne { to { transform: rotate(1turn); } }
@keyframes derive { to { transform: translate3d(-1024px, 0, 0); } }
@keyframes rayons { from { transform: rotate(-2.5deg); } to { transform: rotate(3deg); } }
@keyframes monte { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes pose { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
@keyframes remplit { from { transform: scaleX(0); } to { transform: none; } }
/* mouvement réduit (réglage système, ou forcé par boucle.js) : plus de déplacement, de simples fondus */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: opacity .2s linear !important; scroll-behavior: auto !important; }
  .msg, .carte, .menu-feuille, .page > * { animation: fondu .25s linear both !important; }
}
:root[data-mouvement="reduit"] *, :root[data-mouvement="reduit"] *::before, :root[data-mouvement="reduit"] *::after { animation: none !important; transition: opacity .2s linear !important; scroll-behavior: auto !important; }
:root[data-mouvement="reduit"] :is(.msg, .carte, .menu-feuille, .page > *) { animation: fondu .25s linear both !important; }
@media (min-width: 721px) { .ecran { border-inline: 1px solid rgba(170,240,210,.12); } }
