/* HiddenDocs, Dossier APOLLO. Mobile d'abord. */

:root {
    --space: #050505;
    --ink: #ece8df;
    --mute: #908b81;
    --f: 'Jost', 'Futura', 'Century Gothic', system-ui, sans-serif;
    --gut: clamp(22px, 6.4vw, 72px);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
    background: var(--space);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.hd3 {
    margin: 0;
    background: var(--space);
    color: var(--ink);
    font: 400 17px/1.55 var(--f);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.hd3 img { display: block; max-width: 100%; }
/* :where() garde cette remise à zéro sans poids : les marges des classes plus bas s'appliquent bien */
:where(.hd3) h1,
:where(.hd3) h2,
:where(.hd3) p,
:where(.hd3) figure { margin: 0; }
.hd3 a { color: inherit; }
.hd3 button { font: inherit; color: inherit; }
.hd3 ::selection { background: var(--ink); color: var(--space); }
.hd3 :focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

#ast-scroll-top,
.woocommerce-store-notice { display: none !important; }

/* La scène 3D, derrière tout le reste */
/* Hauteur de l'écran barre d'adresse repliée (100lvh) : la scène ne change pas de taille pendant le défilement
   sur téléphone (sinon elle se redimensionnait et glissait à chaque mouvement de la barre) */
.space {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 0;
    display: block;
    width: 100%;
    height: 100vh;
    height: 100lvh;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.4s ease;
}

.space.is-on { opacity: 1; }

main,
.top,
.foot { position: relative; z-index: 1; }

/* Rien ne doit dépasser en largeur : sur téléphone, le navigateur dézoomerait toute la page
   et le texte paraîtrait décalé à gauche. (clip ne casse pas les éléments collants.) */
/* Pas de rognage sur main : sur iPhone, un ancêtre rogné empêche Safari de déplacer les scènes collées (sticky)
   de façon fluide, et le texte tremblait au défilement. Chaque scène rogne elle-même ce qui dépasse. */

/* En-tête */
.top {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(env(safe-area-inset-top) + 20px) var(--gut) 0;
}

.top__logo img { width: auto; height: 26px; }
.top__lang { display: flex; gap: 18px; font-size: 14px; letter-spacing: 0.04em; }
.top__lang a { color: var(--mute); text-decoration: none; }
.top__lang a[aria-current='true'] { color: var(--ink); }

/* Lien discret vers le dossier, pendant la traversée */
.peek {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 18px);
    right: var(--gut);
    z-index: 4;
    padding: 6px 0;
    font-size: 14px;
    letter-spacing: 0.03em;
    text-decoration: underline;
    text-underline-offset: 5px;
    text-decoration-thickness: 1px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}

.peek.is-on { opacity: 1; visibility: visible; transition: opacity 0.5s ease; }

/* La traversée : une scène fixe, des textes calés sur le défilement */
.journey { position: relative; height: calc((var(--length) + 1.35) * 100vh); height: calc((var(--length) + 1.35) * 100svh); }

.stage {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    height: var(--vis, 100svh); /* hauteur visible, suivie en douceur par le script (barre du navigateur repliée) */
    overflow: hidden;
    will-change: transform; /* calque à part : déplacé par le compositeur, texte jamais redessiné en défilant */
}

.beat {
    position: absolute;
    left: var(--gut);
    right: var(--gut);
    pointer-events: none;
}

.js .beat {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}

.js .beat.is-on {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.45s ease;
}

.beat--hero { bottom: calc(9svh + env(safe-area-inset-bottom)); }

.hero__title {
    font-weight: 500;
    font-size: 17.5vw;
    line-height: 0.92;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.hero__title [data-type] { display: block; min-height: 0.92em; }

.js .hero__title { visibility: hidden; animation: show 0s 3.5s forwards; }
.js .hero__title.is-ready { visibility: visible; animation: none; }

/* Le curseur reste en ligne, au bout du mot : aucune ligne vide pendant la frappe */
.caret {
    display: inline-block;
    width: 0.06em;
    height: 0.72em;
    margin-left: 0.05em;
    vertical-align: baseline;
    background: var(--ink);
    animation: blink 1.1s steps(2, start) infinite;
    transition: opacity 0.6s ease;
}

.caret.is-off { opacity: 0; animation: none; }

.hero__line {
    max-width: 30ch;
    margin-top: 24px;
    font-weight: 300;
    font-size: 18px;
    line-height: 1.5;
    opacity: 0.8;
}

.js .hero__line { opacity: 0; animation: lineShow 0s 6s forwards; }
.js .hero-typed .hero__line { opacity: 0.8; animation: none; transition: opacity 1.4s ease 0.2s; }

/* Les phrases du récit */
.say {
    font-weight: 300;
    font-size: clamp(30px, 8.4vw, 72px);
    line-height: 1.13;
    letter-spacing: -0.01em;
    text-wrap: balance;
    text-shadow: 0 0 28px rgba(5, 5, 5, 0.65);
}

.say--low { bottom: calc(14svh + env(safe-area-inset-bottom)); max-width: 12.5em; }
.say--high { top: calc(15svh + env(safe-area-inset-top)); max-width: 12.5em; }
.say--big { font-size: clamp(36px, 10.4vw, 96px); line-height: 1.06; }
.say--long { font-size: clamp(26px, 7.2vw, 62px); }

/* La citation d'Armstrong */
.quote blockquote { margin: 0; }
.quote figcaption { margin-top: 22px; font-size: 15px; letter-spacing: 0.02em; color: var(--mute); text-shadow: none; }

/* Révélation mot à mot */
.w {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.45em);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.beat.is-on .w {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease, transform 0.9s var(--ease);
    transition-delay: calc(var(--i) * 38ms);
}

/* Les photographies (en 3D dans la scène ; image simple si WebGL est indisponible) */
.shot { position: absolute; inset: 0; left: 0; right: 0; }
.shot figcaption { position: absolute; left: var(--gut); right: var(--gut); }
.hd3 .shot__flat { display: none; }

/* Légende façon archive : le fait, puis la référence NASA du cliché */
.shot__cap { font-size: clamp(26px, 7.2vw, 62px); }
.shot__text,
.shot__ref { display: block; }
.shot__ref { margin-top: 16px; font-weight: 400; font-size: 13px; line-height: 1.45; letter-spacing: 0.02em; color: var(--mute); text-shadow: none; }

/* Pendant sa plage, chaque texte remonte doucement (parallaxe avec la scène) */
@media (hover: hover) and (pointer: fine) {
    .js-ok .beat { translate: 0 calc(var(--k, 0) * -16px); }
}

html.no-webgl .shot__flat,
html.no-js .shot__flat {
    display: block;
    position: absolute;
    left: 50%;
    top: 52%;
    width: min(82vw, 60vh);
    height: auto;
    transform: translate(-50%, -50%);
}

/* Le sondage : la source est nettement détachée de la phrase */
.poll p:first-child { max-width: 13em; }
.poll__src {
    max-width: 30em;
    margin-top: clamp(30px, 5svh, 54px);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: 0.01em;
    color: var(--mute);
    text-shadow: none;
}

/* La question finale */
.vote__choices { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.vote__choices button {
    min-height: 50px;
    padding: 0 22px;
    border: 1px solid rgba(236, 232, 223, 0.45);
    background: rgba(5, 5, 5, 0.35);
    font-weight: 400;
    font-size: 16px;
    letter-spacing: 0.01em;
    text-shadow: none;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.vote__choices button:hover,
.vote__choices button:focus-visible { background: var(--ink); color: var(--space); border-color: var(--ink); }

.vote__reply { max-width: 22em; margin-top: 22px; font-size: 19px; line-height: 1.45; opacity: 0; transition: opacity 0.6s ease; }
.vote.is-answered .vote__choices { display: none; }
.vote.is-answered .vote__reply { opacity: 1; }

html.no-webgl .shot__flat { transition: opacity 0.5s ease; }
html.no-webgl .shot:not(.is-on) .shot__flat { opacity: 0; }

/* L'ouverture s'efface quand on commence à descendre */
.js-ok .beat--hero:not(.is-on) { transform: translateY(-14px); }
.js-ok .beat--hero { transition: opacity 0.6s ease, transform 0.8s var(--ease), visibility 0s linear 0.6s; }
.js-ok .beat--hero.is-on { transition: opacity 0.6s ease, transform 0.8s var(--ease); }

/* Sans JavaScript : le récit se lit comme une page classique */
html.no-js .journey { height: auto; }
html.no-js .stage { position: relative; height: auto; overflow: visible; padding-bottom: 10vh; }
html.no-js .beat,
html.no-js .shot figcaption { position: relative; inset: auto; left: auto; right: auto; top: auto; bottom: auto; transform: none; }
html.no-js .beat { margin: 0 var(--gut) 24vh; }
html.no-js .beat--hero { min-height: 90vh; display: flex; flex-direction: column; justify-content: flex-end; }
html.no-js .shot__flat { position: relative; left: auto; top: auto; transform: none; margin: 0 0 24px; }

/* Image de secours sans WebGL */
.hd3 .moon-still {
    display: none;
    position: absolute;
    left: 50%;
    top: 33%;
    width: 80vw;
    max-width: 520px;
    height: auto;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

html.no-webgl .moon-still,
html.no-js .moon-still { display: block; }

/* Le dossier : une scène qui reste à l'écran pendant que le livre se retourne */
.offer { position: relative; height: 175vh; height: 175svh; }

.offer__stage {
    overflow: hidden;
    overflow: clip;
    will-change: transform;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100svh;
    height: var(--vis, 100svh);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(18px, 4svh, 40px);
    padding: calc(env(safe-area-inset-top) + 48px) var(--gut) calc(env(safe-area-inset-bottom) + 20px);
    text-align: center;
}

/* Le livre en 3D : couverture, quatrième de couverture avec les chapitres, dos et tranche */
.tome {
    --ry: -34deg;
    --rx: 10deg;
    --lift: 0px;
    --depth: 16px;
    flex: none;
    width: min(58vw, 33svh, 300px);
    aspect-ratio: 2 / 3;
    perspective: 1500px;
}

.tome__body {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform: translateY(var(--lift)) rotateX(var(--rx)) rotateY(var(--ry));
}

.tome__face {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 2px 5px 5px 2px;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.tome__face--front { background: #e9e4d8; transform: translateZ(calc(var(--depth) / 2)); }
.hd3 .tome__cover { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }

.tome__face--back {
    container-type: inline-size;
    display: flex;
    flex-direction: column;
    padding: 10% 8% 8%;
    background: #121210;
    color: var(--ink);
    text-align: left;
    box-shadow: inset 0 0 0 1px rgba(236, 232, 223, 0.08);
    transform: rotateY(180deg) translateZ(calc(var(--depth) / 2));
}

.tome__name { font-weight: 500; font-size: 13px; font-size: 7.6cqw; line-height: 1.15; letter-spacing: 0.02em; text-transform: uppercase; }
.tome__pitch { margin-top: 10px; margin-top: 5cqw; font-weight: 300; font-size: 12px; font-size: 6.3cqw; line-height: 1.38; color: rgba(236, 232, 223, 0.78); }
.tome__toc { margin: 14px 0 0; margin-top: 7cqw; padding: 0; list-style: none; }
.tome__toc li { display: flex; gap: 6px; gap: 3cqw; padding: 4px 0; padding: 2.2cqw 0; font-size: 12px; font-size: 6.6cqw; line-height: 1.28; }
.tome__toc span { flex: none; width: 2em; color: var(--mute); }
.tome__meta { margin-top: auto; padding-top: 8px; font-size: 11px; font-size: 5.4cqw; color: var(--mute); }

.tome__spine {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(var(--depth) / -2);
    width: var(--depth);
    display: grid;
    place-items: center;
    overflow: hidden;
    background: #dcd6c8;
    color: #1a1a18;
    transform: rotateY(-90deg);
}

.tome__spine span { writing-mode: vertical-rl; font-size: 8px; letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap; }

.tome__pages {
    position: absolute;
    top: 1.2%;
    bottom: 1.2%;
    right: calc(var(--depth) / -2);
    width: var(--depth);
    background: repeating-linear-gradient(90deg, #f2eee4 0 1px, #d8d1c3 1px 2px);
    transform: rotateY(90deg);
}

.offer__text { display: flex; flex-direction: column; align-items: center; }

.offer__sub { display: block; margin-top: 14px; font-weight: 400; font-size: 13px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--mute); }
.offer__title {
    max-width: 18em;
    font-weight: 400;
    font-size: clamp(22px, 5.8vw, 38px);
    line-height: 1.2;
}

.offer__price {
    margin-top: clamp(12px, 2.6svh, 28px);
    font-weight: 300;
    font-size: clamp(42px, 11.5vw, 70px);
    line-height: 1;
}

.offer__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 340px;
    min-height: 56px;
    margin-top: clamp(12px, 2.2svh, 22px);
    padding: 0 28px;
    background: var(--ink);
    color: var(--space) !important;
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.offer__cta:hover { background: #fff; }
.offer__note { max-width: 34ch; margin-top: 12px; font-size: 13px; line-height: 1.5; color: var(--mute); }

/* Sans JavaScript, la scène du dossier se lit simplement */
html.no-js .offer { height: auto; }
html.no-js .offer__stage { position: relative; height: auto; padding-top: 12vh; padding-bottom: 12vh; }

/* Pied de page */
.foot {
    padding: 44px var(--gut) calc(36px + env(safe-area-inset-bottom));
    background: var(--space);
    font-size: 14px;
    color: var(--mute);
}

.foot__links { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.foot__links + .foot__links { margin-top: 12px; }
.foot__links a { color: var(--ink); text-decoration: none; }
.foot__links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.foot p { max-width: 62ch; margin-top: 22px; font-size: 13px; line-height: 1.6; }
.foot p + p { margin-top: 8px; }
.foot__reads { margin: 0 0 34px; }
.foot .foot__label { margin: 0 0 10px; font-size: 14px; }
.foot__label a { color: var(--mute); text-decoration: none; }
.foot__label a:hover { color: var(--ink); }
.foot__reads ul { margin: 0; padding: 0; list-style: none; }
.foot__reads li { margin: 6px 0; font-size: 15px; line-height: 1.45; }
.foot__reads li a { color: var(--ink); text-decoration: none; }
.foot__reads li a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Écran en hauteur (téléphone, tablette debout) : tout est centré, avec des marges égales des deux côtés.
   Même critère que la scène 3D (largeur / hauteur ≤ 1,05) : l'astre est alors cadré en haut, le texte dessous. */
@media (max-aspect-ratio: 21/20) {
    .beat { text-align: center; }
    .say--low,
    .say--high,
    .hero__line,
    .poll p:first-child,
    .poll__src,
    .vote__reply { margin-left: auto; margin-right: auto; }
    .hero__title { font-size: min(16vw, 150px); }
    .vote__choices { justify-content: center; }
    .foot { text-align: center; }
    .foot__links { justify-content: center; }
    .foot p { margin-left: auto; margin-right: auto; }
}

@keyframes blink { to { visibility: hidden; } }
@keyframes show { to { visibility: visible; } }
@keyframes lineShow { to { opacity: 0.8; } }

/* Écran en largeur (ordinateur, téléphone couché) : textes à gauche, la scène occupe la droite */
@media (min-aspect-ratio: 21/20) {
    .top__logo img { height: 30px; }

    /* L'ouverture est centrée verticalement : plus de grand vide au-dessus du titre */
    .beat--hero { top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center; padding-top: 4vh; }
    .hero__title { font-size: clamp(96px, 10.5vw, 196px); }
    .hero__line { font-size: 20px; max-width: 34ch; }

    .say { font-size: clamp(42px, 4.2vw, 78px); }
    .say--low { top: 50%; bottom: auto; transform: translateY(-50%); max-width: 10.5em; }
    .say--high { top: 15vh; bottom: auto; max-width: 11em; }
    .say--big { font-size: clamp(54px, 5.6vw, 104px); max-width: 9em; }
    .vote,
    .poll { max-width: 12em; }

    html.no-webgl .shot__flat { left: 72%; width: 44vh; }
    .hd3 .moon-still { left: 68%; top: 46%; width: 66vh; max-width: none; }

    .poll__src { font-size: 15px; }

    /* Le dossier : le livre à gauche, le titre et l'achat à droite */
    .offer { height: 190vh; }
    .offer__stage { flex-direction: row; gap: clamp(56px, 9vw, 150px); padding-top: 0; padding-bottom: 0; text-align: left; }
    .tome { --depth: 20px; width: min(24vw, 54vh, 360px); }
    .offer__text { align-items: flex-start; max-width: 30em; }
}

/* Téléphones courts : le livre et l'achat tiennent ensemble dans l'écran */
@media (max-aspect-ratio: 21/20) and (max-height: 700px) {
    .tome { width: min(56vw, 31svh, 300px); }
    .offer__stage { gap: 14px; padding-top: calc(env(safe-area-inset-top) + 40px); }
    .offer__title { font-size: 21px; }
    .offer__price { font-size: 38px; }
    .offer__cta { min-height: 50px; }
}

/* Téléphone couché : la hauteur manque, les tailles suivent la hauteur */
@media (min-aspect-ratio: 21/20) and (max-height: 520px) {
    .hero__title { font-size: min(10.5vw, 22vh); }
    .say { font-size: clamp(24px, 7.4vh, 42px); }
    .say--big { font-size: clamp(28px, 9vh, 54px); }
    .say--high { top: 12vh; }
}

@media (prefers-reduced-motion: reduce) {
    .w,
    .beat.is-on .w { transition: none; transform: none; }
    .caret { animation: none; }
}

/* La fin : les preuves que contient le dossier (une liste simple, qui arrive ligne à ligne) */
.proofs { max-width: 15em; }
.proofs > p:first-child { margin: 0; }
.proofs__list {
    list-style: none; margin: clamp(18px, 3svh, 30px) 0 0; padding: 0; max-width: 30em;
    font-size: clamp(16px, 1.3vw, 20px); line-height: 1.35; letter-spacing: 0; text-shadow: 0 0 18px rgba(5, 5, 5, 0.8);
}
.proofs__list li { padding: 8px 0; border-top: 1px solid rgba(236, 232, 223, 0.14); opacity: 0; transform: translateY(8px); transition: opacity 0.4s ease, transform 0.5s ease; }
.beat.is-on .proofs__list li { opacity: 1; transform: none; transition: opacity 0.6s ease, transform 0.8s var(--ease); }
.beat.is-on .proofs__list li:nth-child(1) { transition-delay: 0.35s; }
.beat.is-on .proofs__list li:nth-child(2) { transition-delay: 0.5s; }
.beat.is-on .proofs__list li:nth-child(3) { transition-delay: 0.65s; }
.beat.is-on .proofs__list li:nth-child(4) { transition-delay: 0.8s; }
.beat.is-on .proofs__list li:nth-child(5) { transition-delay: 0.95s; }
.beat.is-on .proofs__list li:nth-child(6) { transition-delay: 1.1s; }
.offer__proof { margin: 18px 0 0; max-width: 24em; font-size: 17px; line-height: 1.5; color: var(--ink); opacity: 0.86; }
@media (max-aspect-ratio: 21/20) {
    .proofs { max-width: 11em; }
    .proofs__list { font-size: 15px; margin-left: auto; margin-right: auto; max-width: 22em; }
    .proofs__list li { padding: 6px 0; }
}

/* Téléphone : la liste des preuves descend un peu, sous l'en-tête et le lien du dossier */
@media (max-aspect-ratio: 21/20) {
    .proofs.say--high { top: calc(23svh + env(safe-area-inset-top)); }
}

/* La fouille des archives : une phrase longue, plus petite que les autres */
.say.hunt { max-width: 16em; font-size: clamp(24px, 2.5vw, 44px); line-height: 1.2; }
@media (max-aspect-ratio: 21/20) {
    .say.hunt { max-width: 13em; font-size: clamp(22px, 6vw, 30px); }
}

/* Titre d'ouverture à mot long (« Expediente ») : taille réduite pour tenir dans l'écran */
.hero__title--long { font-size: 12.2vw; }
@media (max-aspect-ratio: 21/20) {
    .hero__title--long { font-size: min(11.4vw, 108px); }
}
@media (min-aspect-ratio: 21/20) {
    .hero__title--long { font-size: clamp(72px, 7.4vw, 138px); }
}
@media (min-aspect-ratio: 21/20) and (max-height: 520px) {
    .hero__title--long { font-size: min(7.4vw, 15.5vh); }
}

/* Sélecteur de langue compact (05/12/2026) : langue courante + menu déroulant */
.langsel { position: relative; font-size: 14px; letter-spacing: 0.06em; }
.langsel summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; padding: 8px 2px; color: var(--ink, #ece8df); -webkit-tap-highlight-color: transparent; }
.langsel summary::-webkit-details-marker { display: none; }
.langsel summary svg { opacity: 0.7; transition: transform 0.2s; }
.langsel[open] summary svg { transform: rotate(180deg); }
.langsel__menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 158px; padding: 6px 0; background: #0b0b0a; border: 1px solid rgba(236, 232, 223, 0.18); display: flex; flex-direction: column; }
.langsel__menu a { display: flex; gap: 12px; padding: 9px 16px; color: var(--mute, #908b81); text-decoration: none; letter-spacing: 0.02em; white-space: nowrap; }
.langsel__menu a b { font-weight: 500; color: var(--ink, #ece8df); min-width: 22px; letter-spacing: 0.06em; }
.langsel__menu a:hover, .langsel__menu a:focus-visible { color: var(--ink, #ece8df); background: rgba(236, 232, 223, 0.06); }
