/* /css/layout.css */

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 300;
  background-color: transparent;
  border-bottom: none;
  pointer-events: none;
  padding: 1rem env(safe-area-inset-right) 1rem env(safe-area-inset-left);
  transition: padding 0.4s var(--ease-out-expo);
}

.navbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1.5rem;
  width: calc(100% - 2rem);
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  background-color: oklch(from var(--bg-color) l c h / 0.70);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  pointer-events: auto;
  box-shadow: 0 10px 30px -10px var(--shadow-color);
  transition: padding 0.4s var(--ease-out-expo), 
              background-color 0.4s var(--ease-out-expo), 
              border-color 0.4s var(--ease-out-expo),
              box-shadow 0.4s var(--ease-out-expo);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-color);
  text-decoration: none;
  transition: transform 0.4s var(--ease-out-expo), filter 0.4s var(--ease-out-expo);
  transform-origin: left center;
}

.logo:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 0 8px oklch(from var(--primary-color) l c h / 0.5));
}

.logo-icon {
  height: clamp(2rem, 6vw, 2.5rem);
  width: auto;
  transition: transform 0.4s var(--ease-out-expo);
}

.logo-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-color);
  transition: color 0.4s var(--ease-out-expo);
}

.logo:hover .logo-text {
  color: var(--primary-color);
}

.burger-menu {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* Zone tactile 44×44px minimum */
  width: 44px;
  height: 44px;
  padding: 12px 8px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease;
}

.burger-menu:hover {
  background-color: oklch(from var(--text-color) l c h / 0.05);
}

.burger-menu:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 4px;
  border-radius: 4px;
}

.burger-menu span {
  display: block;
  height: 2px;
  width: 100%;
  background-color: var(--text-color);
  border-radius: 2px;
  transition: all 0.5s var(--ease-out-expo);
}

.burger-menu.toggle span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.burger-menu.toggle span:nth-child(2) {
  opacity: 0;
}

.burger-menu.toggle span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.nav-links {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 0;
  right: 0;
  z-index: 299;
  background-color: oklch(from var(--bg-secondary) l c h / 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 0;
  box-shadow: 0 20px 40px var(--shadow-color);
  transform: translateY(-10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.4s var(--ease-out-expo), opacity 0.4s var(--ease-out-expo), visibility 0.4s var(--ease-out-expo);
}

.nav-links.nav-active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  font-size: var(--fs-body); /* Typography token (P1) */
  font-weight: 500;
  padding: 0.75rem 0;
  transition: color 0.5s var(--ease-out-expo);
}

/* Effet de couleur simple au survol et état actif */
.nav-links a:not(.btn-primary) {
  position: relative;
  transition: color 0.3s ease;
}

.nav-links a:not(.btn-primary):hover,
.nav-links a:not(.btn-primary).active-link {
  color: var(--primary-color);
}

/* Bouton "Me contacter" — alignement avec le système (pill comme partout) */
.nav-links .btn-primary {
  border-radius: var(--radius-full);
  margin-top: 0.5rem; /* respiration supplémentaire sur mobile */
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* État scrolled : léger backdrop-filter pour la profondeur */
.navbar.scrolled {
  padding: 0.5rem env(safe-area-inset-right) 0.5rem env(safe-area-inset-left);
}

.navbar.scrolled .navbar-inner {
  background-color: oklch(from var(--bg-color) l c h / 0.85);
  box-shadow: 0 15px 40px -15px var(--shadow-color);
}

/* =============================================
   HERO
   ============================================= */

/* La section hero reste collée en haut — les sections du dessous glissent par-dessus */
.hero-section {
  position: sticky;
  top: 0;
  z-index: 0;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  /* masque le débordement du wrapper vidéo lors du parallax */
}

/* Wrapper Vanta — cible du translateY parallax */
.hero-vanta-wrap {
  position: absolute;
  inset: -15% 0;
  /* 130% de hauteur pour laisser de la marge en haut/bas au glissement */
  z-index: -1;
  pointer-events: none;
}

/* Logo en filigrane derrière l'animation Vanta */
.hero-vanta-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../assets/img/favicon-white.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 40%;
  opacity: 0.20; /* Opacité augmentée pour mieux voir le logo */
  z-index: -1;
}

/* Overlay sombre pour lisibilité du texte sur l'image */
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: oklch(from var(--bg-color) l c h / 0.72);
  pointer-events: none;
}

.hero {
  position: relative;
  /* passe au-dessus de l'overlay */
  padding: calc(var(--navbar-height) + 2.5rem) calc(2rem + env(safe-area-inset-right)) var(--space-sm) calc(2rem + env(safe-area-inset-left)); /* Responsive vertical padding with navbar offset and safe areas (P1) */
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  width: 100%;
}

.hero h1 {
  font-size: var(--fs-display); /* Typography token (P1) */
  margin-bottom: var(--space-md); /* Spacing token (P1) */
  font-weight: 800;
  line-height: 1.08;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md); /* Spacing token (P1) */
  max-width: 560px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs); /* Spacing token (P1) */
  width: 100%;
}

/* Stats */
.hero-trust {
  margin-top: var(--space-lg); /* Spacing token (P1) */
  padding-top: var(--space-md); /* Spacing token (P1) */
  border-top: 1px solid var(--border-color);
  font-family: var(--font-body);
  font-size: var(--fs-muted); /* Typography token (P1) */
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* =============================================
   SECTIONS — Superposition sur le hero
   ============================================= */
/* Toutes les sections après le hero ont un z-index supérieur et remontent par-dessus */
.services-section,
.features,
.portfolio-section,
.about-section,
.contact-section,
.faq-section,
.site-footer {
  position: relative;
  z-index: 1;
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background-color: var(--footer-bg);
  color: oklch(from var(--text-color) l c h / 0.85); /* Increased contrast (P2) */
  padding: var(--space-lg) 0 var(--space-md); /* Spacing tokens (P1) */
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md); /* Spacing tokens (P1) */
  max-width: 1200px;
  margin: 0 auto var(--space-md);
  padding-left: calc(1.5rem + env(safe-area-inset-left));
  padding-right: calc(1.5rem + env(safe-area-inset-right));
}

@media (min-width: 768px) {
  .footer-content {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.site-footer .logo {
  color: var(--text-color);
  margin-bottom: 0.75rem;
}

.site-footer .logo-text {
  color: var(--text-color);
}

.site-footer .logo:hover .logo-text {
  color: var(--primary-color);
}

.footer-brand p {
  font-size: var(--fs-small); /* Typography tokens (P1) */
  max-width: 280px;
}

.footer-links,
.footer-contact,
.footer-legal {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs); /* Spacing tokens (P1) */
}

.footer-links h4,
.footer-contact h4,
.footer-legal h4 {
  color: var(--text-color);
  font-size: var(--fs-body); /* Typography tokens (P1) */
  margin-bottom: 0.25rem;
}

.footer-links a,
.footer-contact a,
.footer-legal a {
  color: oklch(from var(--text-color) l c h / 0.8); /* Increased contrast (P2) */
  text-decoration: none;
  font-size: var(--fs-small); /* Typography tokens (P1) */
  transition: color 0.5s var(--ease-out-expo);
}

.footer-links a:hover,
.footer-contact a:hover,
.footer-legal a:hover {
  color: var(--text-color);
}

.footer-contact p {
  font-size: var(--fs-small); /* Typography tokens (P1) */
}

.footer-location {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.footer-bottom {
  text-align: center;
  padding-top: var(--space-sm); /* Spacing tokens (P1) */
  border-top: 1px solid var(--border-color);
  font-size: var(--fs-small); /* Typography tokens (P1) */
  color: oklch(from var(--text-color) l c h / 0.6); /* Increased contrast (P2) */
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

@media (min-width: 768px) {
  .footer-bottom {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.footer-bottom p {
  margin: 0 auto;
}

/* =============================================
   PARALLAX
   ============================================= */
.parallax-layer {
  will-change: transform;
}

/* =============================================
   LEGAL PAGES
   ============================================= */
.legal-main {
  padding: calc(var(--navbar-height) + 2.5rem) 5% 4rem;
  min-height: 60vh;
}

.legal-container {
  max-width: 800px;
  margin: 0 auto;
}

.legal-container h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 2rem;
  text-align: center;
}

.legal-container h2 {
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
}

.legal-container p,
.legal-container ul {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.legal-container ul {
  margin-left: 2rem;
}

.legal-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.legal-card a {
  color: var(--primary-color);
}

/* =============================================
   RESPONSIVE LAYOUT MEDIA QUERIES
   ============================================= */

/* --- MOBILE FIRST (max-width: 767px) --- */
@media (max-width: 767px) {
  /* Hero — safe area bas */
  .hero {
    padding: calc(var(--navbar-height) + 1.5rem) 1.5rem env(safe-area-inset-bottom, 2rem);
    min-height: 100svh;
  }


  .hero-trust {
    margin-top: 2rem;
    padding-top: 1.25rem;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  /* Parallax */
  .parallax-layer {
    will-change: auto;
    transform: none !important;
  }
}

/* --- PETIT MOBILE (max-width: 400px) --- */
@media (max-width: 400px) {
  .footer-content {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: clamp(2rem, 11vw, 2.75rem);
  }
}

/* --- SMALL TABLET/MOBILE (min-width: 640px) --- */
@media (min-width: 640px) {
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- MEDIUM TABLET (min-width: 768px) --- */
@media (min-width: 768px) {
  :root {
    --navbar-height: 80px;
  }

  .burger-menu {
    display: none;
  }

  .navbar-inner {
    padding: 1.25rem 2rem;
  }

  /* Version condensée de la pilule sur scroll (desktop) */
  .navbar.scrolled .navbar-inner {
    padding: 0.625rem 2rem;
  }

  .logo {
    font-size: 1.5rem;
    gap: 0.75rem;
  }

  .logo-icon {
    height: 2.5rem;
  }

  .nav-links {
    position: relative;
    display: flex;
    flex-direction: row;
    padding: 0;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    border: none;
    gap: 0.35rem;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    align-items: center;
  }

  .nav-links a:not(.btn-primary) {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
  }

  .nav-links .btn-primary {
    margin-top: 0;
    margin-left: 0.5rem;
  }

  /* Indicateur de survol glissant (desktop) */
  .nav-hover-backdrop {
    position: absolute;
    background-color: oklch(from var(--primary-color) l c h / 0.08);
    border: 1px solid oklch(from var(--primary-color) l c h / 0.15);
    border-radius: var(--radius-full);
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    transform: scale(0.9);
    transition: transform 0.35s var(--ease-out-expo), 
                left 0.35s var(--ease-out-expo), 
                width 0.35s var(--ease-out-expo), 
                height 0.35s var(--ease-out-expo), 
                opacity 0.25s ease;
  }

  .nav-hover-backdrop.is-active {
    opacity: 1;
    transform: scale(1);
  }

}

/* --- DESKTOP (min-width: 1024px) --- */
@media (min-width: 1024px) {
  .hero {
    padding-top: 8rem;
    padding-bottom: 8rem;
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .hero h1 {
    max-width: 1000px;
  }

  .footer-content {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

/* =============================================
   MOBILE LANDSCAPE ADJUSTMENTS (Short viewports)
   ============================================= */
@media (max-height: 500px) and (orientation: landscape) {
  :root {
    --navbar-height: 50px;
    --space-xl: 3rem; /* Reduce large vertical spaces */
  }

  .navbar {
    padding: 0.25rem env(safe-area-inset-right) 0.25rem env(safe-area-inset-left);
  }

  .navbar.scrolled {
    padding: 0.15rem env(safe-area-inset-right) 0.15rem env(safe-area-inset-left);
  }

  .navbar-inner {
    padding: 0.25rem 1.25rem;
  }

  /* Disable sticky hero in landscape to allow scrolling */
  .hero-section {
    position: relative;
    min-height: auto;
    overflow: visible;
  }

  .hero {
    min-height: auto;
    padding: calc(var(--navbar-height) + 1.5rem) calc(1.5rem + env(safe-area-inset-right)) 2rem calc(1.5rem + env(safe-area-inset-left));
  }

  .hero-trust {
    margin-top: var(--space-md);
    padding-top: var(--space-sm);
  }
}

@media (max-width: 767px) and (max-height: 500px) and (orientation: landscape) {
  /* Adjust burger menu dropdown for mobile landscape height */
  .nav-links {
    max-height: calc(100svh - 75px);
    overflow-y: auto;
    padding: 1rem 0;
    gap: 0.25rem;
  }

  .nav-links a {
    padding: 0.4rem 0;
  }

  .nav-links .btn-primary {
    margin-top: 0.25rem;
    padding: 0.4rem 1.5rem;
  }
}

@media (min-width: 768px) and (max-height: 500px) and (orientation: landscape) {
  /* Compact desktop navbar links for landscape wider screens (like iPhone Pro) */
  .nav-links a:not(.btn-primary) {
    padding: 0.3rem 0.75rem;
  }
  .nav-links .btn-primary {
    padding: 0.4rem 1.25rem;
  }
}
