/* ============================================================
   L'ACADÉMIE DES GUERRIÈRES — REFONTE GRAPHIQUE
   Calque de fond animé, halo curseur, hiérarchie, micro-interactions,
   et porte d'intro (cette dernière n'agit que sur index.html, où
   l'élément #door-intro existe).
   Chargé sur les 9 pages. Charte respectée : noir, blanc cassé,
   orange #f19f00, Montserrat.
   ============================================================ */

/* ------------------------------------------------------------
   1. CALQUE DE FOND ANIMÉ + SECTIONS TRANSPARENTES
   Le fond glisse d'une teinte à l'autre au scroll (js/animations.js).
   ------------------------------------------------------------ */
#bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: #000000;
  will-change: background-color;
}

/* Aura orange qui suit le curseur sur toute la page, comme une lampe.
   Posée DERRIÈRE le contenu (z-index -1, sur le calque de fond) : elle
   rayonne autant sur le blanc cassé que sur le noir, sans teinter le texte. */
#cursor-lamp {
  position: fixed;
  top: 0;
  left: 0;
  width: 28vmin;
  height: 28vmin;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  background: radial-gradient(
    circle,
    rgba(241, 159, 0, 0.32) 0%,
    rgba(241, 159, 0, 0.12) 35%,
    rgba(241, 159, 0, 0.04) 65%,
    transparent 100%
  );
  filter: blur(24px);
  transition: opacity 0.6s ease, transform 0.2s ease-out;
  will-change: transform, opacity;
}
@media (hover: none) {
  #cursor-lamp { display: none; }
}

body {
  background-color: transparent;
  --ink: #ffffff;
}

/* Les sections deviennent transparentes : le calque de fond les traverse */
.hero,
.hero-simple,
main .section-light,
main .section-dark,
main .section-darker,
main .cta-section {
  background-color: transparent;
}

/* Le texte porté DIRECTEMENT par le fond de section suit l'encre interpolée :
   il reste lisible quelle que soit la teinte du fond en cours de transition. */
main .section,
main .cta-section {
  color: var(--ink);
}
main .quote-block .quote,
main .text-white {
  color: var(--ink);
}

/* ------------------------------------------------------------
   2. COMPOSANTS À FOND PROPRE — couleur de texte FIXE
   Ces éléments ont leur propre fond : leur texte ne doit PAS suivre
   l'encre de section, sinon il devient illisible (titre blanc sur
   carte blanche, titre foncé sur carte foncée).
   ------------------------------------------------------------ */
/* Fond clair (carte blanche) → texte foncé */
main .card,
main .card h3,
main .bonus-card,
main .bonus-card h4,
main .blog-card,
main .blog-card h3,
main .offer-card,
main .offer-card h3,
main .form-group input,
main .form-group textarea {
  color: var(--color-black);
}

/* Fond foncé (carte sombre) → texte clair */
main .card-dark,
main .card-dark h3,
main .module-card,
main .module-card h3,
main .testimonial-card,
main .testimonial-card h3,
main .audio-testimonial,
main .offer-banner,
main .offer-banner .text-white,
main .offer-card.featured,
main .offer-card.featured h3,
main .contact-info {
  color: var(--color-white);
}

/* Le halo radial du hero d'accueil reste, posé sur le calque */
.home-hero::before {
  background: radial-gradient(circle at 22% 45%, rgba(241, 159, 0, 0.12), transparent 55%);
}

/* ------------------------------------------------------------
   3. GRAIN — matière subtile sur tout le site
   ------------------------------------------------------------ */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ------------------------------------------------------------
   4. HIÉRARCHIE VISUELLE — plus d'air, typo plus expressive
   ------------------------------------------------------------ */
main .section { padding: 140px 0; }
main .cta-section { padding: 150px 0; }

@media (max-width: 768px) {
  main .section,
  main .cta-section { padding: 96px 0; }
}

.home-hero h1 {
  font-size: clamp(2.5rem, 6.5vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

main .section-header { margin-bottom: 80px; }

main .section-header h2 {
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

main .quote-block .quote {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  letter-spacing: -0.02em;
}

/* Filets orange discrets en tête de section */
main .section-header .text-eyebrow {
  display: inline-block;
  position: relative;
  padding-bottom: 14px;
  margin-bottom: 18px;
}
main .section-header .text-eyebrow::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 40px;
  height: 2px;
  transform: translateX(-50%);
  background-color: var(--color-orange);
}

/* ------------------------------------------------------------
   5. MICRO-INTERACTIONS — boutons & cartes
   ------------------------------------------------------------ */
.btn {
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 80%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-18deg);
  transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}
.btn:hover::before { left: 130%; }

.offer-card,
.pain-card,
.testimonial-card,
.card,
.module-card,
.bonus-card,
.blog-card {
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.4s ease,
              border-color 0.4s ease;
}
.pain-card:hover {
  transform: translateY(-6px);
}
.pain-card:hover .icon-wrap {
  background-color: var(--color-orange);
  color: var(--color-black);
}
.pain-card .icon-wrap {
  transition: background-color 0.4s ease, color 0.4s ease;
}
.offer-card:hover,
.card:hover,
.module-card:hover,
.bonus-card:hover,
.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.18);
}
.offer-card.featured:hover {
  box-shadow: 0 30px 60px rgba(241, 159, 0, 0.18);
}
.testimonial-card:hover {
  transform: translateY(-6px);
  border-color: var(--color-orange);
}
.transformation-card .label .name {
  transition: color 0.4s ease;
}
.transformation-card:hover .label .name {
  color: var(--color-orange);
}

/* ------------------------------------------------------------
   6. PORTE D'INTRO — temple zen Rinzai (sankarado)
   N'agit que sur index.html, où #door-intro existe.
   Calque fixe par-dessus la page entièrement rendue.
   ------------------------------------------------------------ */
#door-intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  background-color: #0a0a0a;
  perspective: 2400px;
  overflow: hidden;
}
html.door-active #door-intro { display: block; }
html.door-active body { overflow: hidden; }

/* Halo orange qui éclôt pendant l'ouverture */
.door-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 80vmax;
  height: 80vmax;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(241, 159, 0, 0.16), transparent 62%);
  opacity: 0;
  pointer-events: none;
}

/* Les deux battants */
.door-panel {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  will-change: transform;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}
.door-left  { left: 0;  transform-origin: left center; }
.door-right { right: 0; transform-origin: right center; }

/* Aura orange qui suit le curseur : une lampe qui éclaire la porte */
.door-lamp {
  position: absolute;
  top: 0;
  left: 0;
  width: 48vmin;
  height: 48vmin;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  background: radial-gradient(circle, rgba(241, 159, 0, 0.30), rgba(241, 159, 0, 0.10) 38%, transparent 70%);
  mix-blend-mode: screen;
  transition: opacity 0.5s ease, transform 0.18s ease-out;
  will-change: transform, opacity;
}

.door-svg {
  width: 100%;
  height: 100%;
  display: block;
}
/* Le battant droit est le miroir du gauche : poignée vers la couture, gonds dehors */
.door-right .door-svg { transform: scaleX(-1); }

/* Vignette : creux de lumière, suggère la profondeur des panneaux */
.door-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 44%, transparent 50%, rgba(0, 0, 0, 0.62));
}

/* Le mandala officiel, à cheval sur la couture, clippé en deux par les battants */
.door-mandala {
  position: absolute;
  top: 50%;
  width: clamp(124px, 15vw, 188px);
  height: clamp(124px, 15vw, 188px);
  filter: drop-shadow(0 0 24px rgba(241, 159, 0, 0.55));
  will-change: transform;
  z-index: 3;
}
.door-left  .door-mandala { right: 0; transform: translate(50%, -50%); }
.door-right .door-mandala { left: 0;  transform: translate(-50%, -50%); }

/* Contenu central : CTA + indice */
.door-content {
  position: absolute;
  left: 50%;
  top: 63%;
  transform: translate(-50%, -50%);
  z-index: 5;
  text-align: center;
  width: min(90vw, 460px);
  padding: 0 24px;
}
.door-content .door-enter {
  box-shadow: 0 14px 40px rgba(241, 159, 0, 0.28);
}
.door-hint {
  margin-top: 18px;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

/* Bouton discret pour passer l'intro */
.door-skip {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 5;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  padding: 10px 18px;
  transition: color 0.3s ease;
}
.door-skip:hover { color: var(--color-orange); }

@media (max-width: 600px) {
  .door-content { top: 68%; }
}

/* ------------------------------------------------------------
   7. MOUVEMENT RÉDUIT — la porte ne joue pas, rien ne bouge
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html.door-active #door-intro { display: none; }
  html.door-active body { overflow: auto; }
  .btn::before { display: none; }
}

/* ------------------------------------------------------------
   8. RESPONSIVE — pas de débordement horizontal sur mobile
   ------------------------------------------------------------ */
/* Filet de sécurité au niveau racine. overflow: clip découpe le
   débordement sans casser position: sticky. */
html { overflow-x: clip; }

/* Les boutons s'enroulent au lieu de forcer une largeur supérieure à
   l'écran : c'était la cause du site plus large que le téléphone
   (libellés longs en white-space: nowrap qui élargissaient la page). */
.btn { white-space: normal; }

/* Les éléments de grille peuvent rétrécir sous la largeur de leur
   contenu au lieu de pousser la page au-delà de l'écran. */
.hero-content,
.hero-grid > *,
.grid > *,
.offers-grid > *,
.story-grid > *,
.contact-grid > * {
  min-width: 0;
}

@media (max-width: 600px) {
  .offer-banner { padding: 24px; }
}

/* ------------------------------------------------------------
   9. COHÉRENCE — texte du hero et boutons contour suivent l'encre
   ------------------------------------------------------------ */
/* Sur les pages courtes, le hero reste visible alors que le fond a
   déjà changé : son texte doit suivre l'encre, comme les sections.
   La home est exclue : son rendu est déjà validé. */
.hero:not(.home-hero),
.hero-simple { color: var(--ink); }
.hero:not(.home-hero) .lead,
.hero-simple .lead { color: var(--ink); }

/* Les boutons contour suivent l'encre, sinon contour blanc invisible
   sur fond clair. Survol en orange, lisible sur toute teinte. */
.btn-outline {
  color: var(--ink);
  border-color: var(--ink);
}
.btn-outline:hover {
  background-color: var(--color-orange);
  border-color: var(--color-orange);
  color: var(--color-black);
}

/* Les titres ne se coupent jamais au milieu d'un mot. Le débordement
   horizontal est déjà géré par min-width: 0 sur .hero-content plus haut,
   et les clamp() ont été calibrés pour que les mots français longs
   tiennent dans leur colonne aux différents breakpoints. */
h1, h2, h3, .h1, .h2, .h3 {
  overflow-wrap: normal;
  word-break: normal;
  hyphens: manual;
}

/* Hero un peu plus compact sur petits écrans : les mots longs
   ("accompagnement"...) rentrent sans se couper. Home non touchée. */
@media (max-width: 560px) {
  .hero-simple h1,
  .hero:not(.home-hero) h1 { font-size: clamp(2rem, 7.5vw, 3rem); }
}

/* Academie et Coaching : leur hero doit remplir le viewport pour que
   la section suivante n'entre pas dans la zone d'interpolation du
   bg-layer au chargement initial (voir js/animations.js, le scrub
   commence à 'top 80%' de la section suivante). Sans cette règle, le
   fond apparaît gris au lieu de noir franc tant qu'on n'a pas scrollé. */
body[data-page="academie"] .hero-simple,
body[data-page="coaching"] .hero-simple {
  min-height: calc(100svh - var(--header-height));
  display: flex;
  align-items: center;
}
