/* Introduction mobile : composition commune à la vraie page d'accueil
   et à l'introduction réinsérée pendant le retour depuis Infos / Mentions légales.
   Aucune règle desktop n'est modifiée. */
.hero-name-mobile { display: none; }
.hero-mobile-mascot { display: none; }

@media (max-width: 900px) {
  .hero, .solene-return-hero {
    box-sizing: border-box;
    min-height: 100svh;
    padding: 0 20px;
  }

  .hero .hero-content,
  .solene-return-hero .hero-content {
    box-sizing: border-box;
    min-height: 100svh;
    padding: 12px 0 calc(75px + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    position: relative;
  }

  .hero h1, .solene-return-hero h1 {
    margin: 0;
    width: 100%;
    font-size: clamp(66px, calc(31.4vw - 12px), 275px);
    line-height: 1.05;
    font-weight: 400;
    letter-spacing: -0.075em;
    white-space: nowrap;
  }

  .hero-name-desktop { display: none; }
  .hero-name-mobile { display: inline; white-space: nowrap; }
  .hero-mobile-o { position: relative; }

  .hero-mobile-mascot {
    display: block;
    position: absolute;
    top: 1.015em;
    left: calc(50% - .23em);
    width: clamp(65px, 20.5vw, 180px);
    height: auto;
    pointer-events: none;
    transform-origin: 38% 4%;
    animation: solene-mobile-mascot-swing 2s ease-in-out infinite;
  }

  /* Aucun filet sous la mascotte : l'image seule est accrochée au « o ». */
  .hero-mobile-o::after { content: none; }

  @keyframes solene-mobile-mascot-swing {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
  }

  .hero .intro-line,
  .solene-return-hero .intro-line {
    font-size: var(--solene-mobile-intro-font-size, 25px);
    line-height: 1.25;
    letter-spacing: 0;
    font-weight: 400;
    margin: 0;
  }

  /* La présentation de la page Infos utilise la même taille et le même interligne. */
  .infos-page .infos-description {
    font-size: var(--solene-mobile-intro-font-size, 25px);
    line-height: 1.25;
  }

  /* La mention entière ne se sépare pas en plein milieu sur les iPhone usuels. */
  .hero .intro-mobile-keep-phrase,
  .solene-return-hero .intro-mobile-keep-phrase { white-space: nowrap; }
  .hero .intro-mobile-keep-pair,
  .solene-return-hero .intro-mobile-keep-pair { white-space: nowrap; }

  .hero .intro-line:first-of-type,
  .solene-return-hero .intro-line:first-of-type {
    margin-top: auto;
  }

  /* Le point reste visible. La mascotte est désormais attachée au prénom. */
  .hero .intro-anchor,
  .solene-return-hero .intro-anchor {
    display: inline;
    position: static;
  }
  .hero .intro-anchor .mascotte,
  .solene-return-hero .intro-anchor .mascotte {
    display: none;
  }

  /* Replacer le header AU PIED de l'introduction, puis en haut de la galerie.
     Le script d'accueil contrôle top et la classe .is-fixed. */
  #accueil ~ #site-header {
    position: absolute;
    height: auto;
    min-height: 0;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: clamp(22px, 6.9vw, 28px);
    line-height: 1.15;
    letter-spacing: -0.065em;
  }

  #accueil ~ #site-header.is-fixed {
    position: fixed;
    top: 0;
  }

  html.direct-projects #site-header {
    position: fixed;
    top: 0 !important;
  }

  /* Ne jamais retirer l'introduction au milieu du scroll natif iOS :
     elle reste hors-champ sous la galerie sans déclencher de recalcul de page. */
  body.projects-active.projects-active-keep-intro #accueil {
    display: flex !important;
  }

  /* La grille suit immédiatement l'introduction quand elle est visible.
     Une fois l'intro masquée, l'espacement sous le header reste conservé. */
  #accueil ~ .projects { padding-top: 76px; }
}

@media (max-width: 900px) and (max-height: 670px) {
  .hero .hero-content,
  .solene-return-hero .hero-content {
    padding-bottom: 65px;
  }
  .hero .intro-line,
  .solene-return-hero .intro-line {
    font-size: var(--solene-mobile-intro-font-size, 25px);
    line-height: 1.25;
  }
}

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

/* Sur les très petits téléphones, la phrase peut se couper avant « et les
   lieux » pour éviter tout débordement hors de l'écran. */
@media (max-width: 359px) {
  .hero .intro-mobile-keep-phrase,
  .solene-return-hero .intro-mobile-keep-phrase { white-space: normal; }
}
/* PrÃ©nom seul uniquement sur tÃ©lÃ©phone (600 px ou moins).
   De 601 Ã  900 px, retour au nom complet et Ã  sa taille desktop fluide.
   A coller Ã€ LA FIN de assets/css/mobile-intro.css. */
@media (min-width: 601px) and (max-width: 900px) {
  .hero .hero-name-mobile,
  .solene-return-hero .hero-name-mobile {
    display: none;
  }
  .hero .hero-name-desktop,
  .solene-return-hero .hero-name-desktop {
    display: inline;
  }
  .hero h1,
  .solene-return-hero h1 {
    font-size: calc(11.8vw - 6px);
  }
}
/* TABLETTES / FENÃŠTRES Ã‰TROITES : COMPOSITION D'INTRODUCTION DESKTOP.
   Entre 601 et 900 px, le nom complet, le texte sous le nom et la mascotte
   au point final se comportent comme sur ordinateur.
   La composition mobile Â« SolÃ¨ne Â» + mascotte suspendue reste <= 600 px. */
@media (min-width: 601px) and (max-width: 900px) {
  .hero,
  .solene-return-hero {
    padding-right: var(--margin, 20px);
    padding-left: var(--margin, 20px);
  }

  .hero .hero-content,
  .solene-return-hero .hero-content {
    display: block;
    min-height: 0;
    padding: 5px 0 0;
  }

  .hero .hero-name-mobile,
  .solene-return-hero .hero-name-mobile {
    display: none;
  }

  .hero .hero-name-desktop,
  .solene-return-hero .hero-name-desktop {
    display: inline;
  }

  .hero h1,
  .solene-return-hero h1 {
    font-size: calc(11.8vw - 6px);
  }

  .hero .intro-line,
  .solene-return-hero .intro-line {
    margin: 0;
    font-size: clamp(18px, 2.43vw, 35px);
    line-height: 1.25;
    letter-spacing: -0.055em;
    font-weight: 400;
  }

  .hero .intro-line:first-of-type,
  .solene-return-hero .intro-line:first-of-type {
    margin-top: 5px;
  }

  /* Sur ce format, conserver les retours de ligne naturels du desktop. */
  .hero .intro-mobile-keep-phrase,
  .solene-return-hero .intro-mobile-keep-phrase,
  .hero .intro-mobile-keep-pair,
  .solene-return-hero .intro-mobile-keep-pair {
    white-space: normal;
  }

  /* Mascotte desktop ancrÃ©e Ã  la ponctuation du texte, et non au prÃ©nom. */
  .hero .intro-anchor,
  .solene-return-hero .intro-anchor {
    position: relative;
    display: inline-block;
  }

  .hero .intro-anchor .mascotte,
  .solene-return-hero .intro-anchor .mascotte {
    position: absolute;
    display: inline-flex;
    left: calc(50% - 35px);
    top: 70%;
    width: 100px;
    height: auto;
    transform-origin: 37% 4%;
    animation: swing 2s ease-in-out infinite;
  }
}

@media (min-width: 601px) and (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .hero .intro-anchor .mascotte,
  .solene-return-hero .intro-anchor .mascotte {
    animation: none;
  }
}
/* AJUSTEMENT DE L'INTRODUCTION â€” SEUIL MOBILE Ã€ 500 PX
   Ã€ placer tout Ã  la fin de assets/css/mobile-intro.css.
   Jusqu'Ã  500px : composition tÃ©lÃ©phone Â« SolÃ¨ne Â» / mascotte au Â« o Â».
   De 501 Ã  900px : composition nom complet / texte sous le nom.
   Ã€ partir de 901px : composition desktop habituelle.
*/

@media (min-width: 501px) and (max-width: 900px) {
  .hero,
  .solene-return-hero {
    padding-left: var(--margin, 20px);
    padding-right: var(--margin, 20px);
  }

  .hero .hero-content,
  .solene-return-hero .hero-content {
    display: block;
    min-height: 0;
    padding: 5px 0 0;
  }

  .hero .hero-name-mobile,
  .solene-return-hero .hero-name-mobile {
    display: none;
  }

  .hero .hero-name-desktop,
  .solene-return-hero .hero-name-desktop {
    display: inline;
  }

  .hero h1,
  .solene-return-hero h1 {
    font-size: calc(11.8vw - 6px);
  }

  /* Dans cette composition, laisser les mots se rÃ©partir naturellement. */
  .hero .intro-mobile-keep-phrase,
  .solene-return-hero .intro-mobile-keep-phrase,
  .hero .intro-mobile-keep-pair,
  .solene-return-hero .intro-mobile-keep-pair {
    white-space: normal;
  }

  /* Replacer la mascotte desktop sur le point final du texte. */
  .hero .intro-anchor,
  .solene-return-hero .intro-anchor {
    display: inline-block;
    position: relative;
  }

  .hero .intro-anchor .mascotte,
  .solene-return-hero .intro-anchor .mascotte {
    position: absolute;
    display: inline-flex;
    left: calc(50% - clamp(26px, 3.6vw, 35px));
    top: 70%;
    width: clamp(70px, 13.3vw, 100px);
    height: auto;
    transform-origin: 37% 4%;
    animation: swing 2s ease-in-out infinite;
  }
}

/* Le texte suit une Ã©chelle continue lorsque le NOM COMPLET est visible.
   501px : ~25px ; 900px : ~29px ; 1440px : 35px.
   L'espacement sous le nom suit lui aussi la largeur de l'Ã©cran.
   Au-delÃ  de 1440px, le CSS grand Ã©cran dÃ©jÃ  installÃ© reprend la main. */
@media (min-width: 501px) and (max-width: 1440px) {
  .hero .intro-line,
  .solene-return-hero .intro-line {
    margin: 0;
    font-size: clamp(25px, calc(1.0638vw + 19.68px), 35px);
    line-height: 1.25;
    letter-spacing: -0.055em;
    font-weight: 400;
  }

  .hero .intro-line:first-of-type,
  .solene-return-hero .intro-line:first-of-type {
    margin-top: clamp(10px, 1.5vw, 22px);
  }
}

@media (min-width: 501px) and (max-width: 900px) and (prefers-reduced-motion: reduce) {
  .hero .intro-anchor .mascotte,
  .solene-return-hero .intro-anchor .mascotte {
    animation: none;
  }
}