/* ══════════════════════════════════════════════════════════════
   EMERA · LOADER STYLES — partagés sur toutes les pages
   /loader.css — racine du site
   ──────────────────────────────────────────────────────────────
   Le même loader splash s'affiche une seule fois par session,
   peu importe la page d'arrivée. Ces styles sont identiques à
   ceux de la home (où ils sont aussi définis inline pour le LCP).
══════════════════════════════════════════════════════════════ */

:root {
  --em-gold: #B89A5C;
  --em-ink:  #2E2C2A;
  --em-expo: cubic-bezier(.16,1,.3,1);
}

#loader {
  position: fixed; inset: 0;
  background: #fff;
  z-index: 7000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0;
  overflow: hidden;
  font-family: 'Barlow', sans-serif;
}
#loader.out {
  pointer-events: none;
  animation: ldrIris 1.3s cubic-bezier(.87,0,.13,1) forwards;
}
@keyframes ldrIris {
  0%   { clip-path: polygon(0 0,100% 0,100% 100%,0 100%); opacity: 1; }
  30%  { clip-path: polygon(0 0,100% 0,100% 100%,0 100%); opacity: 1; }
  100% { clip-path: polygon(50% 50%,50% 50%,50% 50%,50% 50%); opacity: 0; }
}

#ldGl {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  opacity: .35;
  mix-blend-mode: multiply;
}

/* Expanding rings emerging from center */
.ld-rings {
  position: absolute; top: 50%; left: 50%;
  width: 1px; height: 1px;
  z-index: 1; pointer-events: none;
  transform: translate(-50%,-50%);
}
.ld-rings::before, .ld-rings::after {
  content: '';
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--em-gold);
  opacity: 0;
  animation: ldRing 3s cubic-bezier(.4,0,.2,1) infinite;
}
.ld-rings::after { animation-delay: 1.5s; }
@keyframes ldRing {
  0%   { width: 30px; height: 30px; opacity: 0; }
  20%  { opacity: .35; }
  100% { width: 520px; height: 520px; opacity: 0; }
}

/* Floating gold dust particles */
.ld-dust { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.ld-dust span {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--em-gold);
  opacity: 0;
  box-shadow: 0 0 6px rgba(184,154,92,.6);
  animation: dustFloat 6s cubic-bezier(.4,0,.6,1) infinite;
}
@keyframes dustFloat {
  0%   { transform: translateY(20vh) translateX(0); opacity: 0; }
  20%  { opacity: .7; }
  80%  { opacity: .5; }
  100% { transform: translateY(-30vh) translateX(20px); opacity: 0; }
}

.ld-stack {
  position: relative;
  z-index: 2;
  display: flex; flex-direction: column;
  align-items: center;
}

.ld-logo {
  width: clamp(46px, 5.5vw, 68px);
  height: auto;
  opacity: 0;
  margin-bottom: 38px;
  filter: drop-shadow(0 4px 24px rgba(46,44,42,.06));
  animation:
    logoFade .9s var(--em-expo) .15s forwards,
    logoBreath 4s ease-in-out 1.2s infinite;
}
@keyframes logoFade {
  from { opacity: 0; transform: translateY(18px) scale(.92); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
@keyframes logoBreath {
  0%, 100% { transform: scale(1)    rotate(0); filter: drop-shadow(0 4px 24px rgba(46,44,42,.06)); }
  50%      { transform: scale(1.04) rotate(.5deg); filter: drop-shadow(0 6px 32px rgba(184,154,92,.18)); }
}

.ld-main {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 200;
  font-size: clamp(20px, 3vw, 36px);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--em-ink);
  line-height: 1.1;
  text-align: center;
}
.ld-main em {
  font-style: italic;
  font-weight: 200;
  color: var(--em-gold);
  letter-spacing: .12em;
}
/* Letter-by-letter reveal */
.ld-main .ltr {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  animation: ltrIn .7s cubic-bezier(.16,1,.3,1) forwards;
  will-change: opacity, transform;
}
@keyframes ltrIn {
  to { opacity: 1; transform: translateY(0); }
}

/* line break helper */
.ld-main .ld-br {
  display: block;
  height: 0; line-height: 0;
}

.ld-sub {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 500;
  font-size: clamp(10px, .95vw, 12px);
  letter-spacing: .48em;
  text-transform: uppercase;
  color: #5a5450;
  margin-top: 22px;
  opacity: 0;
  animation: fU .9s var(--em-expo) 1.1s forwards;
}

.ld-bar-wrap {
  position: relative;
  width: clamp(140px, 18vw, 200px);
  height: 1px;
  background: rgba(46,44,42,.08);
  margin-top: 50px;
  overflow: visible;
  opacity: 0;
  animation: fI .5s ease 1.3s forwards;
}
.ld-bar {
  height: 100%; width: 0;
  background: var(--em-gold);
  animation: lB 3.8s cubic-bezier(.45,0,.15,1) 1.4s forwards;
  position: relative;
  box-shadow: 0 0 8px rgba(184,154,92,.5);
}
.ld-bar::after {
  content: '';
  position: absolute; right: -3px; top: -2.5px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--em-gold);
  box-shadow:
    0 0 10px rgba(184,154,92,.7),
    0 0 22px rgba(184,154,92,.35);
  animation: barTip 1.6s ease-in-out 1.4s infinite;
}
@keyframes barTip {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.4); }
}
.ld-bar::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 100%;
  background: linear-gradient(to right,
    rgba(184,154,92,0) 0%,
    rgba(184,154,92,.45) 80%,
    rgba(184,154,92,.85) 100%);
  filter: blur(3px);
  pointer-events: none;
}

.ld-count {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(9px, .8vw, 11px);
  font-weight: 500;
  letter-spacing: .55em;
  color: rgba(46,44,42,.42);
  margin-top: 22px;
  opacity: 0;
  animation: fI .5s ease 1.3s forwards;
  font-variant-numeric: tabular-nums;
  padding-left: .55em;
}

@keyframes fU { from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:none} }
@keyframes fI { to{opacity:1} }
@keyframes lB { to{width:100%} }

/* ── Mobile fixes for the sub-text overflow ── */
@media (max-width: 900px) and (max-height: 700px), (max-width: 1100px) and (orientation: portrait) and (max-height: 700px) {
  .ld-bar-wrap { margin-top: 32px; }
  .ld-count { margin-top: 12px; }
}
@media (max-width: 600px) {
  .ld-sub {
    letter-spacing: .32em;
    font-size: 9px;
    padding: 0 24px;
    padding-left: calc(24px + .32em);
    text-align: center;
    max-width: 100%;
  }
}
@media (max-width: 380px) {
  .ld-sub {
    letter-spacing: .26em;
    font-size: 8.5px;
    padding: 0 18px;
    padding-left: calc(18px + .26em);
  }
}
