/**
 * Scène finale — téléphone d’abord, respiration au bureau, mouvement tenu.
 * Chargée après premium.css (et après mobile-home.css sur l’accueil).
 */

/* Filet de lecture : une ligne, pas un gadget. */
.majj-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 600;
  pointer-events: none;
  background: transparent;
}

.majj-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: #2F51B2;
}

/* -------------------------------------------------------------------------- */
/* Bureau — plus d’air, mesure lisible, grilles qui respirent                */
/* -------------------------------------------------------------------------- */
@media (min-width: 1100px) {
  .section,
  .charte-majj-officiel .section,
  .publications {
    padding-block: clamp(5.5rem, 7.2vw, 8rem);
  }

  .page-hero,
  .charte-majj-officiel .page-hero {
    padding-block: clamp(8.5rem, 12vh, 11rem) clamp(4.25rem, 6vh, 6.5rem);
  }

  .section-subtitle,
  .section-subtitle--centered,
  .charte-majj-officiel .section-subtitle {
    max-width: 38rem;
  }

  .cabinet-read,
  .charte-majj-officiel .cabinet-read {
    gap: clamp(2.75rem, 4.5vw, 5rem);
    align-items: start;
  }

  .contact__inner,
  .charte-majj-officiel .contact__inner {
    gap: clamp(3rem, 5vw, 5.5rem);
    align-items: start;
  }

  .values-grid,
  .why-grid,
  .references__grid,
  .publications__grid,
  .contact-ways__grid {
    gap: clamp(1.25rem, 2vw, 2rem);
  }

  .vision__quote,
  .charte-majj-officiel .vision__quote {
    max-width: 40rem;
    margin-inline: auto;
  }
}

/* -------------------------------------------------------------------------- */
/* Téléphone — composition écrite pour la main, toutes les pages             */
/* -------------------------------------------------------------------------- */
@media (max-width: 639px) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .container,
  .charte-majj-officiel .container {
    padding-inline: 1.25rem;
  }

  .section,
  .charte-majj-officiel .section,
  .publications {
    padding-block: 3.15rem 3.4rem;
  }

  .section-title,
  .charte-majj-officiel .section-title,
  .charte-majj-officiel h2.section-title {
    font-size: clamp(1.55rem, 7.2vw, 1.9rem);
    line-height: 1.18;
    letter-spacing: -0.02em;
    text-align: left;
    max-width: none;
    margin-inline: 0;
  }

  .text-center .section-title,
  .section-title.text-center,
  .charte-majj-officiel .text-center .section-title {
    text-align: left;
  }

  .section-subtitle,
  .section-subtitle--centered,
  .charte-majj-officiel .section-subtitle {
    text-align: left;
    margin-inline: 0;
    max-width: 36rem;
    font-size: 1rem;
    line-height: 1.55;
  }

  .accent-line.mx-auto,
  .charte-majj-officiel .accent-line.mx-auto {
    margin-inline: 0;
  }

  /* Accueil : le titre se lit en affiche, pas en colonne de 13 caractères. */
  .majj-front-page .hero,
  .charte-majj-officiel.majj-front-page .hero {
    min-height: 100svh;
    min-height: 100dvh;
  }

  .majj-front-page .hero__content,
  .charte-majj-officiel.majj-front-page .hero__content {
    padding-bottom: 5.5rem;
  }

  .majj-front-page .hero__title,
  .charte-majj-officiel.majj-front-page .hero__title {
    max-width: 12em;
    font-size: clamp(2.05rem, 9.2vw, 2.65rem);
    line-height: 1.08;
    letter-spacing: -0.032em;
  }

  .majj-front-page .hero__chapo,
  .charte-majj-officiel.majj-front-page .hero__chapo {
    max-width: 28em;
    font-size: 1.05rem;
    line-height: 1.45;
  }

  .majj-front-page .hero__cta,
  .charte-majj-officiel.majj-front-page .hero__cta {
    flex-direction: column;
    align-items: stretch;
    max-width: 100%;
    gap: 0.65rem;
  }

  .majj-front-page .hero__cta .btn,
  .charte-majj-officiel.majj-front-page .hero__cta .btn {
    width: 100%;
    justify-content: center;
    min-height: 3rem;
  }

  .whatsapp-float {
    right: 0.85rem;
    bottom: calc(0.85rem + env(safe-area-inset-bottom));
    width: 3.15rem;
    height: 3.15rem;
  }

  /* Héros internes : une entrée, pas un bandeau de bureau. */
  .page-hero,
  .charte-majj-officiel .page-hero {
    min-height: 0;
    padding: 6.35rem 0 2.35rem;
    text-align: left;
  }

  .page-hero .container,
  .charte-majj-officiel .page-hero .container {
    text-align: left;
  }

  .page-hero h1,
  .charte-majj-officiel .page-hero h1 {
    font-size: clamp(1.85rem, 8vw, 2.35rem);
    line-height: 1.12;
    letter-spacing: -0.028em;
    max-width: 14em;
    text-align: left;
    margin-inline: 0;
  }

  .page-hero p,
  .charte-majj-officiel .page-hero p {
    text-align: left;
    max-width: 34em;
    margin-inline: 0;
  }

  .breadcrumb {
    justify-content: flex-start;
  }

  /* Identité */
  .cabinet-read,
  .charte-majj-officiel .cabinet-read {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
  }

  .cabinet-read__story p,
  .charte-majj-officiel .cabinet-read__story p {
    font-size: 1.02rem;
    line-height: 1.65;
  }

  .stats-bar__inner,
  .charte-majj-officiel .stats-bar__inner {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .stats-bar__item,
  .charte-majj-officiel .stats-bar__item {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 0.85rem 1rem;
    text-align: left;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(11, 43, 102, 0.12);
  }

  .stats-bar__item .counter,
  .charte-majj-officiel .stats-bar__item .counter {
    font-size: 1.85rem;
    line-height: 1;
  }

  .stats-bar__item p {
    margin: 0;
  }

  .values-grid,
  .why-grid,
  .charte-majj-officiel .values-grid,
  .charte-majj-officiel .why-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }

  .vision__quote,
  .charte-majj-officiel .vision__quote {
    font-size: 1.2rem;
    line-height: 1.45;
    text-align: left;
  }

  /* Expertises : onglets au pouce, scène en dessous. */
  .expertise-reader,
  .charte-majj-officiel .expertise-reader {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .expertise-reader__nav,
  .charte-majj-officiel .expertise-reader__nav {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.4rem;
    margin-inline: -1.25rem;
    padding-inline: 1.25rem;
    -webkit-overflow-scrolling: touch;
  }

  .expertise-reader__tab,
  .charte-majj-officiel .expertise-reader__tab {
    flex: 0 0 auto;
    scroll-snap-align: start;
    max-width: 15.5rem;
    min-height: 2.75rem;
    text-align: left;
  }

  .expertise-reader__visual,
  .charte-majj-officiel .expertise-reader__visual {
    height: 11.5rem;
  }

  .expertise-reader__title,
  .charte-majj-officiel .expertise-reader__title {
    font-size: 1.45rem;
    line-height: 1.2;
  }

  /* Références et publications : une carte à la fois. */
  .references__grid,
  .references__grid--2,
  .publications__grid,
  .charte-majj-officiel .references__grid,
  .charte-majj-officiel .publications__grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .majj-front-page .publications__grid,
  .charte-majj-officiel.majj-front-page .publications__grid {
    overflow: visible;
    margin-inline: 0;
    padding: 0;
    scroll-snap-type: none;
  }

  .majj-front-page .publications__grid > .pub-card,
  .majj-front-page .publications__grid > .publications__card,
  .charte-majj-officiel.majj-front-page .publications__grid > .pub-card,
  .charte-majj-officiel.majj-front-page .publications__grid > .publications__card {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
  }

  .filter-bar,
  .charte-majj-officiel .filter-bar {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.45rem;
    overflow-x: auto;
    margin-inline: -1.25rem;
    padding-inline: 1.25rem 1.5rem;
    padding-bottom: 0.35rem;
    -webkit-overflow-scrolling: touch;
  }

  .filter-btn {
    flex: 0 0 auto;
    min-height: 2.6rem;
  }

  /* Contact */
  .contact-ways__grid,
  .charte-majj-officiel .contact-ways__grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .contact-way,
  .charte-majj-officiel .contact-way {
    min-height: 0;
    padding: 1.15rem 1.1rem;
  }

  .contact__inner,
  .charte-majj-officiel .contact__inner {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .contact__title,
  .contact__form-title,
  .charte-majj-officiel .contact__title {
    text-align: left;
  }

  .contact-form input,
  .contact-form textarea,
  .contact-form select,
  .form-group input,
  .form-group textarea,
  .form-group select,
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px;
  }

  .faq__grid {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
  }

  .faq-item__question {
    min-height: 3rem;
    text-align: left;
  }

  /* Profil */
  .expert__inner,
  .expert-page__intro,
  .charte-majj-officiel .expert__inner {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
  }

  .expert__photo,
  .charte-majj-officiel .expert__photo {
    width: 100%;
    max-width: 100%;
  }

  .expert__portrait,
  .charte-majj-officiel .expert__portrait {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center top;
  }

  .team-stage__people,
  .charte-majj-officiel .team-stage__people {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.55rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: -1.25rem;
    padding-inline: 1.25rem 1.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .team-stage__person {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  /* Pied et menu : zones au pouce. */
  .footer__grid,
  .charte-majj-officiel .footer__grid {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
  }

  .header__hamburger {
    min-width: 2.75rem;
    min-height: 2.75rem;
  }

  .header__nav-link {
    min-height: 2.75rem;
  }
}

/* -------------------------------------------------------------------------- */
/* Mouvement — plus lent, plus précis, sur toutes les pages                  */
/* -------------------------------------------------------------------------- */
html.majj-motion .page-hero--photo .page-hero__media {
  animation: majj-hero-settle 3.2s cubic-bezier(0.45, 0, 0.15, 1) both;
}

html.majj-motion .hero.loaded .hero__tagline,
html.majj-motion .hero.loaded .hero__title,
html.majj-motion .hero.loaded .hero__chapo,
html.majj-motion .hero.loaded .hero__description,
html.majj-motion .hero.loaded .hero__cta .btn,
html.majj-motion .page-hero.loaded .breadcrumb,
html.majj-motion .page-hero.loaded h1,
html.majj-motion .page-hero.loaded p {
  animation-name: majj-soft-rise, majj-soft-glow;
  animation-duration: 1.9s, 2.4s;
  animation-timing-function: cubic-bezier(0.45, 0, 0.15, 1), cubic-bezier(0.45, 0, 0.15, 1);
  animation-fill-mode: both, both;
}

@keyframes majj-soft-glow {
  from {
    text-shadow: 0 0 26px rgba(186, 198, 245, 0.42);
  }
  to {
    text-shadow: 0 0 0 rgba(186, 198, 245, 0);
  }
}

@keyframes majj-hero-settle {
  from {
    transform: scale(1.08);
  }
  to {
    transform: scale(1);
  }
}

html.majj-motion .majj-breath {
  transform: translate3d(0, 36px, 0) scale(0.99);
  filter: drop-shadow(0 22px 36px rgba(75, 109, 199, 0.16));
  transition:
    opacity 1.75s cubic-bezier(0.45, 0, 0.15, 1),
    transform 2.05s cubic-bezier(0.45, 0, 0.15, 1),
    filter 2.25s cubic-bezier(0.45, 0, 0.15, 1);
  transition-delay: var(--majj-delay, 0ms);
}

html.majj-motion .majj-breath.majj-in {
  filter: drop-shadow(0 0 0 rgba(75, 109, 199, 0));
}

html.majj-motion .team-cover.majj-in:hover .team-cover__photo img,
html.majj-motion .mission-card.majj-in:hover img,
html.majj-motion .pub-card.majj-in:hover img {
  transform: scale(1.045);
}

html.majj-motion .team-cover__photo img,
html.majj-motion .mission-card img,
html.majj-motion .pub-card img,
html.majj-motion .expert__portrait {
  transition: transform 1.25s cubic-bezier(0.45, 0, 0.15, 1);
}

@media (hover: hover) and (pointer: fine) {
  html.majj-motion .contact-way.majj-in:hover,
  html.majj-motion .value-card.majj-in:hover,
  html.majj-motion .mission-card.majj-in:hover,
  html.majj-motion .pub-card.majj-in:hover,
  html.majj-motion .team-cover.majj-in:hover {
    transform: translate3d(0, -4px, 0);
  }
}

@media (max-width: 639px) {
  html.majj-motion .contact-way.majj-in:hover,
  html.majj-motion .value-card.majj-in:hover,
  html.majj-motion .mission-card.majj-in:hover,
  html.majj-motion .pub-card.majj-in:hover,
  html.majj-motion .expertise-index__item:hover,
  html.majj-motion .team-cover.majj-in:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .majj-progress {
    display: none;
  }

  html.majj-motion .page-hero--photo .page-hero__media,
  html.majj-motion .team-cover__photo img,
  html.majj-motion .mission-card img,
  html.majj-motion .pub-card img,
  html.majj-motion .expert__portrait,
  html.majj-motion .majj-breath,
  html.majj-motion .majj-breath.majj-in {
    animation: none;
    transition: none;
    transform: none;
    filter: none;
  }
}
/* Textes longs : fondu lent, halo discret, sans essuyage. */
html.majj-motion .majj-prose {
  opacity: 0;
  text-shadow: 0 0 28px rgba(186, 198, 245, 0.48);
  transition:
    opacity 1.9s cubic-bezier(0.45, 0, 0.15, 1) var(--majj-delay, 0ms),
    text-shadow 2.4s cubic-bezier(0.45, 0, 0.15, 1) var(--majj-delay, 0ms);
}

html.majj-motion .majj-prose.majj-glow {
  opacity: 1;
  text-shadow: 0 0 0 rgba(75, 109, 199, 0);
}

@media (prefers-reduced-motion: reduce) {
  html.majj-motion .majj-prose,
  html.majj-motion .majj-prose.majj-glow {
    animation: none;
    opacity: 1;
    filter: none;
    text-shadow: none;
    -webkit-mask-image: none;
    mask-image: none;
    transition: none;
  }
}
/* Telephone : les filets de section disparaissent. Pas de panneau sur les photos. */
@media (max-width: 639px) {
  .accent-line,
  .charte-majj-officiel .accent-line {
    display: none;
  }

  .stats-bar,
  .charte-majj-officiel .stats-bar {
    border-top: 0;
    border-bottom: 0;
  }

  .stats-bar__item + .stats-bar__item::before,
  .charte-majj-officiel .stats-bar__item + .stats-bar__item::before,
  .charte-majj-officiel .stats-bar--3 .stats-bar__item + .stats-bar__item::before {
    content: none;
  }
}
