/* ============================================================
   Atelier Michel Denis — Design system
   Site statique, sans cookies, polices auto-hébergées
   ============================================================ */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/fraunces-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/fraunces-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/fraunces-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-latin-600-normal.woff2') format('woff2');
}

/* ---------- Design tokens ---------- */
:root {
  /* Palette — chaleureux artisanal (repris du logo MDD) */
  --cream:       #FAF5EC;
  --cream-2:     #F3EADA;
  --surface:     #FFFDF9;
  --ink:         #2A211A;
  --ink-soft:    #5A4E43;
  --terracotta:  #B04A2E;
  --terracotta-d:#8E3A22;
  --ocre:        #CF9333;
  --brown:       #6B4A2E;
  --line:        #E4D9C6;

  --accent:      var(--terracotta);
  --accent-ink:  #FFFFFF;

  /* Typographie */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Rythme */
  --container: 1160px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 4px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(42,33,26,.06), 0 8px 30px rgba(42,33,26,.08);
  --shadow-lg: 0 20px 60px rgba(42,33,26,.16);
  --transition: .25s cubic-bezier(.4,0,.2,1);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(1rem, .97rem + .18vw, 1.075rem);
  line-height: 1.7;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--terracotta-d); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.3rem, 1.6rem + 3.2vw, 4rem); }
h2 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + .8vw, 1.6rem); }
p { margin: 0 0 1.1em; }
:focus-visible { outline: 3px solid var(--ocre); outline-offset: 2px; border-radius: 2px; }

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 820px; }
.section { padding-block: clamp(3.5rem, 2rem + 7vw, 7rem); }
.section--tint { background: var(--cream-2); }
.section--dark { background: var(--ink); color: #F3EADA; }
.section--dark h1, .section--dark h2, .section--dark h3 { color: #FFFDF9; }

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: .78rem;
  font-weight: 600;
  color: var(--terracotta);
  margin: 0 0 1rem;
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--ocre); }
.lead { font-size: clamp(1.1rem, 1.02rem + .4vw, 1.3rem); color: var(--ink-soft); }
.section__head { max-width: 640px; margin-bottom: clamp(2rem, 4vw, 3.25rem); }
.section__head--center { margin-inline: auto; text-align: center; }
.section__head--center .eyebrow { justify-content: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: .98rem;
  line-height: 1;
  padding: .95rem 1.6rem;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}
.btn--primary { background: var(--terracotta); color: #fff; }
.btn--primary:hover { background: var(--terracotta-d); transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--terracotta); color: var(--terracotta-d); }
.btn--light { background: #FFFDF9; color: var(--ink); }
.btn--light:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-row { display: flex; flex-wrap: wrap; gap: .85rem; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250,245,236,.9);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 74px;
}
.brand { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; color: var(--ink); }
.brand__mark { width: 44px; height: 44px; flex: none; }
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; line-height: 1.05; }
.brand__tag { display: block; font-family: var(--font-body); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); margin-top: .12rem; }
@media (max-width: 380px) { .brand__name { font-size: 1.02rem; } }

.nav__menu { display: flex; align-items: center; gap: .35rem; }
.nav__links { display: flex; align-items: center; gap: .35rem; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem;
  padding: .5rem .8rem; border-radius: var(--radius); transition: var(--transition);
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--terracotta-d); background: var(--cream-2); }
.nav__cta { margin-left: .5rem; }

.nav__toggle {
  display: none; background: none; border: 1.5px solid var(--line); border-radius: var(--radius);
  width: 46px; height: 42px; cursor: pointer; align-items: center; justify-content: center; color: var(--ink);
}
.nav__toggle svg { width: 22px; height: 22px; }

/* Dropdown (services) */
.has-sub { position: relative; }
.subnav {
  position: absolute; top: calc(100% + .4rem); left: 0; min-width: 240px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: .5rem; list-style: none; margin: 0;
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: var(--transition);
}
.has-sub:hover .subnav, .has-sub:focus-within .subnav { opacity: 1; visibility: visible; transform: translateY(0); }
.subnav a { display: block; padding: .6rem .8rem; }

@media (max-width: 940px) {
  .nav__toggle { display: inline-flex; }
  .nav__menu {
    position: fixed; inset: 74px 0 auto 0; background: var(--cream);
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
    flex-direction: column; align-items: stretch; gap: 0; padding: 1rem var(--gutter) 1.5rem;
    max-height: calc(100vh - 74px); overflow-y: auto;
    transform: translateY(-120%); transition: transform .3s ease; visibility: hidden;
  }
  .nav__menu.is-open { transform: translateY(0); visibility: visible; }
  .nav__links { flex-direction: column; align-items: stretch; gap: .1rem; }
  .nav__links a { padding: .8rem .5rem; border-radius: 0; border-bottom: 1px solid var(--line); }
  .subnav { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: none; padding: 0 0 0 1rem; }
  .nav__cta { margin: 1rem 0 0; }
  .nav__cta .btn { width: 100%; justify-content: center; }
}

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--ink); }
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; opacity: .5; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(105deg, rgba(42,33,26,.82) 0%, rgba(42,33,26,.55) 45%, rgba(42,33,26,.2) 100%);
}
.hero__inner { position: relative; z-index: 2; padding-block: clamp(4.5rem, 3rem + 10vw, 9rem); max-width: 720px; color: #FBF3E6; }
.hero h1 { color: #FFFDF9; }
.hero .lead { color: #EADFCB; }
.hero .eyebrow { color: var(--ocre); }
.hero .eyebrow::before { background: var(--ocre); }

/* ---------- Services grid ---------- */
.grid { display: grid; gap: clamp(1.1rem, 2vw, 1.75rem); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid--3, .grid--2 { grid-template-columns: 1fr; } }

.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; text-decoration: none; color: inherit; transition: var(--transition);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #d8c9ac; }
.card__media { aspect-ratio: 4/3; overflow: hidden; background: var(--cream-2); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card__media img { transform: scale(1.05); }
.card__body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; flex: 1; }
.card__body h3 { margin-bottom: .4rem; }
.card__body p { color: var(--ink-soft); font-size: .96rem; margin-bottom: 1.1rem; }
.card__more { margin-top: auto; font-weight: 600; font-size: .92rem; color: var(--terracotta-d); display: inline-flex; align-items: center; gap: .4rem; }
.card:hover .card__more { gap: .7rem; }

/* ---------- Split / feature ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split--reverse .split__media { order: 2; }
.split__media img { border-radius: var(--radius-lg); box-shadow: var(--shadow); width: 100%; }
@media (max-width: 800px) { .split { grid-template-columns: 1fr; } .split--reverse .split__media { order: 0; } }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 3vw, 2.5rem); text-align: center; }
.stat__num { font-family: var(--font-display); font-size: clamp(2.2rem, 1.5rem + 2.5vw, 3.2rem); font-weight: 600; color: var(--terracotta); line-height: 1; }
.stat__label { font-size: .92rem; color: var(--ink-soft); margin-top: .5rem; }
@media (max-width: 560px) { .stats { grid-template-columns: 1fr; gap: 1.75rem; } }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.gallery figure { margin: 0; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.gallery img { width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .5s ease; }
.gallery figure:hover img { transform: scale(1.06); }

/* ---------- List with checks ---------- */
.ticks { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: .85rem; }
.ticks li { position: relative; padding-left: 2rem; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .35em; width: 18px; height: 18px;
  background: var(--terracotta); border-radius: 50%;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/70% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='white' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/70% no-repeat;
}

/* ---------- Contact / info blocks ---------- */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; }
.info-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.5rem; }
.info-card h3 { font-size: 1.05rem; font-family: var(--font-body); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--terracotta); margin-bottom: .6rem; }
.info-card a { color: var(--ink); text-decoration: none; font-weight: 500; }
.info-card a:hover { color: var(--terracotta-d); }

/* ---------- CTA band ---------- */
.cta-band { background: var(--terracotta); color: #fff; border-radius: var(--radius-lg); padding: clamp(2.25rem, 5vw, 3.5rem); text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #FBE7DD; max-width: 520px; margin-inline: auto; }

/* ---------- Page hero (interior pages) ---------- */
.page-hero { background: var(--cream-2); border-bottom: 1px solid var(--line); padding-block: clamp(2.5rem, 2rem + 4vw, 4.5rem); }
.breadcrumb { font-size: .85rem; color: var(--ink-soft); margin-bottom: 1rem; }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--terracotta-d); }

/* ---------- Carte (Leaflet) ---------- */
#map { height: 440px; width: 100%; border-radius: var(--radius-lg); border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 0; background: var(--cream-2); }
.leaflet-container { font-family: var(--font-body); }
@media (max-width: 600px) { #map { height: 340px; } }

/* ---------- Prose ---------- */
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #D9CDBD; padding-block: clamp(3rem, 5vw, 4.5rem) 2rem; }
.site-footer a { color: #E7DAC7; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
.footer-brand__name { font-family: var(--font-display); font-size: 1.3rem; color: #FFFDF9; margin-bottom: .5rem; }
.footer h4 { color: #FFFDF9; font-family: var(--font-body); font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 1rem; }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; font-size: .95rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 1.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: .85rem; color: #A99B89; }
.footer-bottom a { color: #A99B89; }
.social { display: flex; gap: .6rem; }
.social a { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; transition: var(--transition); }
.social a:hover { background: var(--terracotta); border-color: var(--terracotta); }
.social svg { width: 18px; height: 18px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; gap: 2rem; } }

/* ---------- Logo strip ---------- */
.logo-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: clamp(1.75rem, 5vw, 3.5rem); }
.logo-strip img { height: 42px; width: auto; max-width: 150px; object-fit: contain; opacity: .72; filter: grayscale(1); transition: var(--transition); }
.logo-strip img:hover { opacity: 1; filter: grayscale(0); }

/* ---------- Partners full grid ---------- */
.partners-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.partners-grid figure { margin: 0; background: var(--surface); aspect-ratio: 3/2; display: flex; align-items: center; justify-content: center; padding: 1.5rem; transition: var(--transition); }
.partners-grid figure:hover { background: var(--cream); }
.partners-grid img { max-height: 100%; max-width: 100%; width: auto; object-fit: contain; filter: grayscale(1); opacity: .78; transition: var(--transition); }
.partners-grid figure:hover img { filter: grayscale(0); opacity: 1; }

/* ---------- Steps (canapé) ---------- */
.steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: clamp(1rem, 2vw, 1.5rem); counter-reset: step; }
.step { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.step__media { aspect-ratio: 4/3; overflow: hidden; background: var(--cream-2); }
.step__media img { width: 100%; height: 100%; object-fit: cover; }
.step__num { counter-increment: step; position: absolute; top: .8rem; left: .8rem; z-index: 2; background: var(--terracotta); color: #fff; font-family: var(--font-display); font-weight: 600; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); }
.step__num::before { content: counter(step); }
.step__body { padding: 1rem 1.15rem 1.2rem; }
.step__body p { margin: 0; font-size: .95rem; color: var(--ink-soft); }

/* ---------- Numbered process list ---------- */
.process { list-style: none; counter-reset: p; padding: 0; margin: 2rem 0 0; display: grid; gap: 1rem; }
.process li { counter-increment: p; position: relative; padding: 1.1rem 1.25rem 1.1rem 4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.process li::before { content: counter(p, decimal-leading-zero); position: absolute; left: 1.25rem; top: 1rem; font-family: var(--font-display); font-weight: 600; color: var(--terracotta); font-size: 1.15rem; }
.process li strong { display: block; margin-bottom: .1rem; }
.process li span { color: var(--ink-soft); font-size: .96rem; }

/* ---------- Reveal on scroll ----------
   Masqué uniquement si JS est actif (classe .js sur <html>) : sans JS,
   ou en cas d'échec de chargement, tout le contenu reste visible. */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}
