/* ═══════════════════════════════════════════════════════════
   OGALYX — ambiance (ajout propre au site, hors template)
   Partagé par index.html et les pages privées :
   - titres en Cinzel + révélation mot à mot ([data-split])
   - curseur doré (souris uniquement)
   - grain photographique
   Propre à index.html : ouverture (logo tracé + rideau), menu mobile.
   Tout est neutralisé avec « réduire les animations ».
   ═══════════════════════════════════════════════════════════ */

/* ─── titres de sections dans la capitale romaine du logo ─── */
.coll-title, .mw, .pstep h3,
.gate-title, .biens-title, .adm-title {
  font-family: 'Cinzel', 'Times New Roman', serif;
  font-weight: 400;
  letter-spacing: 0.02em;
}
.coll-title { letter-spacing: 0.03em; text-wrap: balance; }
.mw { letter-spacing: 0.01em; }

/* ─── révélation mot à mot : chaque mot monte hors d'un masque ─── */
.sw { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.sw > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1.15s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: calc(var(--wi, 0) * 70ms);
}
[data-split].split-in .sw > span { transform: none; }

/* ─── grain : bruit SVG fixe, déplacé par saccades (compositeur seul) ─── */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none; z-index: 400;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  will-change: transform;
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0%   { transform: translate(0, 0); }
  20%  { transform: translate(-4%, 3%); }
  40%  { transform: translate(3%, -5%); }
  60%  { transform: translate(-2%, 6%); }
  80%  { transform: translate(5%, 2%); }
  100% { transform: translate(-3%, -2%); }
}

/* ─── curseur doré : point + anneau qui grossit sur ce qui se clique ─── */
html.has-cursor, html.has-cursor a, html.has-cursor button, html.has-cursor summary { cursor: none; }
html.has-cursor input, html.has-cursor textarea { cursor: text; }
.cur-dot, .cur-ring {
  position: fixed; top: 0; left: 0; z-index: 500;
  pointer-events: none; border-radius: 50%;
  opacity: 0; transition: opacity .3s;
}
html.cursor-on .cur-dot, html.cursor-on .cur-ring { opacity: 1; }
.cur-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #d9b871; }
.cur-ring {
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1px solid rgba(217, 184, 113, 0.75);
  transition: opacity .3s, width .45s cubic-bezier(0.22, 1, 0.36, 1), height .45s cubic-bezier(0.22, 1, 0.36, 1),
              margin .45s cubic-bezier(0.22, 1, 0.36, 1), background-color .45s, border-color .45s;
}
.cur-ring.is-link { width: 58px; height: 58px; margin: -29px 0 0 -29px; background: rgba(217, 184, 113, 0.12); }
.cur-ring.is-media {
  width: 86px; height: 86px; margin: -43px 0 0 -43px;
  background: rgba(20, 19, 17, 0.35); border-color: rgba(217, 184, 113, 0.9);
  backdrop-filter: blur(2px);
}
.cur-ring.is-media::after {
  content: 'VOIR'; position: absolute; inset: 0; display: grid; place-items: center;
  font: 500 10px/1 'DM Mono', monospace; letter-spacing: 0.12em; color: #f2f1ec;
}
html.cursor-down .cur-ring { transform: scale(0.85); }

/* ═══════════ index.html : OUVERTURE ═══════════ */
/* logo : un balayage circulaire suit le « O » (masque conique animé),
   puis un reflet doré traverse le monogramme */
@property --trace { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.loader-mark {
  -webkit-mask-image: conic-gradient(from 200deg, #000 var(--trace), transparent calc(var(--trace) + 1deg));
          mask-image: conic-gradient(from 200deg, #000 var(--trace), transparent calc(var(--trace) + 1deg));
  animation: trace .85s cubic-bezier(0.65, 0, 0.35, 1) .05s forwards;
}
@keyframes trace { to { --trace: 360deg; } }
.loader-mark-wrap {
  position: relative; display: block; width: 76px; aspect-ratio: 338 / 368; overflow: hidden; margin: 0 auto 22px;
  /* le reflet ne touche que le dessin du monogramme */
  -webkit-mask: url('images/logo-mark.png?v=202611011240') center / 100% 100% no-repeat;
          mask: url('images/logo-mark.png?v=202611011240') center / 100% 100% no-repeat;
}
.loader-mark-wrap .loader-mark { margin: 0; }
.loader-mark-wrap::after {
  content: ''; position: absolute; inset: -20% -60%;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 244, 214, 0.55) 50%, transparent 60%);
  transform: translateX(-70%);
  animation: sheen 1.1s ease-in-out .7s forwards;
  mix-blend-mode: overlay;
}
@keyframes sheen { to { transform: translateX(70%); } }
.loader.done .loader-mark-wrap { opacity: 0; transform: translateY(-14px) scale(.92); transition: opacity .5s, transform .8s cubic-bezier(0.65, 0, 0.35, 1); }

/* rideau : le voile du loader se lève au lieu de s'estomper */
.loader::before { transition: clip-path 1s cubic-bezier(0.77, 0, 0.175, 1) .1s; clip-path: inset(0 0 0 0); }
.loader.done::before { opacity: 1; clip-path: inset(0 0 100% 0); }
.loader::after {
  content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 1px;
  background: #d9b871; opacity: 0; pointer-events: none;
}
.loader.done::after { animation: curtain-edge 1s cubic-bezier(0.77, 0, 0.175, 1) .1s forwards; }
@keyframes curtain-edge {
  0%   { top: 100%; opacity: 1; }
  90%  { opacity: 1; }
  100% { top: 0; opacity: 0; }
}

/* ═══════════ index.html : MENU MOBILE ═══════════ */
.dock-burger { display: none; }
.mnav { display: none; }
@media (max-width: 900px) {
  .dock-nav { display: none !important; }
  .dock-burger {
    display: grid; place-items: center; flex: 0 0 auto;
    width: 40px; height: 36px; margin-left: auto;
    background: none; border: 0; color: inherit;
  }
  .dock-burger span { grid-area: 1 / 1; display: block; width: 20px; height: 1px; background: currentColor; transition: transform .5s cubic-bezier(0.22, 1, 0.36, 1); }
  .dock-burger span:first-child { transform: translateY(-4px); }
  .dock-burger span:last-child { transform: translateY(4px); }
  html.menu-open .dock-burger span:first-child { transform: rotate(45deg); }
  html.menu-open .dock-burger span:last-child { transform: rotate(-45deg); }
  .dock { z-index: 160; }

  .mnav {
    display: flex; flex-direction: column; justify-content: center;
    position: fixed; inset: 0; z-index: 150;
    padding: 90px 28px 40px;
    background: var(--bone);
    clip-path: inset(0 0 100% 0);
    transition: clip-path .7s cubic-bezier(0.77, 0, 0.175, 1);
    visibility: hidden;
  }
  html.menu-open .mnav { clip-path: inset(0 0 0 0); visibility: visible; }
  html.menu-open, html.menu-open body { overflow: hidden; }
  .mnav a {
    font-family: 'Cinzel', 'Times New Roman', serif; font-size: clamp(30px, 9vw, 44px); letter-spacing: 0.04em;
    padding: 12px 0; border-bottom: 1px solid var(--ink-faint);
    display: flex; justify-content: space-between; align-items: baseline;
    opacity: 0; transform: translateY(24px);
    transition: opacity .6s, transform .8s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(.18s + var(--mi, 0) * 70ms);
  }
  .mnav a small { font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: 0.08em; color: var(--ash); }
  .mnav a.accent { color: var(--lime); }
  html.menu-open .mnav a { opacity: 1; transform: none; }
  .mnav-foot { margin-top: 36px; color: var(--ash); }
}

/* ═══════════ mouvement réduit : tout reste fixe et lisible ═══════════ */
@media (prefers-reduced-motion: reduce) {
  .sw > span { transform: none !important; transition: none !important; }
  .grain { animation: none; }
  .loader-mark { -webkit-mask-image: none; mask-image: none; animation: none; }
  .loader-mark-wrap::after { display: none; }
  .mnav, .mnav a { transition: none !important; }
}

/* ═══════════ index.html : DEVISE — kicker et phrases agrandis ═══════════ */
.motto-kicker.mono { font-size: clamp(13px, 1.25vw, 17px); letter-spacing: 0.16em; opacity: 0.85; }
.motto-hint.mono {
  font-family: var(--sans); text-transform: none;
  font-size: clamp(21px, 2.3vw, 34px); letter-spacing: -0.01em; line-height: 1.25;
  max-width: min(920px, 86vw); bottom: 11vh;
}
/* chaque nouvelle phrase monte mot à mot (découpe faite par ambiance.js) */
.motto-hint.hint-in .sw > span { transform: none; }
.motto-hint .sw > span { transition-duration: .9s; transition-delay: calc(var(--wi, 0) * 55ms); }

/* ═══════════ index.html : ACCROCHE lisible sur la vidéo ═══════════ */
/* voile dégradé derrière la phrase ; son opacité suit celle des mots (ambiance.js) */
/* bandeau sombre arrondi, ajusté à la phrase par ambiance.js ; l'ombre adoucit ses bords */
.spot-scrim {
  position: absolute; opacity: 0; pointer-events: none;
  background: rgba(10, 10, 9, 0.46); border-radius: 999px;
  box-shadow: 0 0 60px 30px rgba(10, 10, 9, 0.32);
}
.spot-intro {
  font-weight: 500; text-wrap: balance;
  /* halo sombre porté par chaque mot : il disparaît avec eux, la vidéo n'est pas assombrie */
  text-shadow: 0 0 24px rgba(0, 0, 0, 0.6), 0 0 64px rgba(0, 0, 0, 0.6), 0 0 120px rgba(0, 0, 0, 0.45), 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* ═══════════ index.html : OBJECTIONS en liste à puces, ligne par ligne ═══════════ */
.final-text { text-align: left; width: fit-content; max-width: min(940px, 86vw); }
.final-text br { display: none; }
.final-text .fs {
  display: block; position: relative; padding-left: 1.05em;
  opacity: 0.18; transform: translateX(-0.6em);
  transition: color .5s, opacity .9s cubic-bezier(0.22, 1, 0.36, 1), transform 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.final-text .fs + .fs { margin-top: 0.12em; }
.final-text .fs.on { opacity: 1; transform: none; }
.final-text .fs::before {
  content: ''; position: absolute; left: 0.08em; top: 0.5em;
  width: 0.3em; height: 0.3em; background: #d9b871;
  transform: rotate(45deg) scale(0);
  transition: transform .7s cubic-bezier(0.34, 1.56, 0.64, 1) .1s;
}
.final-text .fs.on::before { transform: rotate(45deg) scale(1); }
.final-text #fs4 { margin-top: 0.45em; }
.final-text #fs4::before { display: none; }
body.static .final-text .fs { opacity: 1; transform: none; }
body.static .final-text .fs::before { transform: rotate(45deg) scale(1); }

/* ═══════════ RAPPEL DE DÉFILEMENT (tout le site) ═══════════ */
.scroll-cue {
  position: fixed; left: 50%; bottom: 20px; z-index: 300;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  transform: translate(-50%, 12px); opacity: 0;
  pointer-events: none; color: #fff; mix-blend-mode: difference;
  transition: opacity .6s, transform .8s cubic-bezier(0.22, 1, 0.36, 1);
}
.scroll-cue.show { opacity: 0.9; transform: translate(-50%, 0); }
.scroll-cue span { font: 400 10px/1 'DM Mono', monospace; letter-spacing: 0.22em; }
.scroll-cue i {
  position: relative; display: block; width: 1px; height: 42px; overflow: hidden;
  background: rgba(255, 255, 255, 0.28);
}
.scroll-cue i::after {
  content: ''; position: absolute; left: 0; top: 0; width: 1px; height: 45%;
  background: #fff; animation: cue 1.8s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}
@keyframes cue { 0% { transform: translateY(-100%); } 100% { transform: translateY(230%); } }
html.menu-open .scroll-cue { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .motto-hint .sw > span, .final-text .fs, .final-text .fs::before { transition: none !important; }
  .scroll-cue i::after { animation: none; height: 100%; }
}
