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

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* ── Accessibility ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: .5rem 1rem;
  z-index: 9999;
  font-weight: 600;
  text-decoration: none;
}
.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: 0;
}

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  color: var(--color-primary);
}
h1 { font-size: clamp(1.6rem, 5vw, 2.6rem); margin-bottom: .75rem; }
h2 { font-size: clamp(1.3rem, 4vw, 2rem); margin-bottom: 1.5rem; padding-bottom: .5rem; border-bottom: 3px solid var(--color-secondary); display: inline-block; }
h3 { font-size: clamp(1.05rem, 3vw, 1.35rem); margin-bottom: .5rem; }
p { margin-bottom: 1rem; }
a { color: var(--color-accent); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
ul { padding-left: 1.25rem; margin-bottom: 1rem; }
li { margin-bottom: .4rem; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: .75rem 1.5rem;
  border-radius: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  cursor: pointer;
  text-align: center;
  transition: opacity .2s, transform .15s;
  text-decoration: none;
  border: 2px solid transparent;
}
.btn:hover, .btn:focus { opacity: .88; transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--color-secondary); color: #fff; }
.btn-outline { background: transparent; border-color: var(--color-primary); color: var(--color-primary); }

/* ── Header ── */
.site-header {
  background: var(--color-primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  gap: .75rem;
}
.logo-link { display: flex; align-items: center; }
.logo-link img { height: 40px; width: auto; }
.header-tel {
  color: var(--color-secondary);
  font-weight: 700;
  font-family: var(--font-display);
  font-size: .9rem;
  white-space: nowrap;
}
.header-tel:hover { color: #fff; text-decoration: none; }
.nav-toggle {
  background: none;
  border: 2px solid var(--color-secondary);
  color: var(--color-secondary);
  padding: .4rem .6rem;
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
}

/* ── Nav ── */
.site-nav {
  background: var(--color-primary);
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}
.site-nav.is-open { max-height: 400px; }
.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.site-nav a {
  display: block;
  color: #fff;
  padding: .75rem 1.25rem;
  font-family: var(--font-display);
  font-size: .95rem;
  border-top: 1px solid rgba(255,255,255,.1);
  transition: background .2s;
}
.site-nav a:hover, .site-nav a:focus { background: rgba(255,255,255,.12); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--color-secondary); }

/* Desktop nav */
@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .site-nav { max-height: none !important; overflow: visible; }
  .site-nav ul { flex-direction: row; }
  .site-nav a { border: none; padding: .75rem 1rem; }
}

/* ── CTA tel bar ── */
.cta-tel-bar {
  background: var(--color-secondary);
  text-align: center;
  padding: .5rem 1rem;
}
.cta-tel-bar a {
  color: #fff;
  font-weight: 700;
  font-family: var(--font-display);
  font-size: .9rem;
}
.cta-tel-bar a:hover { text-decoration: underline; }

/* ── Hero ── */
.hero {
  background: color-mix(in srgb, var(--color-primary) 6%, var(--color-bg));
  padding: 3rem 1rem 2rem;
}
.hero-inner {
  max-width: 900px;
  margin: 0 auto;
}
.hero h1 { color: var(--color-primary); margin-bottom: 1rem; }
.intro {
  font-size: 1.1rem;
  color: color-mix(in srgb, var(--color-text) 80%, transparent);
  max-width: 700px;
  margin-bottom: 1.5rem;
}
.hero-placeholder { margin: 1.5rem 0; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

/* ── Page hero ── */
.page-hero {
  background: color-mix(in srgb, var(--color-primary) 6%, var(--color-bg));
  padding: 2.5rem 1rem 2rem;
  border-bottom: 3px solid var(--color-secondary);
}
.page-hero h1 { max-width: 800px; }
.page-hero p { max-width: 700px; font-size: 1.05rem; margin-bottom: 0; }

/* ── Page content ── */
.page-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1rem;
}
.page-content section { margin-bottom: 3.5rem; }

/* ── Features grid ── */
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
@media (min-width: 640px) { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .features-grid { grid-template-columns: repeat(3, 1fr); } }

.feature {
  background: color-mix(in srgb, var(--color-primary) 4%, var(--color-bg));
  border-radius: 10px;
  padding: 1.5rem;
  border-left: 4px solid var(--color-secondary);
}
.feature-icon { font-size: 2rem; margin-bottom: .75rem; }

/* ── Cards grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
@media (min-width: 640px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--color-bg);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--color-text) 12%, transparent);
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  display: flex;
  flex-direction: column;
  padding-bottom: 1.25rem;
}
.card h3 { padding: 1rem 1.25rem .25rem; }
.card p { padding: 0 1.25rem; flex: 1; font-size: .95rem; }
.card .btn { margin: .5rem 1.25rem 0; align-self: flex-start; }

/* ── Zone badges ── */
.zone-badges { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.badge {
  background: color-mix(in srgb, var(--color-accent) 12%, var(--color-bg));
  color: var(--color-accent);
  border: 1px solid color-mix(in srgb, var(--color-accent) 30%, transparent);
  border-radius: 20px;
  padding: .3rem .85rem;
  font-size: .88rem;
  font-weight: 600;
}

/* ── CTA section ── */
.cta-section {
  background: color-mix(in srgb, var(--color-accent) 8%, var(--color-bg));
  border-radius: 12px;
  padding: 2.5rem 1.5rem;
  text-align: center;
}
.cta-section h2 { border: none; display: block; }
.cta-section .hero-ctas { justify-content: center; }
.cta-tagline { margin-top: 1.25rem; color: color-mix(in srgb, var(--color-text) 65%, transparent); font-size: .95rem; }

/* ── Service detail (services page) ── */
.service-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 12%, transparent);
}
@media (min-width: 768px) {
  .service-detail { grid-template-columns: 1fr 1fr; align-items: start; }
  .service-detail--reverse .service-visual { order: 2; }
  .service-detail--reverse .service-text { order: 1; }
}
.service-detail:last-of-type { border-bottom: none; }

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

/* ── Gallery grid ── */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}
@media (min-width: 640px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
.gallery-item { border-radius: 10px; overflow: hidden; }
.gallery-item h3 { margin-top: .75rem; font-size: 1rem; }
.gallery-item p { font-size: .9rem; margin-top: .25rem; }

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

.contact-dl dt { font-weight: 700; margin-top: 1rem; }
.contact-dl dd { margin-left: 0; margin-bottom: .5rem; }
.contact-dl a { color: var(--color-accent); }
.contact-map { margin-top: 1.5rem; }
.contact-map iframe { width: 100%; display: block; }
.contact-map p { margin-top: .5rem; font-size: .85rem; }

/* ── Contact form ── */
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-group label { font-weight: 600; font-size: .95rem; }
.form-group input,
.form-group select,
.form-group textarea {
  padding: .65rem .85rem;
  border: 1.5px solid color-mix(in srgb, var(--color-text) 25%, transparent);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color .2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 2px solid var(--color-accent);
  border-color: var(--color-accent);
}
.form-rgpd { font-size: .82rem; color: color-mix(in srgb, var(--color-text) 60%, transparent); margin-bottom: .5rem; }

/* ── Legal page ── */
.legal-content section { margin-bottom: 2rem; }
.legal-content h2 { font-size: 1.15rem; margin-bottom: .5rem; border: none; display: block; }

/* ── Visual placeholders ── */
.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));
}

/* ── Footer ── */
.site-footer {
  background: var(--color-primary);
  color: rgba(255,255,255,.85);
  margin-top: auto;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2.5rem 1rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}
@media (min-width: 640px) { .footer-inner { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .footer-inner { grid-template-columns: 1.5fr 1fr 1fr; } }

.footer-brand p { font-size: .9rem; margin-top: .75rem; }
.footer-nav h4, .footer-contact h4 {
  color: var(--color-secondary);
  font-family: var(--font-display);
  font-size: .95rem;
  margin-bottom: .75rem;
}
.footer-nav ul { list-style: none; padding: 0; }
.footer-nav a { color: rgba(255,255,255,.8); font-size: .9rem; display: block; padding: .15rem 0; }
.footer-nav a:hover { color: var(--color-secondary); text-decoration: none; }
.footer-contact p { font-size: .9rem; margin-bottom: .4rem; }
.footer-contact a { color: rgba(255,255,255,.8); }
.footer-contact a:hover { color: var(--color-secondary); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15);
  padding: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .5rem;
  font-size: .82rem;
  max-width: 1200px;
  margin: 0 auto;
  color: rgba(255,255,255,.6);
}
.footer-bottom a { color: rgba(255,255,255,.6); }
.footer-bottom a:hover { color: var(--color-secondary); }

/* ── Motion pass (WEB-5700) ─────────────────────────────
   Effets discrets, GPU-friendly, thème aquatique pisciniste.
   Tous encapsulés dans prefers-reduced-motion: no-preference.
   Bloc reduce en fin de fichier annule tout pour l'accessibilité. */

.visual-placeholder { background-size: 220% 220%; background-position: 0% 50%; }
.card,
.feature,
.badge,
.gallery-item,
.visual-placeholder,
.cta-section,
.header-tel,
.footer-nav a,
.footer-contact a { will-change: auto; }

@media (prefers-reduced-motion: no-preference) {

  /* 1. Aqua shimmer — le dégradé des placeholders glisse comme la surface d'un bassin */
  .visual-placeholder { animation: aeau-shimmer 16s ease-in-out infinite; }
  @keyframes aeau-shimmer {
    0%,100% { background-position: 0% 50%; }
    50%     { background-position: 100% 50%; }
  }
  .visual-placeholder { transition: transform .4s ease, box-shadow .4s ease; }
  .card:hover .visual-placeholder,
  .gallery-item:hover .visual-placeholder {
    transform: scale(1.015);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--color-accent) 22%, transparent);
  }

  /* 2. Cards & feature — lift et halo teal (accent) au survol */
  .card {
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
  }
  .card:hover, .card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px color-mix(in srgb, var(--color-accent) 18%, transparent);
    border-color: color-mix(in srgb, var(--color-accent) 45%, transparent);
  }
  .feature {
    transition: transform .3s ease, border-left-width .2s ease, background-color .3s ease;
  }
  .feature:hover {
    transform: translateY(-2px);
    border-left-width: 6px;
    background: color-mix(in srgb, var(--color-accent) 7%, var(--color-bg));
  }

  /* 3. Badges zone d'intervention — micro-scale au survol */
  .badge {
    transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
  }
  .badge:hover {
    transform: translateY(-1px) scale(1.04);
    background: color-mix(in srgb, var(--color-accent) 22%, var(--color-bg));
    border-color: color-mix(in srgb, var(--color-accent) 55%, transparent);
  }

  /* 4. Header tel + footer links — soulignement accent qui pousse */
  .header-tel,
  .footer-nav a,
  .footer-contact a {
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0% 1.5px;
    transition: background-size .3s ease, color .2s ease;
  }
  .header-tel:hover,
  .footer-nav a:hover,
  .footer-contact a:hover { background-size: 100% 1.5px; text-decoration: none; }

  /* 5. Scroll reveal — fade + translateY (activé par main.js via IntersectionObserver
        ou par CSS scroll-driven sur les navigateurs récents). Fallback : contenu visible
        même si JS off (voir .no-js plus bas). */
  .reveal-init {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .7s ease-out, transform .7s ease-out;
  }
  .reveal-init.is-visible {
    opacity: 1;
    transform: none;
  }
  /* Sur navigateurs supportant scroll-timeline (Chromium 115+), on double via CSS pur */
  @supports (animation-timeline: view()) {
    .card, .feature, .gallery-item, .service-detail, .cta-section {
      animation: aeau-rise linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 30%;
    }
    @keyframes aeau-rise {
      from { opacity: 0; transform: translateY(24px); }
      to   { opacity: 1; transform: none; }
    }
  }

  /* 6. Focus-visible ring cohérent avec la palette (teal accent + offset) */
  .btn:focus-visible,
  .badge:focus-visible,
  .card a:focus-visible,
  .site-nav a:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--color-accent) 90%, transparent);
    outline-offset: 3px;
    border-radius: 6px;
  }

  /* Menu mobile — transition plus douce que la valeur par défaut */
  .site-nav { transition: max-height .35s cubic-bezier(.4,0,.2,1); }
}

/* Accessibilité : coupe tout le motion si prefers-reduced-motion: reduce */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .reveal-init { opacity: 1 !important; transform: none !important; }
}
