/* =========================================================
   PESites — feuille de style
   Palette tirée des façades provençales :
   chaux (murs), encre (nuit), volet (bleu charrette),
   mimosa (jaune), platane (vert).
   ========================================================= */

@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-grotesque.woff2") format("woff2-variations"),
       url("../fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --chaux: #eef1ec;
  --chaux-2: #e1e7e0;
  --papier: #fbfcfa;
  --encre: #12324a;
  --encre-2: #3d5a6e;
  --volet: #2e6e8e;
  --mimosa: #f2c230;
  --platane: #6e7f45;
  --nuit: #0f2636;

  --font: "Bricolage", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--chaux);
  color: var(--encre);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.55;
  font-variation-settings: "opsz" 16;
  overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--mimosa); outline-offset: 3px; border-radius: 4px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--encre); color: var(--chaux); padding: .6em 1em; border-radius: 8px;
}
.skip:focus { top: 12px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5em; min-height: 48px; padding: .75em 1.35em;
  border: 2px solid var(--encre); border-radius: 999px;
  background: var(--encre); color: var(--chaux);
  font: 600 1rem/1 var(--font); text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn:hover { background: var(--volet); border-color: var(--volet); }
.btn--ghost { background: transparent; color: var(--encre); }
.btn--ghost:hover { background: var(--encre); color: var(--chaux); border-color: var(--encre); }
.btn--small { min-height: 40px; padding: .55em 1.05em; font-size: .95rem; }

/* ---------- en-tête ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: clamp(12px, 3vw, 40px);
  padding: 12px var(--gutter);
  background: var(--chaux);
  border-bottom: 2px solid transparent;
  transition: border-color .3s;
}
.top.is-scrolled { border-bottom-color: var(--encre); }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 750; font-size: 1.35rem; letter-spacing: -.02em; text-decoration: none;
  font-variation-settings: "opsz" 48, "wdth" 85;
}
.brand__mark { width: 30px; height: 30px; }
.nav { display: flex; gap: clamp(12px, 2.4vw, 32px); margin-left: auto; }
.nav a { text-decoration: none; font-weight: 550; padding: .3em 0; background: linear-gradient(var(--encre), var(--encre)) left bottom / 0 2px no-repeat; transition: background-size .25s var(--ease); }
.nav a:hover { background-size: 100% 2px; }
@media (max-width: 640px) {
  .nav { display: none; }
  .top .btn--small { margin-left: auto; }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  grid-template-areas:
    "title village"
    "lead  village"
    "card  village";
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(24px, 4vw, 64px);
  min-height: calc(100svh - 66px);
  padding: clamp(20px, 4vh, 48px) var(--gutter) clamp(28px, 5vh, 56px);
  max-width: 1480px; margin-inline: auto;
}
.hero__title {
  grid-area: title / title / title / village;
  position: relative; z-index: 2;
  pointer-events: none;
  margin: 0 0 clamp(16px, 3vh, 36px);
  font-size: clamp(2.7rem, 5.9vw, 6.1rem);
  line-height: .92;
  letter-spacing: -.022em;
  font-weight: 740;
  font-variation-settings: "opsz" 96, "wdth" 82;
}
.hero__title .line { display: block; overflow: hidden; padding-bottom: .07em; }
.hero__title .line > span { display: inline-block; transform: translateY(110%); transition: transform 1s var(--ease); }
.is-ready .hero__title .line > span { transform: none; }
.is-ready .hero__title .line:nth-child(2) > span { transition-delay: .1s; }

.hero__lead { grid-area: lead; }
.hero__lead p { max-width: 34ch; margin: 0 0 1.4em; font-size: clamp(1.08rem, 1.3vw, 1.25rem); color: var(--encre-2); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- village isométrique ---------- */
.village { grid-area: village; position: relative; align-self: end; }
.village__svg { width: 100%; height: auto; max-height: calc(100svh - 150px); min-height: 380px; overflow: visible; user-select: none; -webkit-tap-highlight-color: transparent; }
.village__hint {
  position: absolute; bottom: 4%; right: 0; margin: 0; z-index: 1;
  display: flex; align-items: center; gap: .5em;
  font-size: .95rem; font-weight: 550; color: var(--encre-2);
}
.village__hint::before {
  content: ""; width: 10px; height: 14px; background: var(--mimosa);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.village__noscript { text-align: center; }

.shop { cursor: pointer; outline: none; }
.shop > .shop__body { transition: transform .35s var(--ease), filter .35s; }
.shop:hover > .shop__body,
.shop:focus-visible > .shop__body { transform: translateY(-6px); }
.shop:focus-visible > .shop__body { filter: drop-shadow(0 0 0 var(--mimosa)) drop-shadow(0 0 3px var(--mimosa)); }
.shop.is-active > .shop__body { transform: translateY(-10px); }
.shop .shop__shadow { transition: opacity .35s; opacity: 0; }
.shop:hover .shop__shadow, .shop.is-active .shop__shadow { opacity: 1; }

/* apparition au chargement : les bâtiments tombent un par un */
.drop { opacity: 0; transform: translateY(-40px); transition: opacity .5s, transform .7s var(--ease); }
.is-ready .drop { opacity: 1; transform: none; }

.plumbob-pos { transition: transform .7s var(--ease); }
.plumbob { transform-box: fill-box; transform-origin: center; animation: bob 2.4s ease-in-out infinite; }
.plumbob__spin { transform-box: fill-box; transform-origin: center; animation: spin 3.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes spin { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.55); } }

.water { animation: ripple 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ripple { 50% { transform: scale(.92); opacity: .75; } }

.card {
  grid-area: card; align-self: end;
  margin-top: 28px;
  padding: 18px 20px 16px;
  background: var(--papier);
  border: 2px solid var(--encre);
  border-radius: 14px;
  box-shadow: 6px 6px 0 var(--encre);
}
.card__kind { margin: 0 0 .1em; font-size: .95rem; font-weight: 600; color: var(--volet); }
.card__title { margin: 0 0 .5em; font-size: 1.45rem; line-height: 1.12; letter-spacing: -.02em; font-weight: 720; font-variation-settings: "opsz" 40, "wdth" 88; }
.card__list { margin: 0; padding: 0; list-style: none; display: grid; gap: .35em; font-size: 1rem; line-height: 1.4; }
.card__list li { display: grid; grid-template-columns: 14px 1fr; gap: 8px; }
.card__list li::before { content: ""; width: 8px; height: 11px; margin-top: .4em; background: var(--mimosa); outline: 1.5px solid var(--encre); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.card__list a { font-weight: 600; }
.card.is-swapping > * { animation: cardIn .45s var(--ease); }
@keyframes cardIn { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 960px) {
  .hero__title { grid-area: title; }
  .hero__title .line { display: inline; }
  .hero__title .line > span { display: inline; }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "title" "lead" "village" "card";
    grid-template-rows: auto;
    min-height: 0;
  }
  .hero__lead p { max-width: 46ch; }
  .village { margin: 28px calc(-1 * var(--gutter)) 0; }
  .village__hint { padding-inline: var(--gutter); }
  .village__svg { max-height: none; min-height: 0; }
  .village__hint { position: static; margin-bottom: 6px; }
  .card { margin-top: 8px; }
}

/* =========================================================
   SERVICES
   ========================================================= */
.services { padding: clamp(64px, 10vw, 140px) 0 clamp(48px, 8vw, 110px); }
.section-title {
  margin: 0 0 .9em;
  font-size: clamp(2.1rem, 4.6vw, 3.9rem);
  line-height: 1;
  letter-spacing: -.02em;
  font-weight: 720;
  font-variation-settings: "opsz" 96, "wdth" 84;
  max-width: 18ch;
}
.service {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr);
  gap: clamp(16px, 3vw, 48px);
  align-items: start;
  padding: clamp(22px, 3vw, 36px) 0;
  border-top: 2px solid var(--encre);
}
.service:last-child { border-bottom: 2px solid var(--encre); }
.service__name {
  margin: 0;
  font-size: clamp(1.9rem, 3.4vw, 3rem);
  line-height: 1;
  letter-spacing: -.03em;
  font-weight: 700;
  font-variation-settings: "opsz" 72, "wdth" 82;
}
.service__text { margin: 0; max-width: 42ch; color: var(--encre-2); }
.tags { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: .3em .8em; border: 1.5px solid var(--encre); border-radius: 999px; font-size: .9rem; font-weight: 550; background: var(--papier); }
@media (max-width: 900px) {
  .service { grid-template-columns: 1fr; gap: 12px; }
}

/* =========================================================
   DÉMOS
   ========================================================= */
.demos__intro { padding-bottom: clamp(24px, 4vw, 48px); }
.demos__intro p { max-width: 52ch; margin: -1em 0 0; color: var(--encre-2); font-size: clamp(1.05rem, 1.3vw, 1.2rem); }

.scrolly { position: relative; height: var(--len, 300vh); }
.scrolly__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }

/* ---------- dessin animé ---------- */
.cartoon {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  align-items: center;
  gap: clamp(16px, 4vw, 64px);
  padding: 72px var(--gutter) 24px;
  max-width: 1400px; margin-inline: auto;
}
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(18px, 3vh, 32px); }
.steps li {
  display: grid; grid-template-columns: 3.2rem 1fr; column-gap: 12px;
  color: var(--encre-2);
  opacity: .38; transition: opacity .4s;
  max-width: 34ch;
}
.steps li::before {
  content: attr(data-n);
  grid-row: span 2;
  font-size: 3rem; line-height: .9; font-weight: 760;
  font-variation-settings: "opsz" 96, "wdth" 75;
  color: var(--encre);
}
.steps li strong { display: block; font-size: clamp(1.4rem, 2.2vw, 2rem); line-height: 1.1; color: var(--encre); font-weight: 700; letter-spacing: -.02em; font-variation-settings: "opsz" 48, "wdth" 85; }
.steps li.is-on { opacity: 1; }
.steps li.is-on::before { color: var(--volet); }
.cartoon__art svg { width: 100%; max-height: calc(100svh - 120px); margin-inline: auto; }
.cartoon__art .life { opacity: 0; }

@media (max-width: 860px) {
  .cartoon { grid-template-columns: 1fr; align-content: center; padding-top: 80px; gap: 12px; }
  .steps { display: block; min-height: 5.2em; }
  .steps li { display: none; opacity: 1; }
  .steps li.is-on { display: grid; }
  .steps li::before { font-size: 2.4rem; }
  .cartoon__art svg { max-height: 60svh; }
}

/* ---------- film au scroll ---------- */
.film { background: var(--nuit); color: var(--papier); }
.film__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.film__shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,38,54,.0) 40%, rgba(15,38,54,.75) 100%); }
.film__captions { position: absolute; left: var(--gutter); right: var(--gutter); bottom: clamp(84px, 14vh, 140px); }
.film__captions p {
  position: absolute; left: 0; bottom: 0; margin: 0;
  max-width: 16ch;
  font-size: clamp(2.2rem, 5.6vw, 5.2rem); line-height: .95; letter-spacing: -.02em; font-weight: 720;
  font-variation-settings: "opsz" 96, "wdth" 82;
  opacity: 0; transform: translateY(24px);
  text-shadow: 0 2px 30px rgba(15,38,54,.45);
}
.film__note { position: absolute; left: var(--gutter); bottom: 28px; margin: 0; max-width: 46ch; font-size: .9rem; opacity: .8; }
.film__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(251,252,250,.15); }
.film__bar span { display: block; height: 100%; width: 100%; background: var(--mimosa); transform-origin: left; transform: scaleX(0); }

/* =========================================================
   CONTACT
   ========================================================= */
.contact { background: var(--mimosa); padding: clamp(72px, 12vw, 160px) 0; }
.contact__grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(24px, 5vw, 80px); align-items: end; }
.contact__title {
  margin: 0;
  font-size: clamp(3rem, 8.4vw, 8rem);
  line-height: .9; letter-spacing: -.025em; font-weight: 760;
  font-variation-settings: "opsz" 96, "wdth" 80;
}
.contact__ways { display: grid; gap: 14px; }
.contact__big {
  font-size: clamp(2rem, 4.4vw, 3.6rem); line-height: 1; font-weight: 740; letter-spacing: -.02em;
  font-variation-settings: "opsz" 96, "wdth" 82;
  text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 8px;
}
.contact__big:hover { color: var(--volet); }
.contact__mail { font-size: clamp(1.05rem, 1.6vw, 1.35rem); font-weight: 600; word-break: break-word; text-underline-offset: 5px; }
.contact__where { margin: 6px 0 0; max-width: 36ch; }
@media (max-width: 860px) { .contact__grid { grid-template-columns: 1fr; } }

/* ---------- pied de page ---------- */
.foot { background: var(--encre); color: var(--chaux); padding: 22px 0; font-size: .95rem; }
.foot__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.foot p { margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

.legal {
  width: min(560px, 100% - 32px); max-height: 86vh;
  padding: 28px; border: 2px solid var(--encre); border-radius: 16px;
  background: var(--papier); color: var(--encre);
  box-shadow: 8px 8px 0 var(--encre);
}
.legal::backdrop { background: rgba(15, 38, 54, .55); }
.legal h2 { margin: 0 0 .6em; font-size: 1.8rem; letter-spacing: -.02em; font-variation-settings: "opsz" 48, "wdth" 85; }
.legal h3 { margin: 1.1em 0 .2em; font-size: 1.05rem; }
.legal p { margin: 0; font-size: 1rem; }
.legal form { margin-top: 1.4em; }
.todo { background: var(--mimosa); padding: 0 .3em; border-radius: 3px; }

/* ---------- mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__title .line > span, .drop { transform: none !important; opacity: 1 !important; transition: none !important; }
  .plumbob, .plumbob__spin, .water { animation: none; }
}
