/* si-mo.fr — page Studio.

   La colonne de gauche vient de shelf.css, comme Dessin et Traduction. À
   droite, une feuille de papier déchirée sur ses quatre côtés porte les deux
   applications ; le chat de Zazou se promène le long de son bas (studio.js).

   Le chat est le dessin de Si Mo pour Zazou, repris tel quel : ses tracés
   (la classe .ink, les filtres w1-w3 qui le font trembler) sont dans
   studio/index.html. Les bords déchirés sont générés : feuille.css. */

/* --- La feuille : papier déchiré sur ses quatre côtés ---

   Comme les volets de l'accueil et la planche d'inspiration : la surface du
   papier, une frange de fibres blanches là où il s'est déchiré, et une ombre
   portée. Quatre masques imbriqués : chaque couple gauche/droite et haut/bas
   se croise aux coins sans se recouvrir.
     .sheet          l'ombre (drop-shadow suit la forme déchirée)
     .sheet__rim-x   frange, gauche/droite
     .sheet__rim-y   frange, haut/bas — fond blanc
     .sheet__sides   papier, gauche/droite
     .sheet__paper   papier, haut/bas — fond du papier */

.sheet {
  --tear: 28px; /* = STRIP dans tools/feuille.mjs */
  --sheet-paper: #efeeea;
  --sheet-rim: #ffffff;
  margin-block: var(--pad-block);
  filter:
    drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0.8rem 1.4rem rgba(0, 0, 0, 0.6));
}

.sheet__rim-x,
.sheet__sides {
  -webkit-mask-size: var(--tear) 100%, var(--tear) 100%, calc(100% - 2 * var(--tear) + 6px) 100%;
  mask-size: var(--tear) 100%, var(--tear) 100%, calc(100% - 2 * var(--tear) + 6px) 100%;
  -webkit-mask-position: 0 0, 100% 0, calc(var(--tear) - 3px) 0;
  mask-position: 0 0, 100% 0, calc(var(--tear) - 3px) 0;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.sheet__rim-y,
.sheet__paper {
  -webkit-mask-size: 100% var(--tear), 100% var(--tear), 100% calc(100% - 2 * var(--tear) + 6px);
  mask-size: 100% var(--tear), 100% var(--tear), 100% calc(100% - 2 * var(--tear) + 6px);
  -webkit-mask-position: 0 0, 0 100%, 0 calc(var(--tear) - 3px);
  mask-position: 0 0, 0 100%, 0 calc(var(--tear) - 3px);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.sheet__rim-x {
  -webkit-mask-image: var(--rim-left), var(--rim-right), linear-gradient(#000, #000);
  mask-image: var(--rim-left), var(--rim-right), linear-gradient(#000, #000);
}
.sheet__rim-y {
  background: var(--sheet-rim);
  -webkit-mask-image: var(--rim-top), var(--rim-bottom), linear-gradient(#000, #000);
  mask-image: var(--rim-top), var(--rim-bottom), linear-gradient(#000, #000);
}
.sheet__sides {
  -webkit-mask-image: var(--tear-left), var(--tear-right), linear-gradient(#000, #000);
  mask-image: var(--tear-left), var(--tear-right), linear-gradient(#000, #000);
}
.sheet__paper {
  position: relative;
  padding: clamp(2.5rem, 5vw, 3.5rem) clamp(2.25rem, 5vw, 3.5rem) 10rem;
  background: var(--sheet-paper);
  color: var(--ink-jiao);
  overflow: hidden;
  -webkit-mask-image: var(--tear-top), var(--tear-bottom), linear-gradient(#000, #000);
  mask-image: var(--tear-top), var(--tear-bottom), linear-gradient(#000, #000);
}

/* --- Les deux fiches --- */

.apps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: clamp(2.5rem, 5vw, 4rem);
}

.app__status {
  font-size: var(--text-meta);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #6b6a67;
  margin: 0 0 0.6rem;
}
/* Une pastille : pleine pour une application publiée, vide pour une à venir. */
.app__status::before {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.6em;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  vertical-align: 0.1em;
}
.app__status--live::before { background: currentColor; }

.app__name {
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
  line-height: 1.1;
  margin: 0 0 0.3rem;
}
.app__what { margin: 0 0 1.2rem; color: #4a4946; }
.app__text { max-width: 30rem; margin: 0 0 1.2rem; }
.app__link { font-size: var(--text-meta); letter-spacing: 0.2em; text-transform: uppercase; }

.app__shot {
  float: right;
  width: clamp(6.5rem, 14vw, 9rem);
  height: auto;
  margin: 0 0 1rem 1.5rem;
  border-radius: 1rem;
  border: 1px solid rgba(17, 17, 17, 0.15);
  box-shadow: 0 0.6rem 1.4rem rgba(17, 17, 17, 0.15);
}

/* Sur téléphone, la colonne est trop étroite pour que le texte coule à côté
   de la capture : elle passe au-dessus, sans laisser de trou à sa gauche. */
@media (max-width: 30rem) {
  .app__shot { float: none; display: block; margin: 0 0 1.5rem; }
}

/* --- Le chat --- */

/* Le sol du chat : un trait à main levée, qui tremble image par image comme
   Zazou (même cadence ; ses propres filtres s1-s3, réglés pour une ligne).
   studio.js le redessine à la largeur réelle de la feuille. */
.floor {
  position: absolute;
  left: 1.5rem;
  right: 1.5rem;
  bottom: 2.25rem;
  height: 12px;
}
.floor svg { display: block; width: 100%; height: 100%; overflow: visible; }

.cat {
  position: absolute;
  bottom: 2.6rem;
  left: 0;
  height: 7rem;
  transform: translateX(5rem); /* sans script, il reste assis là */
  will-change: transform;
}
.cat__pose { display: none; position: absolute; bottom: 0; height: 100%; }
.cat__pose svg { height: 100%; width: auto; overflow: visible; display: block; }
.cat[data-pose="assis"] .cat__pose--assis,
.cat[data-pose="marche"] .cat__pose--marche,
.cat[data-pose="dort"] .cat__pose--dort,
.cat[data-pose="etire"] .cat__pose--etire,
.cat[data-pose="tape"] .cat__pose--tape,
.cat[data-pose="baille"] .cat__pose--baille { display: block; }
/* Les poses sont centrées sur le point où le chat se tient. */
.cat__pose { transform: translateX(-50%); }
.cat.is-left .cat__pose--marche { transform: translateX(-50%) scaleX(-1); }

.wall--studio .ink { stroke: #1E1410; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.boil use { animation: boil 0.36s steps(1) infinite; opacity: 0; }
.boil use:nth-child(2) { animation-delay: -0.12s; }
.boil use:nth-child(3) { animation-delay: -0.24s; }
@keyframes boil { 0% { opacity: 1; } 33.34% { opacity: 0; } 100% { opacity: 0; } }
.pas { position: relative; height: 100%; aspect-ratio: 300 / 240; }
.pas svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pas .b { animation: pas 0.5s steps(1) infinite; }
.pas .a { animation: pas 0.5s steps(1) infinite reverse; }
@keyframes pas { 0% { visibility: visible; } 50% { visibility: hidden; } }

@media (prefers-reduced-motion: reduce) {
  .boil use { animation: none; }
  .boil use:first-child { opacity: 1; }
}
