/* =====================================================================
   DESIGN RESTORATION — ARCHIVE JULES VERNE
   ---------------------------------------------------------------------
   Couche de FINITION premium, chargée EN DERNIER (après archive.css +
   glacial-noir.css). Restaure l'ADN éditorial premium : relief,
   profondeur douce, rythme éditorial, micro-interactions, traitement
   d'image — dans la direction froide « glacial noir » déjà en place.

   PRINCIPES
   · Additif et piloté par les classes .ej-* existantes — aucune
     réécriture de structure, aucun texte modifié.
   · Entièrement réversible : retirer ce <link> (et design-restoration.js)
     restaure exactement l'état précédent.
   · Direction : luxe froid et silencieux. On AJOUTE du relief et de la
     tension — jamais d'aplat, jamais plus sombre, jamais gadget.
   ===================================================================== */

:root {
  /* Relief de luminance (surfaces légèrement relevées vs le fond) */
  --rz-lift:        #122A3A;   /* panneau relevé — océan */
  --rz-lift-2:      #173447;   /* panneau au survol */
  --rz-hairline:    rgba(173, 199, 212, 0.16);
  --rz-hairline-lit:rgba(206, 158, 96, 0.52);   /* filet accentué — dorure cuivre */
  --rz-glow:        rgba(194, 133, 63, 0.28);    /* halo cuivre localisé */
  --rz-ink-deep:    #04080D;   /* encre d'abysse la plus profonde (ombres) */
  /* courbe standard = --ease (archive.css) ; on ne garde que la variante out */
  --rz-ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --rz-shadow-soft: 0 2px 14px rgba(3, 7, 12, 0.45);
  --rz-shadow-card: 0 18px 48px rgba(3, 7, 12, 0.55), 0 2px 6px rgba(3, 7, 12, 0.4);
}

/* =====================================================================
   1. PROFONDEUR DE FOND — relief atmosphérique (sans assombrir)
   ===================================================================== */
/* Une seconde nappe de lumière froide très haute + grain optique discret,
   superposée au voile de glacial-noir, pour casser l'aplat du navy. */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 32% at 50% 0%, rgba(63, 150, 170, 0.07), transparent 70%),
    radial-gradient(40% 24% at 88% 8%, rgba(194, 133, 63, 0.06), transparent 70%);
  mix-blend-mode: screen;
}

/* =====================================================================
   2. RYTHME ÉDITORIAL DES SECTIONS — strates, filets qui se tracent
   ===================================================================== */
/* Alternance de ton très subtile : une section sur deux reçoit un voile
   plus clair → les blocs se lisent comme composés, pas uniformes. */
main > .ej-section:nth-of-type(even):not(.ej-quote) {
  background:
    linear-gradient(180deg, rgba(194, 133, 63, 0.022) 0%, transparent 22%, transparent 78%, rgba(4, 8, 13, 0.30) 100%);
}

/* Filet de section anobli : dégradé lumineux au centre plutôt qu'un trait plat */
.ej-section[style*="border-top"] {
  border-top: 0 !important;
  position: relative;
}
.ej-section[style*="border-top"]::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--rz-hairline-lit) 50%, transparent);
  opacity: 0.7;
}

/* Sur-titre (kicker) : trait qui se trace à l'entrée (piloté par JS .is-drawn) */
.ej-kicker::before {
  transform: scaleX(0.55); transform-origin: left center;
  transition: transform 0.9s var(--rz-ease-out), opacity 0.6s ease;
}
/* le kicker porte lui-même .ej-reveal → reçoit .is-in ; ou son en-tête est tracé */
.ej-section-head.is-drawn .ej-kicker::before,
.ej-kicker.is-in::before { transform: scaleX(1); }

/* En-tête de section : filet horizontal fin qui se trace sous le titre */
.ej-section-head { position: relative; }
.ej-section-head::after {
  content: ""; display: block; height: 1px; margin-top: clamp(1.4rem, 3vw, 2.2rem);
  max-width: 8.5rem;
  background: linear-gradient(90deg, var(--rz-hairline-lit), transparent);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 1s var(--rz-ease-out) 0.15s;
}
.ej-section-head.is-center::after { margin-left: auto; margin-right: auto;
  background: linear-gradient(90deg, transparent, var(--rz-hairline-lit), transparent); }
.ej-section-head.is-drawn::after { transform: scaleX(1); }

/* =====================================================================
   3. HERO — présence éditoriale, profondeur, indice de défilement
   ===================================================================== */
.ej-hero-inner { max-width: var(--container); margin: 0 auto; }
/* Le kicker du hero respire davantage */
.ej-hero .ej-kicker { letter-spacing: 0.26em; opacity: 0.95; }
/* Titre : contraste et tenue typographique */
.ej-hero-title { letter-spacing: -0.025em; line-height: 1.04; text-wrap: balance; }
/* Signature : agrandie pour la présence + filet de séparation discret au-dessus */
.ej-hero-signature {
  position: relative; padding-top: 1.6rem;
  height: clamp(104px, 13vw, 150px); width: auto; opacity: 0.95;
}
.ej-hero-signature::before {
  content: ""; position: absolute; top: 0; left: 0; width: 3.4rem; height: 1px;
  background: linear-gradient(90deg, var(--rz-hairline-lit), transparent);
}
/* Indice de défilement — trait vertical lumineux qui pulse, bas du hero */
.ej-hero::after {
  content: ""; position: absolute; left: 50%; bottom: 1.6rem; width: 1px; height: 46px;
  background: linear-gradient(180deg, transparent, var(--rz-hairline-lit));
  transform: translateX(-50%); transform-origin: bottom; z-index: 2;
  animation: rzScrollCue 2.6s var(--ease) infinite;
}
@keyframes rzScrollCue {
  0%, 100% { opacity: 0.15; transform: translateX(-50%) scaleY(0.55); }
  50%      { opacity: 0.9;  transform: translateX(-50%) scaleY(1); }
}

/* =====================================================================
   4. CARTES — papier muséal froid : relief, rim lumineux, hover noble
   ===================================================================== */
.ej-card {
  background:
    linear-gradient(180deg, var(--rz-lift) 0%, #0B1F2C 100%);
  border-color: var(--rz-hairline);
  box-shadow: var(--rz-shadow-soft);
  transition:
    transform 0.5s var(--ease), box-shadow 0.5s var(--ease),
    border-color 0.5s var(--ease), background 0.5s var(--ease);
}
.ej-card:hover {
  background: linear-gradient(180deg, var(--rz-lift-2) 0%, #102A3C 100%);
  border-color: var(--rz-hairline-lit);
  box-shadow: var(--rz-shadow-card), inset 0 1px 0 rgba(206, 158, 96, 0.16);
  transform: translateY(-6px);
}
/* Liseré HUD supérieur : plus présent, lumière glacier */
.ej-card::before { background: var(--rz-hairline-lit); opacity: 0.6; height: 2px; box-shadow: 0 0 10px var(--rz-glow); }
.ej-card:hover::before { width: 72px; opacity: 1; }
/* Numéro d'index : capitale froide, présence d'archive */
.ej-card-index { color: var(--cu, #C2853F); opacity: 0.9; }
.ej-access-card .ej-card-arrow { transition: gap 0.4s var(--ease), color 0.4s var(--ease); }
.ej-access-card:hover .ej-card-arrow { color: var(--cu-soft, #DDA866); }

/* Cartes œuvres : cadre intérieur + lévitation */
.ej-work {
  background: linear-gradient(180deg, var(--rz-lift) 0%, #0B1E2B 100%);
  box-shadow: var(--rz-shadow-soft); border-color: var(--rz-hairline);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.5s var(--ease);
}
.ej-work:hover { transform: translateY(-6px); box-shadow: var(--rz-shadow-card); border-color: var(--rz-hairline-lit); }
.ej-work-cover { box-shadow: inset 0 0 0 1px rgba(176, 205, 221, 0.08), inset 0 -40px 60px -40px rgba(3, 7, 12, 0.8); }

/* =====================================================================
   5. BOUTONS — remplissage balayé, focus premium
   ===================================================================== */
.ej-btn { position: relative; overflow: hidden; isolation: isolate; }
/* Balayage lumineux au survol (primary) */
.ej-btn--primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%);
  transform: translateX(-120%); transition: transform 0.7s var(--rz-ease-out);
}
.ej-btn--primary:hover::after { transform: translateX(120%); }
/* Focus clavier visible et raffiné */
.ej-btn:focus-visible,
.ej-nav-link:focus-visible,
.ej-source-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--gl-navy, #0A131C), 0 0 0 4px var(--rz-hairline-lit);
  border-radius: 4px;
}

/* =====================================================================
   6. SECTIONS IMAGE + TEXTE — direction artistique éditoriale
   ===================================================================== */
/* ombre portée sur le CONTENEUR (sinon overflow:hidden la rognerait sur l'img) */
.ej-split-media { position: relative; overflow: hidden; border-radius: var(--radius, 14px); box-shadow: 0 24px 60px rgba(3, 7, 12, 0.5); }
.ej-split-media img { border: 0; border-radius: inherit; }
/* Voile d'étalonnage froid + liseré intérieur (cadre muséal) */
.ej-split-media::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 19, 28, 0) 55%, rgba(5, 9, 14, 0.45) 100%);
  box-shadow: inset 0 0 0 1px var(--rz-hairline);
}
.ej-figure-cap { color: var(--gl-steel, #92A6B4); }

/* =====================================================================
   7. FOOTER — finition : titres laiton froid, liens soulignés animés
   ===================================================================== */
.ej-footer { position: relative; }
.ej-footer::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--rz-hairline-lit), transparent);
  opacity: 0.6;
}
.ej-footer-col a { position: relative; display: inline-block; }
.ej-footer-col a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px;
  background: var(--cu, #C2853F);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.4s var(--ease);
}
.ej-footer-col a:hover::after { transform: scaleX(1); }

/* =====================================================================
   8. RÉVÉLATIONS — courbe raffinée + cascade échelonnée (piloté par JS)
   ===================================================================== */
.ej-reveal {
  transform: translateY(30px) scale(0.992);
  transition:
    opacity 0.9s var(--rz-ease-out), transform 0.9s var(--rz-ease-out);
}
/* will-change seulement tant que non révélé → la couche compositeur est libérée après .is-in */
.ej-reveal:not(.is-in) { will-change: opacity, transform; }
.ej-reveal.is-in { transform: none; }
/* La cascade (transition-delay par index) est appliquée en inline par le JS. */

/* Images à parallaxe / zoom au scroll : préparées par le JS (.ej-parallax) */
.ej-parallax { will-change: transform; }

/* =====================================================================
   10. RAFFINEMENT FINAL — typographie éditoriale, ancres, tactile
   ---------------------------------------------------------------------
   Couche de polish « AAA » : aucune refonte, uniquement des micro-
   ajustements qui élèvent la perception (anti-orphelins, atterrissage
   d'ancre propre, retour tactile cohérent).
   ===================================================================== */
/* Ancres : ne plus atterrir sous la navbar fixe (76px + respiration) */
html { scroll-padding-top: 96px; }

/* Équilibrage typographique — titres composés, corps sans orphelin/veuve */
.ej-section-title, .ej-card-title, .ej-work-title, .ej-era-title,
.ej-hero-title, .ej-quote-text {
  text-wrap: balance;
}
.ej-section-lead, .ej-card-text, .ej-work-desc, .ej-hero-sub, p {
  text-wrap: pretty;
}
/* Tracking optique des titres d'affichage (cohérence avec le hero) */
.ej-section-title, .ej-card-title, .ej-work-title, .ej-era-title {
  letter-spacing: -0.012em;
}

/* Retour tactile : le bouton ghost s'élève comme le primary (parité) */
.ej-btn--ghost:hover { transform: translateY(-2px); }

/* =====================================================================
   11. SCÈNE — ambiance abyssale, jauge de profondeur, micro-interactions
   ---------------------------------------------------------------------
   Les touches « signature » : une scène vivante mais sobre. Tout est
   subliminal, performant (transform/opacity seulement) et se replie
   sous prefers-reduced-motion.
   ===================================================================== */
/* 11.a — Aurore abyssale : lueurs cuivre & lagon dérivant très lentement
   en fond de page (bioluminescence des abysses, ciel du voyage lunaire).
   Sous le grain (body::after, z -1) ; jamais au-dessus du contenu. */
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 32% at 78% 10%, rgba(194, 133, 63, 0.10), transparent 60%),
    radial-gradient(44% 40% at 14% 90%, rgba(111, 182, 200, 0.08), transparent 62%);
  will-change: transform;
  animation: ejAurora 46s ease-in-out infinite alternate;
}
@keyframes ejAurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(0, -2.4%, 0) scale(1.08); }
}

/* 11.b — Jauge de profondeur : filet cuivre tracé en haut, rempli au scroll
   (la sonde qui descend). Piloté par --ej-progress (0→1) depuis le JS. */
.ej-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 100%;
  transform: scaleX(var(--ej-progress, 0)); transform-origin: left center;
  background: linear-gradient(90deg, var(--cu-deep), var(--cu), var(--cu-soft));
  box-shadow: 0 0 12px var(--cu-glow);
  z-index: 200; pointer-events: none;
}

/* 11.c — Flèches de CTA qui glissent : le « → » final, enveloppé par le JS,
   avance d'un cran à l'entrée du survol. */
.ej-arrow { display: inline-block; transition: transform 0.35s var(--rz-ease-out); }
.ej-btn:hover .ej-arrow,
.ej-source-link:hover .ej-arrow { transform: translateX(4px); }
.ej-source-link .ej-arrow { margin-left: 0.3em; }

/* 11.d — Liens de navigation : soulignement cuivre qui se trace au survol
   (cohérence avec le footer ; l'état actif conserve son filet plein). */
.ej-nav-link::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px;
  background: var(--cu-soft); transform: scaleX(0); transform-origin: left center;
  transition: transform 0.35s var(--ease);
}
.ej-nav-link:hover::after { transform: scaleX(1); }
.ej-nav-link.is-active::after { transform: scaleX(1); background: var(--cu); }

/* =====================================================================
   12. HERO CINÉMATOGRAPHIQUE — entrée du titre mot à mot, souffle du
   portrait. Le JS découpe le titre en .ej-word ; sans JS ou en
   reduced-motion, le titre s'affiche normalement via .ej-reveal.
   ===================================================================== */
.ej-hero-title.ej-words .ej-word {
  display: inline-block;
  opacity: 0; transform: translateY(0.5em);
  transition: opacity 0.85s var(--rz-ease-out), transform 0.85s var(--rz-ease-out);
}
/* Hiérarchie du hero : le NOM domine, l'œuvre devient sous-titre cuivre. */
.ej-hero-line { display: block; }
.ej-hero-works {
  font-size: 0.48em; color: var(--cu-soft); letter-spacing: 0.005em;
  margin-top: 0.16em;
}
.ej-hero-title.ej-words.is-revealed .ej-word { opacity: 1; transform: none; }

/* Souffle : le fond du hero respire très lentement (le portrait vit).
   Le <img> intérieur reçoit la parallaxe JS — on anime le conteneur,
   les deux transforms se composent sans conflit. */
.ej-hero-bg {
  animation: ejHeroBreath 22s ease-in-out infinite alternate;
  transform-origin: 58% 32%;
}
@keyframes ejHeroBreath {
  0%   { transform: scale(1); }
  100% { transform: scale(1.045); }
}

/* =====================================================================
   13. CHRONOLOGIE — l'épine se remplit de cuivre au défilement, chaque
   jalon s'allume à son entrée (piloté par le JS : --tl-progress + .is-seen).
   ===================================================================== */
.ej-timeline::after {
  content: ""; position: absolute; left: -1px; top: 0; width: 2px; height: 100%;
  transform-origin: top center; transform: scaleY(var(--tl-progress, 0));
  background: linear-gradient(180deg, var(--cu-soft), var(--cu) 55%, var(--cu-deep));
  box-shadow: 0 0 10px var(--cu-glow); border-radius: 2px;
}
.ej-tl-item::before {
  transition: background 0.55s var(--ease), border-color 0.55s var(--ease),
    box-shadow 0.55s var(--ease), transform 0.55s var(--rz-ease-out);
  transform: scale(0.7);
}
.ej-tl-item.is-seen::before {
  background: var(--cu); border-color: var(--cu-soft); transform: scale(1);
  box-shadow: 0 0 0 4px rgba(194, 133, 63, 0.14), 0 0 12px var(--cu-glow);
}
.ej-tl-year { transition: color 0.55s var(--ease); }
.ej-tl-item.is-seen .ej-tl-year { color: var(--cu-soft); }

/* =====================================================================
   14. SIGNATURE VERNIENNE — la rose des vents (motif du logo) infuse
   l'ensemble : médaillon de chapitre entre les sections, filigrane
   cartographique sur le parchemin, lettrines façon cartonnage Hetzel.
   ===================================================================== */
/* 14.a — Médaillon « rose des vents » posé sur chaque filet de section,
   comme un fleuron de chapitre dans un livre gravé. */
.ej-section[style*="border-top"]::after {
  content: ""; position: absolute; top: 0; left: 50%;
  transform: translate(-50%, -50%); width: 30px; height: 30px; z-index: 1;
  background: center/30px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='15' fill='%2308161F' stroke='%23C2853F' stroke-width='1'/%3E%3Cpath d='M20 5 L23 17 L35 20 L23 23 L20 35 L17 23 L5 20 L17 17 Z' fill='%23DDA866'/%3E%3Cpath d='M20 5 L20 20 L17 17 Z' fill='%23ECE3CE'/%3E%3Ccircle cx='20' cy='20' r='1.9' fill='%2308161F' stroke='%23C2853F' stroke-width='.7'/%3E%3C/svg%3E");
}

/* 14.b — Filigrane de rose des vents sur la section parchemin : une carte
   ancienne sous le texte. */
.ej-quote { overflow: hidden; }
.ej-quote > .ej-container { position: relative; z-index: 1; }
.ej-quote::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  right: clamp(-90px, -4vw, -40px); bottom: -70px;
  width: clamp(260px, 34vw, 420px); aspect-ratio: 1; opacity: 0.07;
  background: center/contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%238A5A2C' stroke-width='1.6'%3E%3Ccircle cx='100' cy='100' r='90'/%3E%3Ccircle cx='100' cy='100' r='66'/%3E%3Cpath d='M100 100 L150 50 M100 100 L150 150 M100 100 L50 150 M100 100 L50 50'/%3E%3C/g%3E%3Cpath d='M100 6 L110 90 L194 100 L110 110 L100 194 L90 110 L6 100 L90 90 Z' fill='%238A5A2C'/%3E%3Ccircle cx='100' cy='100' r='4' fill='%238A5A2C'/%3E%3C/svg%3E");
}

/* 14.c — Lettrine : capitale ornée en tête de chapitre (typo Hetzel). */
.jv-lettrine::first-letter {
  float: left; font-family: var(--font-display, serif);
  font-size: 3.5em; line-height: 0.7; padding: 0.06em 0.14em 0 0;
  color: var(--cu); font-weight: 400;
}

/* =====================================================================
   15. RESPIRATION — de l'air entre les titres et le texte
   ---------------------------------------------------------------------
   Les .ej-section-title ont margin-bottom: 0 et les <p> aucune marge
   haute : le titre collait au corps. On rétablit un intervalle franc.
   ===================================================================== */
.ej-section-title + p,
.ej-page-hero .ej-section-title + .ej-section-lead,
.ej-prose .ej-section-title + * {
  margin-top: clamp(1.3rem, 2.4vw, 1.9rem);
}
/* Chapeaux : un cran d'air de plus sous le titre. */
.ej-section-lead { margin-top: clamp(1.2rem, 2vw, 1.5rem); }
/* Prose : interligne légèrement plus aéré pour la lecture longue. */
.ej-prose p { line-height: 1.78; }

/* =====================================================================
   9. ACCESSIBILITÉ MOUVEMENT — tout repli proprement
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  .ej-hero::after { animation: none; opacity: 0.4; }
  .ej-section-head::after,
  .ej-kicker::before { transform: none !important; transition: none; }
  .ej-btn--primary::after { display: none; }
  .ej-btn--primary:hover, .ej-btn--ghost:hover { transform: none; }
  .ej-parallax { transform: none !important; }
  body::before { animation: none; }
  .ej-arrow { transition: none; }
  .ej-hero-bg { animation: none; }
  .ej-tl-item::before { transform: none; transition: none; }
}
