/* ============================================================
   Mégalogiciel 2026 — « Le cahier de jeux »
   Papier quadrillé · encre bleue · orange feutre · vert tampon
   ============================================================ */

:root {
  --papier: #FDFCF8;
  --papier-doux: #F5F3EB;
  --blanc: #FFFFFF;
  --encre: #212B5F;
  --encre-85: rgba(33, 43, 95, .85);
  --encre-60: rgba(33, 43, 95, .62);
  --encre-20: rgba(33, 43, 95, .2);
  --encre-12: rgba(33, 43, 95, .12);
  --orange: #F4610A;
  --orange-15: rgba(244, 97, 10, .16);
  --bleu: #2B54D4;
  --quadrillage: #DCE7F4;
  --vert: #0F8A3D;
  --vert-15: rgba(15, 138, 61, .14);
  --bordure: 2px solid var(--encre);
  --ombre: 6px 6px 0 var(--encre-12);
  --ombre-forte: 8px 8px 0 var(--encre-20);
  --rayon: 12px;
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-corps: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-note: "Caveat", "Segoe Print", cursive;
}

/* ---------- socle ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-corps);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--encre);
  background-color: var(--papier);
  background-image:
    linear-gradient(var(--quadrillage) 1px, transparent 1px),
    linear-gradient(90deg, var(--quadrillage) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-font-smoothing: antialiased;
}

/* la marge orange du cahier */
body::before {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  left: 86px;
  width: 2px;
  background: rgba(244, 97, 10, .28);
  pointer-events: none;
  z-index: 0;
}

img { max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
}

p { margin: 0; }

a { color: var(--bleu); }

::selection { background: var(--orange); color: var(--blanc); }

:focus-visible {
  outline: 3px solid var(--bleu);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: min(1180px, 100% - 48px);
  margin-inline: auto;
  position: relative;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  background: var(--encre);
  color: var(--papier);
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- éléments partagés ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bleu);
}
.eyebrow::before {
  content: "";
  width: 9px; height: 9px;
  background: var(--orange);
  transform: rotate(45deg);
  flex: none;
}

.btn {
  display: inline-block;
  font-family: var(--font-corps);
  font-weight: 700;
  font-size: .95rem;
  padding: 12px 22px;
  border-radius: 10px;
  border: var(--bordure);
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn--primaire { background: var(--orange); color: var(--blanc); box-shadow: 4px 4px 0 var(--encre); }
.btn--secondaire { background: var(--papier); color: var(--encre); box-shadow: 4px 4px 0 var(--encre-12); }
.btn:hover { transform: translate(-1px, -1px); }
.btn--primaire:hover { box-shadow: 5px 5px 0 var(--encre); }
.btn--secondaire:hover { background: var(--blanc); box-shadow: 5px 5px 0 var(--encre-12); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--encre); }

.chip {
  font-family: var(--font-corps);
  font-weight: 600;
  font-size: .88rem;
  color: var(--encre);
  background: transparent;
  border: 2px solid var(--encre-20);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.chip:hover { border-color: var(--encre); }
.chip.is-actif,
.chip[aria-pressed="true"] { background: var(--encre); border-color: var(--encre); color: var(--papier); }
.chip--statique {
  cursor: default;
  background: var(--blanc);
  border-color: var(--encre);
  padding: 5px 14px;
  font-size: .82rem;
}

.tampon {
  display: inline-block;
  font-weight: 700;
  font-size: .76rem;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  transform: rotate(-2deg);
  white-space: nowrap;
}
.tampon--gratuit { color: var(--vert); background: var(--vert-15); border: 2px solid var(--vert); }
.tampon--payant { color: var(--orange); background: var(--orange-15); border: 2px solid var(--orange); }

.gp-badge { display: block; height: auto; }

.sticker {
  background: var(--blanc);
  border: var(--bordure);
  border-radius: 14px;
  padding: 10px;
  box-shadow: var(--ombre);
}

.lien-simple {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--bleu);
  text-decoration: underline;
  cursor: pointer;
}

.annotation {
  font-family: var(--font-note);
  font-weight: 600;
  font-size: 1.35rem;
  line-height: 1.1;
  color: var(--bleu);
  transform: rotate(-3deg);
}
.annotation__fleche { display: block; width: 46px; height: 32px; margin: 2px 0 0 6px; }

/* ---------- en-tête ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 252, 248, .93);
  backdrop-filter: blur(6px);
  border-bottom: var(--bordure);
}
.site-head__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-block: 14px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.logo__mark {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  background: var(--orange);
  color: var(--blanc);
  border: var(--bordure);
  border-radius: 9px;
  box-shadow: 3px 3px 0 var(--encre);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
}
.logo__word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  color: var(--encre);
}
.logo__word em { font-style: normal; color: var(--orange); }

.nav { display: flex; align-items: center; gap: 26px; }
.nav a {
  font-weight: 600;
  font-size: .95rem;
  color: var(--encre);
  text-decoration: none;
}
.nav a:hover {
  text-decoration: underline wavy var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.nav-toggle {
  display: none;
  width: 42px; height: 38px;
  background: var(--blanc);
  border: var(--bordure);
  border-radius: 8px;
  cursor: pointer;
  position: relative;
}
.nav-toggle__barre,
.nav-toggle::before,
.nav-toggle::after {
  content: "";
  position: absolute;
  left: 9px; right: 9px;
  height: 2px;
  background: var(--encre);
}
.nav-toggle::before { top: 11px; }
.nav-toggle__barre { top: 17px; }
.nav-toggle::after { top: 23px; }

/* ---------- héros ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
  gap: 56px;
  padding-block: 64px 84px;
}
.hero--plein { grid-template-columns: 1fr; }

.hero__titre {
  font-size: clamp(2.3rem, 4.6vw, 3.8rem);
  font-weight: 800;
  margin-top: 18px;
}
.surligne {
  font-style: normal;
  background-image: linear-gradient(100deg, rgba(244, 97, 10, .3), rgba(244, 97, 10, .3));
  background-repeat: no-repeat;
  background-size: 100% 34%;
  background-position: 0 88%;
}

.hero__sous-titre {
  margin-top: 18px;
  max-width: 46ch;
  font-size: 1.07rem;
  line-height: 1.6;
  color: var(--encre-85);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.hero__faits {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-top: 30px;
  font-family: var(--font-note);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--bleu);
}
.hero__faits span[aria-hidden] { font-size: 1.1rem; color: var(--encre-20); }

/* l'album : les 20 cases qui se collent */
.hero__album { position: relative; }

.mosaique {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 12px;
}
.mosaique__case {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  background: var(--blanc);
  border: var(--bordure);
  border-radius: 12px;
  box-shadow: 3px 3px 0 var(--encre-12);
  transition: transform .18s ease, box-shadow .18s ease;
  animation: coller .5s cubic-bezier(.34, 1.56, .64, 1) both;
  animation-delay: var(--delai, 0s);
}
.mosaique__case:nth-child(4n+1) { rotate: -1.2deg; }
.mosaique__case:nth-child(4n+2) { rotate: .9deg; }
.mosaique__case:nth-child(4n+3) { rotate: -.6deg; }
.mosaique__case:nth-child(4n)   { rotate: 1.4deg; }
.mosaique__case img { width: 68%; height: auto; border-radius: 6px; }
.mosaique__case:hover {
  transform: translate(-2px, -3px) rotate(0deg);
  box-shadow: 5px 6px 0 var(--encre-20);
  z-index: 2;
}

@keyframes coller {
  from { opacity: 0; transform: scale(.3) rotate(-12deg); }
}

.hero__album .annotation {
  position: absolute;
  right: -4px;
  bottom: -52px;
}
.hero__album .annotation__fleche {
  transform: scaleX(-1) rotate(-40deg);
  margin-left: 2px;
}

/* ---------- catalogue ---------- */

.catalogue { padding-block: 26px 96px; }

.catalogue__tete {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.catalogue__tete h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; }

.recherche input {
  font-family: var(--font-corps);
  font-size: .95rem;
  color: var(--encre);
  background: var(--blanc);
  border: var(--bordure);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--encre-12);
  padding: 10px 14px;
  width: 260px;
}
.recherche input::placeholder { color: var(--encre-60); }

.filtres {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}
.filtres__sep {
  width: 2px;
  height: 22px;
  background: var(--encre-20);
  margin-inline: 6px;
}

.catalogue__compte {
  margin-top: 16px;
  font-family: var(--font-note);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--bleu);
}

.grille {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 14px;
}

.jeu {
  position: relative;
  background: var(--blanc);
  border: var(--bordure);
  border-radius: 14px;
  box-shadow: var(--ombre);
  transition: transform .18s ease, box-shadow .18s ease;
}
.jeu:nth-child(4n+1) { rotate: -.4deg; }
.jeu:nth-child(4n+2) { rotate: .35deg; }
.jeu:nth-child(4n+3) { rotate: -.25deg; }
.jeu:nth-child(4n)   { rotate: .4deg; }
.jeu:hover {
  rotate: 0deg;
  transform: translate(-2px, -2px);
  box-shadow: var(--ombre-forte);
}
.jeu[hidden] { display: none; }

.jeu__lien {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.jeu__media {
  border-bottom: var(--bordure);
  border-radius: 11px 11px 0 0;
  overflow: hidden;
  background: var(--papier-doux);
}
.jeu__media img {
  display: block;
  width: 100%;
  aspect-ratio: 640 / 360;
  object-fit: cover;
}

.jeu__corps { padding: 16px 18px 18px; }

.jeu__tete { display: flex; align-items: center; gap: 12px; }
.jeu__icone {
  width: 46px; height: 46px;
  border: var(--bordure);
  border-radius: 10px;
  background: var(--blanc);
  flex: none;
}
.jeu__titre h3 { font-size: 1.02rem; font-weight: 700; }
.jeu__titre p { margin-top: 2px; font-size: .8rem; color: var(--encre-60); }

.jeu__accroche {
  margin-top: 10px;
  font-size: .9rem;
  line-height: 1.45;
  color: var(--encre-85);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.jeu__pied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}
.jeu__store {
  position: relative;
  z-index: 2;
  display: inline-block;
  border-radius: 6px;
}
.jeu__store .gp-badge { height: 32px; }

.catalogue__vide {
  text-align: center;
  padding: 48px 0 20px;
  font-size: 1.05rem;
  color: var(--encre-85);
}

/* ---------- fiche jeu ---------- */

.retour {
  display: inline-block;
  margin-block: 26px 20px;
  font-weight: 600;
  color: var(--bleu);
  text-decoration: none;
}
.retour:hover {
  text-decoration: underline wavy var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.fiche-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 44px;
  align-items: start;
}

.fiche-hero__media { rotate: -.6deg; }
.fiche-hero__media img {
  display: block;
  width: 100%;
  aspect-ratio: 640 / 360;
  object-fit: cover;
  border-radius: 7px;
}

.fiche-hero__identite {
  display: flex;
  align-items: center;
  gap: 16px;
}
.fiche-hero__icone {
  width: 64px; height: 64px;
  border: var(--bordure);
  border-radius: 14px;
  box-shadow: 3px 3px 0 var(--encre-12);
  flex: none;
  background: var(--blanc);
}
.fiche-hero__identite h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 800; }
.fiche-hero__chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.fiche-hero__accroche {
  margin-top: 18px;
  font-family: var(--font-note);
  font-weight: 700;
  font-size: 1.55rem;
  line-height: 1.2;
  color: var(--bleu);
}

.fiche-hero__desc {
  margin-top: 10px;
  max-width: 60ch;
  line-height: 1.65;
  color: var(--encre-85);
}

.fiche-hero__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}
.fiche-hero__store {
  display: inline-block;
  background: var(--blanc);
  border: var(--bordure);
  border-radius: 10px;
  box-shadow: 4px 4px 0 var(--encre);
  padding: 9px 14px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.fiche-hero__store:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--encre); }
.fiche-hero__store:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--encre); }
.fiche-hero__store .gp-badge { height: 56px; }

.fiche-hero__paquet {
  margin-top: 16px;
  font-size: .82rem;
  color: var(--encre-60);
}
.fiche-hero__paquet code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .78rem;
  background: var(--papier-doux);
  border: 1px solid var(--encre-20);
  border-radius: 6px;
  padding: 2px 6px;
}

.fiche-points { margin-top: 56px; }
.fiche-points h2 { font-size: 1.45rem; font-weight: 800; }
.fiche-points ul {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 24px;
}
.fiche-points li {
  position: relative;
  background: var(--blanc);
  border: var(--bordure);
  border-radius: 10px;
  padding: 13px 16px 13px 46px;
  font-weight: 500;
  font-size: .93rem;
}
.fiche-points li::before {
  content: "✓";
  position: absolute;
  left: 13px;
  top: calc(50% - 11px);
  display: grid;
  place-items: center;
  width: 21px; height: 21px;
  background: var(--vert-15);
  border: 2px solid var(--vert);
  border-radius: 6px;
  color: var(--vert);
  font-size: .8rem;
  font-weight: 800;
}

/* la même case du cahier : bande encre, dos de couverture */
.fiche-suite {
  margin-top: 64px;
  background: var(--encre);
  padding-block: 44px 64px;
}
.fiche-suite h2 { color: var(--papier); font-size: 1.45rem; font-weight: 800; }
.fiche-suite__rang {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 20px 2px 10px;
  scrollbar-width: thin;
}
.mini {
  flex: none;
  width: 158px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  background: var(--papier);
  border: var(--bordure);
  border-radius: 12px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .35);
  padding: 12px;
  text-decoration: none;
  transition: transform .15s ease;
}
.mini:nth-child(odd) { rotate: -.7deg; }
.mini:nth-child(even) { rotate: .6deg; }
.mini:hover { transform: translate(-1px, -3px); rotate: 0deg; }
.mini img {
  width: 54px; height: 54px;
  border: var(--bordure);
  border-radius: 10px;
  background: var(--blanc);
}
.mini__nom {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .86rem;
  line-height: 1.2;
  color: var(--encre);
}

/* ---------- pages texte ---------- */

.page-texte { max-width: 74ch; padding-block: 56px 96px; }
.page-texte h1 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 800; margin-top: 16px; }
.page-texte h2 { font-size: 1.3rem; font-weight: 800; margin-top: 36px; }
.page-texte p { margin-top: 12px; line-height: 1.7; color: var(--encre-85); }
.page-texte code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .85em;
  background: var(--papier-doux);
  border: 1px solid var(--encre-20);
  border-radius: 6px;
  padding: 1px 6px;
}

/* 404 */
.page-perdue {
  display: flex;
  align-items: center;
  gap: 52px;
  padding-block: 72px 110px;
}
.page-perdue__sticker { rotate: -3deg; padding: 34px 44px; }
.page-perdue__code {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 4.2rem;
  color: var(--orange);
  line-height: 1;
}
.page-perdue__texte h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; }
.page-perdue__texte p { margin: 14px 0 24px; line-height: 1.6; color: var(--encre-85); }

/* ---------- pied de page ---------- */

.site-foot { background: var(--encre); color: rgba(253, 252, 248, .82); }
.site-foot__cols {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr) minmax(0, .8fr);
  gap: 44px;
  padding-block: 48px 30px;
}
.site-foot h2 {
  font-family: var(--font-corps);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--orange);
}
.site-foot__marque p {
  margin-top: 14px;
  max-width: 34ch;
  line-height: 1.6;
  font-size: .93rem;
}
.logo--clair .logo__word { color: var(--papier); }
.site-foot__nav a,
.site-foot__ailleurs a {
  display: block;
  margin-top: 11px;
  color: rgba(253, 252, 248, .82);
  text-decoration: none;
  font-size: .93rem;
  overflow-wrap: break-word;
}
.site-foot__nav a:hover,
.site-foot__ailleurs a:hover {
  color: var(--papier);
  text-decoration: underline wavy var(--orange);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.site-foot__bas {
  border-top: 1px solid rgba(253, 252, 248, .18);
  padding-block: 18px 26px;
  font-size: .8rem;
  color: rgba(253, 252, 248, .55);
}

/* ---------- responsive ---------- */

@media (max-width: 1000px) {
  body::before { display: none; }
}

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 44px; padding-block: 44px 72px; }
  .hero__album .annotation { position: static; margin-top: 14px; transform: rotate(-2deg); }
  .hero__album .annotation__fleche { display: none; }
  .grille { grid-template-columns: repeat(2, 1fr); }
  .fiche-hero { grid-template-columns: 1fr; gap: 30px; }
  .fiche-hero__media { max-width: 560px; }
}

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--papier);
    border-bottom: var(--bordure);
    padding: 8px 20px 16px;
    box-shadow: 0 10px 0 rgba(33, 43, 95, .08);
  }
  body.nav-ouvert .nav { display: flex; }
  .nav a { padding: 13px 2px; border-bottom: 1px dashed var(--encre-20); }
  .site-head__in { position: relative; flex-wrap: wrap; }
  .site-foot__cols { grid-template-columns: 1fr 1fr; gap: 36px 24px; }
  .site-foot__marque { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .grille { grid-template-columns: 1fr; }
  .fiche-points ul { grid-template-columns: 1fr; }
  .page-perdue { flex-direction: column; align-items: flex-start; gap: 28px; }
  .recherche input { width: 100%; }
  .catalogue__tete { align-items: stretch; }
  .hero__actions .btn { flex: 1 1 auto; text-align: center; }
  .site-foot__cols { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- mouvement réduit ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
