/* ============================================
   RESPONSIVE — Mobile First Media Queries
   ============================================ */

/* ---------- MOBILE PORTRAIT (< 480px) ---------- */
@media (max-width: 479px) {

  /* Navigation */
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-dark);
    flex-direction: column;
    align-items: stretch;
    padding: calc(var(--nav-height) + 1.5rem) 1.5rem 1.5rem;
    gap: 0.3rem;
    transition: right 0.4s var(--ease);
    z-index: 1000;
    overflow-y: auto;
    border-left: 1px solid var(--border);
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-link {
    padding: 0.8rem 1rem;
    font-size: var(--fs-base);
    border-radius: 10px;
  }

  .nav-cta-link {
    margin-top: 0.5rem;
    text-align: center;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-overlay.active {
    display: block;
  }

  /* Hero */
  .hero {
    padding-top: calc(var(--nav-height) + 1rem);
    min-height: auto;
    padding-bottom: 2rem;
  }

  .hero-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  .hero-visual {
    order: -1;
  }

  .phone-mockup {
    width: 220px;
  }

  .floating-badge {
    display: none;
  }

  .hero-badge {
    font-size: 0.7rem;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .hero-buttons .btn {
    justify-content: center;
  }

  /* À Propos */
  .apropos-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Services */
  .services-grid {
    grid-template-columns: 1fr;
  }

  /* Portfolio */
  .portfolio-filters {
    gap: 0.4rem;
  }

  .filter-btn {
    padding: 0.4rem 0.8rem;
    font-size: var(--fs-xs);
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  /* Timeline */
  .timeline-line {
    left: 18px;
  }

  .timeline-item {
    padding-left: 55px;
  }

  .timeline-marker {
    left: 5px;
    width: 28px;
    height: 28px;
  }

  .timeline-content {
    padding: 1.2rem;
  }

  /* Témoignages */
  .temoignages-grid {
    grid-template-columns: 1fr;
  }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .contact-info-card {
    padding: 1.5rem;
  }

  .contact-form {
    padding: 1.5rem;
  }

  /* Footer */
  .footer-top {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-links {
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 42px;
    height: 42px;
  }
}

/* ---------- MOBILE PAYSAGE / PETITE TABLETTE (481px – 768px) ---------- */
@media (min-width: 480px) and (max-width: 768px) {

  /* Navigation */
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: var(--bg-dark);
    flex-direction: column;
    align-items: stretch;
    padding: calc(var(--nav-height) + 1.5rem) 1.5rem 1.5rem;
    gap: 0.3rem;
    transition: right 0.4s var(--ease);
    z-index: 1000;
    overflow-y: auto;
    border-left: 1px solid var(--border);
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-link {
    padding: 0.8rem 1rem;
    font-size: var(--fs-base);
  }

  .nav-toggle {
    display: flex;
  }

  .nav-overlay.active {
    display: block;
  }

  /* Hero */
  .hero-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }

  .hero-subtitle {
    max-width: 100%;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
  }

  .phone-mockup {
    width: 240px;
  }

  .floating-badge {
    font-size: 0.7rem;
    padding: 0.4rem 0.7rem;
  }

  /* À Propos */
  .apropos-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Services */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Portfolio */
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .portfolio-thumbnail {
    height: 180px;
  }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer-top {
    flex-direction: column;
    gap: 2rem;
  }
}

/* ---------- TABLETTE (769px – 1024px) ---------- */
@media (min-width: 769px) and (max-width: 1024px) {

  /* Navigation */
  .nav-menu {
    gap: 0.2rem;
  }

  .nav-link {
    padding: 0.45rem 0.7rem;
    font-size: var(--fs-sm);
  }

  /* Hero */
  .hero-container {
    gap: 3rem;
  }

  .phone-mockup {
    width: 260px;
  }

  /* Services */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Portfolio */
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Timeline */
  .timeline {
    max-width: 600px;
  }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr 1.3fr;
    gap: 2rem;
  }

  /* Footer */
  .footer-links {
    gap: 3rem;
  }
}

/* ---------- DESKTOP (1025px – 1280px) ---------- */
@media (min-width: 1025px) and (max-width: 1280px) {

  .nav-link {
    padding: 0.5rem 0.8rem;
    font-size: var(--fs-sm);
  }

  .hero-container {
    gap: 3rem;
  }

  .phone-mockup {
    width: 260px;
  }

  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ---------- GRAND ÉCRAN (> 1280px) ---------- */
@media (min-width: 1281px) {
  .container {
    padding: 0 2rem;
  }

  .portfolio-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }
}

/* ---------- HAUTEUR RÉDUITE (< 600px) ---------- */
@media (max-height: 600px) and (min-width: 769px) {
  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-height) + 1rem);
    padding-bottom: 1.5rem;
  }

  .hero-container {
    min-height: auto;
  }
}

/* ---------- HOVER NONE (touch devices) ---------- */
@media (hover: none) and (pointer: coarse) {
  .service-card:hover,
  .portfolio-card:hover,
  .temoignage-card:hover,
  .timeline-content:hover {
    transform: none;
  }

  .service-card:hover::before {
    opacity: 0;
  }

  .portfolio-overlay {
    display: none;
  }

  /* Always show portfolio links on touch */
  .portfolio-card .portfolio-overlay {
    display: flex;
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 1;
  }

  .portfolio-link {
    transform: scale(1);
  }
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .animate-on-scroll {
    opacity: 1;
    transform: none;
  }
}

/* ---------- DARK MODE (already dark, but respect system preference for borders) ---------- */
@media (prefers-color-scheme: light) {
  /* Site is intentionally dark-themed, this is a fallback notice */
}

/* ---------- PRINT ---------- */
@media print {
  .navbar,
  .back-to-top,
  .nav-overlay,
  .hero-bg-shapes,
  .floating-badge {
    display: none !important;
  }

  body {
    background: white;
    color: #333;
  }

  .section {
    padding: 2rem 0;
  }
}
