/* =========================================================
   Mystère & illusions optiques
   ========================================================= */

.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Grain de pellicule sur toute la page */
body::after {
  content: ""; position: fixed; inset: -50%; z-index: 90; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .4 0 0 0 0 .3 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
  opacity: .07; mix-blend-mode: overlay;
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

/* Or qui miroite dans les titres */
h1 em, h2 em,
:is(.on-dark, .hero, .page-hero, .cta) h1 em, :is(.on-dark, .hero, .page-hero, .cta) h2 em {
  background: linear-gradient(100deg, #b8860b 0%, #f2c94c 30%, #fff6d8 45%, #f2c94c 60%, #b8860b 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: shimmer 7s ease-in-out infinite;
  padding-right: .06em;
}
@keyframes shimmer { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }

/* Titres principaux qui émergent de la brume */
.hero h1, .page-hero h1 { animation: emerge 2.2s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes emerge {
  from { opacity: 0; filter: blur(14px); letter-spacing: .08em; }
  to { opacity: 1; filter: blur(0); letter-spacing: -0.005em; }
}
.reveal { filter: blur(6px); transition: opacity .9s ease, transform .9s ease, filter 1.1s ease; }
.reveal.in { filter: none; }

/* Brume qui dérive */
.mist { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.mist span {
  position: absolute; width: 60vw; height: 60vw; max-width: 900px; max-height: 900px; border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 201, 76, .12), transparent 62%);
  filter: blur(30px); animation: drift 26s ease-in-out infinite alternate;
}
.mist span:nth-child(1) { left: -15%; top: 20%; }
.mist span:nth-child(2) { right: -20%; top: -30%; background: radial-gradient(circle, rgba(52, 195, 127, .16), transparent 62%); animation-duration: 34s; animation-delay: -10s; }
.mist span:nth-child(3) { left: 30%; bottom: -50%; background: radial-gradient(circle, rgba(246, 250, 244, .07), transparent 62%); animation-duration: 40s; animation-delay: -20s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(8vw, -4vw) scale(1.15); }
  100% { transform: translate(-6vw, 5vw) scale(.92); }
}
.page-hero::before {
  content: ""; position: absolute; inset: -20%; z-index: 1; pointer-events: none;
  background:
    radial-gradient(35% 45% at 20% 30%, rgba(242, 201, 76, .10), transparent 70%),
    radial-gradient(30% 40% at 80% 70%, rgba(52, 195, 127, .14), transparent 70%);
  animation: drift 30s ease-in-out infinite alternate;
}
.page-hero .wrap { z-index: 2; }
.page-hero-bg img { animation: kenburns 28s ease-in-out infinite alternate; transform-origin: 60% 40%; }
@keyframes kenburns { from { transform: scale(1.02); } to { transform: scale(1.14) translate(-1.5%, 1%); } }

/* Braises */
.embers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.hero-grid, .cta .wrap { z-index: 1; }

/* Mandala de géométrie sacrée */
.mandala { display: block; width: 100%; height: 100%; color: var(--gold-light); overflow: visible; }
.mandala g { transform-box: fill-box; transform-origin: center; }
.mandala .m-a { animation: spin 120s linear infinite; opacity: .55; }
.mandala .m-b { animation: spin 80s linear infinite reverse; opacity: .35; }
.mandala .m-c { animation: spin 160s linear infinite; opacity: .5; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero-visual .halo {
  position: absolute; z-index: 0; pointer-events: none;
  left: -25%; top: -16%; width: 150%; aspect-ratio: 1;
}
.hero-visual .halo .mandala { animation: breathe 9s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .55; scale: 1; } 50% { opacity: .9; scale: 1.035; } }
.hero-visual .arch { position: relative; z-index: 1; }
.hero-visual .hero-badge { z-index: 2; }
.hero-visual::before { z-index: 1; }
[data-depth] { will-change: transform; }

/* Brume de chaleur sur l'image */
.arch img { filter: url(#haze); }

/* Lanterne : symboles cachés révélés par la lumière */
.lantern-zone { position: relative; overflow: hidden; isolation: isolate; }
.lantern-zone > .wrap { position: relative; z-index: 2; }
.lantern { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.lantern::before, .lantern::after {
  content: ""; position: absolute; inset: 0;
  background: url("/img/glyphs.svg") 0 0 / 180px 180px repeat;
}
.lantern::before { opacity: .035; }
.lantern::after {
  opacity: .75;
  -webkit-mask-image: radial-gradient(circle var(--lr, 220px) at var(--mx, 70%) var(--my, 40%), #000 0%, rgba(0,0,0,.4) 45%, transparent 100%);
  mask-image: radial-gradient(circle var(--lr, 220px) at var(--mx, 70%) var(--my, 40%), #000 0%, rgba(0,0,0,.4) 45%, transparent 100%);
}
.lantern-zone::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(circle calc(var(--lr, 220px) * 1.6) at var(--mx, 70%) var(--my, 40%), rgba(242, 201, 76, .10), transparent 70%);
}
.lantern-zone > .mandala {
  position: absolute; z-index: 0; right: -18%; top: 50%; width: min(900px, 90vw); height: auto; aspect-ratio: 1;
  translate: 0 -50%; opacity: .12; pointer-events: none;
}
.lantern-hint {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 8px;
  font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--gold-light); opacity: .75;
}
.lantern-hint::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-light); box-shadow: 0 0 12px 3px rgba(242, 201, 76, .6); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; transform: scale(.7); } }
.element { position: relative; }
.element svg { transition: filter .4s, transform .6s; }
.element:hover svg { filter: drop-shadow(0 0 10px rgba(242, 201, 76, .7)); transform: translateY(-3px) rotate(-6deg); }

/* L'œil qui regarde */
.eye { width: 170px; margin: 0 auto 26px; color: var(--gold-light); }
.eye svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 0 8px rgba(242, 201, 76, .35)); }
.eye .eye-lid { transform-box: fill-box; transform-origin: center; transition: transform .12s ease-in; }
.eye.blink .eye-lid { transform: scaleY(.08); }
.eye .eye-iris { transition: transform .25s ease-out; }

/* Photos : reflet qui traverse au survol */
.card-media, .post-card .media, .gallery figure, .split-media .frame { position: relative; }
.card-media::after, .post-card .media::after, .gallery figure::before, .split-media .frame::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 246, 216, .28) 50%, transparent 65%);
  transform: translateX(-120%); transition: transform 1.1s ease;
}
.card:hover .card-media::after, .post-card:hover .media::after, .gallery figure:hover::before, .split-media:hover .frame::after { transform: translateX(120%); }

@media (prefers-reduced-motion: reduce) {
  body::after, .mist, .embers { display: none; }
  .lantern-hint::before { animation: none; }
  .arch img { filter: none; }
  .mandala g, .page-hero-bg img, .hero-visual .halo .mandala, h1 em, h2 em, .page-hero::before { animation: none !important; }
  .hero h1, .page-hero h1 { animation: none; }
  .reveal { filter: none; }
}

/* =========================================================
   Couleurs de la spiritualite et de l Afrique
   ========================================================= */

/* Bande kente sous l en-tete et en haut du pied de page */
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px;
  background: var(--kente); opacity: .95;
}
.site-footer { position: relative; }
.site-footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--kente);
}

/* Reflet rouge et or sur fond clair, or et kaolin sur fond sombre */
h1 em, h2 em {
  background-image: linear-gradient(100deg, #0b7a4a 0%, #c48a00 32%, #e8b220 48%, #c48a00 64%, #0b7a4a 100%);
}
:is(.on-dark, .hero, .page-hero, .cta) h1 em, :is(.on-dark, .hero, .page-hero, .cta) h2 em {
  background-image: linear-gradient(100deg, #d4a017 0%, #f2c94c 30%, #fff6d8 45%, #f2c94c 60%, #f0b429 100%);
}

/* Lueurs : or, violet spirituel, rouge */
.hero::before {
  background:
    radial-gradient(55% 65% at 78% 40%, rgba(242, 201, 76, .16), transparent 70%),
    radial-gradient(45% 55% at 95% 95%, rgba(120, 220, 160, .18), transparent 70%),
    radial-gradient(40% 50% at 5% 100%, rgba(52, 195, 127, .22), transparent 70%);
}
.mist span:nth-child(3) { background: radial-gradient(circle, rgba(120, 220, 160, .14), transparent 62%); }
.page-hero::before {
  background:
    radial-gradient(35% 45% at 20% 30%, rgba(242, 201, 76, .10), transparent 70%),
    radial-gradient(30% 40% at 85% 25%, rgba(120, 220, 160, .16), transparent 70%),
    radial-gradient(30% 40% at 80% 80%, rgba(52, 195, 127, .16), transparent 70%);
}
.mandala .m-b { color: var(--violet); }
.lantern-zone::before {
  background:
    radial-gradient(circle calc(var(--lr, 220px) * 1.6) at var(--mx, 70%) var(--my, 40%), rgba(120, 220, 160, .12), rgba(242, 201, 76, .05) 40%, transparent 70%);
}

/* Chaque element sa couleur : eau indigo, feu rouge, terre verte, air kaolin */
.element { --el: var(--gold-light); }
.element:nth-child(1) { --el: var(--water); }
.element:nth-child(2) { --el: var(--fire); }
.element:nth-child(3) { --el: var(--green-light); }
.element:nth-child(4) { --el: var(--on-dark); }
.element svg { color: var(--el); }
.element::before {
  content: ""; position: absolute; top: -1px; left: 28px; width: 44px; height: 2px; background: var(--el);
  box-shadow: 0 0 12px var(--el);
}
.element:hover svg { filter: drop-shadow(0 0 12px var(--el)); }
@media (max-width: 560px) { .element::before { left: 0; } }

/* Trois chemins : rouge (purification), or (consultation), vert (abondance) */
.cards .card { --accent: var(--green-deep); }
.cards .card:nth-child(2) { --accent: #b8860b; }
.cards .card:nth-child(3) { --accent: var(--green); }
.cards .card-body { border-top: 3px solid var(--accent); }
.cards .card-num { color: var(--accent); }

/* Etapes aux couleurs du kente */
.step:nth-child(1)::before { color: var(--green-deep); }
.step:nth-child(2)::before { color: #b8860b; }
.step:nth-child(3)::before { color: var(--green); }
.step:nth-child(4)::before { color: #0b5d3b; }
.on-dark .step:nth-child(2)::before { color: var(--gold-light); }
.on-dark .step:nth-child(3)::before { color: var(--green-light); }
.on-dark .step:nth-child(4)::before { color: var(--violet); }
.on-dark .step:nth-child(1)::before { color: var(--fire); }

/* Avatars des temoignages en alternance */
.testimonial:nth-child(3n+1) .avatar { background: var(--green-deep); color: #fff6d8; }
.testimonial:nth-child(3n+2) .avatar { background: var(--green); color: #fff6d8; }
.testimonial:nth-child(3n) .avatar { background: var(--earth); }
.testimonial figcaption .avatar { color: #fff6d8; }
.testimonial.featured figcaption .avatar { background: var(--gold); color: var(--night); }

/* Corrections */
.page-hero.article-hero { overflow-x: clip; }
.page-hero.article-hero::before { inset: 0; }

/* Tablette : pas de carte orpheline sur la derniere ligne */
@media (min-width: 641px) and (max-width: 960px) {
  .cards .card:last-child:nth-child(odd),
  .posts .post-card:last-child:nth-child(odd):not(.feature) {
    grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; align-items: stretch;
  }
  .cards .card:last-child:nth-child(odd) .card-media { aspect-ratio: auto; height: 100%; min-height: 260px; }
  .cards .card:last-child:nth-child(odd) .card-body { border-top: 0; border-left: 3px solid var(--accent); }
  .posts .post-card:last-child:nth-child(odd):not(.feature) { gap: 28px; align-items: center; }
  .posts .post-card:last-child:nth-child(odd):not(.feature) .media { margin: 0; }
}

/* Tablette : photos des blocs empiles en format paysage pleine largeur */
@media (min-width: 561px) and (max-width: 860px) {
  .split-media { max-width: none; margin-right: 0; }
  .split-media .frame, .offer .split-media .frame { aspect-ratio: 16 / 10; }
  .split-media .inset { width: 30%; right: 20px; bottom: -28px; }
}


/* Palette blanc, vert et or : accents distincts */
.cards .card { --accent: var(--green); }
.cards .card:nth-child(2) { --accent: var(--gold); }
.cards .card:nth-child(3) { --accent: var(--earth); }
.step:nth-child(odd)::before { color: var(--green); }
.step:nth-child(even)::before { color: #b8860b; }
.on-dark .step:nth-child(odd)::before { color: var(--green-light); }
.on-dark .step:nth-child(even)::before { color: var(--gold-light); }
.testimonial:nth-child(3n+1) .avatar { background: var(--green); color: #fff; }
.testimonial:nth-child(3n+2) .avatar { background: var(--gold); color: var(--night); }
.testimonial:nth-child(3n) .avatar { background: var(--earth); color: var(--gold-light); }
.testimonial.featured figcaption .avatar { background: var(--gold); color: var(--night); }
.element:nth-child(2) { --el: var(--gold-light); }

/* =========================================================
   Palette blanc / vert / or appliquee aux elements du navigateur
   ========================================================= */
:root { color-scheme: light; accent-color: var(--green); caret-color: var(--green); }
::selection { background: var(--gold-light); color: var(--night); }
:is(.on-dark, .hero, .page-hero, .cta, .site-footer, .nav) ::selection { background: var(--green); color: #fff; }

html { scrollbar-color: var(--green) var(--sand); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--sand); }
::-webkit-scrollbar-thumb { background: var(--green); border-radius: 999px; border: 3px solid var(--sand); }
::-webkit-scrollbar-thumb:hover { background: var(--earth); }

:focus-visible { outline-color: var(--gold); }

/* Champs de formulaire */
.field select {
  appearance: none; -webkit-appearance: none; padding-right: 44px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%231e8a55' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center;
}
.field input:-webkit-autofill, .field textarea:-webkit-autofill, .field select:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--sand) inset;
  transition: background-color 9999s;
}
.field input::placeholder, .field textarea::placeholder { color: #8aa197; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(20, 154, 92, .16); }

/* Bouton WhatsApp flottant aux couleurs du site */
.wa-float { background: var(--green); color: #fff; box-shadow: 0 10px 28px rgba(8, 74, 48, .35), 0 0 0 3px var(--gold-light); }
.wa-float:hover { background: var(--earth); }

/* Mentions legales */
.prose.legal > p:first-of-type::first-letter { float: none; font: inherit; color: inherit; padding: 0; }
.prose.legal h2 { font-size: clamp(1.6rem, 2.6vw, 2rem); margin-top: 1.6em; }
.prose.legal h2:first-child { margin-top: 0; }
.prose.legal a { color: var(--green-deep); text-underline-offset: 3px; }
.legal-date { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
