/* ==========================================================================
   CEREC — cerec.one
   Feuille de style unique. Aucune dépendance externe.
   ========================================================================== */

/* --- Police auto-hébergée (RGPD : aucun appel vers un CDN tiers) ---------- */
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/manrope-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/manrope-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* --- Jetons de design ---------------------------------------------------- */
:root {
  --ink: #16181a;
  --ink-mid: #4b4f54;
  --ink-soft: #6e7378;
  --paper: #ffffff;
  --paper-alt: #f5f3f0;
  --paper-deep: #16181a;
  --line: #e3ded7;
  --accent: #2c3e50;

  --wrap: 1320px;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --section-y: clamp(5rem, 11vw, 10.5rem);

  --step--1: clamp(0.8rem, 0.77rem + 0.15vw, 0.875rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --step-1: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.25rem + 1.2vw, 2.2rem);
  --step-3: clamp(2rem, 1.5rem + 2.4vw, 3.4rem);
  --step-4: clamp(2.6rem, 1.5rem + 5vw, 6rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.032em;
  text-wrap: balance;
}
p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

::selection { background: var(--ink); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  background: var(--ink);
  color: var(--paper);
  padding: 0.85rem 1.4rem;
}
.skip:focus { left: 0; }

/* --- Utilitaires --------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
.section--alt { background: var(--paper-alt); }
.section--dark { background: var(--paper-deep); color: #f2f0ed; }
.section--dark h2, .section--dark h3 { color: #fff; }

.eyebrow {
  display: block;
  margin-bottom: 1.6rem;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.section--dark .eyebrow { color: #8f959b; }

.lead {
  font-size: var(--step-1);
  line-height: 1.5;
  font-weight: 300;
  color: var(--ink-mid);
  letter-spacing: -0.018em;
}
.section--dark .lead { color: #c3c7cb; }

.measure { max-width: 62ch; }

/* --- Révélation au défilement -------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal[data-delay='1'] { transition-delay: 0.09s; }
.reveal[data-delay='2'] { transition-delay: 0.18s; }
.reveal[data-delay='3'] { transition-delay: 0.27s; }

/* --- En-tête ------------------------------------------------------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.15rem var(--gutter);
  color: #fff;
  transition: background-color 0.45s var(--ease), color 0.45s var(--ease),
    box-shadow 0.45s var(--ease), padding 0.45s var(--ease);
}
.site-header.is-solid,
.site-header.is-open {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(14px);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
  padding-block: 0.85rem;
}
/* Pages intérieures : en-tête opaque dès le chargement */
.site-header--static {
  position: sticky;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(14px);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
}

/* Logo : SVG intégré à la page, il hérite donc de la couleur du texte — blanc
   sur le héro, encre une fois l'en-tête opaque. Aucun fichier externe, le logo
   s'affiche donc aussi bien en ligne qu'en ouvrant le fichier en local. */
/* Le logotype est centré sur la baseline, qui est l'élément le plus large.
   flex: none empêche l'en-tête de comprimer le bloc et de faire passer la
   baseline sur deux lignes. */
.brand {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
.brand__mark {
  display: block;
  width: clamp(96px, 9vw, 118px);
  height: auto;
}
.brand__fallback { display: none; }
.brand__tag {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.135em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  opacity: 0.72;
}
/* Sous 560 px, la baseline devient trop large : seul le logotype subsiste. */
@media (max-width: 560px) {
  .brand__tag { display: none; }
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Logo complet (avec baseline) dans le pied de page */
.footer-logo {
  display: block;
  width: 148px;
  height: auto;
  margin-bottom: 1.6rem;
}

.nav { display: flex; align-items: center; gap: clamp(1.2rem, 2.2vw, 2.4rem); }
.nav a {
  position: relative;
  font-size: 0.855rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding-block: 0.3rem;
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.45s var(--ease);
}
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav .nav-cta {
  padding: 0.62rem 1.35rem;
  border: 1px solid currentColor;
  border-radius: 100px;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}
.nav .nav-cta::after { display: none; }
.nav .nav-cta:hover { background: currentColor; }
.nav .nav-cta:hover span { color: var(--paper); }
.site-header.is-solid .nav .nav-cta:hover span,
.site-header--static .nav .nav-cta:hover span { color: #fff; }

.burger {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.burger span {
  display: block;
  width: 24px;
  height: 1.5px;
  margin: 5px auto;
  background: currentColor;
  transition: transform 0.4s var(--ease), opacity 0.3s var(--ease);
}
.is-open .burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.is-open .burger span:nth-child(2) { opacity: 0; }
.is-open .burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 900px) {
  .burger { display: block; }
  .nav {
    position: fixed;
    inset: 0 0 auto 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 5.5rem var(--gutter) 2.5rem;
    background: var(--paper);
    color: var(--ink);
    transform: translateY(-100%);
    visibility: hidden;
    transition: transform 0.55s var(--ease), visibility 0.55s;
  }
  .is-open .nav { transform: none; visibility: visible; }
  .nav a {
    width: 100%;
    padding-block: 1rem;
    font-size: 1.28rem;
    border-bottom: 1px solid var(--line);
  }
  .nav .nav-cta {
    margin-top: 1.6rem;
    width: auto;
    border-color: var(--ink);
    border-radius: 100px;
  }
}

/* --- Héro ---------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding: 8rem var(--gutter) clamp(3rem, 7vw, 6rem);
  color: #fff;
  overflow: hidden;
}
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: heroZoom 22s var(--ease) forwards;
}
@keyframes heroZoom {
  from { transform: scale(1.09); }
  to { transform: scale(1); }
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    185deg,
    rgba(10, 12, 14, 0.52) 0%,
    rgba(10, 12, 14, 0.16) 38%,
    rgba(10, 12, 14, 0.58) 78%,
    rgba(10, 12, 14, 0.82) 100%
  );
}
.hero__inner { width: 100%; max-width: var(--wrap); margin-inline: auto; }
.hero h1 {
  max-width: 17ch;
  font-size: var(--step-4);
  font-weight: 500;
  letter-spacing: -0.042em;
}
.hero h1 em {
  font-style: normal;
  font-weight: 200;
}
.hero__sub {
  max-width: 46ch;
  margin-top: clamp(1.5rem, 3vw, 2.4rem);
  font-size: var(--step-1);
  font-weight: 300;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.88);
}
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  margin-top: clamp(2rem, 4vw, 3.2rem);
  padding-top: 1.7rem;
  border-top: 1px solid rgba(255, 255, 255, 0.26);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}
.hero__meta span:not(:last-child)::after {
  content: '';
  display: inline-block;
  width: 3px;
  height: 3px;
  margin-left: 1.5rem;
  vertical-align: middle;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
}

/* --- Titres de section ---------------------------------------------------- */
.section__head { margin-bottom: clamp(3rem, 6vw, 5.5rem); }
.section__head h2 { font-size: var(--step-3); max-width: 20ch; }
.section__head .lead { margin-top: 1.6rem; max-width: 58ch; }

/* --- Grille « posture diamant » ------------------------------------------ */
.profiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}
.profile {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: clamp(2rem, 3.2vw, 3rem) clamp(1.5rem, 2.4vw, 2.4rem);
  background: var(--paper);
  transition: background-color 0.5s var(--ease);
}
.section--alt .profile { background: var(--paper-alt); }
.profile:hover { background: var(--ink); color: #fff; }
.profile:hover .profile__role { color: rgba(255, 255, 255, 0.62); }
.profile:hover p { color: rgba(255, 255, 255, 0.82); }
.profile__role {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.5s var(--ease);
}
.profile h3 { font-size: var(--step-1); letter-spacing: -0.028em; }
.profile p {
  margin: 0;
  font-size: 0.945rem;
  line-height: 1.6;
  color: var(--ink-mid);
  transition: color 0.5s var(--ease);
}

/* --- Métiers ------------------------------------------------------------- */
.services { border-top: 1px solid var(--line); }
.service {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr) minmax(0, 1.35fr);
  gap: clamp(1rem, 3vw, 3rem);
  align-items: start;
  padding-block: clamp(2.2rem, 3.6vw, 3.4rem);
  border-bottom: 1px solid var(--line);
}
.service__num {
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  padding-top: 0.5rem;
}
.service h3 { font-size: var(--step-2); letter-spacing: -0.035em; }
.service__body { color: var(--ink-mid); }
.service__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.service__tags li {
  padding: 0.34rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 0.79rem;
  font-weight: 500;
  color: var(--ink-soft);
}
@media (max-width: 820px) {
  .service { grid-template-columns: 3rem minmax(0, 1fr); }
  .service__body { grid-column: 2; }
}

/* --- Bloc réhabilitation ------------------------------------------------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(2rem, 4vw, 4rem);
  margin-top: clamp(3rem, 5vw, 4.5rem);
}
.pillar { border-top: 1px solid rgba(255, 255, 255, 0.2); padding-top: 1.6rem; }
.pillar h3 {
  font-size: var(--step-1);
  margin-bottom: 0.9rem;
  letter-spacing: -0.028em;
}
.pillar p { color: #b8bdc2; font-size: 0.955rem; line-height: 1.62; }

/* --- Galerie des réalisations -------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: clamp(2rem, 4vw, 3.2rem);
}
.filter {
  padding: 0.55rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: none;
  font: inherit;
  font-size: 0.855rem;
  font-weight: 500;
  color: var(--ink-mid);
  cursor: pointer;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease),
    border-color 0.35s var(--ease);
}
.filter:hover { border-color: var(--ink); color: var(--ink); }
.filter[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
  gap: clamp(1.4rem, 2.4vw, 2.4rem);
}
.card { display: block; }
.card[hidden] { display: none; }
.card__media {
  position: relative;
  overflow: hidden;
  background: var(--paper-alt);
  aspect-ratio: 4 / 3;
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease), filter 0.7s var(--ease);
}
.card:hover .card__media img { transform: scale(1.055); }
.card__body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.15rem;
}
.card h3 {
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: -0.028em;
}
.card__place {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.card__go {
  flex: none;
  font-size: 1.2rem;
  color: var(--ink-soft);
  transition: transform 0.5s var(--ease), color 0.5s var(--ease);
}
.card:hover .card__go { transform: translateX(5px); color: var(--ink); }

/* --- Bandeau chiffres ---------------------------------------------------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: clamp(2rem, 4vw, 3.5rem);
}
.stat__num {
  display: block;
  font-size: var(--step-3);
  font-weight: 300;
  letter-spacing: -0.05em;
  line-height: 1;
}
.stat__label {
  display: block;
  margin-top: 0.85rem;
  font-size: 0.9rem;
  color: var(--ink-mid);
  max-width: 26ch;
}
.section--dark .stat__label { color: #b8bdc2; }

/* --- Contact ------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(2rem, 4vw, 4rem);
  margin-top: clamp(2.5rem, 4vw, 4rem);
}
.contact-block h3 {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}
.contact-block p, .contact-block a { font-size: var(--step-1); font-weight: 300; }
.contact-block address { font-style: normal; }
.link-u {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.5s var(--ease);
}
.link-u:hover { background-size: 0% 1px; }

/* --- Pied de page -------------------------------------------------------- */
.site-footer {
  padding-block: clamp(3rem, 5vw, 4.5rem);
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--ink-soft);
}
.site-footer__row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  justify-content: space-between;
  align-items: center;
}
.site-footer a:hover { color: var(--ink); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1.5rem; }

/* --- Pages projet -------------------------------------------------------- */
.project-hero {
  padding-top: clamp(7rem, 12vw, 10rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}
.back {
  display: inline-block;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.35s var(--ease);
}
.back:hover { color: var(--ink); }
.project-hero h1 {
  font-size: var(--step-3);
  max-width: 20ch;
}
.project-hero .lead { margin-top: 1.8rem; max-width: 60ch; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: clamp(2rem, 3vw, 2.5rem);
  border-top: 1px solid var(--line);
}
.fact dt {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.fact dd {
  margin: 0.6rem 0 0;
  font-size: 1.05rem;
  font-weight: 400;
}

.figure { margin: 0; }
.figure--wide { margin-block: clamp(2rem, 5vw, 4.5rem); }
.figure img { width: 100%; }
.figure figcaption {
  margin-top: 0.9rem;
  font-size: 0.855rem;
  color: var(--ink-soft);
}

.duo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: clamp(1.2rem, 2.4vw, 2rem);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: clamp(1.2rem, 2.4vw, 2rem);
}
.gallery img { width: 100%; }

.prose { max-width: 66ch; }
.prose h2 {
  font-size: var(--step-2);
  margin-bottom: 1.4rem;
}
.prose h3 {
  font-size: var(--step-1);
  margin: 2.6rem 0 1rem;
}
.prose ul { margin: 0 0 1.15em; padding-left: 1.15rem; color: var(--ink-mid); }
.prose li { margin-bottom: 0.5rem; }
.prose p { color: var(--ink-mid); }

.next-project {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding-block: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--line);
}
.next-project h2 { font-size: var(--step-2); }
.next-project a { font-size: var(--step-1); font-weight: 500; }
