@import url("tokens.css");

/* ===== RESET & BASE ===== */
*, *::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.65;
}

img, svg { max-width: 100%; height: auto; }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ===== 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.1rem, 3vw, 1.35rem); }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--color-secondary);
  text-decoration: none;
}
a:hover, a:focus {
  text-decoration: underline;
  color: var(--color-accent);
}

ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.5rem; }

/* ===== LAYOUT ===== */
.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

section { padding: 3.5rem 0; }

.section-alt {
  background: color-mix(in srgb, var(--color-primary) 5%, var(--color-bg));
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.section-header h2 { margin-bottom: 0.5rem; }
.section-header .lead {
  color: #6b7280;
  max-width: 620px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  padding: 0.8rem 1.75rem;
  border-radius: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--color-secondary);
  color: #fff;
  border-color: var(--color-secondary);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--color-text);
}

.btn-outline {
  background: transparent;
  color: var(--color-secondary);
  border-color: var(--color-secondary);
}
.btn-outline:hover, .btn-outline:focus {
  background: var(--color-secondary);
  color: #fff;
}

.btn-white {
  background: #fff;
  color: var(--color-primary);
  border-color: #fff;
}
.btn-white:hover, .btn-white:focus {
  background: var(--color-accent);
  color: var(--color-text);
  border-color: var(--color-accent);
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.75rem;
}

/* ===== HEADER & NAV ===== */
.site-header {
  background: var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.nav-logo img {
  height: 38px;
  width: auto;
  filter: brightness(0) invert(1);
}
.nav-logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  letter-spacing: 0.08em;
}
.nav-logo-text span { color: var(--color-accent); }

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: #fff;
  min-width: 44px;
  min-height: 44px;
}

.burger {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  position: relative;
  transition: background 0.2s;
}
.burger::before, .burger::after {
  content: "";
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  position: absolute;
  left: 0;
  transition: transform 0.3s ease, top 0.3s ease;
}
.burger::before { top: -7px; }
.burger::after { top: 7px; }

.nav-toggle[aria-expanded="true"] .burger { background: transparent; }
.nav-toggle[aria-expanded="true"] .burger::before {
  top: 0;
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .burger::after {
  top: 0;
  transform: rotate(-45deg);
}

.nav-menu {
  display: none;
  position: absolute;
  top: 64px;
  left: 0;
  width: 100%;
  background: var(--color-primary);
  list-style: none;
  padding: 0.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.nav-menu.is-open { display: block; }

.nav-menu li a {
  display: block;
  padding: 0.85rem 1.5rem;
  color: rgba(255,255,255,0.9);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: color 0.15s, background 0.15s;
}
.nav-menu li:last-child a { border-bottom: none; }
.nav-menu li a:hover,
.nav-menu li a[aria-current="page"] {
  color: var(--color-accent);
  background: rgba(255,255,255,0.05);
  text-decoration: none;
}

@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .nav-menu {
    display: flex !important;
    position: static;
    background: none;
    border-top: none;
    box-shadow: none;
    width: auto;
    gap: 0.25rem;
    padding: 0;
  }
  .nav-menu li a {
    padding: 0.5rem 1rem;
    border-bottom: none;
    border-radius: 4px;
    font-size: 0.85rem;
  }
  .nav-menu li a:hover,
  .nav-menu li a[aria-current="page"] {
    background: rgba(255,255,255,0.1);
  }
}

/* ===== HERO ===== */
.hero {
  background: var(--color-primary);
  color: #fff;
  overflow: hidden;
}

.hero-inner {
  padding: 3.5rem 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}

.hero h1 {
  color: #fff;
  margin-bottom: 0.75rem;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--color-accent);
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.25rem;
}

.hero-intro {
  color: rgba(255,255,255,0.8);
  max-width: 560px;
  font-size: 1.05rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    min-height: 420px;
  }
  .hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 2rem 4rem 0;
  }
  .hero-visual-col {
    display: flex;
    align-items: stretch;
  }
  .hero-visual-col .visual-placeholder {
    aspect-ratio: auto;
    flex: 1;
    border-radius: 0;
  }
  .hero-inner {
    padding: 0 1.25rem;
    display: contents;
  }
  .hero-grid > .hero-content {
    padding-left: 1.25rem;
  }
}

/* ===== FEATURES / QUICK SERVICES ===== */
.features-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .features-grid { grid-template-columns: repeat(3, 1fr); }
}

.feature-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.07);
  padding: 1.5rem;
  border-top: 3px solid var(--color-secondary);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 22px rgba(0,0,0,0.11);
}
.feature-card h3 {
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}
.feature-card p {
  color: #4b5563;
  font-size: 0.95rem;
}

/* ===== ABOUT (homepage section) ===== */
.about-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 768px) {
  .about-grid { grid-template-columns: 1fr 1fr; }
}

.about-text h2 { margin-bottom: 1rem; }
.about-text p { color: #374151; }
.about-text blockquote {
  border-left: 3px solid var(--color-secondary);
  padding: 0.75rem 1rem;
  font-style: italic;
  color: #6b7280;
  background: color-mix(in srgb, var(--color-secondary) 5%, #fff);
  border-radius: 0 4px 4px 0;
  margin: 1.5rem 0;
}

/* ===== ZONE ===== */
.zone-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  list-style: none;
  padding: 0;
}
.zone-chip {
  background: var(--color-secondary);
  color: #fff;
  padding: 0.4rem 1.1rem;
  border-radius: 20px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
}

/* ===== CTA BAND ===== */
.cta-band {
  background: var(--color-secondary);
  padding: 3rem 1.25rem;
  text-align: center;
}
.cta-band h2 { color: #fff; margin-bottom: 0.5rem; }
.cta-band p { color: rgba(255,255,255,0.88); margin-bottom: 1.75rem; font-size: 1.05rem; }

/* ===== PAGE HERO (inner pages) ===== */
.page-hero {
  background: var(--color-primary);
  padding: 3rem 1.25rem;
  color: #fff;
}
.page-hero h1 { color: #fff; margin-bottom: 0.5rem; }
.page-hero .lead {
  color: rgba(255,255,255,0.75);
  font-size: 1.05rem;
  max-width: 600px;
}
.page-hero .breadcrumb {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.75rem;
}
.page-hero .breadcrumb a { color: rgba(255,255,255,0.6); text-decoration: none; }
.page-hero .breadcrumb a:hover { color: var(--color-accent); }

/* ===== SERVICES PAGE ===== */
.service-detail-section {
  padding: 3rem 0;
  border-bottom: 1px solid #e5e7eb;
}
.service-detail-section:last-child { border-bottom: none; }

.service-detail-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 768px) {
  .service-detail-grid { grid-template-columns: 1fr 1fr; }
  .service-detail-grid.reverse { direction: rtl; }
  .service-detail-grid.reverse > * { direction: ltr; }
}

.service-detail-text h2 {
  color: var(--color-primary);
  margin-bottom: 1rem;
}
.service-detail-text p { color: #374151; }
.service-detail-text ul {
  margin-top: 1rem;
  color: #374151;
}
.service-detail-text ul li {
  padding-left: 0.25rem;
}
.service-detail-text ul li::marker {
  color: var(--color-secondary);
}

/* ===== CONTACT PAGE ===== */
.contact-layout {
  display: grid;
  gap: 3rem;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) {
  .contact-layout { grid-template-columns: 1fr 1fr; }
}

.contact-form label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--color-primary);
  font-size: 0.9rem;
  font-family: var(--font-display);
}
.contact-form .field { margin-bottom: 1.25rem; }

.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-secondary) 20%, transparent);
}
.contact-form textarea { resize: vertical; min-height: 130px; }

.contact-form .btn { width: 100%; text-align: center; margin-top: 0.5rem; }

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

.info-block {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}
.info-icon {
  width: 44px;
  height: 44px;
  background: color-mix(in srgb, var(--color-secondary) 12%, #fff);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-secondary);
  font-size: 1.25rem;
}
.info-content strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary);
  margin-bottom: 0.2rem;
}
.info-content p, .info-content a { color: #374151; font-size: 0.95rem; }
.info-content a { text-decoration: none; }
.info-content a:hover { color: var(--color-secondary); text-decoration: underline; }

.contact-tel {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--color-secondary);
}

.map-wrapper {
  margin-top: 1.5rem;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #e5e7eb;
}
.osm-frame {
  width: 100%;
  height: 260px;
  border: 0;
  display: block;
}
@media (min-width: 768px) {
  .osm-frame { height: 320px; }
}

.rgpd-notice {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #f3f4f6;
  line-height: 1.5;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--color-primary);
  color: rgba(255,255,255,0.75);
  padding: 3rem 0 0;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  padding-bottom: 2.5rem;
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }

.footer-brand p {
  font-size: 0.9rem;
  margin-top: 0.75rem;
  color: rgba(255,255,255,0.55);
  max-width: 280px;
}
.footer-brand img { filter: brightness(0) invert(1); height: 36px; width: auto; }

.footer-nav h4, .footer-contact h4 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: 1rem;
}
.footer-nav ul { list-style: none; padding: 0; }
.footer-nav li { margin-bottom: 0.5rem; }
.footer-nav a {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  text-decoration: none;
}
.footer-nav a:hover { color: var(--color-accent); }

.footer-contact address { font-style: normal; font-size: 0.9rem; line-height: 1.9; }
.footer-contact a { color: rgba(255,255,255,0.7); }
.footer-contact a:hover { color: var(--color-accent); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.35);
}
.footer-bottom a { color: rgba(255,255,255,0.45); }
.footer-bottom a:hover { color: var(--color-accent); }

/* ===== VISUAL PLACEHOLDER ===== */
.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));
}

/* ===== ANIMATIONS ===== */
@media (prefers-reduced-motion: no-preference) {
  /* --- Scroll reveal (base) --- */
  .fade-in {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
    will-change: opacity, transform;
  }
  .fade-in.visible {
    opacity: 1;
    transform: translateY(0);
  }
  .fade-in:nth-child(2) { transition-delay: 0.08s; }
  .fade-in:nth-child(3) { transition-delay: 0.16s; }
  .fade-in:nth-child(4) { transition-delay: 0.24s; }
  .fade-in:nth-child(5) { transition-delay: 0.32s; }
  .fade-in:nth-child(6) { transition-delay: 0.4s; }

  /* --- Hero entrance (au chargement, échelonné) --- */
  @keyframes hero-rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .hero-tagline,
  .hero h1,
  .hero-intro,
  .hero-cta {
    animation: hero-rise 0.7s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }
  .hero h1        { animation-delay: 0.08s; }
  .hero-intro     { animation-delay: 0.18s; }
  .hero-cta       { animation-delay: 0.28s; }
  .hero-visual-col .visual-placeholder {
    animation: hero-rise 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0.15s both;
  }

  /* --- Placeholders : dégradé qui glisse doucement --- */
  .visual-placeholder {
    background-size: 180% 180%;
    background-position: 0% 0%;
    transition: background-position 0.6s ease, transform 0.35s ease,
                box-shadow 0.35s ease;
  }
  .visual-placeholder:hover {
    background-position: 100% 100%;
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  }

  /* --- Feature cards : hover renforcé, accent bar qui grandit --- */
  .feature-card {
    position: relative;
    overflow: hidden;
  }
  .feature-card::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  .feature-card:hover::after,
  .feature-card:focus-within::after {
    transform: scaleX(1);
  }

  /* --- Zone chips : petit pulse au hover --- */
  .zone-chip {
    transition: transform 0.2s ease, background-color 0.2s ease,
                box-shadow 0.2s ease;
    cursor: default;
  }
  .zone-chip:hover {
    transform: translateY(-2px);
    background: var(--color-accent);
    color: var(--color-text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  /* --- Boutons : ombre subtile au hover --- */
  .btn-primary:hover,
  .btn-white:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  }
  .btn-outline:hover {
    box-shadow: 0 4px 12px color-mix(in srgb, var(--color-secondary) 30%, transparent);
  }

  /* --- Liens du menu : soulignement animé --- */
  @media (min-width: 768px) {
    .nav-menu li a {
      position: relative;
    }
    .nav-menu li a::after {
      content: "";
      position: absolute;
      left: 1rem;
      right: 1rem;
      bottom: 4px;
      height: 2px;
      background: var(--color-accent);
      transform: scaleX(0);
      transform-origin: left center;
      transition: transform 0.28s cubic-bezier(0.22, 0.61, 0.36, 1);
    }
    .nav-menu li a:hover::after,
    .nav-menu li a[aria-current="page"]::after {
      transform: scaleX(1);
    }
  }

  /* --- CTA band : léger shift du fond au hover d'un bouton interne --- */
  .cta-band {
    background: linear-gradient(
      120deg,
      var(--color-secondary) 0%,
      color-mix(in srgb, var(--color-secondary) 82%, var(--color-primary)) 100%
    );
    background-size: 160% 160%;
    background-position: 0% 50%;
    transition: background-position 0.9s ease;
  }
  .cta-band:hover { background-position: 100% 50%; }

  /* --- Info blocks (contact) : icône qui rebondit au hover --- */
  .info-block {
    transition: transform 0.25s ease;
  }
  .info-block:hover .info-icon {
    transform: scale(1.08) rotate(-4deg);
    background: color-mix(in srgb, var(--color-secondary) 20%, #fff);
  }
  .info-icon {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.3s ease;
  }

  /* --- Service detail : image side glisse depuis le bord --- */
  .service-detail-grid .visual-placeholder {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.7s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  .service-detail-grid.reverse .visual-placeholder {
    transform: translateX(20px);
  }
  .service-detail-grid.is-visible .visual-placeholder {
    opacity: 1;
    transform: translateX(0);
  }
}

/* --- Focus visible élégant (toujours actif, hors reduced-motion pour la transition) --- */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.btn:focus-visible {
  outline-offset: 4px;
}
