/* JN Habitat — feuille de style du site public */

@font-face {
  font-family: "Archivo";
  src: url(fonts/archivo.woff2) format("woff2-variations"), url(fonts/archivo.woff2) format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --noir: #1d1c1a;      /* anthracite du logo */
  --noir-2: #2a2825;
  --sable: #d8c7a8;     /* beige de la marque */
  --lin: #efe8dc;       /* beige clair des sections */
  --blanc: #fbfaf7;
  --texte: #1d1c1a;
  --texte-2: #5f5a52;
  --trait: rgba(29, 28, 26, .14);
  --ok: #4f6b45;
  --err: #9c3b2a;
  --radius: 6px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(64px, 9vw, 120px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-stretch: 100%;
  color: var(--texte);
  background: var(--blanc);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-stretch: 112%; line-height: 1.08; letter-spacing: -.015em; }
h1 { font-size: clamp(2.4rem, 4.6vw, 3.8rem); font-weight: 760; line-height: 1.02; letter-spacing: -.025em; }
h2 { font-size: clamp(1.85rem, 3.4vw, 2.7rem); font-weight: 720; }
h3 { font-size: 1.2rem; font-weight: 680; font-stretch: 108%; letter-spacing: -.005em; }
p { margin: 0; }

:focus-visible { outline: 3px solid var(--sable); outline-offset: 3px; border-radius: 3px; }
.section--sand :focus-visible, .section--lin :focus-visible { outline-color: var(--noir); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--sable); color: var(--noir); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 0 22px;
  border-radius: var(--radius); border: 1.5px solid transparent;
  font: inherit; font-weight: 640; font-stretch: 106%; font-size: 1rem;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn--sand { background: var(--sable); color: var(--noir); }
.btn--sand:hover { background: #e6d8bf; }
.btn--dark { background: var(--noir); color: var(--blanc); }
.btn--dark:hover { background: var(--noir-2); }
.btn--ghost { border-color: rgba(251, 250, 247, .35); color: var(--blanc); }
.btn--ghost:hover { border-color: var(--sable); color: var(--sable); }
.btn--sm { min-height: 40px; padding: 0 16px; font-size: .95rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* En-tête */
.top { position: sticky; top: 0; z-index: 40; background: var(--noir); color: var(--blanc); }
.top__in { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--sable); }
.brand__mark { width: 36px; height: 36px; }
.brand__name { font-weight: 760; font-stretch: 118%; font-size: 1.15rem; letter-spacing: .01em; color: var(--blanc); }
.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a { text-decoration: none; font-size: .98rem; color: rgba(251, 250, 247, .78); padding: 6px 0; border-bottom: 1.5px solid transparent; }
.nav a:hover { color: var(--blanc); border-bottom-color: var(--sable); }
.burger { display: none; }

@media (max-width: 900px) {
  .top__in { gap: 12px; }
  .top__call { margin-left: auto; }
  .burger {
    display: grid; place-content: center; gap: 6px;
    width: 44px; height: 44px; background: none; border: 0; cursor: pointer; padding: 0;
  }
  .burger span { display: block; width: 24px; height: 2px; background: var(--blanc); transition: transform .2s; }
  .burger[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
  .burger[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .nav {
    position: absolute; left: 0; right: 0; top: 68px;
    flex-direction: column; gap: 0; margin: 0;
    background: var(--noir); padding: 8px var(--gutter) 20px;
    border-top: 1px solid rgba(251, 250, 247, .1);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { font-size: 1.15rem; padding: 14px 0; border-bottom: 1px solid rgba(251, 250, 247, .08); }
}
@media (max-width: 420px) {
  .brand__name { display: none; }
}

/* Hero */
.hero { background: var(--noir); color: var(--blanc); padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 104px); }
.hero__in { display: grid; grid-template-columns: 1fr 1.08fr; gap: clamp(32px, 5vw, 72px); align-items: center; }
.hero h1 { max-width: 15ch; }
.hero__lead { margin-top: 24px; max-width: 46ch; font-size: 1.15rem; color: rgba(251, 250, 247, .78); }
.hero__cta { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero__media { margin: 0; }
.hero__caption { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 14px; font-size: .92rem; color: rgba(251, 250, 247, .62); }
.hero__caption span:first-child { color: var(--sable); font-weight: 600; }

@media (max-width: 900px) {
  .hero__in { grid-template-columns: 1fr; }
  .hero h1 { max-width: 16ch; }
}

/* Avant / après */
.compare {
  --pos: 50%;
  position: relative; aspect-ratio: 3 / 2; overflow: hidden;
  border-radius: var(--radius); background: var(--noir-2);
  user-select: none; -webkit-user-select: none; touch-action: pan-y;
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.compare__before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare__line {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px;
  background: var(--blanc); pointer-events: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12);
}
.compare__knob {
  position: absolute; top: 50%; left: var(--pos); width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; background: var(--blanc); color: var(--noir);
  display: grid; place-items: center; pointer-events: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .28);
}
.compare__tag {
  position: absolute; top: 14px; padding: 5px 11px; border-radius: 4px;
  font-size: .82rem; font-weight: 650; font-stretch: 108%; pointer-events: none;
}
.compare__tag--before { left: 14px; background: rgba(29, 28, 26, .82); color: var(--blanc); }
.compare__tag--after { right: 14px; background: var(--sable); color: var(--noir); }
.compare input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none;
}
.compare:focus-within .compare__knob { outline: 3px solid var(--sable); outline-offset: 3px; }

/* Sections */
.section { padding: var(--section) 0; }
.section--lin { background: var(--lin); }
.section--sand { background: var(--sable); }
.section--dark { background: var(--noir); color: var(--blanc); }
.head { max-width: 640px; margin-bottom: clamp(32px, 4vw, 52px); }
.head p { margin-top: 14px; color: var(--texte-2); font-size: 1.1rem; }
.head--row { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.head--row > div { max-width: 560px; }

/* Prestations */
.services { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); column-gap: clamp(32px, 6vw, 96px); }
.services li { padding: 26px 0; border-top: 1px solid var(--trait); display: grid; grid-template-columns: minmax(0, 15ch) 1fr; gap: 20px; align-items: baseline; }
.services li:nth-last-child(-n+2) { border-bottom: 1px solid var(--trait); }
.services p { color: var(--texte-2); }
@media (max-width: 860px) {
  .services { grid-template-columns: 1fr; }
  .services li:nth-last-child(2) { border-bottom: 0; }
}
@media (max-width: 520px) {
  .services li { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }
}

/* Réalisations */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1.5px solid var(--trait); background: transparent; color: var(--texte);
  font: inherit; font-size: .95rem; cursor: pointer;
}
.chip:hover { border-color: var(--noir); }
.chip[aria-pressed="true"] { background: var(--noir); border-color: var(--noir); color: var(--blanc); }
.demo-note { margin: -12px 0 28px; padding: 12px 16px; border-left: 3px solid var(--noir); background: rgba(255, 255, 255, .55); font-size: .95rem; color: var(--texte-2); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 2.6vw, 34px); }
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.card { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.card__img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius); background: #e4dccd; }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card__img img { transform: scale(1.03); }
.card__badge {
  position: absolute; left: 12px; bottom: 12px; padding: 5px 10px; border-radius: 4px;
  background: var(--noir); color: var(--blanc); font-size: .8rem; font-weight: 620;
}
.card__count { position: absolute; right: 12px; bottom: 12px; padding: 5px 9px; border-radius: 4px; background: rgba(251, 250, 247, .9); font-size: .8rem; font-weight: 600; }
.card h3 { margin-top: 16px; font-size: 1.15rem; }
.card__meta { margin-top: 4px; color: var(--texte-2); font-size: .95rem; }
.card[hidden] { display: none; }

.empty { padding: 40px 0 8px; display: grid; justify-items: start; gap: 18px; font-size: 1.15rem; }

/* Déroulé */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(20px, 3vw, 40px); counter-reset: step; }
.steps li { counter-increment: step; padding-top: 22px; border-top: 2px solid var(--noir); }
.steps li::before {
  content: counter(step);
  display: block; margin-bottom: 18px;
  font-size: 3rem; line-height: 1; font-weight: 300; font-stretch: 125%; color: #b6a27e;
}
.steps p { margin-top: 10px; color: var(--texte-2); }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); row-gap: 40px; } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* À propos */
.about { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.about__mark { color: var(--noir); max-width: 320px; width: 100%; justify-self: center; }
.about__mark svg { width: 100%; height: auto; }
.about__text p { margin-top: 18px; max-width: 58ch; font-size: 1.1rem; }
.facts { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.facts li { padding: 8px 14px; border: 1.5px solid rgba(29, 28, 26, .3); border-radius: 999px; font-size: .95rem; font-weight: 560; }
@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; }
  .about__mark { max-width: 120px; justify-self: start; }
}

/* Contact */
.contact { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(36px, 6vw, 96px); align-items: start; }
.contact__info p { margin-top: 16px; color: rgba(251, 250, 247, .74); max-width: 40ch; font-size: 1.1rem; }
.contact__big { display: inline-block; margin-top: 36px; font-size: clamp(2rem, 4.4vw, 3rem); font-weight: 720; font-stretch: 115%; letter-spacing: -.01em; color: var(--sable); text-decoration: none; line-height: 1.1; }
.contact__big:hover { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.contact__mail { display: inline-block; margin-top: 10px; font-size: 1.1rem; color: var(--blanc); word-break: break-word; }
.contact__zone { font-size: 1rem !important; margin-top: 28px !important; }
@media (max-width: 860px) { .contact { grid-template-columns: 1fr; } }

.form { display: grid; gap: 16px; padding: clamp(20px, 3vw, 32px); background: var(--noir-2); border-radius: var(--radius); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 520px) { .form__row { grid-template-columns: 1fr; } }
.form label { display: grid; gap: 6px; font-size: .95rem; font-weight: 560; color: rgba(251, 250, 247, .86); }
.req { color: var(--sable); margin-left: 2px; }
.form input, .form select, .form textarea {
  width: 100%; min-height: 48px; padding: 11px 13px;
  border: 1.5px solid rgba(251, 250, 247, .16); border-radius: var(--radius);
  background: var(--noir); color: var(--blanc);
  font: inherit; font-size: 1rem; font-weight: 400;
}
.form textarea { resize: vertical; min-height: 120px; }
.form select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23d8c7a8' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--sable); }
.form [aria-invalid="true"] { border-color: #d98d7b; }
.form ::placeholder { color: rgba(251, 250, 247, .38); }
.form__legal { font-size: .85rem; color: rgba(251, 250, 247, .55); }
.form__msg { font-size: .98rem; min-height: 1.4em; }
.form__msg.is-ok { color: #b9d3a8; }
.form__msg.is-err { color: #f0b3a3; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Pied de page */
.foot { background: var(--noir); color: rgba(251, 250, 247, .66); border-top: 1px solid rgba(251, 250, 247, .08); padding: 32px 0 40px; font-size: .92rem; }
.foot__in { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot strong { color: var(--blanc); font-stretch: 115%; }
.foot p { margin-top: 6px; }
.foot__links { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: flex-start; }
.foot__links a { color: rgba(251, 250, 247, .8); text-decoration: none; }
.foot__links a:hover { color: var(--sable); }
.todo { background: rgba(216, 199, 168, .18); color: var(--sable); padding: 0 6px; border-radius: 3px; }

/* Visionneuse */
.viewer { width: min(1200px, 100vw - 32px); max-width: none; max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: 10px; background: var(--blanc); color: var(--texte); overflow: hidden; }
.viewer::backdrop { background: rgba(20, 19, 17, .82); }
.viewer[open] { animation: pop .22s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { .viewer[open] { animation: none; } .card__img img { transition: none; } }
.viewer__in { display: grid; grid-template-columns: 1fr 340px; max-height: calc(100dvh - 32px); }
.viewer__stage { position: relative; background: var(--noir); display: grid; place-items: center; min-height: 0; }
.viewer__media { width: 100%; height: 100%; display: grid; place-items: center; }
.viewer__media > img { width: 100%; height: 100%; max-height: calc(100dvh - 32px); object-fit: contain; }
.viewer__media .compare { width: 100%; border-radius: 0; aspect-ratio: auto; height: 100%; max-height: calc(100dvh - 32px); min-height: 320px; }
.viewer__media .compare img { object-fit: contain; background: var(--noir); }
.viewer__media .compare__tag { top: auto; bottom: 14px; }
.viewer__photo-tag { position: absolute; top: 14px; left: 14px; padding: 5px 11px; border-radius: 4px; font-size: .82rem; font-weight: 650; background: var(--sable); color: var(--noir); }
.viewer__photo-tag--avant { background: rgba(29, 28, 26, .82); color: var(--blanc); border: 1px solid rgba(251, 250, 247, .3); }
.viewer__nav { position: absolute; top: 50%; margin-top: -24px; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(251, 250, 247, .92); color: var(--noir); display: grid; place-items: center; cursor: pointer; z-index: 2; }
.viewer__nav--prev { left: 14px; }
.viewer__nav--next { right: 14px; }
.viewer__nav[hidden] { display: none; }
.viewer__close { position: absolute; top: 12px; right: 12px; z-index: 3; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--blanc); color: var(--noir); display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .15); }
.viewer__side { padding: 64px 28px 28px; overflow-y: auto; }
.viewer__cat { font-size: .9rem; font-weight: 600; color: #8a7553; }
.viewer__side h3 { margin-top: 6px; font-size: 1.5rem; }
.viewer__meta { margin-top: 6px; color: var(--texte-2); }
.viewer__desc { margin-top: 18px; white-space: pre-line; }
.viewer__thumbs { margin-top: 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.viewer__thumbs button { padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; aspect-ratio: 1; cursor: pointer; background: #e4dccd; position: relative; }
.viewer__thumbs button[aria-current="true"] { border-color: var(--noir); }
.viewer__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.viewer__thumbs .thumb-ab { display: grid; place-items: center; background: var(--noir); color: var(--sable); font-size: .72rem; font-weight: 700; line-height: 1.1; text-align: center; }

@media (max-width: 860px) {
  .viewer { width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .viewer__in { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: 100dvh; max-height: none; }
  .viewer__stage { height: min(62dvh, 75vw); }
  .viewer__media > img, .viewer__media .compare { max-height: min(62dvh, 75vw); min-height: 0; }
  .viewer__side { padding: 20px var(--gutter) 32px; }
  .viewer__nav { width: 42px; height: 42px; margin-top: -21px; }
}

/* Mentions légales */
.legal { padding: clamp(40px, 6vw, 80px) 0 var(--section); }
.legal h1 { font-size: clamp(2rem, 4.4vw, 3rem); }
.legal h2 { font-size: 1.35rem; margin-top: 40px; }
.legal p, .legal li { margin-top: 10px; max-width: 70ch; color: var(--texte-2); }
.legal .back { display: inline-block; margin-bottom: 28px; }
