/* Dolo — « Cuivre et eau ».
   Fond encre chaude, cuivre en accent, un vert d'eau en contrepoint froid.
   Une seule audace : la conduite qui traverse la page (voir js/conduite.js).
   Tout le reste reste sobre — pas d'ombre portée, pas de carte flottante. */

:root {
  /* Matières */
  --encre:        #16110E;  /* brun-noir chaud : le fond */
  --fonte:        #221913;  /* surfaces posées sur l'encre */
  --fonte-haute:  #2C211A;  /* champs de formulaire, survols */
  --cuivre:       #C4763F;
  --cuivre-vif:   #E9A46A;
  --laiton:       #D9A441;
  --eau:          #3C8C8A;  /* le contrepoint froid */
  --creme:        #F1E7DE;
  --creme-sourd:  #A99688;
  --filet:        rgba(196, 118, 63, 0.22);

  --titre:  "Fraunces", Georgia, serif;
  --texte:  "IBM Plex Sans", system-ui, sans-serif;
  --donnee: "IBM Plex Mono", ui-monospace, monospace;

  --bloc: 68rem;
  --gouttiere: clamp(1.25rem, 5vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  position: relative;
  background: var(--encre);
  color: var(--creme);
  font-family: var(--texte);
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.06rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--titre);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--cuivre-vif); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--laiton); }

:focus-visible { outline: 2px solid var(--cuivre-vif); outline-offset: 3px; border-radius: 2px; }

.evitement {
  position: absolute; left: -9999px; top: 0; z-index: 60;
  background: var(--cuivre); color: var(--encre); padding: 0.7rem 1.2rem;
  font-weight: 600; text-decoration: none;
}
.evitement:focus { left: 0.5rem; top: 0.5rem; }

.bloc { max-width: var(--bloc); margin-inline: auto; padding-inline: var(--gouttiere); }

/* L'œil : l'étiquette qui nomme la section. Monospace, comme un repère de plan. */
.oeil {
  font-family: var(--donnee); font-size: 0.76rem; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--cuivre);
  margin: 0 0 0.9rem;
}
.cartouche {
  display: inline-block; font-family: var(--donnee); font-size: 0.74rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--cuivre-vif);
  border: 1px solid var(--filet); padding: 0.35rem 0.8rem; margin: 0 0 1.75rem;
}

.section { padding-block: clamp(4rem, 9vw, 7rem); }
.section__titre { font-size: clamp(1.7rem, 3.4vw, 2.5rem); max-width: 20ch; margin-bottom: 2.5rem; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.12rem; letter-spacing: -0.01em; }

/* ---------------- Boutons ---------------- */
.bouton {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--texte); font-size: 0.97rem; font-weight: 600;
  padding: 0.8rem 1.4rem; border: 1px solid transparent; cursor: pointer;
  text-decoration: none; transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.bouton--plein { background: var(--cuivre); color: #180F09; }
.bouton--plein:hover { background: var(--cuivre-vif); color: #180F09; }
.bouton--nu { border-color: var(--filet); color: var(--creme); }
.bouton--nu:hover { border-color: var(--cuivre); color: var(--cuivre-vif); }
.bouton__icone { width: 1.05rem; height: 1.05rem; flex: none; }

/* ---------------- En-tête ---------------- */
.entete {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--encre) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--filet);
}
.entete__interieur {
  max-width: var(--bloc); margin-inline: auto; padding: 0.85rem var(--gouttiere);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.marque {
  display: inline-flex; align-items: center; gap: 0.55rem;
  font-family: var(--titre); font-size: 1.35rem; font-weight: 700;
  color: var(--creme); text-decoration: none; letter-spacing: -0.02em;
}
.marque__signe { width: 1.15rem; height: 1.15rem; color: var(--cuivre); }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 1.9rem); }
.nav a { color: var(--creme-sourd); text-decoration: none; font-size: 0.95rem; }
.nav a:hover { color: var(--cuivre-vif); }
.nav__tel { font-family: var(--donnee); font-size: 0.9rem !important; color: var(--creme) !important; }
.nav__tel:hover { color: var(--cuivre-vif) !important; }
.nav .bouton { color: #180F09; }

.bascule {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 40px; padding: 0; background: none; border: 0; cursor: pointer;
}
.bascule span { display: block; width: 22px; height: 2px; margin-inline: auto; background: var(--creme); transition: transform 0.2s ease, opacity 0.2s ease; }
.bascule[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.bascule[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.bascule[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------------- Hero ---------------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(4rem, 12vw, 9rem) clamp(3.5rem, 8vw, 6rem); }
.hero__fond { position: absolute; inset: 0; pointer-events: none; }
.hero__halo {
  position: absolute; top: -30%; right: -12%; width: 62vw; height: 62vw;
  max-width: 780px; max-height: 780px; border-radius: 50%;
  background:
    radial-gradient(circle at 42% 38%, rgba(233, 164, 106, 0.30), transparent 58%),
    radial-gradient(circle at 62% 66%, rgba(60, 140, 138, 0.24), transparent 62%);
  filter: blur(28px);
  animation: respire 18s ease-in-out infinite;
}
@keyframes respire {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(-2%, 3%, 0) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) { .hero__halo { animation: none; } }

.hero__interieur { position: relative; }
/* Séquence d'ouverture : le hero se pose en quatre temps, une seule fois. */
@media (prefers-reduced-motion: no-preference) {
  .hero__interieur > * { animation: pose 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) backwards; }
  .cartouche     { animation-delay: 0.05s; }
  .hero__titre   { animation-delay: 0.16s; }
  .hero__chapo   { animation-delay: 0.30s; }
  .hero__actions { animation-delay: 0.42s; }
}
@keyframes pose { from { opacity: 0; transform: translateY(14px); } }
.hero__titre { font-size: clamp(2.7rem, 8.5vw, 5.6rem); font-weight: 700; max-width: 14ch; }
.hero__titre em { font-style: normal; color: var(--cuivre-vif); }
.hero__chapo { max-width: 46ch; margin-top: 1.6rem; color: var(--creme-sourd); font-size: 1.1rem; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.25rem; }

/* ---------------- Jauges ---------------- */
.jauges { border-block: 1px solid var(--filet); }
.jauges__grille { display: grid; grid-template-columns: repeat(2, 1fr); }
.jauge { padding: 1.5rem 0.5rem 1.5rem 0; }
.jauge + .jauge { border-left: 1px solid var(--filet); padding-left: clamp(1rem, 3vw, 2rem); }
.jauge b {
  display: block; font-family: var(--donnee); font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 500; color: var(--cuivre-vif); line-height: 1; font-variant-numeric: tabular-nums;
}
.jauge span { display: block; margin-top: 0.45rem; font-size: 0.86rem; color: var(--creme-sourd); }

/* ---------------- Emplacements photo ---------------- */
/* Tant qu'aucune image n'est déposée, l'emplacement se tient seul : matière
   cuivre et eau, et son intitulé. js/ui.js bascule en photo dès qu'elle existe. */
.vue {
  position: relative; aspect-ratio: 3 / 2; overflow: hidden;
  background:
    radial-gradient(120% 90% at 18% 12%, rgba(233, 164, 106, 0.30), transparent 60%),
    radial-gradient(110% 80% at 82% 88%, rgba(60, 140, 138, 0.28), transparent 62%),
    var(--fonte);
  border: 1px solid var(--filet);
  display: grid; place-items: center;
  background-size: cover; background-position: center;
}
.vue--portrait { aspect-ratio: 4 / 5; }
.vue__attente {
  font-family: var(--donnee); font-size: 0.72rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--creme-sourd); text-align: center; padding: 0 1rem;
}
/* Les photos d'atelier tirent vers le bleu froid. Sans traitement elles
   flottent au-dessus de la page au lieu d'y appartenir : on désature d'un
   cran et on pose un voile cuivre, plus une ombre basse qui raccroche
   l'image au fond encre. */
.vue.est-photo {
  border-color: transparent;
  filter: saturate(0.78) contrast(1.05) brightness(0.93);
}
.vue.est-photo::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(22, 17, 14, 0) 52%, rgba(22, 17, 14, 0.58) 100%),
    linear-gradient(145deg, rgba(196, 118, 63, 0.26), rgba(60, 140, 138, 0.10) 62%, rgba(22, 17, 14, 0.18));
}
.vue.est-photo .vue__attente { display: none; }

/* ---------------- L'artisan ---------------- */
.artisan__grille { display: grid; gap: clamp(2rem, 5vw, 3.5rem); grid-template-columns: 1fr; align-items: start; }
.portrait { margin: 0; }
.portrait figcaption {
  margin-top: 0.8rem; font-family: var(--donnee); font-size: 0.76rem;
  color: var(--creme-sourd); letter-spacing: 0.02em;
}
.artisan__texte p { color: var(--creme-sourd); }
.artisan__texte h2 { margin-bottom: 1.4rem; }
.atouts { list-style: none; margin: 1.75rem 0 0; padding: 0; display: grid; gap: 0.7rem; }
.atouts li { position: relative; padding-left: 1.6rem; color: var(--creme); font-size: 0.95rem; }
.atouts li::before {
  content: ""; position: absolute; left: 0; top: 0.62em;
  width: 0.65rem; height: 0.65rem; border: 1px solid var(--cuivre); border-radius: 50%;
}

/* ---------------- Prestations ---------------- */
.vedettes { display: grid; gap: 1px; background: var(--filet); border: 1px solid var(--filet); grid-template-columns: 1fr; }
.vedette { background: var(--fonte); padding: clamp(1.5rem, 3.5vw, 2.4rem); }
.vedette__reference {
  font-family: var(--donnee); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.2em;
  color: var(--cuivre); margin: 0 0 0.9rem;
}
.vedette h3 { font-size: clamp(1.25rem, 2.4vw, 1.6rem); margin-bottom: 0.9rem; }
.vedette p { color: var(--creme-sourd); }
.fiche { margin: 1.6rem 0 0; display: grid; gap: 0.5rem; }
.fiche > div { display: flex; justify-content: space-between; gap: 1rem; padding-top: 0.5rem; border-top: 1px solid var(--filet); }
.fiche dt { color: var(--creme-sourd); font-size: 0.88rem; }
.fiche dd { margin: 0; font-family: var(--donnee); font-size: 0.88rem; color: var(--creme); }

.secondaires { list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
.secondaires h3 { margin-bottom: 0.35rem; }
.secondaires p { color: var(--creme-sourd); font-size: 0.94rem; }

/* ---------------- Chantiers ---------------- */
.chantiers__grille { display: grid; gap: clamp(1.5rem, 3vw, 2.25rem); grid-template-columns: 1fr; }
.chantier { margin: 0; }
.chantier figcaption { padding-top: 1rem; }
.chantier h3 { margin-bottom: 0.3rem; }
.chantier__meta {
  font-family: var(--donnee); font-size: 0.76rem; color: var(--cuivre);
  letter-spacing: 0.04em; margin-bottom: 0.5rem;
}
.chantier figcaption p:last-child { color: var(--creme-sourd); font-size: 0.92rem; }

/* ---------------- Déroulé ---------------- */
/* Numéroté parce que l'ordre compte réellement : on ne chiffre pas avant d'avoir vu. */
.etapes { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--filet); border: 1px solid var(--filet); grid-template-columns: 1fr; }
.etapes li { background: var(--encre); padding: clamp(1.3rem, 3vw, 1.9rem); }
.etape__rang {
  font-family: var(--donnee); font-size: 0.8rem; font-weight: 500; color: var(--cuivre);
  letter-spacing: 0.1em; margin-bottom: 0.85rem;
}
.etapes h3 { margin-bottom: 0.4rem; }
.etapes p:last-child { color: var(--creme-sourd); font-size: 0.93rem; }

/* ---------------- Avis ---------------- */
.avis__grille { display: grid; gap: clamp(1.5rem, 4vw, 3rem); grid-template-columns: 1fr; }
.avis blockquote { margin: 0; border-left: 2px solid var(--cuivre); padding-left: clamp(1rem, 2.5vw, 1.75rem); }
.avis blockquote p {
  font-family: var(--titre); font-size: clamp(1.15rem, 2.2vw, 1.42rem);
  line-height: 1.4; color: var(--creme);
}
.avis cite { font-style: normal; font-family: var(--donnee); font-size: 0.78rem; color: var(--creme-sourd); letter-spacing: 0.06em; }

/* ---------------- Devis ---------------- */
.devis__grille { display: grid; gap: clamp(2rem, 5vw, 3.5rem); grid-template-columns: 1fr; align-items: start; }
.devis__lead { color: var(--creme-sourd); max-width: 44ch; }
.coordonnees { margin: 2rem 0 0; display: grid; gap: 0.75rem; }
.coordonnees > div { display: grid; gap: 0.15rem; padding-top: 0.75rem; border-top: 1px solid var(--filet); }
.coordonnees dt { font-family: var(--donnee); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--creme-sourd); }
.coordonnees dd { margin: 0; color: var(--creme); }

.formulaire { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; background: var(--fonte); border: 1px solid var(--filet); padding: clamp(1.25rem, 3vw, 2rem); }
.champ { display: grid; gap: 0.35rem; }
.champ--large { grid-column: 1 / -1; }
.champ label { font-family: var(--donnee); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--creme-sourd); }
.formulaire input, .formulaire select, .formulaire textarea {
  font: inherit; font-size: 0.97rem; color: var(--creme);
  background: var(--fonte-haute); border: 1px solid var(--filet);
  padding: 0.65rem 0.75rem; width: 100%; resize: vertical;
}
.formulaire input:focus, .formulaire select:focus, .formulaire textarea:focus {
  outline: none; border-color: var(--cuivre); box-shadow: inset 0 0 0 1px var(--cuivre);
}
.formulaire .bouton { grid-column: 1 / -1; justify-content: center; }
.formulaire__note { grid-column: 1 / -1; margin: 0; font-size: 0.8rem; color: var(--creme-sourd); text-align: center; }
.formulaire__erreur { grid-column: 1 / -1; margin: 0; font-size: 0.88rem; color: #E9A46A; }

.recu { background: var(--fonte); border: 1px solid var(--cuivre); padding: clamp(1.75rem, 4vw, 2.5rem); text-align: center; }
.recu svg { width: 2.4rem; height: 2.4rem; color: var(--cuivre-vif); }
.recu h3 { font-size: 1.4rem; margin: 0.75rem 0 0.5rem; }
.recu p { color: var(--creme-sourd); }
.recu__demo { font-family: var(--donnee); font-size: 0.74rem; letter-spacing: 0.08em; margin-top: 1rem; }

/* ---------------- Pied ---------------- */
.pied { border-top: 1px solid var(--filet); padding-block: clamp(2.5rem, 6vw, 4rem) 1.75rem; }
.pied__grille { display: grid; gap: 1.75rem; grid-template-columns: 1fr; }
.pied__marque { font-family: var(--titre); font-size: 1.5rem; font-weight: 700; margin-bottom: 0.4rem; }
.pied__label { font-family: var(--donnee); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--cuivre); margin-bottom: 0.4rem; }
.pied p { color: var(--creme-sourd); font-size: 0.92rem; }
.pied a { color: var(--creme); text-decoration: none; }
.pied a:hover { color: var(--cuivre-vif); }
.pied__bas {
  display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between;
  margin-top: clamp(2rem, 5vw, 3rem); padding-top: 1.25rem; border-top: 1px solid var(--filet);
}
.pied__bas p { font-size: 0.82rem; }

/* ---------------- Pages annexes ---------------- */
.bloc.page { max-width: 46rem; }
.page section { margin-top: 2.75rem; }
.page h2 { font-size: 1.25rem; margin-bottom: 0.55rem; }
.page p { color: var(--creme-sourd); }
.avis-demo {
  border-left: 2px solid var(--cuivre);
  background: var(--fonte);
  padding: 1.1rem 1.25rem;
  color: var(--creme) !important;
  margin-bottom: 0.5rem;
}
.page__retour { margin-top: 3rem; }
.page__retour a { text-decoration: none; }

/* ---------------- La conduite ---------------- */
.conduite { position: absolute; inset: 0 auto 0 0; width: 96px; z-index: 0; pointer-events: none; display: none; }
.conduite svg { display: block; }
.conduite__tube { fill: none; stroke: var(--filet); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.conduite__eau { fill: none; stroke: url(#coulee); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.conduite__noeud { fill: var(--encre); stroke: var(--cuivre); stroke-width: 2; }
.entete, main, .pied { position: relative; z-index: 1; }

/* ---------------- Apparitions ---------------- */
.parait { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.parait.est-vu { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .parait { opacity: 1; transform: none; transition: none; }
}

/* ---------------- Points de rupture ---------------- */
@media (max-width: 47.99em) {
  /* Sur deux colonnes, le filet du 3ᵉ chiffre tomberait au bord du bloc :
     on sépare par ligne et par colonne, pas par ordre d'apparition. */
  .jauge:nth-child(2n + 1) { border-left: 0; padding-left: 0; }
  .jauge:nth-child(n + 3) { border-top: 1px solid var(--filet); }

  .bascule { display: flex; }
  .nav {
    position: absolute; inset-inline: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--fonte); border-bottom: 1px solid var(--filet);
    padding: 0.5rem var(--gouttiere) 1.25rem;
    opacity: 0; visibility: hidden; transform: translateY(-8px); pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  }
  .nav.est-ouvert { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
  .nav > a { padding-block: 0.85rem; border-bottom: 1px solid var(--filet); }
  .nav .bouton { justify-content: center; margin-top: 1rem; border-bottom: 0; }
}

@media (min-width: 40em) {
  .secondaires { grid-template-columns: repeat(3, 1fr); }
  .etapes { grid-template-columns: repeat(2, 1fr); }
  .avis__grille { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 48em) {
  .jauges__grille { grid-template-columns: repeat(4, 1fr); }
  .vedettes { grid-template-columns: 1fr 1fr; }
  .chantiers__grille { grid-template-columns: repeat(3, 1fr); }
  .artisan__grille { grid-template-columns: 22rem 1fr; }
  .devis__grille { grid-template-columns: 1fr 1.1fr; }
  .pied__grille { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 62em) {
  .pied__grille { grid-template-columns: 1.4fr 1fr 1.2fr 1fr; }
}

@media (min-width: 62em) {
  .etapes { grid-template-columns: repeat(4, 1fr); }
}

/* La conduite demande une gouttière à elle : on ne l'affiche que si la
   fenêtre est assez large pour qu'elle ne passe pas sous le texte. */
@media (min-width: 80em) {
  .conduite { display: block; }
}
