/* ==========================================================================
   home.css — Styles spécifiques à la page d'accueil (index.php) et à la page 404
   Sections : hero (copie corrigée) · ruban des matières · deux parcours · niveaux et matières · avis
   ========================================================================== */

/* ===== HERO : papier à pois, comme un cahier ===== */
.hero {
    padding: 40px 0 64px; overflow: hidden;
    background: var(--creme) radial-gradient(circle, #EBCFAF 1.6px, transparent 1.7px) 0 0 / 24px 24px;
}
.hero__grille { display: grid; gap: 56px; align-items: center; }
.hero h1 { max-width: 11ch; font-size: clamp(2.7rem, 9vw, 4.6rem); }
.hero__chapo { font-size: 1.22rem; color: var(--texte-doux); max-width: 44ch; margin-bottom: 1.6em; }
.hero__garanties { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 26px 0 0; color: var(--texte); font-weight: 700; }
.hero__garanties li { margin: 0; }

@media (min-width: 900px) {
    .hero { padding: 88px 0 104px; }
    .hero__grille { grid-template-columns: 1.1fr .9fr; gap: 64px; }
}

/* ----- La copie corrigée : feuille à grands carreaux (Seyès), écriture cursive d'école -----
   Les lignes sont espacées de 32px : chaque ligne de texte (line-height 32px) repose sur une ligne du cahier. */
.copie { margin: 0 auto; width: 100%; max-width: 440px; }
.copie__pile {
    position: relative; isolation: isolate;
    transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));   /* inclinée par animations.js */
    transition: transform .3s ease-out;
}
.copie__feuille {
    --interligne: 32px;
    --marge: 60px;                       /* position de la marge rouge */
    position: relative;
    padding: calc(var(--interligne) * 3) 18px calc(var(--interligne) * 1.5) calc(var(--marge) + 14px);
    font: 300 1rem/var(--interligne) var(--police-main);
    color: #24389B;                      /* encre de stylo-plume */
    background-color: var(--blanc);
    background-image:
        linear-gradient(90deg, transparent calc(var(--marge) - 1px), #EFA3A0 calc(var(--marge) - 1px), #EFA3A0 calc(var(--marge) + 1px), transparent calc(var(--marge) + 1px)),
        linear-gradient(#B7C2EC 1px, transparent 1px),
        linear-gradient(#E4E9F8 1px, transparent 1px),
        linear-gradient(90deg, #DCE2F6 1px, transparent 1px);
    background-size: 100% 100%, 100% var(--interligne), 100% calc(var(--interligne) / 4), var(--interligne) 100%;
    background-position: 0 0, 0 var(--base, 22px), 0 calc(var(--base, 22px) - var(--interligne)), calc(var(--marge) - var(--interligne) * 4) 0;
    border-radius: 6px;
    box-shadow: 0 6px 0 rgba(120, 53, 15, .1), 0 24px 44px rgba(120, 53, 15, .2);
    rotate: 1.4deg;
    animation: flotte 7s ease-in-out infinite;
}
@keyframes flotte { 50% { translate: 0 -10px; rotate: 2.2deg; } }
/* une seconde feuille dessous */
.copie__pile::before {
    content: ""; position: absolute; inset: 6px -4px -6px 4px; z-index: -1;
    background: var(--blanc); border-radius: 6px; box-shadow: 0 4px 0 rgba(120, 53, 15, .08);
    rotate: -2.2deg;
}
.copie__feuille p { margin: 0; }
.copie__titre span { box-shadow: 0 2px 0 var(--rouge); }     /* titre souligné en rouge, à la règle */
.copie__calcul { padding-left: 1.2em; }
.copie__resultat { position: relative; }
.copie__resultat span { box-shadow: 0 2px 0 #24389B; }
.copie__coche {
    position: absolute; left: calc(-1 * var(--marge) + 6px); top: 2px; width: 26px; height: 26px;
    fill: none; stroke: var(--rouge); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round;
    stroke-dasharray: 1; animation: trait-rouge .6s 2.3s var(--sortie) backwards;   /* la coche se trace en dernier */
}

/* la note et l'appréciation du professeur, au stylo rouge */
.copie__note {
    position: absolute; top: 14px; right: 22px; padding: 6px 20px 10px;
    font: 400 2rem/1.3 var(--police-main); color: var(--rouge); rotate: -5deg;
}
.copie__note small { font-size: .55em; }
.copie__note svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.copie__note path {
    fill: none; stroke: var(--rouge); stroke-width: 2.4; stroke-linecap: round; vector-effect: non-scaling-stroke;
    stroke-dasharray: 1; stroke-dashoffset: 0;
    animation: trait-rouge .9s 1.7s var(--sortie) backwards;   /* le professeur entoure la note */
}
.copie__appreciation {
    position: absolute; top: 34px; left: calc(var(--marge) + 14px);
    font-size: 1.05rem; color: var(--rouge); rotate: -3deg;
    animation: apparition .6s 1.5s var(--sortie) backwards;
}
@keyframes trait-rouge { from { stroke-dashoffset: 1; } }

/* pastille ronde qui tourne : « cours d'essai offert » */
.copie__sceau { position: absolute; left: -22px; bottom: -34px; width: 104px; height: 104px; z-index: 2; filter: drop-shadow(0 5px 0 rgba(194, 65, 12, .5)); }
.copie__sceau-fond { fill: var(--accent); stroke: var(--sur-accent); stroke-width: 3; }
/* le groupe tourne autour du centre exact du cercle (70, 70) ; le texte reste dans le cercle quel que soit le navigateur */
.copie__sceau-rotation { transform-box: view-box; transform-origin: 70px 70px; animation: tourne 24s linear infinite; }
.copie__sceau-texte { font: 800 10.5px var(--police-titre); fill: var(--sur-accent); }
.copie__sceau-etoile { fill: var(--sur-accent); transform-box: fill-box; transform-origin: center; animation: pulse 2.4s var(--rebond) infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { scale: 1.18; } }
@media (min-width: 480px) { .copie__sceau { width: 124px; height: 124px; left: -40px; bottom: -40px; } }

.copie figcaption {
    margin-top: 52px; padding-left: 16px; font-size: 1.05rem; font-weight: 800; color: var(--bleu-fonce);
}
.copie figcaption span { display: block; font-weight: 400; font-size: .95rem; color: var(--texte-doux); }

@media (max-width: 479px) {
    .copie__feuille { --marge: 40px; font-size: .92rem; padding-right: 12px; }
    .copie__note { font-size: 1.7rem; right: 12px; }
}


/* ===== RUBAN DES MATIÈRES : une bande collée en biais, qui défile ===== */
.ruban-zone { overflow: hidden; padding: 16px 0 26px; background: var(--creme); }
.ruban {
    margin: 0 -4%; padding: 14px 0; rotate: -1.4deg;
    background: var(--accent); color: var(--sur-accent);
    border-block: 3px solid var(--sur-accent); box-shadow: 0 6px 0 #C2410C;
    -webkit-mask-image: none; mask-image: none;
}
.ruban ul { list-style: none; margin: 0; align-items: center; }
.ruban li { display: flex; align-items: center; gap: 12px; white-space: nowrap; font: 800 1.45rem/1.2 var(--police-titre); }
.ruban li::after { content: ""; width: 12px; height: 12px; margin-left: 16px; background: var(--sur-accent); border-radius: 4px; rotate: 45deg; }
.ruban .icone { width: 1.15em; height: 1.15em; }


/* ===== DEUX PARCOURS : deux grandes cartes en argile ===== */
.parcours { display: grid; gap: 28px; }
@media (min-width: 900px) { .parcours { grid-template-columns: 1fr 1fr; gap: 32px; } }
.volet { display: flex; flex-direction: column; padding: 28px 24px; border: 3px solid; border-radius: 30px; }
@media (min-width: 640px) { .volet { padding: 36px 36px 32px; } }
.volet h3 { font-size: clamp(1.6rem, 3.6vw, 2rem); }
.volet > p { color: var(--texte-doux); max-width: 46ch; }
.volet--prof  { background: var(--accent-clair); border-color: var(--accent-bord); box-shadow: 0 7px 0 var(--accent-bord); }
.volet--eleve { background: #EAF2FF;            border-color: var(--bleu-bord);   box-shadow: 0 7px 0 var(--bleu-bord); }
.volet__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; margin-top: auto; padding-top: 30px; }

/* Faits chiffrés : les nombres comptent jusqu'à leur valeur quand ils arrivent à l'écran */
.faits { margin: 14px 0 0; }
.faits div { display: grid; grid-template-columns: minmax(6.2rem, 7.6rem) 1fr; gap: 16px; align-items: center; padding: 14px 0; border-top: 3px dotted rgba(120, 53, 15, .22); }
.volet--eleve .faits div { border-top-color: rgba(30, 58, 138, .22); }
.faits dt { font: 800 1.9rem/1.05 var(--police-titre); white-space: nowrap; font-variant-numeric: tabular-nums; }
.volet--prof .faits dt  { color: #C2410C; }
.volet--eleve .faits dt { color: #1D4ED8; }
.faits dd { margin: 0; }


/* ===== NIVEAUX (primaire / collège / lycée / post-bac) : quatre grosses tuiles colorées ===== */
.niveaux { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 22px; }
@media (min-width: 860px) { .niveaux { grid-template-columns: repeat(4, 1fr); gap: 18px; } }
.niveau {
    --n-fond: #DBEAFE; --n-bord: #93C5FD;
    position: relative; display: flex; flex-direction: column; gap: 2px; padding: 18px 18px 20px; text-decoration: none;
    color: var(--bleu-fonce); background: var(--n-fond); border: 3px solid var(--n-bord); border-radius: 22px;
    box-shadow: 0 6px 0 var(--n-bord);
    transition: translate .3s var(--rebond), box-shadow .3s var(--sortie);
}
.niveau:nth-child(2) { --n-fond: #DCFCE7; --n-bord: #86EFAC; }
.niveau:nth-child(3) { --n-fond: #EDE9FE; --n-bord: #C4B5FD; }
.niveau:nth-child(4) { --n-fond: #FCE7F3; --n-bord: #F9A8D4; }
.niveau strong { font: 800 1.6rem/1.1 var(--police-titre); }
.niveau span { color: var(--texte-doux); font-size: .98rem; line-height: 1.35; padding-right: 1.4em; }
.niveau::after { content: "→"; position: absolute; right: 16px; bottom: 14px; font: 800 1.4rem/1 var(--police-titre); transition: translate .3s var(--rebond); }
@media (hover: hover) {
    .niveau:hover { translate: 0 -5px; box-shadow: 0 11px 0 var(--n-bord); color: var(--bleu-fonce); text-decoration: none; }
    .niveau:hover::after { translate: 6px 0; }
}
.niveau:active { translate: 0 3px; box-shadow: 0 2px 0 var(--n-bord); }


/* ===== MATIÈRES : tuiles blanches, pastille à la couleur de la matière qui « tremble » au survol ===== */
.matieres-grille { display: grid; gap: 14px; }
@media (min-width: 600px)  { .matieres-grille { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .matieres-grille { grid-template-columns: repeat(4, 1fr); gap: 18px; } }
.matiere {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px; text-decoration: none; color: var(--texte);
    background: var(--blanc); border: 3px solid var(--bordure); border-radius: 22px;
    box-shadow: 0 5px 0 var(--bordure);
    transition: translate .3s var(--rebond), box-shadow .3s var(--sortie), border-color .2s;
}
@media (hover: hover) {
    .matiere:hover { translate: 0 -4px; border-color: var(--couleur, var(--bleu-fonce)); box-shadow: 0 9px 0 var(--couleur, var(--bleu-fonce)); color: var(--texte); text-decoration: none; }
    .matiere:hover .matiere__icone { animation: tremble .5s var(--sortie); }
}
.matiere:active { translate: 0 3px; box-shadow: 0 1px 0 var(--couleur, var(--bleu-fonce)); }
@keyframes tremble { 25% { rotate: -12deg; scale: 1.1; } 60% { rotate: 9deg; scale: 1.1; } }
.matiere__icone { flex-shrink: 0; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--fond); color: var(--couleur); }
.matiere__icone .icone { width: 28px; height: 28px; }
.matiere__texte { display: grid; gap: 1px; min-width: 0; }
.matiere strong { font: 700 1.2rem/1.2 var(--police-titre); color: var(--bleu-fonce); }
.matiere__texte span { font-size: .95rem; line-height: 1.35; color: var(--texte-doux); }
.matiere--toutes { background: transparent; border-style: dashed; border-color: var(--accent-bord); box-shadow: none; }
.matiere--toutes strong::after { content: " →"; }


/* ===== AVIS : cartes qui défilent sans fin (pause au survol ou au clavier) ===== */
.avis { overflow: hidden; }
.avis .defile { padding: 14px 0 22px; }
.avis .defile__groupe { align-items: stretch; }
.defile__clone { display: contents; }
.temoignage {
    flex: 0 0 auto; width: min(82vw, 390px); display: flex; flex-direction: column; margin: 0; padding: 24px;
    background: var(--blanc); border: 3px solid var(--bleu-bord); border-radius: 24px; box-shadow: 0 6px 0 var(--bleu-bord);
}
.defile__groupe > .temoignage:nth-child(odd)  { rotate: -.9deg; }
.defile__groupe > .temoignage:nth-child(even) { rotate: .9deg; }
.temoignage__etoiles { display: flex; gap: 2px; margin-bottom: 12px; color: var(--accent); }
.temoignage__etoiles .icone { width: 22px; height: 22px; }
.temoignage blockquote { margin: 0 0 20px; font-size: 1.05rem; line-height: 1.55; flex: 1; color: var(--texte); }
.temoignage__auteur { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; padding-top: 14px; border-top: 3px dotted var(--bordure); }
.temoignage__auteur strong { color: var(--bleu-fonce); font-family: var(--police-titre); font-size: 1.1rem; }
.temoignage__auteur span { font-size: .95rem; color: var(--texte-doux); }


/* ===== PAGE 404 : l'annotation du professeur ===== */
.erreur-404 { max-width: 640px; }
.erreur-404__note {
    display: inline-block; margin: 0 0 18px; font: 400 1.5rem/1.6 var(--police-main);
    color: var(--rouge); rotate: -3deg; box-shadow: 0 2px 0 var(--rouge);
}
