@font-face {
    font-family: "Fraunces";
    src: url("/fonts/fraunces.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

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

:root {
    --chaux: #fdfcf8;
    --enduit: #f1ede4;
    --pin: #d9b98c;
    --noyer: #7a4f27;
    --charbon: #2c2621;
    --marge: clamp(16px, 5vw, 80px);
    --arche: 50% 50% 0 0 / 30% 30% 0 0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; } /* les ancres ne passent pas sous le bandeau */

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

body {
    margin: 0;
    background: var(--chaux);
    color: var(--charbon);
    font: 400 1.0625rem/1.65 "Archivo", system-ui, sans-serif;
}

img { display: block; max-width: 100%; height: auto; }
a { color: var(--noyer); }
a:focus-visible { outline: 3px solid var(--noyer); outline-offset: 3px; }
figure { margin: 0; }
figure a { display: block; }
figcaption { padding-top: 8px; font-size: 0.9375rem; }

h1, h2, h3 {
    margin: 0;
    font-family: "Fraunces", Georgia, serif;
    font-variation-settings: "SOFT" 100, "WONK" 0;
    font-weight: 400;
    line-height: 1.08;
    text-wrap: balance;
}

h1 { font-size: clamp(2.5rem, 5.6vw, 5.25rem); }
h2 { font-size: clamp(2rem, 3.6vw, 3.25rem); }
h3 { font-size: clamp(1.75rem, 3vw, 2.75rem); }

/* ---- En-tête ---- */
.entete {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 24px;
    padding: 10px var(--marge);
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--chaux);
    box-shadow: 0 1px 0 rgba(44, 38, 33, 0.12);
}

.marque {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit;
    font: 400 1.5rem/1.2 "Fraunces", Georgia, serif;
    font-variation-settings: "SOFT" 100, "WONK" 0;
    text-decoration: none;
}

/* Le logo a un fond blanc : multiply le fond dans la couleur du bandeau. */
.marque img { width: auto; height: 44px; mix-blend-mode: multiply; }

.entete nav { display: flex; flex-wrap: wrap; gap: 0 20px; }
.entete nav a { display: inline-block; padding: 10px 0; color: inherit; text-decoration: none; }
.entete nav a:hover { text-decoration: underline; }
.entete .langues { gap: 0 12px; }
.langues a[aria-current] { font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }

/* ---- Ouverture : le texte, puis la grande arche sur toute la largeur ---- */
.ouverture-texte {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    gap: 16px clamp(24px, 4vw, 64px);
    align-items: end;
    padding: clamp(16px, 3vw, 40px) var(--marge) clamp(24px, 3vw, 40px);
}
.ouverture-texte p { margin: 0 0 20px; max-width: 46ch; }
.ouverture-texte .lieu { margin: 12px 0 0; }

.grande-arche { padding: 0 clamp(8px, 1.5vw, 24px); }
.grande-arche img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--arche); }

.bouton {
    display: inline-block;
    min-height: 44px;
    padding: 10px 24px;
    border-radius: 999px;
    background: var(--charbon);
    color: var(--chaux);
    font-weight: 500;
    text-decoration: none;
}
.bouton:hover { background: var(--noyer); }

.lieu { margin: 8px 0 16px; color: var(--noyer); }

/* ---- Bandes ---- */
.bande { padding: clamp(56px, 8vw, 112px) var(--marge); }
.bande > h2 { margin-bottom: clamp(24px, 4vw, 48px); }
.intro { max-width: 52ch; margin: 16px 0 0; font-size: 1.1875rem; }

.deux-colonnes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(40px, 6vw, 96px); }
.deux-colonnes p { max-width: 52ch; margin: 16px 0 0; }

/* ---- Avant, après : l'après en grand dans une arche, sans recadrage ---- */
.projet + .projet { margin-top: clamp(64px, 9vw, 128px); }
.projet-texte {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
    gap: 16px clamp(24px, 4vw, 64px);
    align-items: end;
    margin-bottom: clamp(20px, 3vw, 40px);
}
.projet-texte p { margin: 0 0 16px; max-width: 46ch; }
.projet-texte .lieu { margin: 8px 0 0; }

.paire { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: clamp(8px, 1.5vw, 24px); align-items: end; }
.paire img { width: 100%; }
.avant img { border-radius: 4px; }
.apres img { width: 100%; border-radius: var(--arche); }
/* Une photo verticale reste entière sans dépasser l'écran. */
.paire .apres img { width: auto; max-height: 85vh; }

.comparaison { margin-bottom: clamp(56px, 7vw, 104px); }
.comparaison:last-child { margin-bottom: 0; }
.comparaison h3 { margin-bottom: 16px; font-size: clamp(1.5rem, 2.2vw, 2rem); }

/* ---- Petits travaux : le bois ---- */
.bois {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(32px, 6vw, 96px);
    padding: clamp(56px, 8vw, 112px) var(--marge);
    background: var(--pin);
}

.bouton-travaux { margin-top: 24px; }
.serie + .serie { margin-top: clamp(56px, 7vw, 104px); }
.serie h2 { margin-bottom: 16px; font-size: clamp(1.5rem, 2.6vw, 2.25rem); }
.serie-etapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 1.5vw, 24px); }
.serie-etapes img { aspect-ratio: 3 / 4; object-fit: cover; }

.services { margin: 0; padding: 0; list-style: none; font: 400 clamp(1.375rem, 2.2vw, 2rem)/1.2 "Fraunces", Georgia, serif; font-variation-settings: "SOFT" 100, "WONK" 0; }
.services li { padding: 12px 0; border-bottom: 1px solid var(--noyer); }

/* ---- L'histoire du chantier : une vraie suite d'étapes ---- */
.histoire { padding: clamp(56px, 8vw, 112px) var(--marge); background: var(--enduit); }
.etapes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: clamp(24px, 3vw, 40px) clamp(12px, 2vw, 24px);
    margin: clamp(24px, 4vw, 48px) 0 0;
    padding: 0;
    list-style: none;
}
.etapes img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; }
.etapes p { margin: 12px 0 0; font-size: 1rem; line-height: 1.45; }
.etapes strong { font-weight: 600; }

/* Colonnes plutôt que grille : chaque photo garde son format. */
.resultat { columns: 2; column-gap: clamp(12px, 2vw, 24px); }
.resultat figure { break-inside: avoid; margin-bottom: clamp(24px, 3vw, 40px); }

/* ---- Contact ---- */
.contact { padding: clamp(56px, 8vw, 112px) var(--marge); background: var(--charbon); color: var(--chaux); }
.contact h2 { margin-bottom: 12px; }
.contact-langues { margin: 0 0 28px; font-size: 1.1875rem; }
.contact a { color: inherit; }
.contact a:focus-visible { outline-color: var(--chaux); }
.grand {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin-bottom: 8px;
    font: 400 clamp(1.375rem, 3.2vw, 2.5rem)/1.3 "Fraunces", Georgia, serif;
    font-variation-settings: "SOFT" 100, "WONK" 0;
    overflow-wrap: anywhere;
}
address { margin-top: 24px; font-style: normal; }

/* ---- Diaporama du résultat : fond sombre, la photo entière, sans arche ---- */
.bouton-clair { background: transparent; color: var(--charbon); box-shadow: inset 0 0 0 1px var(--charbon); }
.bouton-clair:hover { color: var(--chaux); }
.projet-texte .bouton, .ouverture-texte .bouton { margin: 0 8px 8px 0; }

.page-diaporama { background: var(--charbon); color: var(--chaux); }
.diaporama { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.diaporama a { color: inherit; }
.diaporama a:focus-visible, .commandes button:focus-visible { outline: 3px solid var(--chaux); outline-offset: 3px; }

.diaporama-entete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 24px; padding: 12px var(--marge); }
.diaporama-titre { display: inline-flex; align-items: center; gap: 10px; }
.diaporama-titre img { width: auto; height: 34px; border-radius: 4px; }
.diaporama-entete h1 { font-size: clamp(1.25rem, 2.2vw, 1.75rem); }
.diaporama-entete a { display: inline-block; padding: 10px 0; }

.diaporama:not(.actif) .diapos { display: none; }
.diapos { flex: 1; min-height: 0; margin: 0; padding: 0; list-style: none; }
.diapos-sans-script { margin: 0; padding: 0 var(--marge); list-style: none; }
.diapos-sans-script li { margin-bottom: 16px; }
.diaporama.actif .diapos { padding: 0 clamp(8px, 1.5vw, 24px); }
.diaporama.actif .diapos li { display: none; margin: 0; }
.diaporama.actif .diapos li.courante { display: flex; align-items: center; justify-content: center; height: 100%; animation: fondu 600ms ease-out; }
.diaporama.actif .diapos img { width: auto; max-height: calc(100vh - 136px); max-height: calc(100dvh - 136px); border-radius: 4px; }

@keyframes fondu { from { opacity: 0; } }

.commandes { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 12px var(--marge); }
.commandes[hidden] { display: none; }
.commandes button {
    min-height: 44px;
    padding: 8px 20px;
    border: 1px solid var(--chaux);
    border-radius: 999px;
    background: transparent;
    color: var(--chaux);
    font: inherit;
    cursor: pointer;
}
.commandes button:hover { background: var(--chaux); color: var(--charbon); }
.compteur { min-width: 5em; text-align: center; font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
    .diaporama.actif .diapos li.courante { animation: none; }
}

/* ---- Pied et pages simples ---- */
.pied { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding: 24px var(--marge); font-size: 0.9375rem; }
.pied-marque { display: inline-flex; align-items: center; gap: 8px; }
.pied-marque img { width: auto; height: 32px; mix-blend-mode: multiply; }
.page-simple { padding: clamp(24px, 5vw, 64px) var(--marge); }
.page-simple h1 { margin: 32px 0 24px; }
.texte { max-width: 65ch; }
.texte p { margin: 0 0 1em; }

/* ---- Téléphone et tablette ---- */
@media (max-width: 820px) {
    /* Bandeau compact, toujours visible : logo et langues, puis le menu sur une seule ligne. */
    html { scroll-padding-top: 116px; }
    .entete { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 6px var(--marge) 0; }
    .entete .langues { grid-column: 2; grid-row: 1; }
    .entete nav:not(.langues) { grid-column: 1 / -1; grid-row: 2; flex-wrap: nowrap; gap: 0 16px; overflow-x: auto; }
    .entete nav a { white-space: nowrap; font-size: 0.9375rem; }
    .marque { font-size: 1.25rem; }
    .marque img { height: 38px; }
    .ouverture-texte, .projet-texte, .bois, .deux-colonnes { grid-template-columns: minmax(0, 1fr); }
    .grande-arche img { aspect-ratio: 4 / 3; }
    .paire { grid-template-columns: minmax(0, 1fr); }
    .paire .avant { max-width: 60%; }
}

@media (max-width: 620px) {
    .serie-etapes { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
    .resultat { columns: 1; }
}
