
/* mobile.css — mise en page téléphone.
   À charger APRÈS style.css.
   Les règles prioritaires conservent les réglages mobiles existants. */

@media (max-width: 768px) {
  *, *::before, *::after { box-sizing: border-box !important; }
  html { -webkit-text-size-adjust: 100% !important; }
  html, body { max-width: 100% !important; overflow-x: hidden !important; }
  html body img { max-width: 100% !important; }
  html body .logo img,
  html body .footer-icons img { max-width: none !important; }

  body {
    background: none !important;
    background-color: #B1BBFF !important;
  }

  body::before {
    content: "" !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: -2 !important;
    pointer-events: none !important;
    background: linear-gradient(
      to bottom,
      #8090EE 0%,
      #B1BBFF 55%,
      #D0D7FF 100%
    ) !important;
  }

  html body .bg-stripes div { width: 14vw !important; }

  /* En-tête et navigation */
  html body header {
    top: 58px !important;
    padding: 0 12px !important;
  }

  html body .logo {
    top: -46px !important;
    left: 16px !important;
  }

  html body .logo img { height: 40px !important; }

  html body header nav {
    padding: 13px 30px !important;
    border-radius: 40px !important;
  }

  html body nav ul,
  html body header ul { gap: 24px !important; }

  html body header a {
    font-size: 1.05rem !important;
    padding: 8px 0 !important;
    white-space: nowrap !important;
  }

  html body header nav ul li a {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
  }

  html body header nav { display: flex !important; }

  /* Masquer les grands mots décoratifs sur téléphone */
  html body .header-title-bg,
  html body .header-title-bg.cv-left {
    display: none !important;
  }

  /* Page À propos */
  html body .hero {
    min-height: 0 !important;
    padding: 50px 0 10px !important;
  }

  html body .hero-center {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
  }

  html body .laptop {
    display: block !important;
    flex: 0 0 auto !important;
    width: 125% !important;
    max-width: none !important;
    margin: 0 0 10px 0 !important;
  }

  html body .section {
    width: 82% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 6px 0 !important;
    text-align: left !important;
  }

  html body .section h2 {
    font-size: 1.7rem !important;
    text-align: left !important;
    margin-bottom: 16px !important;
  }

  html body .section .description {
    font-size: 1.08rem !important;
    line-height: 1.8 !important;
    text-align: left !important;
    letter-spacing: 0.01em !important;
  }

  /* Portfolio */
  html body .portfolio-section {
    min-height: 0 !important;
    padding-top: 84px !important;
    padding-bottom: 50px !important;
  }

  html body .portfolio-intro {
    width: 82% !important;
    margin: 18px auto 28px !important;
    text-align: left !important;
  }

  html body .portfolio-intro p {
    font-size: 1.08rem !important;
    line-height: 1.8 !important;
    letter-spacing: 0.01em !important;
    margin-bottom: 22px !important;
    text-align: left !important;
  }

  html body .portfolio-pdf-btn {
    padding: 15px 36px !important;
    font-size: 1.05rem !important;
  }

  html body .projects-title {
    margin-bottom: 22px !important;
    padding: 0 20px !important;
  }

  html body .projects-title h2 {
    font-size: 1.7rem !important;
    margin-bottom: 8px !important;
  }

  html body .projects-subtitle { font-size: 0.9rem !important; }

  html body .portfolio-filters {
    width: 92% !important;
    gap: 10px !important;
    margin-bottom: 34px !important;
  }

  html body .filter-btn {
    padding: 12px 22px !important;
    font-size: 0.95rem !important;
  }

  html body .portfolio-grid {
    grid-template-columns: 1fr !important;
    gap: 46px !important;
    width: 94% !important;
    max-width: 560px !important;
    padding: 0 !important;
  }

  html body .project-info h3 {
    font-size: 1.4rem !important;
  }

  html body .project-info p {
    font-size: 1rem !important;
  }

  html body .project-image { margin-bottom: 14px !important; }

  html body .project-image img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Cadre commun pour les images des projets */
  html body .portfolio-grid .project-image {
    aspect-ratio: 1 / 1 !important;
    width: 100% !important;
    align-items: center !important;
  }

  html body .portfolio-grid .project-image img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
  }

  /* Images agrandies dans la catégorie Interfaces */
  html body .portfolio-grid .project-image.ordilum,
  html body .portfolio-grid .project-image.jazzordi,
  html body .portfolio-grid .project-image.darty,
  html body .portfolio-grid .project-image.mot,
  html body .portfolio-grid .project-image.tor {
    aspect-ratio: auto !important;
    overflow: visible !important;
  }

  html body .portfolio-grid .project-image.ordilum img,
  html body .portfolio-grid .project-image.jazzordi img,
  html body .portfolio-grid .project-image.darty img,
  html body .portfolio-grid .project-image.mot img,
  html body .portfolio-grid .project-image.tor img {
    flex: 0 0 auto !important;
    width: 120% !important;
    height: auto !important;
    max-width: none !important;
  }

  /* Images légèrement plus petites */
  html body .portfolio-grid .project-image.presence img,
  html body .portfolio-grid .project-image.cera img,
  html body .portfolio-grid .project-image.orphe img,
  html body .portfolio-grid .project-image.futur img {
    width: 85% !important;
    height: 85% !important;
  }

  /* PAGE STAGE — trois visuels agrandis */
  html body .portfolio-grid
  .project-card[data-project="galerie"] .project-image,
  html body .portfolio-grid
  .project-card[data-project="dh"] .project-image,
  html body .portfolio-grid
  .project-card[data-project="place"] .project-image {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    aspect-ratio: auto !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* Maquette du site de la galerie */
  html body .portfolio-grid
  .project-card[data-project="galerie"] .project-image img,

  /* Identité visuelle Destination Hérault */
  html body .portfolio-grid
  .project-card[data-project="dh"] .project-image img,

  /* Maquette du site La Place créative */
  html body .portfolio-grid
  .project-card[data-project="place"] .project-image img {
    display: block !important;
    flex: 0 0 auto !important;
    width: 140% !important;
    max-width: none !important;
    max-height: none !important;
    height: auto !important;
    object-fit: contain !important;
  }

  /* Page CV */
  html body .cv-section {
    min-height: 0 !important;
    align-items: flex-start !important;
    padding-top: 92px !important;
    padding-bottom: 50px !important;
  }

  html body .cv-container { width: 90% !important; }

  html body .cv-image {
    border-radius: 8px !important;
    margin-bottom: 22px !important;
  }

  html body .download-btn {
    padding: 17px 42px !important;
    font-size: 1.1rem !important;
  }

  /* Contact */
  html body .contact-card { padding: 32px 22px !important; }

  html body .contact-row {
    flex-direction: column !important;
    gap: 22px !important;
  }

  html body .contact-block { min-width: 0 !important; }

  /* Pied de page */
  html body footer,
  html body footer.footer-contact {
    display: block !important;
    text-align: left !important;
    width: 100% !important;
    padding: 26px 9% 70px !important;
    margin-top: 0 !important;
    min-height: 0 !important;
    position: relative !important;
    overflow: hidden !important;
  }

  html body .footer-title {
    position: absolute !important;
    left: 50% !important;
    right: auto !important;
    top: auto !important;
    bottom: -0.48em !important;
    transform: translateX(-50%) !important;
    margin: 0 !important;
    width: auto !important;
    font-size: 19vw !important;
    font-weight: 600 !important;
    letter-spacing: -0.02em !important;
    color: rgba(255,255,255,0.3) !important;
    z-index: 3 !important;
    white-space: nowrap !important;
    text-align: center !important;
  }

  html body .footer-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    position: relative !important;
    z-index: 10 !important;
  }

  html body .footer-block {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 22px 0 !important;
    text-align: left !important;
    border-bottom: 2px solid rgba(255,255,255,0.65) !important;
  }

  html body .footer-block:last-child {
    border-bottom: 0 !important;
    padding-bottom: 6px !important;
  }

  html body .footer-block h3,
  html body .footer-block p {
    display: block !important;
    margin: 0 0 6px !important;
    text-align: left !important;
    white-space: normal !important;
  }

  html body .footer-block h3 {
    font-size: 1.2rem !important;
    font-weight: 600 !important;
  }

  html body .footer-block p { margin: 0 !important; }

  html body .footer-block p a {
    display: inline !important;
    margin: 0 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    text-align: left !important;
    font-size: 1.05rem !important;
  }

  html body .footer-icons {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 18px !important;
    margin: 14px 0 0 !important;
    text-align: left !important;
  }

  html body .footer-icons a {
    display: inline-block !important;
    margin: 0 !important;
  }

  html body .footer-icons img,
  html body .footer-icons a img {
    width: 44px !important;
    height: 44px !important;
  }

  html body .footer-vertical-stripes div:nth-child(1) { width: 14vw !important; }
  html body .footer-vertical-stripes div:nth-child(2) { width: 19vw !important; }
  html body .footer-vertical-stripes div:nth-child(3) { width: 12vw !important; }
  html body .footer-vertical-stripes div:nth-child(4) { width: 20vw !important; }
  html body .footer-vertical-stripes div:nth-child(5) { width: 16vw !important; }
  html body .footer-vertical-stripes div:nth-child(6) { width: 11vw !important; }
  html body .footer-vertical-stripes div:nth-child(7) { width: 13vw !important; }

  /* Fenêtre des projets */
  html body .project-modal { padding: 12px !important; }

  html body .modal-content {
    padding: 54px 18px 24px !important;
    border-radius: 18px !important;
    max-height: 92vh !important;
    max-height: 92dvh !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
  }

  html body .modal-close {
    top: 10px !important;
    right: 10px !important;
    width: 44px !important;
    height: 44px !important;
    font-size: 1.7rem !important;
  }

  html body .modal-header {
    margin-bottom: 18px !important;
    padding-bottom: 14px !important;
  }

  html body .modal-header h2 {
    font-size: 1.3rem !important;
    padding-right: 40px !important;
  }

  html body .modal-gallery img {
    height: auto !important;
    max-height: 340px !important;
  }

  html body .modal-description {
    padding: 14px 16px !important;
    font-size: 0.95rem !important;
    line-height: 1.65 !important;
  }

  html body .modal-details ul {
    grid-template-columns: 1fr !important;
  }

  html body .modal-link-btn {
    padding: 12px 24px !important;
    font-size: 1rem !important;
  }
}

/* Ajustements pour les petits téléphones */
@media (max-width: 380px) {
  html body header nav { padding: 12px 22px !important; }

  html body nav ul,
  html body header ul { gap: 18px !important; }

  html body header a { font-size: 0.98rem !important; }

  html body .filter-btn {
    padding: 11px 17px !important;
    font-size: 0.88rem !important;
  }

  html body .section h2,
  html body .projects-title h2 { font-size: 1.5rem !important; }

  html body .footer-icons { gap: 12px !important; }

  html body .footer-icons img,
  html body .footer-icons a img {
    width: 40px !important;
    height: 40px !important;
  }
}

/* Désactiver les animations de survol sur écran tactile */
@media (hover: none) {
  html body .project-card:hover { transform: none !important; }
  html body .project-card:hover .project-image img {
    transform: none !important;
  }
}


/* ==========================================
   MODE SOMBRE — TÉLÉPHONE
   S'active selon le thème du téléphone
========================================== */

@media (max-width: 768px) and (prefers-color-scheme: dark) {

  /* Fond général */
  html,
  body {
    background: #10121c !important;
    background-color: #10121c !important;
    color: #f2f3fa !important;
  }

  body::before {
    background: linear-gradient(
      to bottom,
      #10121c 0%,
      #171a2b 55%,
      #20243a 100%
    ) !important;
  }

  /* Textes */
  html body,
  html body .section,
  html body .section h2,
  html body .section .description,
  html body .portfolio-intro,
  html body .portfolio-intro p,
  html body .projects-title,
  html body .projects-title h2,
  html body .projects-subtitle,
  html body .project-info h3,
  html body .project-info p,
  html body .cv-container,
  html body .contact-card,
  html body .contact-block,
  html body .footer-block,
  html body .footer-block h3,
  html body .footer-block p {
    color: #f2f3fa !important;
  }

  /* Navigation */
  html body header nav {
    background: rgba(25, 28, 46, 0.96) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
  }

  html body header nav a,
  html body header a {
    color: #f2f3fa !important;
  }

  /* Filtres du portfolio */
  html body .filter-btn {
    background: #24283c !important;
    color: #f2f3fa !important;
    border-color: #414761 !important;
  }

  html body .filter-btn.active,
  html body .filter-btn[aria-pressed="true"] {
    background: #8c9aff !important;
    color: #10121c !important;
    border-color: #8c9aff !important;
  }

  /* Cartes et blocs */
  html body .contact-card,
  html body .project-card,
  html body .cv-container {
    color: #f2f3fa !important;
  }

  /* Boutons */
  html body .portfolio-pdf-btn,
  html body .download-btn,
  html body .modal-link-btn {
    color: #111426 !important;
  }

  /* Fenêtre de détail des projets */
  html body .project-modal {
    background: rgba(0, 0, 0, 0.78) !important;
  }

  html body .modal-content {
    background: #191c2c !important;
    color: #f2f3fa !important;
    border: 1px solid #343950 !important;
  }

  /* Titre sur fond sombre : reste clair */
  html body .modal-header h2 {
    color: #f2f3fa !important;
  }

  /* Encadrés clairs (description + détails) : texte noir comme en mode clair */
  html body .modal-description,
  html body .modal-description p,
  html body .modal-details ul li {
    color: #1F1F1F !important;
  }

  html body .modal-details ul li span {
    color: #5f73fb !important;
  }

  html body .modal-header {
    border-color: #343950 !important;
  }

  html body .modal-close {
    background: #292e44 !important;
    color: #ffffff !important;
  }

  /* Pied de page */
  html body footer,
  html body footer.footer-contact {
    background-color: #151827 !important;
    color: #f2f3fa !important;
  }

  html body .footer-block {
    border-bottom-color: rgba(255, 255, 255, 0.18) !important;
  }

  /* Bandes décoratives du footer — version mode sombre
     Discrètes, regroupées en bas derrière "CONTACT", sans gêner le texte */
  html body .footer-vertical-stripes {
    display: block !important;
    height: 150px !important;
    bottom: 0 !important;
    opacity: 0.22 !important;
    z-index: 2 !important;
  }

  html body .footer-vertical-stripes div {
    background: #8c9aff !important;
    opacity: 1 !important;
    bottom: -30px !important;
  }

  html body .footer-vertical-stripes div:nth-child(1) { height: 110px !important; left: 4% !important; right: auto !important; }
  html body .footer-vertical-stripes div:nth-child(2) { height: 150px !important; left: 22% !important; right: auto !important; }
  html body .footer-vertical-stripes div:nth-child(3) { height: 120px !important; left: 44% !important; right: auto !important; }
  html body .footer-vertical-stripes div:nth-child(4) { height: 145px !important; left: 60% !important; right: auto !important; }
  html body .footer-vertical-stripes div:nth-child(5) { height: 105px !important; left: 82% !important; right: auto !important; }
  html body .footer-vertical-stripes div:nth-child(6),
  html body .footer-vertical-stripes div:nth-child(7) { display: none !important; }

  html body .footer-block a {
    color: #c7ceff !important;
  }

  /* Icônes des réseaux en blanc */
  html body .footer-icons img,
  html body .footer-icons a img {
    filter: brightness(0) invert(1) !important;
    opacity: 1 !important;
  }

  /* Les grands mots décoratifs restent cachés */
  html body .header-title-bg,
  html body .header-title-bg.cv-left {
    display: none !important;
  }

  /* Les trois visuels de Stage restent agrandis */
  html body .portfolio-grid
  .project-card[data-project="galerie"] .project-image img,
  html body .portfolio-grid
  .project-card[data-project="dh"] .project-image img,
  html body .portfolio-grid
  .project-card[data-project="place"] .project-image img {
    width: 140% !important;
    max-width: none !important;
    height: auto !important;
  }
}

