@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800;900&family=Inter:wght@300;400;500&display=swap');

:root {
  /* Colors */
  --color-black-piano: #050505;
  --color-black-dark: #0a0a0a;
  --color-black-light: #181818;
  --color-ferrari-red: #ff2800;
  --color-ferrari-red-glow: rgba(255, 40, 0, 0.4);
  --color-white: #ffffff;
  --color-white-muted: #a0a0a0;
  
  /* Typo */
  --font-display: 'Outfit', sans-serif;
  --font-text: 'Inter', sans-serif;
  
  /* Utils */
  --transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

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

html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-scroll-container] {
  will-change: transform;
}

.lenis.lenis-stopped {
  overflow: hidden;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

body {
  background-color: var(--color-black-piano);
  color: var(--color-white);
  font-family: var(--font-text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

.text-red { color: var(--color-ferrari-red); }

/* --- NAVIGATION --- */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 10px 5%;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
  background: rgba(5, 5, 5, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo img {
  height: 70px;
  object-fit: contain;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 30px;
}

nav a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
  display: inline-block;
  padding: 5px 0;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-ferrari-red);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.86, 0, 0.07, 1);
}

nav a:hover::after, nav a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* --- BUTTONS --- */
.btn {
  display: inline-block;
  padding: 16px 36px;
  background-color: var(--color-ferrari-red);
  color: var(--color-white);
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  z-index: 1;
  box-shadow: 0 10px 20px var(--color-ferrari-red-glow);
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0% 100%);
  cursor: pointer;
  border: none;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-white);
  transform: translateX(-100%);
  z-index: -1;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.btn:hover::before {
  transform: translateX(0);
}
.btn:hover {
  color: var(--color-ferrari-red);
  box-shadow: 0 10px 30px rgba(255,255,255,0.2);
}

/* --- MAIN LAYOUT --- */
section {
  padding: 120px 5%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.title-large {
  font-size: clamp(3rem, 8vw, 8rem);
  line-height: 0.9;
  margin-bottom: 20px;
}

.subtitle {
  font-size: clamp(1rem, 2vw, 1.5rem);
  color: var(--color-white-muted);
  max-width: 600px;
  margin-bottom: 40px;
}

/* --- 3D / PARALLAX PHOTO FX --- */
.photo-3d-container {
  perspective: 1000px;
  width: 100%;
  height: 100vh;
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
  overflow: hidden;
}

.photo-3d-layer {
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  background-size: cover;
  background-position: center;
  will-change: transform;
  transform-style: preserve-3d;
}

/* Dark overlay to make text readable */
.photo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, var(--color-black-piano) 0%, rgba(5,5,5,0.3) 50%, rgba(5,5,5,0.8) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

/* --- CARDS & GRID --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  margin-top: 50px;
}

.card {
  background: var(--color-black-light);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 40px;
  border-radius: 8px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-10px);
  border-color: var(--color-ferrari-red);
  box-shadow: 0 20px 40px rgba(0,0,0,0.8), 0 0 20px var(--color-ferrari-red-glow);
}

.card i {
  font-size: 3rem;
  color: var(--color-ferrari-red);
  margin-bottom: 20px;
}

.card h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
}

/* --- BURGER BUTTON --- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1100;
  min-width: 44px;
  min-height: 44px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: var(--transition);
  transform-origin: center;
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* --- RESPONSIVE : TABLET ≤ 1024px --- */
@media (max-width: 1024px) {
  .logo img { height: 80px; }

  nav ul { gap: 18px; }

  section { padding: 80px 5%; }
}

/* --- RESPONSIVE : MOBILE ≤ 768px --- */
@media (max-width: 768px) {
  /* Header */
  header { padding: 12px 5%; }
  .logo img { height: 56px; }
  .nav-toggle { display: flex; }

  /* Menu plein écran animé */
  nav ul {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: rgba(5, 5, 5, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    justify-content: center;
    align-items: center;
    gap: 8px;
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1000;
    padding: 100px 0 60px;
    overflow-y: auto;
  }

  nav.open ul {
    transform: translateX(0);
  }

  nav a {
    font-size: 1.8rem;
    padding: 12px 32px;
    display: block;
    text-align: center;
  }

  /* Sections */
  section {
    padding: clamp(60px, 10vw, 80px) 5%;
    min-height: auto;
  }

  /* Hero */
  .hero-content {
    margin-top: 90px !important;
  }

  /* Héros des pages internes (padding-top: 150px en inline) */
  .page-hero {
    padding-top: 100px !important;
  }

  /* Titres inline — fluid */
  h1, h2 {
    font-size: clamp(1.8rem, 7vw, 3rem) !important;
  }

  /* Grilles → 1 colonne */
  .grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }

  /* Cards */
  .card { padding: 24px; }

  /* Blog articles */
  .blog-article {
    padding: 24px 20px !important;
    margin-bottom: 30px !important;
  }

  /* Boutons CTA empilés */
  .btn {
    display: block;
    text-align: center;
    margin-right: 0 !important;
    margin-bottom: 14px;
    clip-path: polygon(4% 0, 100% 0, 96% 100%, 0% 100%);
  }

  /* Footer */
  footer div[style*="display: flex"] {
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
  }

  footer a[style*="font-size: 1.5rem"] {
    font-size: 2rem !important;
    padding: 8px;
  }
}

/* --- RESPONSIVE : TRÈS PETIT ≤ 480px --- */
@media (max-width: 480px) {
  .logo img { height: 48px; }

  nav a { font-size: 1.5rem; padding: 10px 24px; }

  .card { padding: 20px; }

  .btn {
    padding: 14px 24px;
    font-size: 0.9rem;
  }

  /* Héros encore plus compacts sur petits écrans */
  .page-hero {
    padding-top: 90px !important;
  }

  /* Blog : espacement réduit */
  .blog-article {
    padding: 18px 16px !important;
  }

  /* Réduction du titre hero sur petits écrans */
  h1, h2 {
    font-size: clamp(1.6rem, 7vw, 2.5rem) !important;
  }
}
