/* ============================================================
   CHATELIN ÉLAGAGE — direction « Canopée »
   Papier ivoire · vert sapin profond · mousse · Fraunces + Karla
   ============================================================ */

:root {
  --paper: #f6f3ea;
  --paper-2: #ede8d8;
  --ink: #1c2a1e;
  --ink-soft: #44523f;
  --pine-900: #142b1a;
  --pine-700: #1e4d2b;
  --pine-600: #266b39;
  --moss: #6e8b4d;
  --moss-soft: #9aae7a;
  --bark: #7a5c3e;
  --line: rgba(28, 42, 30, 0.14);
  --accent: #b5cc4a;
  --radius: 14px;
  --shadow-soft: 0 10px 30px -12px rgba(20, 43, 26, 0.25);
  --shadow-pop: 0 18px 44px -14px rgba(20, 43, 26, 0.38);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Karla", "Segoe UI", system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip; /* aucun débordement horizontal */
}

/* les enfants de grilles ne forcent jamais la largeur */
.hero-grid > *, .zone-grid > *, .contact-grid > *, .footer-grid > * { min-width: 0; }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--pine-700); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pine-600); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 640;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 em, h2 em {
  font-style: italic;
  font-weight: 500;
  color: var(--pine-600);
}

p { margin: 0 0 1em; }

.wrap { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }
.wrap-narrow { width: min(780px, 100% - 2.5rem); margin-inline: auto; }

.section { padding: clamp(4.5rem, 10vw, 8rem) 0; }

.section-head { margin-bottom: clamp(2.5rem, 6vw, 4.5rem); max-width: 640px; }
.section-head h2 { font-size: clamp(1.9rem, 4.2vw, 3rem); }

.kicker {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bark);
  margin-bottom: 0.9em;
}

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

.skip {
  position: absolute; left: -200vw; top: 0;
  background: var(--pine-700); color: var(--paper);
  padding: 0.7rem 1.2rem; z-index: 200; border-radius: 0 0 10px 0;
}
.skip:focus { left: 0; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  padding: 0.78rem 1.4rem; border-radius: 12px;
  text-decoration: none; border: 2px solid transparent;
  cursor: pointer; line-height: 1.2;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background-color 0.2s, color 0.2s;
}
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn-solid { background: var(--pine-700); color: var(--paper); box-shadow: var(--shadow-soft); }
.btn-solid:hover { background: var(--pine-600); color: var(--paper); transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); transform: translateY(-2px); }
.btn-lg { padding: 0.95rem 1.7rem; font-size: 1.06rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:focus-visible, a:focus-visible, summary:focus-visible, button:focus-visible {
  outline: 3px solid var(--moss); outline-offset: 2px;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.topbar.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px -18px rgba(20, 43, 26, 0.5); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 72px; }

.brand {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-weight: 640; font-size: 1.35rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
}
.brand em { font-style: italic; font-weight: 500; color: var(--pine-600); }
.brand-leaf { width: 1.5rem; height: 1.5rem; color: var(--pine-600); }

.mainnav { display: flex; align-items: center; gap: 1.5rem; }
.mainnav > a:not(.btn) {
  font-weight: 700; font-size: 0.98rem; color: var(--ink);
  text-decoration: none; position: relative;
}
.mainnav > a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: -6px;
  height: 2.5px; background: var(--moss); border-radius: 2px;
  transition: right 0.3s var(--ease-out);
}
.mainnav > a:not(.btn):hover::after { right: 0; }
.mainnav .nav-admin { opacity: 0.6; font-size: 0.88rem; }

.topbar-mobile { display: none; align-items: center; gap: 0.55rem; }
.topbar-phone { padding: 0; width: 46px; height: 46px; border-radius: 50%; justify-content: center; }
.topbar-phone svg { width: 1.25rem; height: 1.25rem; }

.nav-toggle {
  display: none; background: none; border: 0; padding: 0.6rem;
  cursor: pointer; border-radius: 8px;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
  content: ""; display: block; width: 26px; height: 3px;
  background: var(--ink); border-radius: 2px;
  transition: transform 0.3s var(--ease-out), opacity 0.2s;
}
.nav-toggle-bar { position: relative; }
.nav-toggle-bar::before { position: absolute; top: -8px; }
.nav-toggle-bar::after { position: absolute; top: 8px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: rotate(-90deg) translateX(-8px); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { opacity: 0; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(1100px 520px at 85% -10%, rgba(110, 139, 77, 0.16), transparent 65%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(5rem, 10vw, 7.5rem);
  overflow: hidden;
}
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 7vw, 4.6rem); }
.lede { font-size: clamp(1.05rem, 2vw, 1.22rem); color: var(--ink-soft); max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 0.9rem; margin: 1.6rem 0 1.2rem; }
.hero-badge {
  display: flex; align-items: center; gap: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 700;
}
.hero-badge::before {
  content: "";
  width: 0.55rem; height: 0.55rem; border-radius: 50%;
  background: var(--moss); flex: none;
}
.hero-photo {
  margin: 0;
  border-radius: 999px 999px var(--radius) var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-pop);
  max-width: min(100%, 470px);
  justify-self: center;
  border: 6px solid var(--paper);
}
.hero-photo img { aspect-ratio: 1; object-fit: cover; }

.wave { position: absolute; left: 0; right: 0; bottom: -1px; color: var(--paper); line-height: 0; }
.wave svg { width: 100%; height: clamp(34px, 6vw, 90px); display: block; }

/* ---------- Services (épuré : à plat, beaucoup d'air) ---------- */
.services-grid { display: grid; gap: 2.4rem 2.6rem; }
.service-card { border-top: 1px solid var(--line); padding-top: 1.6rem; }
.service-card h3 { font-size: 1.3rem; margin-top: 1rem; }
.service-card p { color: var(--ink-soft); font-size: 0.99rem; margin-bottom: 0.5em; }
.service-icon { width: 44px; height: 44px; color: var(--pine-700); }
.service-icon svg { width: 100%; height: 100%; }
.examples {
  font-size: 0.85rem; color: var(--bark);
  letter-spacing: 0.01em; margin: 0;
}
.services-foot { margin-top: 3rem; color: var(--ink-soft); }

/* ---------- Valeurs ---------- */
.values {
  background: var(--pine-900);
  color: var(--paper);
  padding: clamp(4rem, 9vw, 6rem) 0;
}
.values-grid { display: grid; gap: 2.2rem; }
.value h3 { color: var(--paper); font-size: 1.3rem; margin: 0.4rem 0; }
.value p { color: rgba(246, 243, 234, 0.78); margin: 0; }
.value-num {
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: 2.6rem; color: var(--accent); line-height: 1;
}

/* ---------- Réalisations : carrousel scroll-snap ---------- */
.carousel-track {
  display: flex; gap: 1.1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.25rem 0.25rem 0.75rem;
  scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-track:focus-visible { outline: 3px solid var(--moss); outline-offset: 3px; border-radius: 8px; }
.carousel-track .work { flex: 0 0 min(86%, 460px); scroll-snap-align: start; }

.carousel-ui { display: flex; align-items: center; gap: 1.6rem; margin-top: 1.2rem; }
.carousel-progress {
  flex: 1; height: 3px; border-radius: 99px;
  background: var(--line); overflow: hidden;
}
.carousel-progress span {
  display: block; height: 100%; width: 30%;
  background: var(--pine-700); border-radius: 99px;
  transition: width 0.2s var(--ease-out);
}
.carousel-arrows { display: none; gap: 0.6rem; }
.carousel-btn {
  width: 48px; height: 48px; border-radius: 50%;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
  transition: background-color 0.2s, color 0.2s, opacity 0.2s;
}
.carousel-btn svg { width: 1.3rem; height: 1.3rem; }
.carousel-btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.carousel-btn:disabled { opacity: 0.25; cursor: default; }

.work { margin: 0; }
.work > img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.work figcaption { padding: 0.85rem 0.3rem 0; }
.work figcaption strong { font-family: var(--font-display); font-size: 1.12rem; font-weight: 640; display: block; }
.work figcaption span { color: var(--ink-soft); font-size: 0.95rem; }

/* slider avant/après */
.ba {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  aspect-ratio: 4 / 3;
  --pos: 50%;
}
.ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.ba-handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos);
  width: 3px; background: var(--paper); transform: translateX(-50%);
  box-shadow: 0 0 0 1px rgba(20, 43, 26, 0.25);
  pointer-events: none;
}
.ba-handle span {
  position: absolute; top: 50%; left: 50%;
  width: 44px; height: 44px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--paper);
  box-shadow: var(--shadow-pop);
  display: grid; place-items: center;
}
.ba-handle span::before {
  content: "↔";
  font-size: 1.2rem; font-weight: 700; color: var(--pine-900);
}
.ba-range {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; margin: 0; cursor: ew-resize;
  -webkit-appearance: none; appearance: none;
  touch-action: none; /* le doigt pilote le comparateur, pas le carrousel */
}
.ba:has(.ba-range:focus-visible) { outline: 3px solid var(--moss); outline-offset: 3px; }
.ba-tag {
  position: absolute; top: 0.8rem; z-index: 2;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.3rem 0.75rem; border-radius: 999px;
  background: rgba(20, 43, 26, 0.78); color: var(--paper);
  pointer-events: none;
}
.ba-tag-before { left: 0.8rem; }
.ba-tag-after { right: 0.8rem; background: rgba(246, 243, 234, 0.92); color: var(--pine-900); }

/* ---------- Zone ---------- */
.zone { background: var(--paper-2); padding: clamp(4rem, 9vw, 6.5rem) 0; }
.zone-grid { display: grid; gap: 2.5rem; align-items: center; }
.zone h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); }
.communes { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem 0; padding: 0; margin: 1.4rem 0 0; max-width: 36em; }
.communes li { font-size: 0.95rem; font-weight: 700; color: var(--ink-soft); }
.communes li:not(:last-child)::after { content: "·"; margin: 0 0.6rem; color: var(--moss); }
.communes .communes-more { font-weight: 400; }
.zone-photo { margin: 0; }
.zone-photo img {
  border-radius: 999px 999px var(--radius) var(--radius);
  aspect-ratio: 4 / 5; object-fit: cover;
  border: 6px solid #fffdf6;
  box-shadow: var(--shadow-pop);
  width: min(100%, 420px); margin-inline: auto;
}

/* ---------- FAQ ---------- */
.faq-item {
  background: #fffdf6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 0.8rem;
  overflow: hidden;
}
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  list-style: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 640; font-size: 1.1rem;
  padding: 1.05rem 1.3rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary svg { width: 1.2rem; height: 1.2rem; flex: none; transition: transform 0.3s var(--ease-out); color: var(--bark); }
.faq-item[open] summary svg { transform: rotate(180deg); }
.faq-item p { padding: 0 1.3rem 1.2rem; margin: 0; color: var(--ink-soft); }

/* ---------- Contact ---------- */
.contact { padding: clamp(4.5rem, 10vw, 8rem) 0; }
.contact-grid { display: grid; gap: 2.5rem; }
.contact h2 { font-size: clamp(2rem, 4.5vw, 3rem); }
.contact-list { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; gap: 1.1rem; }
.contact-list li { display: grid; }
.contact-list a { font-size: 1.15rem; font-weight: 700; text-decoration: none; }
.contact-list a strong { font-size: 1.5rem; font-family: var(--font-display); letter-spacing: 0.02em; }
.contact-list span { color: var(--ink-soft); font-size: 0.93rem; }

.contact-form-wrap {
  background: #fffdf6;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: clamp(1.4rem, 3vw, 2.2rem);
}
.flash { border-radius: 12px; padding: 0.9rem 1.1rem; margin-bottom: 1.1rem; font-weight: 700; }
.flash-success { background: rgba(110, 139, 77, 0.16); border: 1px solid var(--moss); color: var(--pine-900); }
.flash-error { background: rgba(176, 70, 50, 0.12); border: 1px solid #b04632; color: #7c2d1c; }

.contact-form .hp { position: absolute; left: -200vw; }
.form-row { margin-bottom: 1rem; display: grid; gap: 0.35rem; }
.form-2col { display: grid; gap: 0 1rem; }
.contact-form label { font-weight: 700; font-size: 0.92rem; }
.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit; color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: none; border-color: var(--pine-600);
  box-shadow: 0 0 0 3px rgba(38, 107, 57, 0.18);
}
.form-note { font-size: 0.82rem; color: var(--ink-soft); margin: 0.8rem 0 0; text-align: center; }

/* ---------- Footer ---------- */
.footer { background: var(--pine-900); color: rgba(246, 243, 234, 0.82); padding: 3.2rem 0 1.4rem; }
.footer a { color: var(--paper); }
.footer-grid { display: grid; gap: 2rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(246, 243, 234, 0.16); }
.brand-footer { font-size: 1.5rem; color: var(--paper); margin-bottom: 0.6rem; }
.brand-footer em { color: var(--accent); }
.footer nav { display: grid; gap: 0.55rem; align-content: start; }
.footer nav a { text-decoration: none; font-weight: 700; }
.footer nav a:hover { color: var(--accent); }
.footer-sister p { margin-bottom: 0.4rem; }
.sister-link {
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 640;
  color: var(--accent); text-decoration: none;
}
.sister-link:hover { color: #d2e470; }
.footer-legal { padding-top: 1.3rem; font-size: 0.85rem; color: rgba(246, 243, 234, 0.55); }

/* ---------- Barre d'appel mobile ---------- */
.callbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 110;
  display: flex;
  transform: translateY(110%);
  transition: transform 0.35s var(--ease-out);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--pine-900);
  box-shadow: 0 -8px 30px rgba(20, 43, 26, 0.35);
}
.callbar.show { transform: translateY(0); }
.callbar a {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 1rem 0.5rem; font-weight: 700; font-size: 1.02rem;
  text-decoration: none; min-height: 56px;
}
.callbar a svg { width: 1.2em; height: 1.2em; }
.callbar-phone { background: var(--accent); color: var(--pine-900); }
.callbar-quote { background: var(--pine-900); color: var(--paper); }

/* ---------- Reveal (uniquement si JS actif) ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); }
.js .reveal.in {
  opacity: 1; transform: none;
  transition: opacity 0.7s var(--ease-out) var(--d, 0ms), transform 0.7s var(--ease-out) var(--d, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
  .marquee-track { animation: none; }
  .btn, .service-card { transition: none; }
}

/* ============================================================
   ≥ 660px
   ============================================================ */
@media (min-width: 660px) {
  .form-2col { grid-template-columns: 1fr 1fr; }
  .services-grid { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .values-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   ≥ 980px — desktop
   ============================================================ */
@media (min-width: 980px) {
  .hero-grid { grid-template-columns: 1.15fr 0.85fr; gap: 3.5rem; }
  .hero-photo { justify-self: end; }
  .services-grid { grid-template-columns: repeat(3, 1fr); }
  .zone-grid { grid-template-columns: 1.1fr 0.9fr; }
  .contact-grid { grid-template-columns: 0.9fr 1.1fr; gap: 4rem; align-items: start; }
  .footer-grid { grid-template-columns: 1.2fr 0.6fr 1fr; }
  .callbar { display: none; }
  .carousel-arrows { display: flex; }
}

/* ============================================================
   < 980px — nav mobile
   ============================================================ */
@media (max-width: 979px) {
  .topbar-mobile { display: flex; }
  .nav-toggle { display: block; }
  .mainnav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 40px -22px rgba(20, 43, 26, 0.4);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 0.5rem 1.25rem 1.25rem;
    display: none;
  }
  .mainnav.open { display: flex; }
  .mainnav > a:not(.btn) { padding: 0.85rem 0.2rem; border-bottom: 1px solid var(--line); }
  .mainnav > a:not(.btn)::after { content: none; }
  .nav-call { margin-top: 1rem; justify-content: center; }
  body { padding-bottom: 72px; } /* place pour la callbar */
}

/* ============================================================
   Mobile soigné (≤ 560px)
   ============================================================ */
@media (max-width: 560px) {
  /* CTA pleine largeur, façon app */
  .hero-cta { display: grid; gap: 0.7rem; }
  .hero-cta .btn { width: 100%; justify-content: center; }

  /* cartes services compactes : icône + titre côte à côte */
  .service-card {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 0.2rem 0.9rem;
    align-items: center;
  }
  .service-card h3 { margin: 0; font-size: 1.15rem; }
  .service-card p, .service-card .examples { grid-column: 1 / -1; }
  .service-card p { margin: 0.4rem 0 0.3em; }

  /* photo secteur en paysage : moins de hauteur consommée */
  .zone-photo img { aspect-ratio: 4 / 3; width: 100%; border-radius: var(--radius); }

  .section-head { margin-bottom: 2rem; }
}

/* tres petits ecrans : la marque tient sur une ligne */
@media (max-width: 420px) {
  .brand { font-size: 1.1rem; }
}
