/* Recap · index · Accueil, suite de la page : accès rapide, matières, « Dans ton Recap », pied de page + fusée du bouton Commencer */

/* ---------- mise en page : l'accueil défile (au lieu d'être centré et coupé) ---------- */
#start { justify-content: flex-start; padding-bottom: calc(122px + env(safe-area-inset-bottom, 0px)); }
#start > .content { margin-block: auto; padding-top: 22px; }

/* ---------- la fusée posée au bord de la carte, à droite du bouton ; elle décolle quand on appuie sur « Commencer » ---------- */
.pi-rocket { display: block; pointer-events: none; }
.pi-rocket img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 3px 2px var(--mc-d1, rgba(40,24,10,.26))) drop-shadow(0 9px 7px var(--mc-d2, rgba(40,24,10,.16)));
  animation: rk-float 3.6s ease-in-out infinite; }
@keyframes rk-float { 0%, 100% { translate: 0 0; rotate: -1.5deg; } 50% { translate: 0 -8px; rotate: 1.5deg; } }
.js .pi.enter .pi-rocket { animation: rk-in .85s cubic-bezier(.34, 1.4, .64, 1) 1.5s backwards; }
@keyframes rk-in { from { opacity: 0; translate: 26px 40px; scale: .7; } }
.pi-rocket.go { z-index: 30; }
.pi-rocket.go img { animation: rk-launch .62s cubic-bezier(.55, 0, .85, .35) forwards; }
@keyframes rk-launch { 0% { translate: 0 0; scale: 1; } 18% { translate: 0 6px; scale: 1.04 .96; } 100% { translate: 40px -118vh; scale: .9; opacity: .9; } }
.st3.launching .core { transform: translateY(4px); box-shadow: 0 1px 0 0 color-mix(in srgb, var(--ink) 38%, transparent); }

/* ---------- blocs communs ---------- */
.hm-sec { position: relative; width: min(100%, 400px); margin: 34px auto 0; text-align: start; box-sizing: border-box; }
.hm-h { display: flex; align-items: center; gap: 10px; margin: 0 2px 14px; font-family: var(--hd-brush, "Caveat Brush", "Caveat", cursive); font-weight: 400; letter-spacing: 0;
  font-size: 1.6rem; line-height: 1; color: var(--ink); }
.hm-h::after { content: ""; flex: 1; height: 0; border-top: 3px dotted color-mix(in srgb, var(--ink) 42%, transparent); translate: 0 3px; }
@keyframes hm-pop { from { opacity: 0; translate: 0 18px; scale: .9; } }
.hm-card { animation: none; }
.hm-sec.in .hm-card, .hm-sec.in .hm-all { animation: hm-pop .55s cubic-bezier(.3, 1.45, .5, 1) calc(120ms + var(--i, 0) * 80ms) backwards; }

/* ---------- matières : 6 cartes doodle avec les objets Low Poly ---------- */
.hm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px 10px; }
.hm-card { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; padding: 0 4px 12px; text-decoration: none; color: var(--c);
  background: var(--card); border: 2.5px solid var(--c); border-radius: 18px 36px 20px 32px / 32px 18px 36px 20px; box-shadow: 3px 4px 0 color-mix(in srgb, var(--c) 34%, transparent);
  -webkit-tap-highlight-color: transparent; transition: transform .12s ease, opacity .12s ease; }
.hm-card:nth-child(odd) { rotate: -1.4deg; } .hm-card:nth-child(even) { rotate: 1.6deg; border-radius: 34px 18px 32px 20px / 20px 34px 18px 32px; } .hm-card:nth-child(3n) { rotate: -.5deg; }
/* l'objet déborde un peu au-dessus de la carte : il « sort » de la page */
.hm-card img { display: block; width: auto; max-width: 80%; height: 70px; object-fit: contain; margin-top: -32px; pointer-events: none; user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 3px 2px var(--mc-d1, rgba(40,24,10,.26))) drop-shadow(0 8px 6px var(--mc-d2, rgba(40,24,10,.16))); transition: transform .25s cubic-bezier(.3, 1.5, .5, 1); }
.hm-card:active img { transform: translateY(-4px) scale(1.06) rotate(-3deg); }
.hm-card .lbl { position: relative; isolation: isolate; padding: 0 3px; font-family: var(--hd-brush, "Caveat Brush", "Caveat", cursive); font-weight: 400; letter-spacing: 0; font-size: 1.12rem; line-height: 1.05; text-align: center; }
.hm-card .lbl::before { content: ""; position: absolute; z-index: -1; left: -3px; right: -3px; bottom: 0; height: 50%; rotate: -1.2deg; border-radius: 3px 9px 4px 10px; background: color-mix(in srgb, var(--c) 30%, transparent); }
.hm-grid { padding-top: 38px; }
/* noms longs (ex. « Life & Earth Sci. ») : une seule ligne qui défile sur le côté, comme subjects.html */
.hm-card .lbl.ts { flex: none; max-width: 100%; box-sizing: border-box; padding: 0 8px; white-space: nowrap; scrollbar-width: none; touch-action: pan-x pan-y; }
.hm-card .lbl.ts::-webkit-scrollbar { display: none; height: 0; }
.hm-card .lbl.ts::before { left: 0; right: 0; }
.hm-card .lbl.ovf { text-align: start; padding-bottom: 4px; }
.hm-card .lbl.ovf::before { display: none; }
.hm-card .lbl.ovf { background: linear-gradient(color-mix(in srgb, var(--c) 30%, transparent), color-mix(in srgb, var(--c) 30%, transparent)) left bottom 4px / 100% 50% no-repeat; background-attachment: local; }
.hm-all { display: flex; align-items: center; justify-content: center; gap: 8px; width: fit-content; margin: 22px auto 0; padding: 9px 20px 9px 22px; text-decoration: none; color: var(--card); background: var(--ink);
  border-radius: 999px; box-shadow: 0 4px 0 0 color-mix(in srgb, var(--ink) 38%, transparent); font: 400 1.05rem/1 "Patrick Hand", "Tajawal", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; transition: transform .12s ease, opacity .12s ease; }
.hm-all svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- « Dans ton Recap » : post-it avec les livres posés sur son coin ---------- */
.hm-note { margin-top: 56px; padding: 22px 18px 20px; background: color-mix(in srgb, var(--accent) 13%, var(--card)); border: 2.5px dashed color-mix(in srgb, var(--ink) 55%, transparent);
  border-radius: 6px 22px 8px 20px; rotate: -1deg; box-shadow: 0 12px 22px rgba(0, 0, 0, .16); }
.hm-tape { position: absolute; top: -9px; left: 22px; width: 52px; height: 16px; rotate: -7deg; background: color-mix(in srgb, var(--teal) 60%, transparent); box-shadow: 0 2px 3px rgba(0, 0, 0, .2); }
.hm-tape.t2 { left: auto; right: 112px; width: 36px; rotate: 6deg; background: color-mix(in srgb, var(--gold) 62%, transparent); }
.hm-books { position: absolute; z-index: 2; inset-inline-end: -10px; top: -58px; width: 108px; height: auto; rotate: 6deg; pointer-events: none; user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 3px 2px var(--mc-d1, rgba(40,24,10,.26))) drop-shadow(0 10px 8px var(--mc-d2, rgba(40,24,10,.16))); animation: hm-bob 5.5s ease-in-out infinite; }
@keyframes hm-bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -4px; } }
.hm-note .hm-h { margin-bottom: 24px; padding-inline-end: 100px; }
.hm-note .hm-h::after { display: none; }
.hm-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 11px; }
.hm-list li { display: flex; align-items: flex-start; gap: 10px; font-size: .92rem; line-height: 1.35; color: var(--text); }
.hm-list svg { flex: none; width: 22px; height: 22px; margin-top: -1px; fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- pied de page : le chat dort sous une phrase ---------- */
.hm-foot { margin-top: 34px; text-align: center; }
.hm-cat { position: relative; width: min(190px, 52vw); margin: 0 auto; pointer-events: none; }
.hm-cat .mc-img { animation: mc-breathe 5.8s ease-in-out infinite; }
.hm-cat .mc-ground { left: 6%; right: 4%; bottom: -4px; height: 13px; }
.hm-foot p { margin: 14px 0 0; font-family: var(--hd-brush, "Caveat Brush", "Caveat", cursive); font-size: 1.25rem; color: var(--muted); letter-spacing: 0; }

@media (max-width: 360px) { .hm-grid { gap: 20px 8px; } .hm-card .lbl { font-size: 1rem; } .hm-books { width: 92px; top: -50px; } .hm-note .hm-h { padding-inline-end: 84px; } }
@media (min-width: 700px) { .hm-sec { width: min(100%, 460px); } }
@media (prefers-reduced-motion: reduce) {
  .pi-rocket img, .hm-books, .hm-cat .mc-img { animation: none !important; }
  .js .pi.enter .pi-rocket, .hm-sec.in .hm-card, .hm-sec.in .hm-all { animation: none !important; }
}
