/* =====================================================================
   DESIGN RESTORATION — ERICH HARTMANN ARCHIV
   ---------------------------------------------------------------------
   Couche de FINITION premium, chargée EN DERNIER (après archive.css +
   altitude.css). Relief, profondeur douce, rythme éditorial,
   micro-interactions — direction documentaire « altitude ».

   PRINCIPES
   · Additif et piloté par les classes .ej-* existantes.
   · Entièrement réversible : retirer ce <link> (et design-restoration.js)
     restaure l'état précédent.
   · Direction : archive muséale sobre — relief sans gadget.
   ===================================================================== */

:root {
  /* Relief de luminance (thème JG 52 / camo) */
  --rz-lift:        #222A30;
  --rz-lift-2:      #2C353C;
  --rz-hairline:    rgba(224, 176, 32, 0.18);
  --rz-hairline-lit:rgba(224, 176, 32, 0.45);
  --rz-glow:        rgba(168, 180, 188, 0.18);
  --rz-ink-deep:    #0A0C0E;
  --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)
   ===================================================================== */
/* Seconde nappe de lumière haute + grain optique discret (thème Altitude). */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 32% at 50% 0%, rgba(168, 180, 188, 0.06), transparent 70%),
    radial-gradient(40% 24% at 88% 8%, rgba(224, 176, 32, 0.04), 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(90, 98, 104, 0.08) 0%, transparent 22%, transparent 78%, rgba(5, 9, 14, 0.3) 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(86px, 11vw, 124px); 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%, #1A201C 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%, #242C28 100%);
  border-color: var(--rz-hairline-lit);
  box-shadow: var(--rz-shadow-card), inset 0 1px 0 rgba(224, 176, 32, 0.12);
  transform: translateY(-6px);
}
/* Liseré supérieur — jaune JG 52 */
.ej-card::before { background: var(--rz-hairline-lit); opacity: 0.6; height: 2px; box-shadow: 0 0 10px rgba(224, 176, 32, 0.25); }
.ej-card:hover::before { width: 72px; opacity: 1; }
.ej-card-index { color: var(--gold, #E0B020); 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(--gold-soft, #F0C84A); }

/* Cartes œuvres : cadre intérieur + lévitation */
.ej-work {
  background: linear-gradient(180deg, var(--rz-lift) 0%, #181C1A 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(224, 176, 32, 0.1), 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 #0A0C0E, 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, 12, 14, 0) 55%, rgba(5, 7, 9, 0.5) 100%);
  box-shadow: inset 0 0 0 1px var(--rz-hairline);
}
.ej-figure-cap { color: var(--muted, #9AA6AE); }

/* =====================================================================
   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(--gold, #E0B020);
  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; }

/* =====================================================================
   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-parallax { transform: none !important; }
}

/* =====================================================================
   10. ATELIER — finition « cabinet de curiosités »
   Patine d'archive, typographie de cabinet, motif-signature (sablier),
   micro-détails pour l'œil aguerri. Tout additif, tout réversible.
   ===================================================================== */

/* Patine : grain d'acier très fin, voile uniforme (derrière nav/boutons) */
main::after {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  opacity: 0.025; mix-blend-mode: soft-light;
}

/* Typographie de cabinet : équilibrage optique + gravure soignée */
.ej-section-title, .ej-page-hero .ej-section-title {
  text-wrap: balance;
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  letter-spacing: -0.016em;
}
.ej-hero-title { font-feature-settings: "kern" 1, "liga" 1, "calt" 1; }

/* Lettrine éditoriale — initiale Marcellus sur le chapô de l'accueil */
.ej-prose p.ej-lead::first-letter {
  font-family: var(--font-display); font-style: normal;
  font-size: 3.1em; line-height: 0.72; float: left;
  margin: 0.05em 0.16em -0.06em 0;
  color: var(--gold, #E0B020);
}

/* Respiration : air entre le titre et le corps de texte (prose) */
.ej-prose .ej-section-title { margin-bottom: clamp(1.5rem, 3.2vw, 2.2rem); }
.ej-prose .ej-section-title + .ej-lead,
.ej-prose .ej-section-title + p { margin-top: 0; }

/* Citations : ponctuation suspendue + équilibre des lignes */
.ej-quote-text { text-wrap: balance; hanging-punctuation: first last; }
.ej-quote-author { font-size: 0.78rem; letter-spacing: 0.18em; }

/* Motif-signature */
.ej-ornament {
  display: block; width: clamp(24px, 4vw, 30px); height: auto;
  margin: 0 auto clamp(1.1rem, 2.6vw, 1.7rem);
  color: var(--gold, #E0B020); opacity: 0.92;
}

/* Micro-détail : « épingle de spécimen » — point net en fin de kicker */
.ej-kicker::after {
  content: ""; width: 3px; height: 3px; border-radius: 50%; flex: 0 0 auto;
  background: var(--rz-hairline-lit); opacity: 0;
  transition: opacity 0.6s var(--rz-ease-out) 0.25s;
}
.ej-kicker.is-in::after, .ej-reveal.is-in .ej-kicker::after { opacity: 0.6; }

/* Finesse des soulignés de liens */
.ej-prose a:not(.ej-btn), .ej-source-link, .ej-contact-mail { text-underline-offset: 4px; }

@media (prefers-reduced-motion: reduce) {
  main::after { opacity: 0.018; }
  .ej-kicker::after { transition: none; }
}

/* Gravure entomologique — Coleoptera vectoriel en filigrane d'angle (carte Subtile Jagden).
   Spécimen « épinglé » : légèrement incliné, clipé par le coin, révélé au survol. */
.ej-card--entomo > :not(.ej-card-bug) { position: relative; z-index: 1; }
.ej-card-bug {
  position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible;
  z-index: 0; pointer-events: none;
  color: var(--gold, #E0B020); opacity: 0.22;
  transition: opacity 0.7s var(--ease);
}
.ej-card--entomo:hover .ej-card-bug { opacity: 0.42; }

/* Héritage entomologie / psyche — désactivé (thème JG 52) */
.ej-card-haze { display: none !important; }

/* =====================================================================
   11. LUSTRE — reflets sobres, accent jaune JG 52
   ===================================================================== */
:root {
  --rz-iris: linear-gradient(90deg, transparent,
     rgba(224,176,32,0.55) 28%, rgba(168,180,188,0.28) 52%,
     rgba(224,176,32,0.4) 78%, transparent);
}

.ej-section-head::after {
  background: linear-gradient(90deg, rgba(224,176,32,0.65),
     rgba(168,180,188,0.28) 48%, transparent);
}
.ej-section-head.is-center::after { background: var(--rz-iris); }
.ej-footer::before { background: var(--rz-iris); opacity: 0.85; }
.ej-hero-signature::before {
  background: linear-gradient(90deg, rgba(224,176,32,0.7),
     rgba(168,180,188,0.3) 55%, transparent);
}

.ej-card {
  box-shadow: var(--rz-shadow-soft),
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 18px 26px -22px rgba(224,176,32,0.06);
}

.ej-btn--primary {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55),
    inset 0 -9px 15px -11px rgba(10,12,14,0.28);
}

.ej-ornament { filter: drop-shadow(0 0 6px rgba(224,176,32,0.3)); }

.ej-nav-link.is-active::after { box-shadow: 0 0 8px rgba(224,176,32,0.45); }
.ej-logo { transition: filter 0.45s var(--ease); }
.ej-logo:hover { filter: drop-shadow(0 0 6px rgba(224,176,32,0.4)); }

/* Couvertures d'œuvres — lustre de vitrine (sous verre) */
.ej-work-cover { position: relative; }
.ej-work-cover::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(122deg, rgba(255,255,255,0.07) 0%, transparent 26%, transparent 74%, rgba(255,255,255,0.035) 100%);
  mix-blend-mode: overlay; opacity: 0.55;
  transition: opacity 0.6s var(--ease);
}
.ej-work:hover .ej-work-cover::after { opacity: 0.85; }

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