:root {
  color-scheme: light;
  --color-ink: #241f21;
  --color-ink-soft: #62595b;
  --color-brand: #D91F2B;
  --color-brand-deep: #B71928;
  --color-brand-logo: #F02832;
  --color-accent: #FFF0F1;
  --color-accent-strong: #FFE1E4;
  --color-paper: #FFF9F9;
  --color-surface: #FFFFFF;
  --color-line: #E8CDD0;
  --color-error: #9B2525;
  --color-success: #155B35;
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --space-1: 0.35rem;
  --space-2: 0.65rem;
  --space-3: 0.9rem;
  --space-4: 1.2rem;
  --space-5: 1.6rem;
  --space-6: 2.1rem;
  --radius-sm: 0.65rem;
  --radius-md: 1rem;
  --radius-lg: 1.35rem;
  --shadow-card: 0 0.4rem 1.4rem rgb(87 19 26 / 9%);
}

*,
*::before,
*::after { box-sizing: border-box; }
html { min-width: 320px; height: 100%; scroll-behavior: auto; }
body {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-width: 320px;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  color: var(--color-ink);
  background: var(--color-paper);
  font-family: var(--font-main);
  line-height: 1.4;
}
body.contact-open { overflow: hidden; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #7A4D00; outline-offset: 3px; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.page-shell {
  position: relative;
  display: flex;
  width: min(100%, 1240px);
  height: 100vh;
  height: 100dvh;
  flex-direction: column;
  margin-inline: auto;
  padding: max(0.4rem, env(safe-area-inset-top)) clamp(0.75rem, 3vw, 2.5rem) max(0.4rem, env(safe-area-inset-bottom));
  overflow: visible;
}
.site-header {
  z-index: 2;
  display: flex;
  min-height: 2.75rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}
.brand { display: inline-flex; min-width: 0; align-items: center; gap: 0.55rem; text-decoration: none; }
.brand-logo { display: block; width: clamp(2.3rem, 7vw, 3.15rem); height: clamp(2.3rem, 7vw, 3.15rem); flex: 0 0 auto; border-radius: 50%; object-fit: contain; }
.brand-name { max-width: 9rem; font-size: clamp(0.83rem, 2.8vw, 1.02rem); font-weight: 780; line-height: 1.1; }
.header-phone {
  display: inline-flex;
  min-width: 2.75rem;
  flex: 0 0 auto;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.35rem 0.4rem;
  border-radius: 999px;
  color: var(--color-brand-deep);
  font-size: clamp(0.66rem, 2.4vw, 0.82rem);
  font-weight: 720;
  text-decoration: none;
  white-space: nowrap;
}
.header-phone:hover { background: var(--color-accent); }

.main-content {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: space-evenly;
  gap: clamp(0.35rem, 1.4vh, 0.9rem);
  padding-block: clamp(0.3rem, 1.3vh, 0.9rem);
}
.hero {
  display: grid;
  min-width: 0;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(0.35rem, 1.2vh, 0.7rem);
  align-items: center;
}
.hero-copy { min-width: 0; }
.eyebrow {
  margin: 0 0 0.22rem;
  color: var(--color-brand-deep);
  font-size: 0.62rem;
  font-weight: 820;
  letter-spacing: 0.13em;
  line-height: 1.2;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
.hero h1 {
  margin: 0;
  font-size: clamp(1.35rem, 5vw, 2.45rem);
  letter-spacing: -0.045em;
  line-height: 1.04;
}
.hero-subtitle { margin: 0.22rem 0 0; color: var(--color-ink-soft); font-size: clamp(0.75rem, 2.7vw, 0.96rem); font-weight: 620; }
.hero-image {
  display: block;
  width: 100%;
  height: clamp(4.5rem, 13vh, 6.3rem);
  border-radius: var(--radius-md);
  background: #eee;
  object-fit: cover;
  object-position: center 48%;
}

.services { display: grid; min-width: 0; flex: 0 0 auto; grid-template-columns: minmax(0, 1fr); gap: clamp(0.35rem, 1vh, 0.65rem); }
.service-card {
  position: relative;
  z-index: 0;
  display: grid;
  min-width: 0;
  min-height: 4.05rem;
  grid-template-columns: minmax(0, 1fr) minmax(6.4rem, auto);
  grid-template-rows: auto auto;
  grid-template-areas: "copy detail" "copy action";
  align-items: center;
  column-gap: 0.45rem;
  row-gap: 0.08rem;
  padding: 0.42rem 0.48rem;
  border: 1px solid var(--color-line);
  border-left: 3px solid var(--color-brand-logo);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-card);
}
.service-card:has(.service-details[open]), .service-card.has-open-details { z-index: 60; }
.service-copy { display: grid; min-width: 0; grid-area: copy; grid-template-columns: 1.45rem minmax(0, 1fr); align-items: start; column-gap: 0.42rem; }
.service-index {
  display: grid;
  width: 1.35rem;
  height: 1.35rem;
  place-items: center;
  margin: 0.08rem 0 0;
  border-radius: 50%;
  color: #fff;
  background: var(--color-brand-deep);
  font-size: 0.59rem;
  font-weight: 800;
}
.service-heading { min-width: 0; }
.service-category { margin: 0 0 0.1rem; color: var(--color-brand-deep); font-size: 0.59rem; font-weight: 780; line-height: 1.12; }
.service-card h2 { display: -webkit-box; margin: 0; overflow: hidden; font-size: clamp(0.76rem, 2.55vw, 0.9rem); font-weight: 760; line-height: 1.17; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.service-details { position: relative; min-width: 0; grid-area: detail; justify-self: stretch; font-size: 0.72rem; }
.service-details > summary {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.15rem 0.3rem;
  border-radius: 0.55rem;
  color: var(--color-brand-deep);
  background: var(--color-accent);
  font-size: 0.68rem;
  font-weight: 750;
  line-height: 1.1;
  list-style: none;
  cursor: pointer;
}
.service-details > summary::-webkit-details-marker { display: none; }
.service-details > summary::after { content: "+"; font-size: 0.95rem; line-height: 1; }
.service-details[open] > summary::after { content: "−"; }
.service-details-content {
  position: fixed;
  z-index: 50;
  top: 50%;
  right: 1rem;
  left: 1rem;
  width: auto;
  max-height: min(65dvh, 27rem);
  padding: 1rem 1.1rem;
  overflow: auto;
  transform: translateY(-50%);
  border: 1px solid var(--color-line);
  border-top: 4px solid var(--color-brand-logo);
  border-radius: var(--radius-lg);
  color: var(--color-ink);
  background: #fff;
  box-shadow: 0 1rem 3rem rgb(30 14 16 / 25%);
  font-size: 0.86rem;
  line-height: 1.48;
}
.service-details-content > p { margin: 0; }
.service-details-content > p + p { margin-top: 0.65rem; }
.service-emphasis { color: var(--color-brand-deep); }
.service-card > .button--service { grid-area: action; justify-self: stretch; }

.button {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.48rem 0.62rem;
  border: 1px solid transparent;
  border-radius: 0.72rem;
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.12;
  text-align: center;
  text-decoration: none;
  transition: background-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
  cursor: pointer;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { cursor: wait; opacity: 0.72; }
.button--service { min-height: 2.75rem; padding: 0.35rem 0.4rem; color: #fff; background: var(--color-brand); font-size: 0.66rem; }
.button--service:hover { background: var(--color-brand-deep); }
.button-arrow { font-size: 0.85rem; line-height: 1; }
.wa-icon { display: inline-grid; width: 1.05rem; height: 1.05rem; flex: 0 0 auto; place-items: center; border: 1.5px solid currentColor; border-radius: 50%; font-size: 0.76rem; line-height: 1; }
.primary-actions {
  position: relative;
  z-index: 4;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1.2fr) minmax(6.7rem, 0.8fr);
  align-items: center;
  gap: 0.35rem;
  margin-inline: -0.1rem;
  padding: 0.3rem 0.1rem 0;
  background: var(--color-paper);
}
.button--whatsapp { color: #fff; background: var(--color-brand); }
.button--whatsapp:hover { background: var(--color-brand-deep); box-shadow: 0 0.3rem 0.8rem rgb(87 19 26 / 20%); }
.button--secondary { color: var(--color-brand-deep); border-color: var(--color-line); background: #fff; }
.button--secondary:hover { background: var(--color-accent); }
.call-link { grid-column: 1 / -1; justify-self: center; padding: 0.12rem 0.35rem; color: var(--color-brand-deep); font-size: 0.72rem; font-weight: 680; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.site-footer { display: flex; flex: 0 0 auto; justify-content: space-between; gap: 0.5rem; padding-top: 0.2rem; color: var(--color-ink-soft); font-size: 0.62rem; line-height: 1.15; }

/* Le panneau contact reste une amélioration progressive et peut défiler indépendamment. */
.js .contact-panel:not(.is-open) { display: none; }
.no-js .contact-panel:not(.is-open):not(:target) { display: none; }
.no-js .contact-panel:target, .no-js .contact-panel.is-open { position: fixed; inset: 0; overflow-y: auto; overscroll-behavior: contain; }
.contact-panel {
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0.75rem;
  background: rgb(24 15 17 / 74%);
}
.js .contact-panel.is-open { position: fixed; inset: 0; overflow-y: auto; overscroll-behavior: contain; }
.contact-dialog {
  position: relative;
  width: min(100%, 40rem);
  margin: auto;
  padding: clamp(1rem, 4vw, 2rem);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow: 0 1.5rem 5rem rgb(0 0 0 / 23%);
}
.contact-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.contact-heading h2 { margin: 0 0 0.2rem; font-size: clamp(1.45rem, 5vw, 2rem); letter-spacing: -0.035em; }
.contact-heading p:last-child { margin: 0; color: var(--color-ink-soft); font-size: 0.9rem; }
.icon-button { display: grid; width: 2.75rem; height: 2.75rem; flex: 0 0 auto; place-items: center; border: 1px solid var(--color-line); border-radius: 50%; color: var(--color-ink); background: #fff; font-size: 1.6rem; line-height: 1; text-decoration: none; cursor: pointer; }
.icon-button:hover { background: var(--color-paper); }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.8rem; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: 0.3rem; font-size: 0.82rem; font-weight: 730; }
.field label > span[aria-hidden="true"] { color: var(--color-error); }
.optional { color: var(--color-ink-soft); font-size: 0.74rem; font-weight: 500; }
.field input, .field select, .field textarea {
  display: block;
  width: 100%;
  min-height: 2.8rem;
  padding: 0.65rem 0.72rem;
  border: 1px solid #9C8C8F;
  border-radius: 0.65rem;
  color: var(--color-ink);
  background: #fff;
}
.field textarea { min-height: 6rem; resize: vertical; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--color-error); }
.field-error { display: block; min-height: 1rem; margin-top: 0.12rem; color: var(--color-error); font-size: 0.75rem; }
.field-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.field-meta > small:last-child { flex: 0 0 auto; color: var(--color-ink-soft); font-size: 0.7rem; }
.required-note { margin: 0.35rem 0 0; color: var(--color-ink-soft); font-size: 0.72rem; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; margin-top: 0.9rem; }
.form-submit { min-width: 12rem; }
.form-whatsapp { color: var(--color-brand-deep); font-size: 0.78rem; font-weight: 680; text-underline-offset: 0.18em; }
.form-alert { margin: 0 0 0.8rem; padding: 0.75rem 0.85rem; border-radius: 0.7rem; font-size: 0.85rem; }
.form-alert--success { color: var(--color-success); border: 1px solid #B8DFC4; background: #EFF9F1; }
.form-alert--error { color: var(--color-error); border: 1px solid #E6C2C2; background: #FFF3F3; }
.button-spinner { width: 1rem; height: 1rem; border: 2px solid rgb(255 255 255 / 50%); border-top-color: #fff; border-radius: 50%; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

@media (min-width: 640px) {
  .page-shell { padding-inline: clamp(1.25rem, 4vw, 3rem); }
  .brand-name { max-width: 13rem; font-size: 1.02rem; }
  .hero { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 1rem; }
  .hero-image { height: clamp(7rem, 17vh, 10rem); }
  .services { gap: 0.55rem; }
  .service-card { min-height: 4.3rem; padding: 0.48rem 0.62rem; }
  .service-card h2 { font-size: clamp(0.86rem, 1.9vw, 1rem); }
  .service-category { font-size: 0.65rem; }
  .button--service { min-height: 2.75rem; font-size: 0.72rem; }
  .primary-actions { grid-template-columns: minmax(13rem, 1fr) minmax(9rem, 0.65fr); width: min(100%, 34rem); align-self: center; gap: 0.55rem; }
  .call-link { font-size: 0.78rem; }
}

@media (min-width: 1024px) {
  .page-shell { padding-top: 0.8rem; padding-bottom: 0.5rem; }
  .site-header { min-height: 3.2rem; }
  .brand-logo { width: 3.15rem; height: 3.15rem; }
  .main-content { justify-content: space-around; gap: clamp(0.5rem, 1.6vh, 1.1rem); padding-block: 0.35rem; }
  .hero { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(1rem, 3vw, 2.4rem); }
  .hero h1 { font-size: clamp(2rem, 3.2vw, 3rem); }
  .hero-image { height: clamp(8.5rem, 24vh, 13rem); border-radius: var(--radius-lg); }
  .services { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; }
  .service-card {
    min-height: clamp(8.5rem, 20vh, 11.5rem);
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 1fr auto;
    grid-template-areas: "copy copy" "detail action";
    align-items: end;
    column-gap: 0.5rem;
    padding: 0.8rem;
  }
  .service-card:has(.service-details[open]) { z-index: 12; }
  .service-copy { grid-template-columns: 1.65rem minmax(0, 1fr); column-gap: 0.5rem; }
  .service-index { width: 1.5rem; height: 1.5rem; }
  .service-category { font-size: 0.68rem; }
  .service-card h2 { font-size: clamp(0.95rem, 1.25vw, 1.14rem); }
  .service-details { width: 5rem; }
  .service-details-content {
    position: absolute;
    top: auto;
    right: auto;
    bottom: calc(100% + 0.45rem);
    left: 0;
    width: min(24rem, 36vw);
    max-height: min(48vh, 24rem);
    transform: none;
    font-size: 0.9rem;
  }
  .button--service { min-height: 2.75rem; min-width: 8rem; padding-inline: 0.7rem; font-size: 0.77rem; }
  .primary-actions { position: static; display: flex; width: auto; justify-content: center; margin: 0.1rem auto 0; padding: 0; background: none; }
  .primary-actions > .button { min-width: 13rem; min-height: 2.8rem; }
  .call-link { margin-left: 0.25rem; }
  .site-footer { padding-top: 0.15rem; font-size: 0.66rem; }
  .contact-panel { align-items: center; padding: 2rem; }
}

@media (max-height: 700px) {
  .page-shell { padding-top: max(0.3rem, env(safe-area-inset-top)); padding-bottom: max(0.3rem, env(safe-area-inset-bottom)); }
  .site-header { min-height: 2.35rem; }
  .brand-logo { width: 2.2rem; height: 2.2rem; }
  .main-content { justify-content: space-around; gap: 0.26rem; padding-block: 0.2rem; }
  .hero { gap: 0.3rem; }
  .hero h1 { font-size: clamp(1.22rem, 4.5vw, 1.8rem); }
  .hero-subtitle { margin-top: 0.12rem; font-size: 0.72rem; }
  .hero-image { height: clamp(3.6rem, 12vh, 5.2rem); }
  .services { gap: 0.3rem; }
  .service-card { min-height: 3.55rem; padding-block: 0.28rem; }
  .service-card h2 { font-size: clamp(0.71rem, 2.35vw, 0.82rem); }
  .service-category { font-size: 0.55rem; }
  .primary-actions { gap: 0.25rem; padding-top: 0.12rem; }
  .primary-actions > .button { min-height: 2.75rem; }
  .call-link { font-size: 0.68rem; }
  .site-footer { font-size: 0.58rem; }
}

@media (min-width: 1024px) and (max-height: 700px) {
  .hero-image { height: clamp(6.4rem, 18vh, 8rem); }
  .service-card { min-height: 7.2rem; }
  .service-card h2 { font-size: 0.92rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
