/* ———————————————————————————————————————————————————————————————————————————————————————— */
/* ——————————————— MOBILE OPTIMIZATIONS ——————————————— */
/* ———————————————————————————————————————————————————————————————————————————————————————— */

/* ———————————————————————————————————————————— */
/* ————— RESET ————— */
/* ———————————————————————————————————————————— */

@media (max-width: 767px) {
  body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
      sans-serif;
    overflow-x: hidden;
    background-color: #000;
  }

  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  .custom-scrollbar-container {
    display: none !important;
  }

  /* Supprime les scrollbars mais garde le scroll */
  ::-webkit-scrollbar {
    display: none;
  }

  html {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .invisible-scrollbar {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
  }

  .invisible-scrollbar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }

  ::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }
}

/* ———————————————————————————————————————————— */
/* ———————————————————————————————————————————— */

body.is-touch {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Viewport mobile dynamique */
.full-height-mobile {
  height: 100vh;
  height: calc(var(--vh, 1vh) * 100);
}

/* États tactiles */
.touch-active {
  transform: scale(0.95) !important;
  opacity: 0.8 !important;
  transition: all 0.15s ease !important;
}

/* ===================================== */
/* ======= RESPONSIVE BREAKPOINTS ===== */
/* ===================================== */

/* Mobile Portrait (< 768px) */
@media (max-width: 767px) {
  /* Container principal - suppression des paddings latéraux */
  .container,
  .projects-container,
  .about-container {
    padding: 0;
    max-width: 100%;
  }

  .hero-content {
    text-align: center;
    gap: 40px;
  }

  .hero-header {
    margin-bottom: 30px;
  }

  .section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    width: 100%;
    z-index: 5;
  }

  .logo-subtitle {
    font-size: 18px;
    margin-top: 15px;
  }

  .hero-title {
    font-size: clamp(32px, 8vw, 48px);
    line-height: 1.2;
    margin-bottom: 20px;
  }

  .hero-description {
    font-size: 16px;
    line-height: 1.6;
    max-width: 100%;
    margin-bottom: 30px;
  }

  /* Navigation principale - cachée sur mobile */
  nav {
    display: none;
  }

  /* Scroll indicator */
  .scroll-indicator {
    bottom: 30px;
    font-size: 12px;
  }

  /* Projects Section - Improved mobile cards */
  .projects-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 0 20px;
  }

  .project-card {
    display: flex !important;
    flex-direction: column !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 20px !important;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    padding: 12px !important;
    min-height: auto;
    aspect-ratio: unset !important;
  }

  .project-card:active {
    transform: scale(0.97) !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
  }

  .project-card-image {
    width: 100% !important;
    height: 200px !important;
    border-radius: 12px !important;
    background-size: cover;
    background-position: center;
    overflow: hidden;
    margin: 0 !important;
    margin-bottom: 16px !important;
    position: relative;
    flex-shrink: 0;
  }

  .project-card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    transition: transform 0.3s ease;
  }

  /* Image plus grande pour le premier projet */
  .project-card:first-child .project-card-image {
    flex: none !important;
    min-height: none !important;
  }

  .project-card-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 0px !important;
    flex-grow: 1;
  }

  /* Fix class name mismatch - JavaScript uses 'project-title' not 'project-card-title' */
  .project-title {
    font-family: "Work Sans", sans-serif !important;
    font-size: 22px !important;
    font-weight: 600 !important;
    color: white !important;
    margin: 0 !important;
    line-height: 1.2 !important;
  }

  .project-meta {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
  }

  .project-card-subtitle {
    font-family: "Work Sans", sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
    width: fit-content !important;
    white-space: nowrap;
  }

  .project-date {
    font-family: "Work Sans", sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
    width: fit-content !important;
    white-space: nowrap;
  }

  .project-role {
    font-family: "Work Sans", sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 6px 12px !important;
    border-radius: 20px !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
    width: fit-content !important;
    white-space: nowrap;
  }

  .project-card-description {
    font-size: 14px !important;
    color: rgba(255, 255, 255, 0.8) !important;
    line-height: 1.5 !important;
    margin-top: 4px !important;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  /* Touch feedback improvements */
  .project-card:active .project-card-image img {
    transform: scale(1.05) !important;
  }

  .project-card:active .project-title {
    color: rgba(255, 255, 255, 1) !important;
  }

  .project-card:active .project-card-subtitle,
  .project-card:active .project-date,
  .project-card:active .project-role {
    color: rgba(255, 255, 255, 0.9) !important;
    background-color: rgba(255, 255, 255, 0.25) !important;
  }

  /* About Section */
  .about-container {
    display: flex;
    padding: 12px;
    gap: 12px;
    border-radius: 12px;
    flex-direction: column;
  }

  .container__about-card-secondary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-sizing: border-box;
  }

  .about-card {
    width: 100%;
    padding: 32px;
    border-radius: 6px;
  }

  .about-card--main h3 {
    font-size: 24px;
    margin-bottom: 15px;
  }

  .about-card--main p + p {
    margin-top: 12px;
  }

  .about-card--main p {
    font-size: 15px;
    line-height: 1.6;
  }

  .about-card--secondary h3 {
    font-size: 20px;
    margin-bottom: 12px;
  }

  .about-card--secondary p {
    font-size: 14px;
    line-height: 1.5;
  }

  /* Skills */
  .skills-container {
    gap: 8px;
  }

  .skill-pill {
    font-size: 11px;
    padding: 6px 12px;
  }

  /* Projects slider */
  .projects-slider {
    height: 120px;
    margin: 20px 0;
  }

  .slide img {
    height: 100px;
    border-radius: 8px;
  }

  .footer-logo {
    margin-bottom: 24px;
  }

  .footer-main {
    padding: 24px 12px;
    background-color: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
  }

  .footer-title {
    font-size: clamp(28px, 7vw, 36px);
    line-height: 1.2;
    margin-bottom: 30px;
  }

  .footer-links {
    flex-direction: column;
    gap: 30px;
  }

  .footer-links__group-top,
  .footer-links__group-bottom {
    width: 100%;
    flex-direction: column;
    gap: 20px;
  }

  /* Boutons */
  .hero-cta,
  .footer-cta {
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 12px;
    min-width: 180px;
    text-align: center;
  }

  .project-modal-close {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}
