:root{
  --brand:#77B28C;
  --brand-2:#5a9866;
  --text:#333;
  --muted:#666;
  --bg:#fff;
  --container:1200px;
  --space-1:0.5rem;
  --space-2:1rem;
  --space-3:1.5rem;
  --space-4:2rem;
  --radius:20px;
  --shadow:0 10px 30px rgba(0,0,0,.10);
  --shadow-lg:0 20px 50px rgba(0,0,0,.15);
  --header-h:64px; /* hauteur header fixe */
}

/* reset + anchor offset for fixed header */
*{margin:0;padding:0;box-sizing:border-box}
html{scroll-behavior:smooth;scroll-padding-top:var(--header-h);}
body{
  font-family:system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height:1.6;color:var(--text);
  background:linear-gradient(135deg,var(--brand) 0%, var(--brand-2) 100%);
}
body.no-scroll{ overflow:hidden; }

img,svg{max-width:100%;height:auto;display:block}
.container{max-width:var(--container);margin:0 auto;padding:0 var(--space-2)}

/* Header */
header{
  background:rgba(255,255,255,.95);
  backdrop-filter:saturate(180%) blur(10px);
  box-shadow:0 8px 32px rgba(0,0,0,.1);
  position:fixed; inset:0 0 auto 0; z-index:1000; transition:all .3s ease;
}
nav{
  display:flex;align-items:center;justify-content:space-between;gap:var(--space-2);
  padding:1rem 0;
}
.logo{display:flex;align-items:center;gap:.6rem;font-size:clamp(1.1rem,2vw,1.4rem);font-weight:700;color:var(--brand);text-decoration:none}
.logo-icon{width:40px;height:40px}

.nav-links{display:flex;list-style:none;gap:clamp(1rem,3vw,2rem)}
.nav-links a{text-decoration:none;color:var(--text);font-weight:500}
.nav-links a:hover{color:var(--brand)}

/* Mobile menu button */
.nav-toggle{display:none;gap:4px;background:transparent;border:0;padding:.5rem;cursor:pointer}
.nav-toggle-bar{display:block;width:26px;height:2px;background:#333;border-radius:2px}
.nav-toggle-bar+.nav-toggle-bar{margin-top:6px}

/* Hero (mobile-first) */
.hero{
  /* triple fallback hauteur (mobile-first) */
  min-height:100svh;
  display:flex; align-items:center; justify-content:center;
  padding-top:100px; background:linear-gradient(135deg,var(--brand) 0%, var(--brand-2) 100%);
  position:relative; overflow:hidden;
}
@supports not (height:100dvh){
  .hero{ min-height:100vh; }
}

.hero-container{
  display:grid;grid-template-columns:1fr 1fr;gap:clamp(1.5rem,3vw,4rem);
  align-items:center;max-width:var(--container);width:100%;padding:0 var(--space-2)
}
.hero-content{color:#fff}
.hero h1{font-size:clamp(2rem,6vw,3.5rem);margin-bottom:1rem;font-weight:800;text-wrap:balance}
.hero .slogan{font-size:clamp(1.05rem,2.4vw,1.5rem);margin-bottom:1rem;opacity:.95}
.hero .description{font-size:clamp(.98rem,1.6vw,1.1rem);margin-bottom:2rem;opacity:.9;line-height:1.7}
.hero-image{position:relative;z-index:2}
.hero-image img{
  width:100%;border-radius:var(--radius);box-shadow:0 20px 50px rgba(0,0,0,.3);
  aspect-ratio:4/3;object-fit:cover
}

.cta-button{
  display:inline-block;background:rgba(255,255,255,.2);color:#fff;padding:12px 28px;text-decoration:none;
  border-radius:999px;font-size:1rem;font-weight:700;border:2px solid rgba(255,255,255,.3);
  backdrop-filter:blur(10px);transition:all .3s ease
}
.cta-button:hover{background:rgba(255,255,255,.3);transform:translateY(-3px);box-shadow:0 10px 25px rgba(0,0,0,.2)}

/* Sections */
.section{padding:clamp(3rem,6vw,5rem) 0;background:#fff}
.section:nth-of-type(even){background:#f8f9fa}
.section-title{
  text-align:center;font-size:clamp(1.6rem,4vw,2.5rem);margin-bottom:clamp(1.5rem,4vw,3rem);color:#333;position:relative
}
.section-title::after{
  content:'';position:absolute;bottom:-10px;left:50%;transform:translateX(-50%);
  width:80px;height:4px;background:linear-gradient(90deg,var(--brand),var(--brand-2));border-radius:2px
}

/* Services Grid */
.services-grid{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));
  gap:clamp(1rem,3vw,2rem);margin-top:clamp(1.5rem,3vw,3rem)
}
.service-card{
  background:#fff;padding:clamp(1rem,3vw,2rem);border-radius:15px;text-align:center;
  box-shadow:var(--shadow);transition:transform .3s ease, box-shadow .3s ease;border:1px solid #f0f0f0
}
.service-card:hover{transform:translateY(-6px);box-shadow:var(--shadow-lg)}
.service-card .icon{width:48px;height:48px;margin-inline:auto;margin-bottom:.75rem;color:var(--brand)}
.service-card h3{font-size:clamp(1.05rem,1.8vw,1.3rem);margin-bottom:.5rem}
.service-card p{color:var(--muted)}

/* Features */
.features{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));
  gap:clamp(1.25rem,3vw,3rem);margin-top:clamp(1.5rem,3vw,3rem)
}
.feature{display:flex;align-items:flex-start;gap:1rem}
.feature-icon{
  background:linear-gradient(135deg,var(--brand),var(--brand-2));color:#fff;padding:1rem;border-radius:50%;
  font-size:1.25rem;min-width:56px;height:56px;display:flex;align-items:center;justify-content:center
}
.feature-content h3{font-size:clamp(1.05rem,2vw,1.3rem);margin-bottom:.25rem}
.feature-content p{color:var(--muted)}

/* About */
.about-content{text-align:center;max-width:800px;margin:0 auto;font-size:clamp(1rem,1.8vw,1.2rem);color:#555;line-height:1.8;padding:0 var(--space-2)}

/* Footer */
footer{background:#2c3e50;color:#fff;text-align:center;padding:clamp(2rem,5vw,3rem) 0}
.footer-content{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));
  gap:clamp(1rem,3vw,2rem);margin-bottom:1.25rem
}
.footer-section h3{margin-bottom:.6rem;color:var(--brand)}
.footer-section p,.footer-section a{color:#bdc3c7;text-decoration:none;line-height:1.6}
.footer-section a:hover{color:#fff}
.social-links{display:flex;justify-content:center;gap:1rem;margin-top:1rem}
.social-links a{background:var(--brand);color:#fff;padding:.7rem;border-radius:50%;text-decoration:none;transition:background .3s ease}
.social-links a:hover{background:var(--brand-2)}

/* ================= Animations stables ================= */
/* Utiliser .reveal sur les éléments, puis .is-visible ajouté par l'observer */
.reveal{ opacity:0; transform:translateY(30px); }
.reveal.is-visible{ animation:fadeInUp 700ms ease forwards; }

@keyframes fadeInUp{ to{ opacity:1; transform:translateY(0) } }

@media (prefers-reduced-motion:reduce){
  *{animation:none !important;transition:none !important;scroll-behavior:auto}
  .reveal, .reveal.is-visible{ opacity:1; transform:none }
}

/* ================= Breakpoints ================= */
@media (max-width:1200px){
  .container{padding:0 1rem}
}

@media (max-width:992px){
  .hero-container{grid-template-columns:1fr;text-align:center}
  .hero-image{order:-1}
  .hero .description{margin-inline:auto;max-width:60ch}
}

@media (max-width:768px){
  /* mobile nav */
  .nav-toggle{display:inline-flex}
  .nav-links{
    position:fixed; inset:64px 0 auto 0; background:#fff;
    flex-direction:column; gap:.5rem; padding:1rem 1.25rem; border-bottom:1px solid #eee;
    transform:translateY(-120%); transition:transform .25s ease; box-shadow:0 10px 25px rgba(0,0,0,.06);
    z-index:999;
  }
  .nav-links.open{ transform:translateY(0); }
  .nav-links a{padding:.6rem 0}

  /* overlay douce sous le menu */
  .nav-links.open::before{
    content:"";
    position:fixed; inset:64px 0 0 0;
    background:rgba(0,0,0,.04);
    pointer-events:none;
  }

  .hero h1{letter-spacing:.2px}
  .services-grid,.features{gap:1rem}
}

@media (max-width:480px){
  .logo-icon{width:32px;height:32px}
  .cta-button{padding:10px 22px;font-size:.95rem}
}

/* ======== Desktop / Tablet ======== */
@media (min-width:768px){
  /* Hero plein écran sous header avec dvh + fallback */
  .hero{
    padding-top:0 !important;
    margin-top:0;
    min-height:calc(100dvh - var(--header-h));
  }
  @supports not (height:100dvh){
    .hero{ min-height:calc(100vh - var(--header-h)); }
  }

  /* Grille full width */
  .hero-container{
    max-width:none;
    width:100vw;
    margin:0;
    padding:0;
    display:grid;
    grid-template-columns:1fr 1fr;
    align-items:stretch;
  }

  /* Confort de lecture */
  .hero-content{
    align-self:center;
    padding:clamp(16px, 3vw, 48px);
    max-width:60ch;
  }

  /* Image pleine hauteur */
  .hero-image{
    order:0;
    position:relative;
    height:100%;
    overflow:hidden;
  }
  .hero-image img{
    width:100%;
    height:100%;
    object-fit:cover;
    aspect-ratio:auto;
    border-radius:0;
    box-shadow:none;
  }

  /* --- Fallback overlay par défaut --- */
  .hero-image::before{
    content:"";
    position:absolute;
    top:0;
    left:clamp(-12vw, -10vw, -80px);
    width:clamp(22vw, 28vw, 360px);
    height:100%;
    background:linear-gradient(
      100deg,
      var(--brand) 0%,
      color-mix(in srgb, var(--brand) 70%, transparent) 40%,
      color-mix(in srgb, var(--brand) 35%, transparent) 70%,
      transparent 100%
    );
    pointer-events:none;
    z-index:2;
  }

  /* --- Si le mask est supporté, on l’utilise et on coupe l’overlay --- */
  @supports (-webkit-mask-image: linear-gradient(#000, #000)) or (mask-image: linear-gradient(#000, #000)) {
    .hero-image::before{ display:none !important; }
    .hero-image img{
      -webkit-mask-image: linear-gradient(
        to right,
        rgba(0,0,0,0)   0%,
        rgba(0,0,0,.15) 8%,
        rgba(0,0,0,.35) 16%,
        rgba(0,0,0,.55) 24%,
        rgba(0,0,0,.75) 34%,
        #000            50%,
        #000           100%
      );
              mask-image: linear-gradient(
        to right,
        rgba(0,0,0,0)   0%,
        rgba(0,0,0,.15) 8%,
        rgba(0,0,0,.35) 16%,
        rgba(0,0,0,.55) 24%,
        rgba(0,0,0,.75) 34%,
        #000            50%,
        #000           100%
      );
      -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat;
      -webkit-mask-size:100% 100%;   mask-size:100% 100%;
    }
  }
}

/* Micro-ajustements très petits écrans */
@media (max-width:360px){
  .container{ padding:0 .75rem; }
  .hero .description{ font-size:.95rem; }
  .service-card, .feature{ padding:.875rem; }
}

/* ====== Mobile Tab Bar (style app mobile) ====== */
@media (max-width:768px){
  /* On cache le burger et les liens du header (on garde juste le logo) */
  .nav-toggle, .nav-links{ display:none !important; }

  /* Espace pour ne pas masquer le contenu derrière la barre */
  body{ padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }

  .mobile-tabbar{
    position:fixed; left:0; right:0; bottom:0;
    height:64px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255,255,255,.96);
    backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 -6px 24px rgba(0,0,0,.08);
    display:flex; align-items:center; justify-content:space-around;
    z-index:1001;
  }

  .mobile-tabbar .tab{
    flex:1 1 0;
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    gap:4px; text-decoration:none;
    color: #555;
    font-size:12px; line-height:1;
    padding:8px 6px;
    min-width: 64px;
  }

  .mobile-tabbar .tab i{
    font-size:20px; /* taille icône */
    line-height:1;
  }

  .mobile-tabbar .tab[aria-selected="true"]{
    color: var(--brand);
  }

  /* Effet de survol/tap */
  .mobile-tabbar .tab:active{ transform: translateY(1px); }
}

/* Masquer la tabbar sur desktop/tablette large */
@media (min-width:769px){
  .mobile-tabbar{ display:none; }
}

/* Texte global */
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Titres */
h1, h2, h3, .section-title {
  font-family: "Poppins", "Inter", sans-serif;
  font-weight: 700;
  letter-spacing: -0.5px; /* rend plus moderne */
}
