:root {
  --noir: #141210;
  --anthracite: #4a443d;
  --beige: #c8b69a;
  --beige-clair: #efe7da;
  --sable: #f6f1e8;
  --creme: #fbf8f3;
  --lin: #ece4d6;
  --encre: #26221e;
  --gris: #6d655b;
  --or: #9b8468;
  --trait: rgba(38, 34, 30, 0.12);
  --rayon: 18px;
  --ombre: 0 30px 60px -34px rgba(38, 34, 30, 0.45);
  --largeur: 1280px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--creme);
  color: var(--encre);
  font: 300 17px/1.7 "Jost", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img, canvas { max-width: 100%; }
a { color: var(--anthracite); }

h1, h2, h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  color: var(--noir);
  line-height: 1.08;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.5rem, 5vw, 4.3rem); }
h2 { font-size: clamp(2rem, 3.6vw, 3rem); }
h3 { font-size: 1.55rem; }

.surtitre {
  margin: 0 0 1rem;
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--or);
  font-weight: 500;
}
.sous-titre {
  margin: 1.4rem 0 0.5rem;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gris);
  font-weight: 500;
}

/* ---- Boutons ---- */
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.95rem 1.7rem;
  border-radius: 999px;
  border: 1px solid var(--noir);
  background: var(--noir);
  color: #fff;
  font: 400 0.92rem "Jost", sans-serif;
  letter-spacing: 0.06em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
}
.bouton:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -16px rgba(20, 18, 16, 0.7); }
.bouton:focus-visible { outline: 2px solid var(--or); outline-offset: 3px; }
.bouton[disabled] { opacity: 0.6; cursor: progress; }
.bouton-clair { background: transparent; color: var(--noir); }
.bouton-clair:hover { background: var(--beige-clair); }

/* ---- Barre ---- */
.barre {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(251, 248, 243, 0.86);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--trait);
}
.barre-interieur {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 0.85rem clamp(1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.marque { display: flex; flex-direction: column; text-decoration: none; line-height: 1.1; }
.marque-nom { font: 500 1.25rem "Cormorant Garamond", serif; letter-spacing: 0.18em; text-transform: uppercase; color: var(--noir); }
.marque-sous { font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--or); }
.barre nav { display: flex; align-items: center; gap: clamp(0.8rem, 2.5vw, 2rem); }
.barre nav a { color: var(--encre); text-decoration: none; font-size: 0.9rem; letter-spacing: 0.03em; }
.barre nav a:hover { color: var(--anthracite); }
.barre nav .nav-action { padding: 0.5rem 1.1rem; border: 1px solid var(--noir); border-radius: 999px; color: var(--noir); }
.barre nav .nav-action:hover { background: var(--noir); color: #fff; }

/* ---- Hero ---- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  max-width: var(--largeur);
  margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 6rem) clamp(1rem, 4vw, 2.5rem) clamp(3rem, 7vw, 6rem);
}
.chapo { font-size: 1.12rem; color: var(--gris); max-width: 34em; }
.actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.reperes {
  list-style: none;
  padding: 0;
  margin: 2.6rem 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  border-top: 1px solid var(--trait);
}
.reperes li { padding-top: 1rem; }
.reperes strong { display: block; font: 500 1.45rem "Cormorant Garamond", serif; color: var(--noir); }
.reperes span { display: block; font-size: 0.82rem; color: var(--gris); line-height: 1.4; }
.hero-visuel { margin: 0; }
.hero-visuel figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.9rem;
  font-size: 0.88rem;
  color: var(--gris);
  min-height: 1.6em;
}
#legende-hero { transition: opacity 0.4s ease; }
.points { display: flex; gap: 0.45rem; }
.points button {
  width: 9px;
  height: 9px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--noir);
  background: transparent;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}
.points button[aria-selected="true"] { background: var(--noir); transform: scale(1.15); }

/* ---- Visuels ---- */
.cadre-canvas {
  position: relative;
  border-radius: var(--rayon);
  overflow: hidden;
  background: var(--lin);
  box-shadow: var(--ombre);
  isolation: isolate;
}
.cadre-canvas canvas { display: block; width: 100%; height: auto; }
.resultat canvas, .config-type canvas { max-height: 78vh; object-fit: contain; }
.hero-visuel canvas { max-height: 640px; object-fit: contain; }
.chargement {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  color: var(--gris);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%) var(--lin);
  background-size: 250% 100%;
  animation: brillance 1.6s linear infinite;
  transition: opacity 0.45s ease;
}
.chargement[hidden] { display: grid; opacity: 0; pointer-events: none; }
@keyframes brillance { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* ---- Sections ---- */
.section { padding: clamp(4rem, 9vw, 7.5rem) clamp(1rem, 4vw, 2.5rem); }
.section > * { max-width: var(--largeur); margin-left: auto; margin-right: auto; }
.section-teinte { background: var(--sable); }
.entete { max-width: 720px; margin-bottom: clamp(2.2rem, 5vw, 3.5rem); text-align: center; }
.entete p:last-child { color: var(--gris); margin: 0 auto; max-width: 38em; }

/* ---- Principes ---- */
.principes {
  list-style: none;
  counter-reset: principe;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(1.5rem, 3vw, 3rem) clamp(1.5rem, 4vw, 4rem);
}
.principes li { counter-increment: principe; border-top: 1px solid var(--trait); padding-top: 1.4rem; }
.principes li::before {
  content: counter(principe, decimal-leading-zero);
  display: block;
  font: italic 400 1.1rem "Cormorant Garamond", serif;
  color: var(--or);
  margin-bottom: 0.6rem;
}
.principes h3 { margin-bottom: 0.4rem; }
.principes p { margin: 0; color: var(--gris); font-size: 0.98rem; }

/* ---- Configurations types ---- */
.onglets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 2.2rem;
}
.onglets button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
  min-width: 150px;
  padding: 0.75rem 1.1rem;
  border: 1px solid var(--trait);
  border-radius: 14px;
  background: var(--creme);
  color: var(--encre);
  font: 400 0.98rem "Jost", sans-serif;
  text-align: left;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.onglets button small { font-size: 0.76rem; color: var(--gris); letter-spacing: 0.02em; transition: color 0.3s ease; }
.onglets button:hover { border-color: var(--anthracite); transform: translateY(-2px); }
.onglets button[aria-selected="true"] { background: var(--noir); border-color: var(--noir); color: #fff; }
.onglets button[aria-selected="true"] small { color: rgba(255, 255, 255, 0.72); }
.config-type {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.pourqui { margin: 0 0 0.4rem; font-size: 0.74rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--or); font-weight: 500; }
.config-texte > p { color: var(--gris); }
.points-cles { list-style: none; padding: 0; margin: 0 0 1.8rem; }
.points-cles li { position: relative; padding: 0.55rem 0 0.55rem 1.4rem; border-bottom: 1px solid var(--trait); font-size: 0.95rem; color: var(--encre); }
.points-cles li::before { content: ""; position: absolute; left: 0; top: 1.15rem; width: 0.55rem; height: 1px; background: var(--or); }

.chiffres {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 1.4rem 0 0.4rem;
  border-top: 1px solid var(--trait);
  border-bottom: 1px solid var(--trait);
}
.chiffres div { padding: 0.8rem 0.6rem 0.7rem 0; }
.chiffres div + div { padding-left: 0.9rem; border-left: 1px solid var(--trait); }
.chiffres dt { font-size: 0.72rem; color: var(--gris); letter-spacing: 0.06em; text-transform: uppercase; }
.chiffres dd { margin: 0; font: 500 1.9rem "Cormorant Garamond", serif; color: var(--noir); line-height: 1.2; }

/* ---- Configurateur ---- */
.configurateur {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.formulaire {
  background: #fff;
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  padding: 1.5rem 1.4rem 0.4rem;
  position: sticky;
  top: 5.5rem;
}
.formulaire fieldset { border: 0; padding: 0 0 1.3rem; margin: 0 0 1.3rem; min-width: 0; border-bottom: 1px solid var(--trait); }
.formulaire fieldset:last-child { border-bottom: 0; margin-bottom: 0; }
.formulaire legend {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font: 500 1.35rem "Cormorant Garamond", serif;
  color: var(--noir);
  margin-bottom: 0.8rem;
}
.etape {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 1px solid var(--or);
  color: var(--or);
  font: 400 0.8rem "Jost", sans-serif;
}
.champs { display: grid; gap: 0.55rem; }
.champs label { display: flex; justify-content: space-between; align-items: center; gap: 0.8rem; font-size: 0.92rem; }
.champs input[type="number"] { width: 6rem; }
.champs select { width: 8.6rem; }
.champs input[type="number"], .champs select {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--trait);
  border-radius: 10px;
  font: inherit;
  background: var(--creme);
  color: var(--encre);
}
.champs input:focus, .champs select:focus { outline: 2px solid var(--beige); outline-offset: 1px; }
.champs .case { justify-content: flex-start; }
.case input, .puces input { accent-color: var(--noir); }
.segments {
  display: flex;
  background: var(--sable);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 0.9rem;
}
.segments label { flex: 1; text-align: center; cursor: pointer; }
.segments input { position: absolute; opacity: 0; pointer-events: none; }
.segments span {
  display: block;
  padding: 0.5rem 0.4rem;
  border-radius: 999px;
  font-size: 0.84rem;
  transition: background 0.3s ease, color 0.3s ease;
}
.segments input:checked + span { background: var(--noir); color: #fff; }
.segments input:focus-visible + span { outline: 2px solid var(--or); }
.groupe-puces + .groupe-puces { margin-top: 0.9rem; }
.puces { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.puces label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.75rem;
  border: 1px solid var(--trait);
  border-radius: 999px;
  font-size: 0.83rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.puces input { margin: 0; }
.puces label:has(input:checked) { background: var(--beige-clair); border-color: var(--anthracite); }
.sous-legende { margin: 0 0 0.45rem; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gris); font-weight: 500; }
.lien { background: none; border: 0; padding: 0; color: var(--anthracite); font: 300 0.8rem "Jost", sans-serif; letter-spacing: 0; text-transform: none; text-decoration: underline; cursor: pointer; }
.filtres { margin-top: 1rem; font-size: 0.88rem; }
.filtres summary { cursor: pointer; color: var(--anthracite); margin-bottom: 0.6rem; }
[data-pour][hidden] { display: none !important; }

.bilan { margin-bottom: 1.6rem; }
.conseils { list-style: none; padding: 0; margin: 0 0 0.8rem; }
.conseils li {
  padding: 0.75rem 0.9rem 0.75rem 2.5rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--trait);
  margin-bottom: 0.5rem;
  position: relative;
  font-size: 0.94rem;
  animation: entree 0.45s ease both;
}
.conseils li::before { position: absolute; left: 0.95rem; top: 0.72rem; }
.conseils .ok::before { content: "✓"; color: var(--anthracite); font-weight: 600; }
.conseils .info::before { content: "i"; font: italic 600 1rem Georgia, serif; color: var(--or); }
.conseils .alerte { background: #fbf2e4; border-color: #efdcbc; }
.conseils .alerte::before { content: "!"; color: #a4611d; font-weight: 700; }
details { font-size: 0.9rem; color: var(--gris); }
@keyframes entree { from { opacity: 0; transform: translateY(6px); } }


/* ---- Apparitions ---- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
[data-reveal].visible { opacity: 1; transform: none; }
.principes li[data-reveal]:nth-child(2) { transition-delay: 0.08s; }
.principes li[data-reveal]:nth-child(3) { transition-delay: 0.16s; }
.principes li[data-reveal]:nth-child(5) { transition-delay: 0.08s; }
.principes li[data-reveal]:nth-child(6) { transition-delay: 0.16s; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .chargement { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---- Integration dans une page (iframe, par ex. Shopify) ----
   La hauteur de l'iframe suit celle de la page : pas de hauteur relative a
   l'ecran (elle grandirait en boucle), pas d'element « collant ». */
.integre .barre { display: none; }
.integre .formulaire { position: static; }
.integre .resultat canvas, .integre .config-type canvas { max-height: 820px; }

@media (max-width: 960px) {
  .hero, .config-type, .configurateur { grid-template-columns: minmax(0, 1fr); }
  .formulaire { position: static; }
  .barre nav a:not(.nav-action) { display: none; }
}
@media (max-width: 560px) {
  .barre nav .nav-action { padding: 0.45rem 0.8rem; font-size: 0.8rem; white-space: nowrap; }
  .marque-sous { white-space: nowrap; font-size: 0.6rem; letter-spacing: 0.14em; }
  .reperes { grid-template-columns: minmax(0, 1fr); }
  .chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chiffres div:nth-child(3) { padding-left: 0; border-left: 0; }
  .onglets button { min-width: calc(50% - 0.3rem); }
}

/* ---- Introduction (shader) ---- */
html.intro-attente::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 99;
  background: #050505;
}
html.intro-verrou, html.intro-verrou body { overflow: hidden; }
#intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  cursor: pointer;
}
#intro.intro-locale { position: absolute; inset: 0 0 auto 0; }
#intro canvas { display: block; width: 100%; height: 100%; }
.intro-ligne {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--intro-ligne, 60%);
  margin: 0;
  text-align: center;
  color: #e9dcc0;
  font: 400 0.78rem "Jost", sans-serif;
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.5em;
  text-transform: uppercase;
  opacity: var(--intro-texte, 0);
  pointer-events: none;
  animation: intro-ecart 3.2s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes intro-ecart { from { letter-spacing: 0.9em; } to { letter-spacing: 0.5em; } }
@media (max-width: 600px) {
  .intro-ligne { font-size: 0.66rem; animation-name: intro-ecart-mobile; }
  @keyframes intro-ecart-mobile { from { letter-spacing: 0.5em; } to { letter-spacing: 0.28em; } }
}
.intro-passer {
  position: absolute;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  padding: 0.4rem 0.9rem;
  border: 1px solid rgba(233, 220, 192, 0.35);
  border-radius: 999px;
  background: transparent;
  color: rgba(233, 220, 192, 0.75);
  font: 400 0.72rem "Jost", sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: var(--intro-texte, 0);
}
.intro-passer:hover { border-color: #e9dcc0; color: #e9dcc0; }
/* Le haut de page attend la fin de l'introduction pour apparaitre. */
.intro-en-cours .hero [data-reveal] { opacity: 0 !important; transform: translateY(26px) !important; }
.intro-finie .hero [data-reveal]:nth-child(2) { transition-delay: 0.15s; }
