:root {
  --noir: #000000;
  --rubine: #CE0058;
  --blanc: #FFFFFF;
  --gris: #5E5E5E;
  --filet: #D9D9D9;
  --angle: 8deg;
  --sans: "IBM Plex Sans Condensed", "Arial Narrow", sans-serif;
  --serif: "IBM Plex Serif", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --signes: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--blanc);
  color: var(--noir);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--rubine);
  outline-offset: 3px;
}

/* Gabarit de page : une colonne de texte et une marge pour le paratexte */
.page {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.bloc {
  display: grid;
  grid-template-columns: minmax(0, 38rem) minmax(0, 15rem);
  column-gap: 4rem;
  align-items: start;
}
.bloc > .texte { grid-column: 1; }
.bloc > .marge { grid-column: 2; }

/* ---------- Logotype recomposé (provisoire, en attendant le SVG) ---------- */
.logotype {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.tiret-planche {
  display: inline-grid;
  place-items: center;
  width: 0.62em;
  height: 0.62em;
  margin: 0 0.04em;
  background: var(--rubine);
  transform: rotate(var(--angle));
  position: relative;
  top: 0.02em;
}
.tiret-planche::after {
  content: "";
  width: 0.3em;
  height: 0.09em;
  background: var(--blanc);
}
.hors-ecran {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.tiret-simple { color: var(--rubine); }

/* ---------- Sigle recomposé ---------- */
.sigle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 3.9rem;
  height: 3.9rem;
}
.sigle::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--rubine);
  transform: rotate(var(--angle));
}
.sigle span {
  position: relative;
  font-family: var(--signes);
  font-weight: 700;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--blanc);
  letter-spacing: -0.06em;
  white-space: nowrap;
}

/* ---------- En-tête ---------- */
.entete {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}
.lien-sigle { display: block; line-height: 0; }
.sigle-img { display: block; width: 5rem; height: auto; }
.entete .contact-rapide {
  font-family: var(--mono);
  font-size: 0.875rem;
  text-decoration: none;
  border-bottom: 2px solid var(--rubine);
}

.ouverture {
  padding-top: clamp(3rem, 10vw, 7rem);
  padding-bottom: clamp(3rem, 8vw, 6rem);
}
.ouverture h1 {
  margin: 0;
  line-height: 0;
}
.ouverture h1 svg {
  display: block;
  width: min(100%, 62rem);
  height: auto;
  overflow: visible;
}
.devise {
  margin: 1.75rem 0 0;
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  letter-spacing: 0.01em;
}
.devise .sep { color: var(--rubine); padding: 0 0.35em; }
.accroche {
  margin: clamp(2.5rem, 6vw, 4.5rem) 0 0;
  font-size: clamp(1.6rem, 3.6vw, 2.6rem);
  line-height: 1.2;
  max-width: 20ch;
}
.presentation {
  margin: 1.5rem 0 0;
  max-width: 36rem;
  color: var(--noir);
}

/* ---------- Sections ---------- */
section.etape, section.pourquoi, section.genres, section.contact {
  padding-top: clamp(3rem, 7vw, 5.5rem);
  padding-bottom: clamp(1rem, 3vw, 2rem);
  border-top: 1px solid var(--filet);
}
h2 {
  margin: 0 0 1.25rem;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 1;
}
h2 .signe {
  color: var(--rubine);
  font-family: var(--signes);
  font-weight: 700;
}
p { margin: 0 0 1.1rem; }

.renvoi {
  font-family: var(--mono);
  font-size: 0.7em;
  font-weight: 700;
  color: var(--rubine);
  text-decoration: none;
  vertical-align: super;
  line-height: 0;
  padding: 0 0.1em;
}
.note {
  font-family: var(--mono);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--gris);
  margin: 0.5rem 0 1rem;
  padding-left: 1.6rem;
  position: relative;
}
.note b {
  position: absolute;
  left: 0;
  color: var(--rubine);
}
.note:target { color: var(--noir); }

/* La planche hors-texte : un encart glissé, incliné, qui déborde */
.planche {
  position: relative;
  margin: 2.5rem 0 1.5rem;
  padding: 1.6rem 1.75rem;
  color: var(--blanc);
  max-width: 30rem;
}
.planche::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--rubine);
  transform: rotate(calc(var(--angle) * -0.25));
  z-index: -1;
}
.planche p { margin: 0; font-size: 1.05rem; }
.planche .titre-planche {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

/* Pourquoi */
.raisons {
  list-style: none;
  margin: 0;
  padding: 0;
}
.raisons li {
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--filet);
}
.raisons li:last-child { border-bottom: 0; }
.raisons h3 {
  margin: 0 0 0.3rem;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.2;
}
.raisons p { margin: 0; }

/* Genres */
.liste-genres {
  font-family: var(--sans);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.6vw, 2.4rem);
  line-height: 1.3;
  margin: 0;
}

/* Contact */
.contact .texte { grid-column: 1 / -1; }
.contact { padding-bottom: clamp(3rem, 8vw, 6rem) !important; }
.adresse-mail {
  display: inline-block;
  margin: 0.5rem 0 1.5rem;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(1.35rem, 6.4vw, 3.6rem);
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}
.adresse-mail .crochet { color: var(--rubine); font-family: var(--signes); }
.adresse-mail:hover .mail { text-decoration: underline; text-decoration-color: var(--rubine); text-decoration-thickness: 3px; text-underline-offset: 0.12em; }

footer {
  border-top: 1px solid var(--filet);
  padding-top: 1.5rem;
  padding-bottom: 2.5rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--gris);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  justify-content: space-between;
  align-items: center;
}
footer .logotype { font-size: 1.1rem; color: var(--noir); }
footer .crochet { color: var(--rubine); font-weight: 700; font-family: var(--signes); }

/* Mobile : la marge passe sous le texte */
@media (max-width: 52rem) {
  .bloc { grid-template-columns: minmax(0, 1fr); }
  .bloc > .marge {
    grid-column: 1;
    border-left: 2px solid var(--rubine);
    padding-left: 1rem;
    margin-bottom: 1rem;
  }
  .note { padding-left: 1.6rem; }
  .sigle-img { width: 3rem; }
}


/* ---------- Navigation ---------- */
.navigation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.75rem;
  font-family: var(--mono);
  font-size: 0.875rem;
}
.navigation a { text-decoration: none; }
.navigation a:hover, .navigation a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--rubine);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}
.navigation a[aria-current="page"] { color: var(--rubine); }

/* ---------- Pages intérieures ---------- */
.titre-page {
  padding-top: clamp(2.5rem, 8vw, 5.5rem);
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
}
.titre-page h1 {
  margin: 0;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(2.3rem, 8vw, 5.5rem);
  line-height: 1;
}
.titre-page h1 .signe { color: var(--rubine); font-family: var(--signes); }
.titre-page .chapeau {
  margin: 1.5rem 0 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.25;
  max-width: 26ch;
}
.engagement {
  padding-top: clamp(2rem, 5vw, 3rem);
  padding-bottom: 0.5rem;
  border-top: 1px solid var(--filet);
}
.engagement h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.conditions { padding-left: 1.2rem; margin: 0 0 1.5rem; }
.conditions li { margin-bottom: 0.6rem; }
.conditions li::marker { color: var(--rubine); }
.bouton {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.8rem 1.4rem;
  background: var(--rubine);
  color: var(--blanc);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.15rem;
  text-decoration: none;
}
.bouton:hover { background: var(--noir); }

@media (max-width: 52rem) {
  .entete { flex-wrap: wrap; gap: 1rem; }
  .entete .contact-rapide { display: none; }
}

main > section:last-child { padding-bottom: clamp(3rem, 8vw, 6rem); }

/* ---------- Touches graphiques ---------- */

/* Notes de marge : un filet Rubine, comme sur le signet */
.note {
  border-left: 2px solid var(--rubine);
  padding-left: 2.2rem;
  transition: color 200ms ease;
}
.note b { left: 0.7rem; }
.note.actif { color: var(--noir); }
.renvoi { transition: color 200ms ease; }
.renvoi.actif, .renvoi:hover {
  color: var(--blanc);
  background: var(--rubine);
}

/* La grande planche hors-texte : inclinée à 8°, elle sort de la page */
.planche-hors {
  position: relative;
  margin: clamp(2.5rem, 6vw, 4rem) calc(50% - 50vw) calc(13vw + 1rem) clamp(0rem, 22vw, 18rem);
  padding: clamp(2.5rem, 6vw, 4rem) clamp(1.5rem, 5vw, 4rem);
  color: var(--blanc);
  isolation: isolate;
}
.planche-hors::before {
  content: "";
  position: absolute;
  inset: 0 -10vw 0 0;
  background: var(--rubine);
  transform: rotate(var(--angle));
  transform-origin: left top;
  z-index: -1;
}
.planche-contenu { max-width: 34rem; }
.planche-hors p { margin: 0; font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.5; }
.planche-hors .titre-planche {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}
.planche-hors.en-attente {
  transform: translateX(40%);
  opacity: 0;
  transition: transform 1s cubic-bezier(.2,.7,.2,1), opacity 600ms ease;
}
.planche-hors.en-attente.posee { transform: none; opacity: 1; }

/* Les raisons : une mini-planche en guise de puce */
.raisons h3 { position: relative; padding-left: 1.4rem; }
.raisons h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 0.6em;
  height: 0.6em;
  background: var(--rubine);
  transform: rotate(var(--angle));
}
.raisons p { padding-left: 1.4rem; }

@media (max-width: 52rem) {
  .bloc > .marge { border-left: 0; padding-left: 0; }
  .planche-hors { margin-left: 0; }
}

html, body { overflow-x: hidden; }
@supports (overflow: clip) { html, body { overflow-x: clip; } }

/* ---------- Réalisations ---------- */
.ouvrages { padding-bottom: clamp(3rem, 8vw, 6rem); }
.grille {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 3rem);
}
.couverture {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform 400ms cubic-bezier(.2,.7,.2,1);
}
.couverture img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.couverture:hover, .couverture:focus-visible { transform: rotate(var(--angle)); }
.legende {
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.titre-ouvrage { font-family: var(--sans); font-weight: 700; font-size: 1.15rem; line-height: 1.25; }
.genre { font-family: var(--mono); font-size: 0.8rem; color: var(--gris); }

.fiche {
  width: min(100% - 2rem, 64rem);
  max-height: calc(100% - 2rem);
  padding: 0;
  border: 0;
  background: var(--blanc);
  color: var(--noir);
}
.fiche::backdrop { background: rgba(0,0,0,.6); }
.fiche-contenu { padding: clamp(1.5rem, 4vw, 3rem); }
.fiche h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); margin-right: 6rem; }
.fiche .credit { margin: 0 0 2rem; }
.fiche .role { font-family: var(--mono); font-size: 0.85rem; color: var(--rubine); }
.fiche figure { margin: 0 0 2rem; }
.fiche figure img { display: block; width: 100%; height: auto; }
.fiche figcaption { font-family: var(--mono); font-size: 0.8rem; color: var(--gris); margin-top: 0.6rem; }
.fermer {
  float: right;
  border: 0;
  background: none;
  font-family: var(--mono);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.3rem 0;
}
.fermer .crochet { color: var(--rubine); font-family: var(--signes); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .couverture { transition: none; }
}

/* Fiche : sous-titre, description, pages blanches détourées */
.fiche .sous-titre { font-family: var(--sans); font-size: 1.2rem; margin: -0.5rem 0 1rem; }
.fiche .description { max-width: 38rem; margin: 0 0 2rem; }
.fiche figure img { outline: 1px solid var(--filet); }
.fiche figure.page-seule { max-width: 32rem; }

/* ---------- Lexique ---------- */
.argument-page { padding-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.argument {
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.6;
  text-align: justify;
  hyphens: auto;
}
.argument a { text-decoration: none; border-bottom: 1px solid var(--filet); }
.argument a:hover { border-bottom-color: var(--rubine); }
.manchette {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  margin: 0.3rem 0 0.8rem;
  padding-left: 1.1rem;
  position: relative;
}
.manchette::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 0.55em;
  height: 0.55em;
  background: var(--rubine);
  transform: rotate(var(--angle));
}
.groupe {
  padding-top: clamp(3rem, 7vw, 5rem);
  border-top: 1px solid var(--filet);
}
.groupe > h2 { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.entree { margin-bottom: clamp(1.25rem, 3vw, 2rem); scroll-margin-top: 1.5rem; }
.terme {
  margin: 0 0 0.5rem;
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(1.4rem, 3vw, 1.75rem);
  line-height: 1.15;
}
.terme .nature {
  font-family: var(--mono);
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--gris);
  margin-left: 0.3rem;
}
.entree:target .terme { text-decoration: underline; text-decoration-color: var(--rubine); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.avec-lettrine::first-letter {
  float: left;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 3.7em;
  line-height: 0.8;
  margin: 0.08em 0.12em 0 0;
}
.cul-de-lampe {
  text-align: center;
  font-family: var(--signes);
  font-weight: 700;
  color: var(--rubine);
  letter-spacing: 0.1em;
  margin: 1.5rem 0 0;
}
.fin-lexique { padding-bottom: 0; }
@media (max-width: 52rem) {
  .entree .marge { margin-bottom: 0; }
  .argument { text-align: left; }
}
