/* Variante Codex : les mêmes pictogrammes passent de la dispersion à la carte. */
.header { border: 0; }
.header .brand { color: var(--green); text-decoration: none; }
.scroll-story {
  --night: #121914;
  --map-ink: #c9deba;
  --white: var(--night);
  position: relative;
  width: 100vw;
  margin: 0 calc(50% - 50vw) 48px;
  background: var(--night);
  color: #f2f2e9;
}
.story-stage { position: relative; padding: 65px 24px 36px; overflow: clip; }
.story-opening { max-width: 680px; margin: 0 auto; text-align: center; }
.story-kicker { color: #b4c3aa; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; }
.story-opening h1 { font: 400 clamp(58px, 7.4vw, 106px)/.97 var(--serif); letter-spacing: -.055em; margin: 25px 0 26px; }
.story-opening h1 em { color: #d6f58b; font-weight: 400; }
.story-deck { color: #c5cec0; font-size: clamp(15px, 1.4vw, 18px); line-height: 1.75; margin: 0; }
.story-byline { color: #9fab99; font-size: 12px; margin: 24px 0 0; }
.story-bridge { text-align: center; max-width: 740px; margin: 80px auto; }
.story-bridge > p:first-child { font: 400 clamp(30px, 4.1vw, 60px)/1.23 var(--serif); letter-spacing: -.035em; margin: 0; }
.story-bridge em { font-weight: 400; color: #d6f58b; }
.here-it-is { color: #d6f58b; font-size: 18px; margin-top: 22px; }
.story-map-title { text-align: center; margin: 36px 0; }
.story-map-title > p:last-child { font: 400 35px/1.2 var(--serif); letter-spacing: -1px; margin: 10px 0; }
.map-plane { position: relative; max-width: 800px; margin: auto; }
.map-icons { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 28px 18px; list-style: none; margin: 0; padding: 0; }
.map-icons li { grid-area: var(--row) / var(--col); display: grid; place-items: center; }
.map-icon { display: flex; align-items: center; justify-content: center; width: clamp(44px,8vw,94px); aspect-ratio: 1; color: var(--map-ink); border-radius: 50%; }
.map-icon svg { width: 100%; height: 100%; }
.map-icon:hover { color: #d6f58b; }
.scroll-story a:focus-visible { outline: 2px solid #d6f58b; outline-offset: 6px; }
.map-path { display: none; position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; color: #899d77; pointer-events: none; }
.map-path line { stroke: currentColor; stroke-width: 1; marker-end: url(#map-arrow); }
.story-map-caption { text-align: center; font-size: 12px; color: #afbea3; margin: 32px 0 0; line-height: 2; }
.story-map-caption a { display: inline-block; padding: 9px 8px; color: #d6f58b; font-size: 14px; }
.story-map-caption a span { margin-left: 10px; }
.story-scroll { display: none; }
.story-skip { display: block; width: fit-content; padding: 10px 0; margin: 20px auto 0; color: #b4c3aa; font-size: 11px; text-decoration: none; }

/* L’animation n’est activée qu’après le calcul d’une scène valide. */
.scroll-story.is-animated { height: 380svh; }
.is-animated .story-stage { position: sticky; top: 0; height: 100svh; min-height: 480px; padding: 0; }
.is-animated .map-plane { position: absolute; inset: 0; max-width: none; margin: 0; }
.is-animated .map-icons { display: block; }
.is-animated .map-icons li { position: absolute; top: 0; left: 0; width: var(--icon-size); height: var(--icon-size); will-change: transform; }
.is-animated .map-icon { width: 100%; height: 100%; }
.is-animated .map-path { display: block; }
.is-animated .story-opening, .is-animated .story-bridge {
  position: absolute; top: 47%; left: 50%; transform: translate(-50%,-50%);
  width: min(680px,68%); margin: 0; z-index: 2; pointer-events: none;
}
.is-animated .story-bridge { opacity: 0; }
.is-animated .story-map-title { position: absolute; top: 6%; left: 0; right: 0; margin: 0; opacity: 0; }
.is-animated .story-map-caption { position: absolute; bottom: 7%; left: 0; right: 0; margin: 0; z-index: 3; opacity: 0; }
.is-animated .story-scroll { display: block; position: absolute; bottom: 9%; left: 0; right: 0; margin: 0; color: #b4c3aa; font-size: 11px; text-align: center; }
.story-scroll span { display: block; margin-top: 9px; font-size: 21px; }
.is-animated .story-skip { position: absolute; bottom: 12px; right: 25px; z-index: 4; margin: 0; }

@media(max-width:600px) {
  .story-opening h1 { font-size: clamp(50px, 13vw, 76px); }
  .story-deck { font-size: 14px; }
  .story-kicker { font-size: 8px; letter-spacing: 1.3px; }
  .desktop-break { display: none; }
  .is-animated .story-opening, .is-animated .story-bridge { width: calc(100% - 68px); }
  .is-animated .story-bridge > p:first-child { font-size: clamp(27px,7.6vw,42px); }
  .is-animated .story-map-title > p:last-child { font-size: 29px; }
  .is-animated .story-skip { right: 0; left: 0; margin: auto; }
  .story-byline { margin-top: 17px; font-size: 11px; }
}
@media(prefers-reduced-motion:reduce) { .scroll-story *, .scroll-story *::before { scroll-behavior: auto; } }
@media print {
  .scroll-story, .scroll-story.is-animated { height: auto !important; width: 100%; margin: 0 0 30px; background: white; color: black; --map-ink: #183e32; --white: white; }
  .scroll-story .story-stage { position: static; height: auto; min-height: 0; padding: 0; overflow: visible; }
  .scroll-story .story-opening { position: static; width: 100%; max-width: none; transform: none; opacity: 1 !important; }
  .scroll-story .story-opening h1 { font-size: 44px; }
  .scroll-story .story-opening p, .scroll-story .story-opening em { color: black; }
  .scroll-story .story-bridge, .scroll-story .story-map-title, .scroll-story .map-plane, .scroll-story .story-map-caption, .scroll-story .story-scroll, .scroll-story .story-skip { display: none; }
}

/* Repères du chemin également présents dans la carte statique. */
.scroll-story:not(.is-animated) .map-icons li { position: relative; }
.scroll-story:not(.is-animated) .map-icons li:not(:last-child)::after { content: '→'; position: absolute; right: -16px; color: #899d77; }
.scroll-story:not(.is-animated) .map-icons li:nth-child(n+5):nth-child(-n+7)::after,
.scroll-story:not(.is-animated) .map-icons li:nth-child(n+13):nth-child(-n+15)::after { content: '←'; right: auto; left: -16px; }
.scroll-story:not(.is-animated) .map-icons li:nth-child(4n):not(:last-child)::after { content: '↓'; right: auto; bottom: -27px; }

@media(min-width:601px) and (min-height:480px) and (max-height:760px) {
  .is-animated .story-scroll { bottom: 3%; }
  .is-animated .story-skip { top: 4px; bottom: auto; }
  .is-animated .story-opening h1 { font-size: 68px; margin: 16px 0; }
  .is-animated .story-deck { font-size: 15px; }
  .is-animated .story-byline { margin-top: 16px; }
  .is-animated .story-bridge > p:first-child { font-size: 42px; }
}

.story-map-jump { display: none; }
.is-animated .story-map-jump { display: block; position: absolute; top: 12px; left: 12px; padding: 10px 14px; background: #d6f58b; color: #121914; border: 0; border-radius: 3px; z-index: 5; transform: translateY(-200%); }
.is-animated .story-map-jump:focus { transform: none; }
@media print { .story-map-jump { display: none !important; } }
