/* Base : polices, couleurs, reset, boutons et utilitaires partagés par toutes les pages.
   Design épuré : une colonne bordée de deux traits fins, des sections séparées par des lignes et des
   bandes hachurées, des cellules qui partagent leurs bordures. En haut, le paysage du launcher
   (pixel art) avec une brume ASCII qui dérive (site.js). */
/* Geist et Geist Mono (graisse variable), découpées par alphabet : le navigateur ne charge que ce qu'il affiche. */
@font-face{font-family:"Geist";src:url(/assets/Geist-latin.woff2) format("woff2");font-weight:100 900;font-display:swap;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:"Geist";src:url(/assets/Geist-latin-ext.woff2) format("woff2");font-weight:100 900;font-display:swap;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:"Geist";src:url(/assets/Geist-cyrillic.woff2) format("woff2");font-weight:100 900;font-display:swap;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Geist Mono";src:url(/assets/GeistMono-latin.woff2) format("woff2");font-weight:100 900;font-display:swap;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:"Geist Mono";src:url(/assets/GeistMono-latin-ext.woff2) format("woff2");font-weight:100 900;font-display:swap;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:"Geist Mono";src:url(/assets/GeistMono-cyrillic.woff2) format("woff2");font-weight:100 900;font-display:swap;unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:Silkscreen;src:url(/assets/Silkscreen-Regular.ttf);font-weight:400;font-display:swap}
@font-face{font-family:Silkscreen;src:url(/assets/Silkscreen-Bold.ttf);font-weight:700;font-display:swap}

:root{
  --bg:#09090b;--bg-2:#0c0c0f;--panel:#111114;--panel-2:#17171b;
  /* Couleurs du thème, en composantes RVB pour les transparences : premier plan, fond, caractères ASCII */
  --fg-rgb:255 255 255;--bg-rgb:9 9 11;--ascii-rgb:206 218 245;
  --text-2:#d4d4d8;--soft:#a9b9dc;
  /* Bouton plein : blanc sur le thème sombre, noir sur le thème clair */
  --solid:#fafafa;--solid-hover:#fff;--on-solid:#09090b;
  --line:rgb(var(--fg-rgb) / .09);--line-2:rgb(var(--fg-rgb) / .15);
  --text:#fafafa;--muted:#a1a1aa;--dim:#71717a;
  /* Largeur de la colonne du site, bordée par les deux traits verticaux */
  --col:1080px;
  /* Bleu brume : seulement en touches (liens, puces, états) */
  --accent:#b8ccf4;--accent-2:#dde7fb;--accent-strong:#8eaaf0;
  --green:#8eaaf0;--green-d:#5b77c4;
  --r:14px;
  --sans:"Geist",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  /* Les petites étiquettes sont en Geist ; la police pixel ne sert plus qu'au nom MISTLY */
  --pix:var(--sans);
  --pixel:Silkscreen,ui-monospace,monospace;
  --mono:"Geist Mono",ui-monospace,"Cascadia Code","SF Mono",Menlo,Consolas,monospace;
  color-scheme:dark;
}
*{box-sizing:border-box;margin:0;padding:0}
html{scroll-behavior:smooth;scroll-padding-top:80px;scrollbar-width:thin;scrollbar-color:#2c2c33 var(--bg)}
body{font-family:var(--sans);background:var(--bg);color:var(--text);line-height:1.6;-webkit-font-smoothing:antialiased;overflow-x:hidden}
h1,h2,h3{letter-spacing:-.025em}
img,svg{display:block;max-width:100%}
a{color:inherit;text-decoration:none}
ul,ol{list-style:none}
button{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:8px}
::selection{background:rgb(var(--ascii-rgb) / .3);color:var(--text)}

::-webkit-scrollbar{width:12px;height:12px}
::-webkit-scrollbar-track{background:var(--bg)}
::-webkit-scrollbar-thumb{background:#26262c;border:3px solid var(--bg);border-radius:8px}
::-webkit-scrollbar-thumb:hover{background:#3a3a42}
::-webkit-scrollbar-corner{background:var(--bg)}

.wrap{max-width:var(--col);margin:0 auto;padding:0 clamp(16px,3vw,28px)}

/* ---------- La colonne et sa grille de lignes ---------- */
body{position:relative}
.col{width:min(var(--col),calc(100% - 32px));margin:0 auto}
/* Les deux traits verticaux, sur toute la hauteur de la page */
.rails{position:absolute;top:0;bottom:0;left:50%;width:min(var(--col),calc(100% - 32px));transform:translateX(-50%);border-left:1px solid var(--line);border-right:1px solid var(--line);pointer-events:none;z-index:2}
/* Une section : un trait sur toute la largeur de l'écran au-dessus */
.blk{position:relative;border-top:1px solid var(--line)}
.blk-title{padding:30px 22px 20px;font-size:clamp(24px,2.6vw,30px);font-weight:600;letter-spacing:-.03em;line-height:1.1}
.blk-title sup{margin-left:4px;font-family:var(--mono);font-size:12px;font-weight:400;letter-spacing:0;color:var(--dim);vertical-align:super}
.blk-lead{padding:0 22px 22px;margin-top:-8px;color:var(--muted);font-size:15px;max-width:640px}
/* Bande hachurée entre deux sections */
.hatch{height:44px;border-top:1px solid var(--line);background:repeating-linear-gradient(-45deg,transparent 0 7px,rgb(var(--fg-rgb) / .055) 7px 8px)}
/* Cellules qui partagent leurs bordures : chacune trace son bord droit et son bord bas (les cases
   vides d'une dernière rangée incomplète restent donc vides, sans bloc gris) */
.cells{display:grid;border-top:1px solid var(--line);margin-bottom:-1px}
.cells>*{background:var(--bg);min-width:0;box-shadow:inset -1px 0 0 var(--line),inset 0 -1px 0 var(--line)}
.cells.c2{grid-template-columns:repeat(2,minmax(0,1fr))}
.cells.c3{grid-template-columns:repeat(3,minmax(0,1fr))}
.cells.c4{grid-template-columns:repeat(4,minmax(0,1fr))}
.cell{padding:22px}
.cell .ico{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;margin-bottom:16px;color:var(--text);border:1px solid var(--line-2);background:rgb(var(--fg-rgb) / .03)}
.cell .ico .ic{width:16px;height:16px}
.cell h3{font-size:15px;font-weight:600;letter-spacing:-.01em;margin-bottom:4px}
.cell p{font-size:14px;color:var(--muted)}
.badge{display:inline-flex;align-items:center;gap:6px;font-family:var(--mono);font-size:11px;font-weight:500;padding:2px 8px;border-radius:6px;border:1px solid var(--line-2);color:var(--muted);white-space:nowrap}
.badge .ic{width:12px;height:12px}
@media (max-width:900px){.cells.c3,.cells.c4{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:600px){.cells.c2,.cells.c3,.cells.c4{grid-template-columns:minmax(0,1fr)}}
.ic{width:18px;height:18px;flex:none}

/* Petite étiquette au-dessus des titres */
.label{display:inline-block;font-size:11.5px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:var(--dim)}
.small{font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--dim)}
.muted{color:var(--muted)}
.accent{color:var(--accent)}
.pill{display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:500;padding:6px 12px;border-radius:999px;background:rgb(var(--fg-rgb) / .04);border:1px solid var(--line-2)}
.sw{width:8px;height:8px;border-radius:50%;background:var(--c)}

/* Boutons en pilule : blanc pour l'action principale, sombre pour le reste */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:9px;font-weight:500;font-size:14.5px;line-height:1.2;
  padding:11px 18px;border-radius:10px;border:1px solid var(--line-2);cursor:pointer;white-space:nowrap;
  background:rgb(var(--fg-rgb) / .04);color:var(--text);transition:background .15s,border-color .15s,transform .15s,box-shadow .15s;
}
.btn:hover{background:rgb(var(--fg-rgb) / .09);border-color:rgb(var(--fg-rgb) / .24)}
.btn.play{background:var(--solid);border-color:var(--solid);color:var(--on-solid)}
.btn.play:hover{background:var(--solid-hover);border-color:var(--solid-hover)}
.btn:active{transform:translateY(1px)}
.btn.ghost{background:none}
.btn.sm{padding:7px 14px;font-size:13.5px}
.btn.sm .ic{width:15px;height:15px}
.btn.lg{padding:15px 26px;font-size:15.5px}

/* Apparition au défilement (activée par site.js) */
.js .reveal{opacity:0;transform:translateY(18px);transition:opacity .7s ease,transform .7s ease}
.js .reveal.in{opacity:1;transform:none}

main,.foot{position:relative;z-index:1}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important}
  html{scroll-behavior:auto}
  .js .reveal{opacity:1;transform:none}
}

/* Bruit de caractères ASCII qui ondule (site.js), derrière une carte ou un encart */
.ascii-noise{position:absolute;inset:0;margin:0;padding:6px 8px;font-family:var(--mono);font-size:12px;line-height:13px;color:rgb(var(--ascii-rgb) / .16);white-space:pre;overflow:hidden;user-select:none;
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 30%,#000 70%,transparent);mask-image:linear-gradient(90deg,transparent,#000 30%,#000 70%,transparent)}

/* ---------- Écran de téléchargement : nuage ASCII, progression, étapes (site.js) ---------- */
.dlx{position:fixed;inset:0;z-index:100;display:grid;place-items:end center;padding:0 16px clamp(28px,7vh,80px);
  background:radial-gradient(70% 60% at 50% 32%,rgba(90,120,200,.22),transparent 70%),rgb(var(--bg-rgb) / .94);
  backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);opacity:0;transition:opacity .25s ease}
.dlx[hidden]{display:none}
.dlx.open{opacity:1}
.dlx-art{position:absolute;inset:0;width:100%;height:100%}
.dlx-panel{position:relative;width:min(560px,100%);display:flex;flex-direction:column;align-items:center;text-align:center;transform:translateY(14px);transition:transform .35s ease}
.dlx.open .dlx-panel{transform:none}
.dlx-panel h2{font-size:clamp(24px,3vw,32px);font-weight:600;letter-spacing:-.03em}
.dlx-sub{margin-top:6px;color:var(--muted);font-size:15px}
.dlx-bar{display:flex;align-items:center;gap:12px;margin:22px 0 22px;font-family:var(--mono);font-size:13px;color:var(--muted);white-space:nowrap}
.dlx-track{font-family:var(--mono);font-size:13px;color:var(--accent);letter-spacing:.02em}
.dlx-pct{min-width:4ch;text-align:right;color:var(--text)}
.dlx.done .dlx-label{color:#7ee2a8}
.dlx-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;border:1px solid var(--line-2);background:rgb(var(--bg-rgb) / .7);text-align:left}
.dlx-steps li{display:flex;flex-direction:column;gap:6px;padding:14px 16px;font-size:13.5px;color:var(--text-2)}
.dlx-steps li+li{border-left:1px solid var(--line-2)}
.dlx-steps .n{font-family:var(--mono);font-size:11.5px;color:var(--dim)}
.dlx-actions{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px 20px;width:100%;margin-top:14px;font-size:13px;color:var(--muted)}
.dlx-actions a{color:var(--text);text-decoration:underline;text-decoration-color:rgb(var(--fg-rgb) / .3);text-underline-offset:3px}
.dlx-guide{display:inline-flex;align-items:center;gap:6px;text-decoration:none!important}
.dlx-guide .ic{width:13px;height:13px}
.dlx-close{margin-top:20px;padding:8px 14px;font-size:13.5px}
.dlx-close kbd{margin-left:4px}
@media (max-width:600px){
  .dlx-steps{grid-template-columns:minmax(0,1fr)}
  .dlx-steps li+li{border-left:0;border-top:1px solid var(--line-2)}
  .dlx-bar{font-size:11px}
  .dlx-track{font-size:10px}
}

/* ---------- Thème clair : matin brumeux (choisi avec le bouton de la barre, ou selon le système) ---------- */
:root[data-theme="light"]{
  color-scheme:light;
  --bg:#f6f7fb;--bg-2:#eceef5;--panel:#ffffff;--panel-2:#f1f3f9;
  --line:rgba(20,24,40,.1);--line-2:rgba(20,24,40,.17);
  --text:#0b0d14;--muted:#4b5263;--dim:#7a8194;--text-2:#2b303d;--soft:#4c64a3;
  --accent:#3559c4;--accent-2:#2747a8;--accent-strong:#3559c4;--green:#3559c4;
  --fg-rgb:11 13 20;--bg-rgb:246 247 251;--ascii-rgb:52 78 150;
  --solid:#0b0d14;--solid-hover:#22273a;--on-solid:#f6f7fb;
}
@media (prefers-color-scheme:light){
  :root:not([data-theme="dark"]){
    color-scheme:light;
    --bg:#f6f7fb;--bg-2:#eceef5;--panel:#ffffff;--panel-2:#f1f3f9;
    --line:rgba(20,24,40,.1);--line-2:rgba(20,24,40,.17);
    --text:#0b0d14;--muted:#4b5263;--dim:#7a8194;--text-2:#2b303d;--soft:#4c64a3;
    --accent:#3559c4;--accent-2:#2747a8;--accent-strong:#3559c4;--green:#3559c4;
    --fg-rgb:11 13 20;--bg-rgb:246 247 251;--ascii-rgb:52 78 150;
    --solid:#0b0d14;--solid-hover:#22273a;--on-solid:#f6f7fb;
  }
}
/* L'écran de téléchargement reste dans la nuit, quel que soit le thème */
.dlx{color-scheme:dark;--text:#fafafa;--muted:#a1a1aa;--dim:#71717a;--text-2:#d4d4d8;--line:rgba(255,255,255,.09);--line-2:rgba(255,255,255,.15);
  --fg-rgb:255 255 255;--bg-rgb:9 9 11;--accent:#b8ccf4;--solid:#fafafa;--solid-hover:#fff;--on-solid:#09090b;color:var(--text)}

/* Bouton du thème dans la barre */
.theme-toggle{display:grid;place-items:center;width:34px;height:34px;padding:0;border:0;border-radius:8px;background:none;color:var(--muted);cursor:pointer;transition:color .15s,background .15s}
.theme-toggle:hover{color:var(--text);background:rgb(var(--fg-rgb) / .06)}
.theme-toggle .ic{width:17px;height:17px}
.theme-toggle .sun{display:none}
:root[data-theme="light"] .theme-toggle .sun{display:block}
:root[data-theme="light"] .theme-toggle .moon{display:none}
@media (prefers-color-scheme:light){
  :root:not([data-theme="dark"]) .theme-toggle .sun{display:block}
  :root:not([data-theme="dark"]) .theme-toggle .moon{display:none}
}
