/* Kazibo, produit : le socle de la plateforme (cahier d'UX §8).
   Elle charge les jetons du kit (assets/tokens.css) et le moteur de la mascotte, PAS kazibo.css :
   son socle est la mise en page de l'affiche. Un outil veut une échelle de texte confortable, une
   hiérarchie nette, des cibles franches.

   Quatre tailles : 14 (secondaire, titre de module), 16 (texte, boutons, champs, adresse),
   18 (nom dans la liste), 24 (nom dans l'en-tête, titre des pages seules).
   Geist pour ce qui se lit, Geist Mono pour ce qui se copie, Martian Mono au logo et au nom d'une app.
   Rayons : 10 px sur ce qui se touche, 14 px sur ce qui flotte ou regroupe, 6 px sur un glyphe.
   Un seul filet (--rule), une seule ombre (sous ce qui flotte). Ruptures : 720 et 1100 px. */

:root{
  --r-touch:10px; --r-float:14px; --r-glyph:6px;
  --shadow:0 8px 24px rgb(23 33 58 / .18);
  --sunk-hover:#DFDCD3;
  --bar:56px;                 /* la barre du bas, au téléphone */
  --gap:32px;                 /* entre deux groupes : du vide, pas un filet */
  /* Trois aplats pour les tuiles des apps et la scène : les couleurs du kit, éclaircies. Jamais sous un texte. */
  --tint-spark:#FFDCB8; --tint-iris:#D2DFF2; --tint-cream:#EFE3CF;
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-bottom:calc(var(--bar) + 16px)}
body{margin:0;background:var(--paper);color:var(--ink);font:400 16px/1.5 var(--f-text);-webkit-font-smoothing:antialiased;overflow-wrap:break-word}
h1,h2,h3,p,ul,ol,dl,dd,pre{margin:0}
ul,ol{padding:0;list-style:none}
a{color:var(--iris);text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
button,input,select{font:inherit;color:inherit}
img,canvas,svg{display:block}
[hidden]{display:none!important}

/* Le focus : encre sur papier (14:1), jamais l'orange seul. */
:focus{outline:none}
:focus-visible{outline:2px solid var(--ink);outline-offset:2px;border-radius:4px}
h1:focus-visible,[role=heading]:focus-visible,h2:focus-visible{outline:none}      /* un titre focalisé à l'arrivée : pas d'anneau */

.sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.offscreen{position:fixed;left:-999px;top:0;opacity:0}
.skip{position:absolute;left:16px;top:-80px;z-index:20;display:inline-flex;align-items:center;min-height:44px;padding:0 16px;background:var(--ink);color:var(--paper);border-radius:var(--r-touch);text-decoration:none}
.skip:focus{top:8px;outline:2px solid var(--paper);box-shadow:0 0 0 4px var(--ink)}
.noscript{max-width:480px;margin:64px auto;padding:0 16px}

.mono,code,pre{font-family:var(--f-mono)}
code{font-size:1em}
.note{font-size:14px;color:var(--mute)}
.strong{font-weight:600}
.plain>li+li{margin-top:4px}

/* ---------------------------------------------------------------- les boutons : 44 px, un verbe */
.btn{appearance:none;display:inline-grid;place-items:center;min-height:44px;min-width:44px;padding:0 16px;border:0;border-radius:var(--r-touch);
  background:var(--sunk);color:var(--ink);font:500 16px/1.2 var(--f-text);text-decoration:none;white-space:nowrap;cursor:pointer;
  touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:transform .1s,background-color .12s}
.btn>span{grid-area:1/1}
.btn .res{visibility:hidden}
.btn.done .lbl{visibility:hidden}
.btn.done .res{visibility:visible}
.btn:hover{background:var(--sunk-hover)}
.btn:active{transform:translateY(1px)}
.btn.primary{background:var(--spark)}
.btn.primary:hover{background:var(--spark-hover)}
.btn.danger{background:var(--paper);color:var(--alert);box-shadow:inset 0 0 0 1.5px var(--alert)}
.btn.danger:hover{background:#FBEDEB}
.btn.quiet{background:none;padding:0 8px}
.btn.quiet:hover{background:var(--sunk)}
/* Un geste en retrait : il se lit comme un lien, il se touche comme un bouton (44 px). */
.btn.linkish,.life-acts .btn.quiet{color:var(--iris);font-weight:400;text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
.btn[disabled]{opacity:.55;cursor:default}
.acts{display:flex;flex-wrap:wrap;gap:8px}

/* Un signe en cellules (icons.js) : 14 px, deux pixels par cellule, de la couleur du texte qui le porte. */
.icon{width:14px;height:14px;shape-rendering:crispEdges}
.icon .ic{fill:currentColor}
/* Un petit contrôle discret : le signe seul, sans fond, sur une cible de 44 px. Le fond ne vient qu'au survol. */
.btn.icon-btn{width:44px;padding:0;background:none;color:var(--mute)}
.btn.icon-btn:hover,.btn.icon-btn.done{background:var(--sunk);color:var(--ink)}
/* Les deux façons : à côté d'un bouton qui agit, la phrase pour l'agent, en petit (« or ask Claude »). */
.btn.ask-also{font-size:14px;color:var(--mute)}

/* Un lien de fin de bloc : une cible de 44 px, sans avoir l'air d'un bouton. */
.more-link{display:inline-flex;align-items:center;min-height:44px;font-size:16px}

/* ---------------------------------------------------------------- la cellule d'état : cinq formes, jamais la couleur seule */
.cell{display:inline-block;flex:none;width:12px;height:12px}
.cell.on{background:var(--ink)}
.cell.busy{background:var(--spark);animation:beat 1.2s ease-in-out infinite}
.cell.off{box-shadow:inset 0 0 0 2px var(--mute)}
.cell.down{position:relative;background:var(--alert)}
.cell.down::after{content:"";position:absolute;inset:4px;background:var(--paper)}
.cell.unknown{border:2px dashed var(--mute)}
.cell.warn{position:relative;background:var(--ink)}
.cell.warn::after{content:"";position:absolute;inset:3px;background:var(--spark)}
.cell.ghost{background:var(--dot)}
.cell.top{background:var(--spark)}
.cell.seen{background:var(--iris)}
@keyframes beat{0%,100%{transform:scale(1)}50%{transform:scale(.6)}}
@keyframes fill{from{clip-path:inset(100% 0 0 0)}to{clip-path:inset(0)}}
.meter{display:inline-flex;gap:4px;margin-right:12px;vertical-align:-1px}

/* ---------------------------------------------------------------- le glyphe d'une app : 5 × 5, deux à cinq cellules en couleur */
.glyph{position:relative;display:block;flex:none;width:40px;height:40px;border-radius:var(--r-glyph);background:var(--sunk)}
.glyph.s{width:32px;height:32px}
.glyph.t-ink-spark{background:var(--tint-iris)}
.glyph.t-ink-iris{background:var(--tint-spark)}
.glyph.t-iris-spark{background:var(--tint-cream)}
.glyph-cells{width:100%;height:100%;shape-rendering:crispEdges}
.ink-spark .g-a,.ink-iris .g-a{fill:var(--ink)}
.iris-spark .g-a,.ink-iris .g-b{fill:var(--iris)}
.ink-spark .g-b,.iris-spark .g-b{fill:var(--spark)}
.pip{display:none;position:absolute;top:-3px;right:-3px;width:8px;height:8px;background:var(--spark);box-shadow:0 0 0 2px var(--paper)}
.needs .pip{display:block}
/* L'accusé de réception d'un lien copié : les cellules s'allument l'une après l'autre (400 ms). */
.glyph.lit rect{animation:lit .4s ease-out both}
.glyph.lit .g-b{animation-name:lit-b}
.glyph.lit .n1{animation-delay:30ms}.glyph.lit .n2{animation-delay:60ms}.glyph.lit .n3{animation-delay:90ms}.glyph.lit .n4{animation-delay:120ms}
.glyph.lit .n5{animation-delay:150ms}.glyph.lit .n6{animation-delay:180ms}.glyph.lit .n7{animation-delay:210ms}.glyph.lit .n8{animation-delay:240ms}
.glyph.lit .n9{animation-delay:270ms}.glyph.lit .n10{animation-delay:300ms}.glyph.lit .n11{animation-delay:330ms}
@keyframes lit{0%{fill:var(--spark)}60%{fill:var(--spark)}}
@keyframes lit-b{0%{fill:var(--ink)}60%{fill:var(--ink)}}

/* ---------------------------------------------------------------- la mascotte : une par vue */
.mascot{display:block;flex:none;line-height:0}
.mascot canvas,.mascot img{display:block;height:auto;image-rendering:pixelated}
.mascot.x1,.mascot.x1 canvas,.mascot.x1 img{width:34px}
.mascot.x2,.mascot.x2 canvas,.mascot.x2 img{width:68px}
.mascot.x3,.mascot.x3 canvas,.mascot.x3 img{width:102px}

/* ---------------------------------------------------------------- les fantômes de chargement : des points, jamais une roue */
.ghost{display:grid;gap:12px;padding:4px 0}
.ghost-line{height:12px;background:linear-gradient(90deg,var(--paper) 4px,transparent 0) 0 0/12px 12px,linear-gradient(var(--paper) 4px,transparent 0) 0 0/12px 12px,var(--dot)}
.ghost-line:nth-child(1){width:55%}.ghost-line:nth-child(2){width:80%}.ghost-line:nth-child(3){width:40%}.ghost-line:nth-child(4){width:65%}

/* En mouvement réduit : rien ne bouge. Le mot porte « … », l'accusé de réception reste, fixe. */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
  .glyph.lit .g-a{fill:var(--spark)}
}
