@import url('tokens.css');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&family=Source+Sans+3:wght@400;600&display=swap');

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}
img, svg { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ─── Skip link ─── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 0 0 4px 4px;
  font-weight: 600;
  z-index: 9999;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ─── Focus ─── */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ─── Typography ─── */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 4vw, 2rem); }
h3 { font-size: clamp(1.05rem, 3vw, 1.3rem); }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
a { color: var(--color-primary); }

/* ─── Container ─── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  line-height: 1;
}
.btn:hover { opacity: 0.88; }
.btn:active { transform: scale(0.98); }
.btn-primary  { background: var(--color-primary); color: #fff; }
.btn-accent   { background: var(--color-accent);  color: #fff; }
.btn-outline  { background: transparent; color: var(--color-primary); border: 2px solid var(--color-primary); }

/* ─── Header / Nav ─── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-primary);
  box-shadow: 0 2px 8px rgba(30,58,138,.08);
}
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}
.site-logo { height: 48px; width: auto; }

/* Hamburger */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* Mobile nav menu */
.nav-menu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg);
  border-bottom: 2px solid var(--color-primary);
  padding: 0.75rem 1.25rem 1.25rem;
  gap: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
}
.nav-menu.is-open { display: flex; }
.nav-menu li a {
  display: block;
  padding: 0.75rem 0;
  color: var(--color-text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  border-bottom: 1px solid #e5e7eb;
}
.nav-menu li:last-child a { border-bottom: none; }
.nav-menu li a:hover,
.nav-menu li a[aria-current="page"] { color: var(--color-primary); }

.nav-cta { white-space: nowrap; font-size: 0.875rem; padding: 0.5rem 1rem; }

@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .nav-menu {
    display: flex !important;
    flex-direction: row;
    position: static;
    border: none;
    padding: 0;
    gap: 0.25rem;
    align-items: center;
    background: transparent;
    box-shadow: none;
  }
  .nav-menu li a {
    padding: 0.45rem 0.75rem;
    border-bottom: none;
    border-radius: 4px;
    font-size: 0.95rem;
  }
  .nav-menu li a:hover { background: #f1f5f9; }
}

/* ─── Page-hero (inner pages) ─── */
.page-hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, #0f4578 100%);
  color: #fff;
  padding: 3rem 0;
  text-align: center;
}
.page-hero h1 { color: #fff; margin-bottom: 0.5rem; }
.page-hero p  { color: #bfdbfe; font-size: 1.05rem; }

/* ─── Hero (Accueil) ─── */
.hero {
  padding: 3rem 0 2.5rem;
  background: linear-gradient(135deg, #eff4ff 0%, var(--color-bg) 70%);
}
.hero h1 { color: var(--color-primary); margin-bottom: 1rem; }
.hero-lead { font-size: 1.1rem; color: #374151; max-width: 640px; margin-bottom: 1.25rem; }
.hero-quote {
  font-style: italic;
  color: var(--color-accent);
  font-size: 1rem;
  border-left: 3px solid var(--color-accent);
  padding-left: 1rem;
  margin: 1.25rem 0;
}
.hero-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }

@media (min-width: 768px) {
  .hero { padding: 4.5rem 0 3.5rem; }
  .hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
  }
}

/* ─── Trust bar ─── */
.trust-bar { background: #f8fafc; border-top: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; padding: 1rem 0; }
.trust-items { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; justify-content: center; align-items: center; }
.trust-item {
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-display);
  color: #374151;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.trust-icon { color: var(--color-accent); font-size: 1rem; font-style: normal; }

/* ─── Sections ─── */
section { padding: 3rem 0; }
.section-alt { background: #f8fafc; }

.section-header { text-align: center; margin-bottom: 2rem; }
.section-header h2 { color: var(--color-primary); margin-bottom: 0.5rem; }
.section-header p { color: #4b5563; max-width: 620px; margin: 0 auto; }

/* ─── Feature items (atouts) ─── */
.features-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 768px) { .features-grid { grid-template-columns: repeat(3,1fr); } }

.feature-item {
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--color-accent);
  background: var(--color-bg);
}
.feature-item h3 { color: var(--color-primary); margin-bottom: 0.5rem; }
.feature-item p  { color: #4b5563; font-size: 0.92rem; }

/* ─── Card grid ─── */
.card-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 640px)  { .card-grid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 1024px) { .card-grid { grid-template-columns: repeat(3,1fr); } }

.card {
  background: var(--color-bg);
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: 0 4px 16px rgba(30,58,138,.12); transform: translateY(-2px); }
.card-body { padding: 1.5rem; }
.card-body h3 { color: var(--color-primary); margin-bottom: 0.5rem; }
.card-body p  { color: #4b5563; font-size: 0.92rem; }

/* ─── Specialty cards ─── */
.spec-grid {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 768px) { .spec-grid { grid-template-columns: repeat(2,1fr); } }

.spec-card {
  background: var(--color-bg);
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.spec-card-body { padding: 1.5rem; }
.spec-card-body h3 { color: var(--color-primary); margin-bottom: 0.75rem; }
.spec-card-body ul { padding-left: 1.1rem; list-style: disc; }
.spec-card-body ul li { color: #4b5563; font-size: 0.9rem; margin-bottom: 0.3rem; }

/* ─── Team grid ─── */
.team-grid {
  display: grid;
  gap: 1.25rem;
}
@media (min-width: 640px)  { .team-grid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 1024px) { .team-grid { grid-template-columns: repeat(4,1fr); } }

.team-card {
  background: var(--color-bg);
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.team-avatar {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--color-primary) 18%, var(--color-bg)) 0%,
    color-mix(in srgb, var(--color-accent) 15%, var(--color-bg)) 100%);
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--color-primary);
}
.team-card-body { padding: 1rem 1.25rem 1.25rem; }
.team-card-body h3 { color: var(--color-primary); font-size: 0.95rem; margin-bottom: 0.25rem; }
.team-card-body p  { color: #6b7280; font-size: 0.82rem; }

/* ─── About layout ─── */
.about-grid {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}
@media (min-width: 768px) { .about-grid { grid-template-columns: 5fr 7fr; } }

.about-text h2 { color: var(--color-primary); margin-bottom: 1rem; }
.about-text p  { color: #374151; }

/* ─── Contact ─── */
.contact-grid {
  display: grid;
  gap: 2.5rem;
}
@media (min-width: 768px) { .contact-grid { grid-template-columns: 1fr 1fr; } }

.contact-info h2 { color: var(--color-primary); margin-bottom: 1.5rem; }

.contact-detail { display: flex; gap: 0.75rem; margin-bottom: 1.25rem; align-items: flex-start; }
.contact-detail-icon { font-style: normal; font-size: 1.2rem; flex-shrink: 0; margin-top: 0.1rem; line-height: 1.6; }
.contact-detail-text strong {
  display: block;
  color: var(--color-primary);
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.2rem;
}
.contact-detail-text a { color: var(--color-text); text-decoration: none; }
.contact-detail-text a:hover { color: var(--color-primary); text-decoration: underline; }

/* Map */
.map-container { border-radius: 10px; overflow: hidden; border: 1px solid #e2e8f0; margin-top: 1.5rem; }
.map-container iframe { display: block; width: 100%; height: 260px; border: none; }
@media (min-width: 768px) { .map-container iframe { height: 320px; } }

/* Form */
.contact-form {
  background: #f8fafc;
  border-radius: 10px;
  padding: 2rem;
  border: 1px solid #e2e8f0;
}
.contact-form h2 { color: var(--color-primary); margin-bottom: 1.5rem; font-size: 1.3rem; }

.form-group { margin-bottom: 1.1rem; }
.form-group label {
  display: block;
  font-weight: 600;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid #d1d5db;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: var(--color-bg);
  transition: border-color .2s;
}
.form-group input:focus,
.form-group textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 2px rgba(30,58,138,.15); }
.form-group textarea { resize: vertical; min-height: 110px; }
.form-note { font-size: 0.8rem; color: #6b7280; margin-top: 0.75rem; line-height: 1.5; }

/* ─── CTA banner ─── */
.cta-banner {
  background: var(--color-primary);
  color: #fff;
  text-align: center;
  padding: 3.5rem 1rem;
}
.cta-banner h2 { color: #fff; margin-bottom: 0.5rem; }
.cta-banner p  { color: #bfdbfe; margin-bottom: 1.5rem; }
.cta-banner .cta-secondary { color: #bfdbfe; margin-top: 1rem; font-size: 0.9rem; }
.cta-banner .cta-secondary a { color: #bfdbfe; }
.cta-banner .cta-secondary a:hover { color: #fff; }

/* ─── Badge ─── */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-display);
  background: #dbeafe;
  color: #1d4ed8;
  margin-bottom: 0.75rem;
}

/* ─── Footer ─── */
footer {
  background: var(--color-primary);
  color: #fff;
  padding: 3rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(3,1fr); } }

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #bfdbfe;
  margin-bottom: 0.875rem;
}
.footer-col p,
.footer-col a { color: #e2e8f0; font-size: 0.9rem; text-decoration: none; line-height: 1.7; }
.footer-col a:hover { color: #fff; }
.footer-col ul li { margin-bottom: 0.4rem; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: #94a3b8;
}
.footer-bottom a { color: #94a3b8; }
.footer-bottom a:hover { color: #fff; }

/* ─── Utilities ─── */
.text-center { text-align: center; }
.mt-1  { margin-top: 1rem; }
.mt-2  { margin-top: 2rem; }
.mb-0  { margin-bottom: 0; }
.tel-link { color: var(--color-primary); font-weight: 700; text-decoration: none; }
.tel-link:hover { text-decoration: underline; }

/* ─── Visual Placeholder (WEB-715) ─── */
.visual-placeholder {
  display: block;
  width: 100%;
  border-radius: 8px;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-primary) 22%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-primary) 10%, var(--color-bg)) 55%,
      color-mix(in srgb, var(--color-secondary) 18%, var(--color-bg)) 100%
    );
}
.visual-placeholder[data-aspect="4:3"]  { aspect-ratio: 4 / 3; }
.visual-placeholder[data-aspect="1:1"]  { aspect-ratio: 1 / 1; }
.visual-placeholder[data-aspect="3:4"]  { aspect-ratio: 3 / 4; }
.visual-placeholder[data-aspect="21:9"] { aspect-ratio: 21 / 9; }

.visual-placeholder[data-tone="secondary"] {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-secondary) 22%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-secondary) 10%, var(--color-bg)) 55%,
      color-mix(in srgb, var(--color-primary) 16%, var(--color-bg)) 100%
    );
}
.visual-placeholder[data-tone="accent"] {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--color-accent, var(--color-primary)) 22%, var(--color-bg)) 0%,
      color-mix(in srgb, var(--color-primary) 12%, var(--color-bg)) 60%,
      color-mix(in srgb, var(--color-secondary) 16%, var(--color-bg)) 100%
    );
}
.visual-placeholder[data-tone="muted"] {
  background: color-mix(in srgb, var(--color-text) 8%, var(--color-bg));
}

/* ─── Keyframes (définis hors media-query pour compatibilité) ─── */
@keyframes revealUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Animations — motion autorisé ─── */
@media (prefers-reduced-motion: no-preference) {

  /* 1 — Séquence hero (page accueil, chargement) */
  .hero .badge      { animation: revealUp 0.55s ease both; }
  .hero h1          { animation: revealUp 0.55s ease 0.09s both; }
  .hero .hero-lead  { animation: revealUp 0.55s ease 0.19s both; }
  .hero .hero-quote { animation: revealUp 0.55s ease 0.28s both; }
  .hero .hero-cta   { animation: revealUp 0.55s ease 0.37s both; }

  /* 2 — Page-hero (pages intérieures) */
  .page-hero h1 { animation: revealUp 0.5s ease both; }
  .page-hero p  { animation: revealUp 0.5s ease 0.12s both; }

  /* 3 — Scroll-reveal piloté par IntersectionObserver (data-reveal → data-revealed) */
  [data-reveal] {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.45s ease, transform 0.45s ease;
  }
  [data-reveal][data-revealed] {
    opacity: 1;
    transform: translateY(0);
  }
  /* Stagger naturel pour les grilles */
  .card-grid     [data-reveal]:nth-child(2),
  .features-grid [data-reveal]:nth-child(2),
  .spec-grid     [data-reveal]:nth-child(2) { transition-delay: 0.07s; }
  .card-grid     [data-reveal]:nth-child(3),
  .features-grid [data-reveal]:nth-child(3) { transition-delay: 0.13s; }
  .card-grid     [data-reveal]:nth-child(4) { transition-delay: 0.19s; }
  .card-grid     [data-reveal]:nth-child(5) { transition-delay: 0.25s; }
  .card-grid     [data-reveal]:nth-child(6) { transition-delay: 0.31s; }

  /* 4 — Feature-item : hover renforcement (border teal → bleu, halo léger) */
  .feature-item {
    transition: border-left-color 0.25s ease, box-shadow 0.25s ease;
  }
  .feature-item:hover {
    border-left-color: var(--color-primary);
    box-shadow: 0 3px 14px rgba(15,118,110,.10);
  }

  /* 5 — Visual placeholder : hover lift (sans toucher à aspect-ratio) */
  .visual-placeholder {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }
  .visual-placeholder:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(30,58,138,.12);
  }
}

/* 6 — Nav underline animé (desktop uniquement) */
@media (min-width: 768px) and (prefers-reduced-motion: no-preference) {
  .nav-menu li a { position: relative; }
  .nav-menu li a::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 0.75rem;
    right: 0.75rem;
    height: 2px;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
    border-radius: 1px;
  }
  .nav-menu li a:hover::after,
  .nav-menu li a[aria-current="page"]::after { transform: scaleX(1); }
}

/* ─── Reduced-motion reset — obligatoire ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
