/* ==========================================================================
   AKELION — Page BlueGuest
   Complète style.css et components.css
   ========================================================================== */


/* --------------------------------------------------------------------------
   Options : les noms de packs restent lisibles dans le corps de texte
   -------------------------------------------------------------------------- */

.use p strong {
  display: inline;
  color: var(--paper);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Saisonnalité — sélecteur interactif
   -------------------------------------------------------------------------- */

.seasons {
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.015);
  padding: clamp(1.25rem, 2.6vw, 2rem);
}

.seasons__title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

.seasons__title--sub {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line-soft);
}

.seasons__tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

/* Onglet de saison */
.season {
  display: grid;
  gap: 0.15rem;
  padding: 0.95rem 0.85rem 0.8rem;
  background: transparent;
  border: 1px solid var(--line-soft);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out);
}

.season:hover { border-color: rgba(255, 255, 255, 0.2); }

.season[aria-selected="true"] {
  border-color: var(--lime);
  background: rgba(195, 210, 0, 0.05);
}

.season__val {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.1vw, 1.6rem);
  font-stretch: 106%;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text-muted);
  transition: color 0.3s var(--ease-out);
}

.season[aria-selected="true"] .season__val { color: var(--lime); }

.season__unit {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}

.season__name {
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Jauge de débit */
.season__bar {
  display: block;
  height: 3px;
  margin-top: 0.7rem;
  background: rgba(255, 255, 255, 0.09);
}

.season__bar i {
  display: block;
  height: 100%;
  width: var(--fill, 0%);
  background: var(--text-faint);
  transition: background 0.35s var(--ease-out);
}

.season[aria-selected="true"] .season__bar i { background: var(--lime); }

.seasons__panels { margin-top: 1.15rem; min-height: 5.25rem; }

.seasons__panel {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-muted);
  animation: season-in 0.35s var(--ease-out);
}

.seasons__panel[hidden] { display: none; }
.seasons__panel strong { color: var(--paper); font-weight: 600; }

@keyframes season-in {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: none; }
}

/* Boucle de régulation */
.loop {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  counter-reset: loop;
}

.loop__step { display: grid; gap: 0.2rem; position: relative; }

.loop__i {
  display: block;
  width: 8px;
  height: 8px;
  background: var(--lime);
  clip-path: var(--octagon);
  margin-bottom: 0.55rem;
}

/* Trait de liaison entre étapes */
.loop__step::after {
  content: "";
  position: absolute;
  top: 3.5px;
  left: 14px;
  right: -0.75rem;
  height: 1px;
  background: repeating-linear-gradient(90deg,
    var(--line-soft) 0 4px, transparent 4px 8px);
}

.loop__step:last-child::after { display: none; }

.loop__name {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
}

.loop__desc {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-faint);
}

@media (max-width: 620px) {
  .seasons__tabs { grid-template-columns: 1fr; }
  .loop { grid-template-columns: repeat(2, 1fr); gap: 1.1rem 0.75rem; }
  .loop__step::after { display: none; }
  .seasons__panels { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .seasons__panel { animation: none; }
}


/* --------------------------------------------------------------------------
   Scène 3D — citerne à droite, chapitres à gauche
   -------------------------------------------------------------------------- */

.bg-scrolly {
  position: relative;
  /* 4 chapitres et leurs pauses de lecture (vue de dessus, transparence) */
  height: 480vh;
  height: 480svh;
}

.bg-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(64% 52% at 68% 46%, rgba(61, 59, 122, 0.4), transparent 70%),
    linear-gradient(180deg, var(--navy-850), var(--navy-900) 55%, var(--navy-950));
  border-block: 1px solid var(--line-soft);
}

.bg-stage__canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 1.1s var(--ease-out);
}

.bg-stage__canvas.is-ready { opacity: 1; }

/* Cotes de l'emprise au sol, posées sur le plan par blueguest3d.js */
.bg-dims {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
}

.bg-dims[hidden] { display: none; }

.bg-dim {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0.3rem 0.6rem;
  background: rgba(8, 8, 26, 0.72);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--paper);
  white-space: nowrap;
  will-change: transform;
}

.bg-dim--area {
  border-color: var(--lime);
  color: var(--lime);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Voile permanent : garde le texte lisible sans clignoter entre chapitres */
.bg-scrim {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(8, 8, 26, 0.9) 0%,
    rgba(8, 8, 26, 0.78) 30%,
    rgba(8, 8, 26, 0.42) 48%,
    transparent 66%
  );
}

.bg-chapters { position: absolute; inset: 0; z-index: 3; pointer-events: none; }

/* Seuls les liens du chapitre visible sont cliquables */
.bg-chapter.is-on a { pointer-events: auto; }

.bg-chapter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  /* Dégage la barre de navigation, fixe au-dessus de la scène */
  padding-top: 5rem;
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
}

.bg-chapter.is-on { opacity: 1; }

.bg-chapter__inner {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.bg-chapter__box {
  max-width: 33rem;
  transform: translateY(16px);
  transition: transform 0.75s var(--ease-out);
}

.bg-chapter.is-on .bg-chapter__box { transform: none; }

.bg-chapter__title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.2vw, 3.2rem);
  font-stretch: 108%;
  font-weight: 700;
  letter-spacing: -0.033em;
  line-height: 1.02;
  color: var(--paper);
  margin-bottom: 1.35rem;
}

.bg-chapter__title sup { font-size: 0.28em; vertical-align: super; }

/* Premier chapitre : il fait office de hero */
.bg-chapter__title--hero {
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  font-stretch: 112%;
  letter-spacing: -0.04em;
  line-height: 0.95;
  margin-bottom: 1.5rem;
}

.bg-chapter__cta { margin-top: 2.25rem; }

.bg-chapter__text {
  color: rgba(215, 216, 226, 0.92);
  font-size: clamp(0.98rem, 1.15vw, 1.08rem);
  line-height: 1.68;
  max-width: 40ch;
}

.bg-chapter__title,
.bg-chapter__text,
.bg-chapter .eyebrow,
.bg-chapter .chapter__hint {
  text-shadow: 0 1px 12px rgba(8, 8, 26, 0.95), 0 0 34px rgba(8, 8, 26, 0.75);
}

/* Chaîne de procédés, en ligne dans le chapitre */
.bg-chain {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  margin: 1.75rem 0 0;
  padding: 0;
}

.bg-chain li {
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line-soft);
  background: rgba(8, 8, 26, 0.5);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}


/* Repères chiffrés */
.bg-facts { list-style: none; margin: 1.75rem 0 0; padding: 0; display: grid; gap: 0.9rem; }

.bg-facts li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line-soft);
}

.bg-facts b {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-stretch: 104%;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--lime);
}

.bg-facts span {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Indicateur de progression */
.bg-dots {
  position: absolute;
  z-index: 4;
  right: var(--gutter);
  bottom: 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: flex-end;
}

.bg-dot {
  width: 22px;
  height: 2px;
  background: rgba(255, 255, 255, 0.16);
  transition: background 0.4s var(--ease-out), width 0.4s var(--ease-out);
}

.bg-dot.is-on { background: var(--lime); width: 34px; }


@media (max-width: 900px) {
  .bg-scrolly { height: 420vh; height: 420svh; }
  /* Téléphone : le texte part du bandeau du site, sans marge perdue.
     Chapitre d'ouverture : texte d'un seul tenant en haut, boutons calés
     en bas de l'écran ; l'image est en fond. Autres chapitres : texte en
     haut, image plus bas (components.css, .stills). */
  .bg-chapter { align-items: flex-start; padding: calc(81px + 1rem) 0 max(1.25rem, env(safe-area-inset-bottom)); }
  .bg-chapter:first-child { align-items: stretch; }
  .bg-chapter:first-child .bg-chapter__inner,
  .bg-chapter:first-child .bg-chapter__box { display: flex; flex-direction: column; }
  .bg-chapter:first-child .bg-chapter__box { flex: 1; min-height: 0; justify-content: flex-end; }
  .bg-chapter .bg-chapter__cta { margin-top: 1.5rem; }
  /* Taille ajustée par main.js (--fit) pour coller le texte aux boutons */
  .bg-chapter:first-child .bg-chapter__title { font-size: calc(1.9rem * var(--fit, 1)); }
  .bg-chapter:first-child .bg-chapter__text { font-size: calc(0.98rem * (0.4 + 0.6 * var(--fit, 1))); }
  .bg-chapter .chapter__hint { display: none; }
  .bg-chapter__box { max-width: none; }
  .bg-chapter__text { max-width: none; }

  /* Texte en haut : le voile part du haut de l'écran */
  .bg-scrim { background: linear-gradient(180deg, rgba(8, 8, 26, 0.88) 0%, rgba(8, 8, 26, 0.6) 30%, rgba(8, 8, 26, 0.2) 50%, transparent 66%); }

  /* Le compteur de chapitres chevaucherait le surtitre */
  .bg-dots { display: none; }
  .bg-facts li { grid-template-columns: 5.5rem 1fr; }

  .bg-dim { font-size: 0.68rem; padding: 0.22rem 0.45rem; }
  .bg-dim--area { font-size: 0.76rem; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-chapter__box { transform: none; }
}

/* Titre d'entrée long (phrase) : plus petit que le nom de produit seul */
.bg-chapter__title--lead { font-size: clamp(1.9rem, 3.8vw, 3.1rem); line-height: 1.04; }

/* --------------------------------------------------------------------------
   Téléphone : défilement continu (main.js, section 10)
   Pas de 3D ni de scène épinglée : les chapitres se suivent comme une page
   normale, séparés par un filet ; le croquis reste fixe en fond pendant
   que le texte défile. Le premier écran garde sa mise en page (texte collé
   aux boutons, voir plus haut).
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .bg-scrolly { height: auto; }
  .bg-stage { position: relative; height: auto; overflow: visible; }
  .bg-stage__canvas, [data-bg-loader], .bg-dots { display: none; }
  .bg-scrim { display: none; }

  .has-stills .stills {
    position: sticky;
    inset: auto;
    top: 0;
    height: 100vh;
    height: 100svh;
    margin-bottom: -100vh;
    margin-bottom: -100svh;
  }

  .bg-chapters { position: relative; inset: auto; pointer-events: auto; }
  .bg-chapter { position: relative; inset: auto; opacity: 1; }
  .bg-chapter__box { transform: none; }
  .bg-chapter:first-child { height: 100vh; height: 100svh; }

  .bg-chapter + .bg-chapter {
    padding: 3rem 0 3.25rem;
    border-top: 1px solid var(--line-soft);
  }
  .bg-chapter:last-child { padding-bottom: 5rem; }

  /* Texte un peu plus grand que dans la scène épinglée */
  .bg-chapter + .bg-chapter .bg-chapter__title { font-size: 2.3rem; line-height: 1.02; margin-bottom: 1.1rem; }
  .bg-chapter + .bg-chapter .bg-chapter__text { font-size: 1.04rem; line-height: 1.65; }

  /* Le croquis, achevé à la fin du dernier chapitre, reste en place : la
     section suivante monte par-dessus et le recouvre (comme Dynafilter) */
  .bg-chapters { padding-bottom: 100vh; padding-bottom: 100svh; }
  .bg-scrolly + .band {
    z-index: 4;
    margin-top: -100vh;
    margin-top: -100svh;
    background: var(--navy-900);
    box-shadow: 0 -30px 60px rgba(8, 8, 26, 0.6);
  }
}
