@font-face {
  font-family: Rubik;
  src: url("../assets/rubik-regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Rubik;
  src: url("../assets/rubik-bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  font-family: Rubik, system-ui, sans-serif;
  color: #233d36;
  background: #f8f5ed;
  --encre: #233d36;
  --terre: #994623;
  --filet: #d4cfc1;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 72% 30%, #fffdf6 0, transparent 66%);
}
button, a { font: inherit; color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid #146151; outline-offset: 5px; }
.entete, .livre { width: min(1180px, calc(100% - clamp(36px, 9vw, 142px))); margin-inline: auto; }
.entete {
  min-height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--filet);
}
.marque { display: flex; align-items: center; gap: 10px; font-size: 1.04rem; font-weight: 700; }
.marque img { display: block; object-fit: contain; }
.passer { font-size: .93rem; text-underline-offset: 5px; text-decoration-color: #9eaaa0; padding-block: 12px; }
.passer:hover { text-decoration-color: currentColor; }
.livre { padding: clamp(24px, 5.8vh, 62px) 0 26px; }
.double-page {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 9fr);
  isolation: isolate;
  border-radius: 6px 14px 10px 5px;
  border: 1px solid #bfb5a2;
  background: #fffaf0;
  box-shadow: 0 3px 0 #f9f2df, 0 4px 0 #c9beaa, 0 6px 0 #fff8e9,
              0 7px 0 #c8bdaa, 0 10px 0 -1px #62766a, 0 18px 25px -14px #504b3c66;
}
.page-texte {
  display: flex;
  flex-flow: column;
  justify-content: space-between;
  min-width: 0;
  padding: clamp(24px, 3.8vw, 58px);
  background: linear-gradient(90deg, transparent 93%, #ddd1b92b);
}
h1 { font-size: clamp(.88rem, 1.18vw, 1.03rem); font-weight: 400; color: var(--terre); margin: 0; }
.recit { padding-block: 24px; }
h2 {
  font-family: Baskervville, Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 4.5vw, 4.35rem);
  font-weight: 500;
  letter-spacing: -.048em;
  line-height: 1.02;
  margin: 0 0 .36em;
  text-wrap: balance;
}
.recit p {
  font-size: clamp(1.02rem, 1.36vw, 1.2rem);
  line-height: 1.62;
  margin: 0;
  max-width: 32ch;
}
.pagination { display: flex; gap: 10px; align-items: center; color: #5c6659; font-size: .86rem; font-variant-numeric: tabular-nums; }
#numero { font-weight: 700; color: var(--terre); }
.trait { width: 32px; height: 1px; background: #b9b2a0; }
.tableau {
  position: relative;
  align-self: stretch;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  border-radius: 0 13px 9px 0;
  background: #e6d9bd;
}
.illustration {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(var(--zoom, 1));
  transition: opacity 520ms ease;
}
.illustration.precedente { opacity: 1; z-index: 1; }
.illustration.courante { opacity: 1; z-index: 2; }
#film {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
}
#film.visible { opacity: 1; }
.tableau::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  box-shadow: inset 7px 0 11px -8px #422c1a9c;
}
.commandes {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  column-gap: clamp(12px, 2.8vw, 42px);
  align-items: end;
  margin-top: clamp(20px, 3.6vh, 36px);
}
#lecture {
  display: inline-flex;
  min-height: 44px;
  justify-self: start;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: transparent;
  border: 1px solid #bcbdaa;
  border-radius: 99px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: .92rem;
}
#lecture:hover { background: #ebe9d9; }
.icone-lecture { width: 10px; height: 12px; border-inline: 3px solid currentColor; }
.en-pause .icone-lecture { width: 0; height: 0; border: 6px solid transparent; border-right: 0; border-left: 10px solid currentColor; }
.parcours { min-width: 0; padding: 0 clamp(24px, 3vw, 46px); }
.piste { height: 110px; position: relative; }
.petits-pas {
  position: absolute;
  bottom: 12px;
  width: 100%;
  height: 2px;
  background: repeating-linear-gradient(90deg, #c2b49a 0 3px, transparent 3px 10px);
}
.pierre {
  position: absolute;
  bottom: 7px;
  width: clamp(20px, 3vw, 43px);
  height: 12px;
  translate: -50% 0;
  border-radius: 60% 43% 45% 46% / 84% 74% 42% 36%;
  background: #d8d1be;
  box-shadow: inset 0 -3px #bcb49f;
}
.pierre:nth-of-type(2n) { rotate: -4deg; }
.pierre:nth-of-type(3n) { rotate: 3deg; }
.pierre.visitee { background: #849d80; box-shadow: inset 0 -3px #5f775d; }
.personnage {
  z-index: 2;
  position: absolute;
  left: 0;
  bottom: 15px;
  width: 75px;
  height: 76px;
  transform-origin: 50% 100%;
  transform: translate(-50%, var(--hauteur, 0px)) rotate(var(--angle, 0deg));
  pointer-events: none;
}
.pose { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; position: absolute; inset: 0; }
.saut, .en-lair .debout { visibility: hidden; }
.en-lair .saut { visibility: visible; }
.attente { grid-column: 2; text-align: end; color: #52644e; font-size: .88rem; margin: 8px 0 0; }
@media (max-width: 720px) {
  .entete, .livre { width: calc(100% - 32px); }
  .entete { min-height: 64px; }
  .marque { gap: 6px; font-size: .94rem; }
  .marque img { width: 31px; height: 34px; }
  .passer { font-size: .86rem; }
  .livre { padding-top: 22px; }
  .double-page { display: flex; flex-direction: column; border-radius: 8px; }
  .tableau { order: -1; border-radius: 7px 7px 0 0; width: 100%; }
  .tableau::after { box-shadow: inset 0 -5px 9px -8px #56341588; }
  .page-texte { position: relative; padding: 19px 22px 20px; min-height: 174px; justify-content: start; }
  .recit { padding: 10px 0 0; }
  h1 { padding-right: 69px; font-size: .86rem; }
  h2 { font-size: clamp(2.05rem, 7.4vw, 2.9rem); margin-bottom: 7px; }
  .recit p { font-size: 1rem; line-height: 1.45; max-width: 52ch; }
  .pagination { position: absolute; top: 19px; right: 21px; font-size: .76rem; gap: 6px; }
  .trait { width: 18px; }
  .commandes { grid-template-columns: 1fr auto; margin-top: 12px; gap: 10px; align-items: center; }
  .parcours { grid-column: 1 / -1; grid-row: 1; padding-inline: 22px; }
  .piste { height: 92px; }
  .personnage { width: 55px; height: 56px; }
  .attente { grid-column: 2; margin: 0; }
}
@media (max-height: 740px) and (min-width: 721px) {
  .entete { min-height: 62px; }
  .livre { width: min(1080px, calc(100% - 72px)); padding-top: 22px; }
  .commandes { margin-top: 16px; }
  .piste { height: 93px; }
}
@media (prefers-reduced-motion: reduce) {
  .illustration { transform: none; transition: none; }
}
