/*
  apps.epacus.fr : le site n'a pas de couleur à lui. Noir sur blanc, et chaque appli apporte
  la sienne (variables --plate, --plate-ink, --plate-accent générées depuis apps.json).
  Une seule audace : l'accueil, sur papier chaud, avec des tuiles aux couleurs de chaque appli.
*/
:root {
  --ink: #000;
  --paper: #fff;
  --soft: #5c5c5c;
  --rule: #000;
  --display: "Avenir Next Condensed", "AvenirNextCondensed-Bold", "Arial Narrow", "Roboto Condensed", sans-serif-condensed, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 64px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.55 var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }

h1, h2, .name, .door, .mark {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: condensed;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.icon { border-radius: 22.4%; box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08); flex: none; }
.ext { margin-left: 0.2em; font-family: var(--text); font-weight: 400; }

/* Barre du haut : la marque, la langue. Rien d'autre. */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: max(18px, env(safe-area-inset-top)) var(--gutter) 18px;
}
.mark { font-size: 1.6rem; line-height: 1; text-decoration: none; }
.lang { font-size: 0.95rem; text-underline-offset: 0.2em; }

/* Accueil : papier chaud, et directement les rayons. */
.home { --paper: #f1ece2; --card-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.07), 0 1px 0 rgb(0 0 0 / 0.04), 0 18px 34px -22px rgb(40 25 10 / 0.55); }

/* Pas d'intro : la page s'ouvre sur les jeux. Le titre reste pour les lecteurs d'écran et les moteurs. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.home main { padding-top: clamp(16px, 3vw, 40px); }

/* Rayons : un numéro, un titre, un filet d'encre. */
.shelf-group { padding: 0 var(--gutter); }
.shelf-group + .shelf-group { margin-top: clamp(56px, 7vw, 104px); }
.shelf-title {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0 0 20px;
  padding-top: 14px;
  border-top: 3px solid var(--ink);
  font-size: clamp(2rem, 1.2rem + 2.4vw, 3.4rem);
  line-height: 1;
}
.shelf-title .num {
  display: inline-grid;
  place-items: center;
  min-width: 2.6em;
  padding: 0.35em 0.5em;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.shelf {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: clamp(12px, 1.4vw, 20px);
}

/* Une tuile, une affiche : la couleur de l'icône, l'icône posée de biais, le nom en gros. */
.plate a {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 360px;
  padding: clamp(20px, 2vw, 28px);
  border-radius: 24px;
  overflow: hidden;
  background: var(--plate);
  color: var(--plate-ink);
  text-decoration: none;
  box-shadow: var(--card-shadow);
  transition: transform 280ms var(--ease), box-shadow 280ms var(--ease);
}
.plate a:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.plate .icon {
  width: 96px;
  height: auto;
  margin-bottom: auto;
  transform: rotate(-4deg);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.08), 0 12px 20px -12px rgb(0 0 0 / 0.55);
  transition: transform 280ms var(--ease);
}
.plate .name { margin-top: 28px; font-size: clamp(2.1rem, 1.4rem + 1.3vw, 2.9rem); line-height: 0.92; }
.plate .what { margin-top: 0.7rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }
.plate .line { margin-top: 0.45rem; font-size: 0.98rem; line-height: 1.45; }
.plate .go {
  margin-top: 1.2rem;
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: underline;
  text-decoration-color: var(--plate-accent);
  text-decoration-thickness: 3px;
  text-underline-offset: 0.3em;
}

/* Tuile large : le texte à gauche, l'icône en grand qui déborde à droite. */
.plate.wide { grid-column: span 2; }
.plate.wide a { padding-right: 46%; }
.plate.wide .icon {
  position: absolute;
  right: 7%;
  top: 50%;
  width: min(36%, 230px);
  margin: 0;
  transform: translateY(-50%) rotate(6deg);
}
.plate.wide .name { margin-top: auto; font-size: clamp(2.6rem, 1.6rem + 2vw, 3.8rem); }

@media (hover: hover) {
  .plate a:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.07), 0 1px 0 rgb(0 0 0 / 0.04), 0 26px 44px -24px rgb(40 25 10 / 0.7); }
  .plate a:hover .icon { transform: rotate(-9deg) scale(1.04); }
  .plate.wide a:hover .icon { transform: translateY(-50%) rotate(1deg) scale(1.04); }
}
@media (prefers-reduced-motion: reduce) {
  .plate a, .plate .icon { transition: none; }
}

/* Applis : des outils, donc des tuiles plus sobres, en ligne, icône à gauche. */
.shelf-apps .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shelf-apps .plate a, .plate.soon a {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "icon name" "icon what" "icon line" "icon go";
  column-gap: 20px;
  align-content: start;
  min-height: 0;
}
.shelf-apps .plate .icon, .plate.soon .icon { grid-area: icon; width: 76px; margin: 0; }
.shelf-apps .plate .name, .plate.soon .name { grid-area: name; margin: 0; font-size: 2rem; }
.shelf-apps .plate .what, .plate.soon .what { grid-area: what; }
.shelf-apps .plate .line, .plate.soon .line { grid-area: line; }
.shelf-apps .plate .go { grid-area: go; }
.plate.soon .go { display: none; }

/* Tablette : deux colonnes. */
@media (max-width: 1060px) {
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shelf-apps .shelf { grid-template-columns: 1fr; }
}

/* Téléphone : chaque jeu devient une ligne, icône à gauche, pour en voir plusieurs par écran. */
@media (max-width: 640px) {
  .shelf { grid-template-columns: 1fr; }
  .plate.wide { grid-column: auto; }
  .plate a, .plate.wide a {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "icon name" "icon what" "icon line" "icon go";
    column-gap: 16px;
    align-content: start;
    min-height: 0;
    padding: 18px;
    border-radius: 20px;
  }
  .plate .icon, .plate.wide .icon, .shelf-apps .plate .icon, .plate.soon .icon {
    grid-area: icon; position: static; width: 64px; margin: 0; transform: rotate(-4deg);
  }
  .plate .name, .plate.wide .name, .shelf-apps .plate .name, .plate.soon .name { grid-area: name; margin: 0; font-size: 1.8rem; }
  .plate .what { grid-area: what; margin-top: 0.4rem; font-size: 0.72rem; }
  .plate .line { grid-area: line; font-size: 0.93rem; }
  .plate .go { grid-area: go; margin-top: 0.8rem; font-size: 0.88rem; }
}

.home main { padding-bottom: clamp(64px, 9vw, 128px); }

/* Page introuvable */
.lost main { padding: clamp(32px, 8vw, 120px) var(--gutter); max-width: 48rem; }
.lost h1 { font-size: clamp(2.6rem, 1.4rem + 5vw, 5.5rem); line-height: 0.92; margin: 0 0 1.2rem; }
.lost .store { display: inline-block; padding: 0.8rem 1.25rem; border-radius: 10px; background: var(--ink); color: var(--paper); font-weight: 600; text-decoration: none; }

/* Mentions légales : une colonne de lecture, rien d'autre. */
.legal main { padding: clamp(32px, 8vw, 120px) var(--gutter) clamp(48px, 8vw, 120px); max-width: 44rem; }
.legal h1 { font-size: clamp(2.6rem, 1.4rem + 5vw, 5.5rem); line-height: 0.92; margin: 0 0 1.6rem; }
.legal h2 { font-size: 1.7rem; margin: 2.6rem 0 0.6rem; }
.legal .lede { font-size: 1.2rem; color: var(--soft); }

/* Pied de page : le noir referme la page. */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem 2rem;
  padding: 40px var(--gutter) max(40px, env(safe-area-inset-bottom));
  background: var(--ink);
  color: var(--paper);
}
.foot .mark { font-size: 2.4rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; font-size: 0.95rem; }
.foot nav a { text-underline-offset: 0.2em; }


/* Couleurs des applis (apps.json) */
.app-bad-ink-tower { --plate: #EEE8DC; --plate-ink: #121110; --plate-accent: #D81E1E; }
.app-miette { --plate: #F6EEDC; --plate-ink: #2A2230; --plate-accent: #22C3E6; }
.app-anvilkin { --plate: #1A1210; --plate-ink: #F3E6C8; --plate-accent: #F2A93B; }
.app-noctilana { --plate: #2B1736; --plate-ink: #F5E8CF; --plate-accent: #DBAB5C; }
.app-cendregarde { --plate: #15131F; --plate-ink: #EDE6F5; --plate-accent: #E8B765; }
.app-scrap-to-billions { --plate: #3B7C89; --plate-ink: #FFFFFF; --plate-accent: #F5B731; }
.app-clickerium { --plate: #1E56D9; --plate-ink: #FFFFFF; --plate-accent: #FFFFFF; }
.app-lyralume { --plate: #FBF4E8; --plate-ink: #26313B; --plate-accent: #D48C0E; }
.app-kinoment { --plate: #A8BEDB; --plate-ink: #14253C; --plate-accent: #B4502E; }
