/* ==========================================================================
   SICOB — Charpente & Ossature Bois — "Précision Minérale"
   Contrat : DESIGN.md — tous les tokens ici, aucune valeur en dur ailleurs.
   ========================================================================== */

:root {
  --ink: #1A202C;
  --ink-2: #2D3748;
  --bg: #F7FAFC;
  --bg-2: #E2E8F0;
  --line: #CBD5E0;
  --muted: #4A5568;
  --muted-dark: #A7B3C4;
  --copper: #C05621;
  --copper-2: #9C4215;
  --gold: #E9A820;
  --green: #276749;

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --radius: 2px;
  --shadow-1: 0 1px 2px rgba(26, 32, 44, .06), 0 8px 24px rgba(26, 32, 44, .08);
  --shadow-2: 0 2px 4px rgba(26, 32, 44, .08), 0 20px 48px rgba(26, 32, 44, .18);
  --ease: cubic-bezier(.4, 0, .2, 1);
  --container: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 .6em;
  letter-spacing: -.01em;
}

h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 700; line-height: 1.05; }
h2 { font-size: clamp(1.9rem, 3.5vw, 2.9rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 500; }

p { margin: 0 0 1em; }

a { color: var(--copper); }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 12px 20px; font-weight: 600;
}
.skip-link:focus { left: 0; }

.container { max-width: var(--container); margin-inline: auto; padding-inline: 24px; }

.muted { color: var(--muted); }

/* --------------------------------------------------------------------------
   Eyebrow — étiquette "fiche technique"
   -------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--font-display);
  font-size: .78rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--copper);
  margin: 0 0 20px;
}
.eyebrow::before { content: ""; width: 24px; height: 2px; background: currentColor; }
.eyebrow-gold { color: var(--gold); }

/* --------------------------------------------------------------------------
   Boutons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  white-space: nowrap;
  font-family: var(--font-body); font-size: .95rem; font-weight: 600;
  padding: 14px 28px; min-height: 48px;
  border: 1px solid transparent; border-radius: var(--radius);
  text-decoration: none; cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.btn svg { flex: none; transition: transform .3s var(--ease); }
.btn:hover svg { transform: translateX(4px); }
.btn-copper { background: var(--copper); color: #fff; }
.btn-copper:hover { background: var(--copper-2); }
.btn-ghost { border-color: currentColor; color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.hero .btn-ghost { color: #fff; }
.hero .btn-ghost:hover { background: var(--bg); color: var(--ink); }
.section-dark .btn-ghost, .page-hero .btn-ghost { color: #fff; }
.section-dark .btn-ghost:hover, .page-hero .btn-ghost:hover { background: var(--bg); color: var(--ink); }
.btn-light { background: var(--bg); color: var(--ink); }
.btn-light:hover { background: var(--bg-2); }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100;
  border-bottom: 1px solid var(--line);
}
/* Le flou vit sur un pseudo-element : un backdrop-filter pose sur .site-header
   en ferait le bloc conteneur des descendants en position:fixed (menu mobile). */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(247, 250, 252, .92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.header-inner {
  display: flex; align-items: center; gap: 32px;
  height: 76px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); margin-right: auto; flex-shrink: 0; }
.brand img { height: 48px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; }
.brand-sub { font-size: .62rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); white-space: nowrap; }

.site-nav { display: flex; gap: 22px; }
.site-nav a {
  position: relative; white-space: nowrap;
  font-size: .875rem; font-weight: 500; text-decoration: none; color: var(--ink);
  padding: 6px 0;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--copper);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--ease);
}
.site-nav a:hover::after, .site-nav a.is-current::after { transform: scaleX(1); }
.site-nav a.is-current { color: var(--copper); }

/* Entre le seuil burger et ~1500px, la baseline de marque n'a pas la place :
   on la masque plutôt que de laisser la marque chevaucher le premier lien. */
@media (min-width: 1241px) and (max-width: 1500px) {
  .brand-sub { display: none; }
}

.nav-toggle {
  display: none;
  position: relative; z-index: 120;
  width: 48px; height: 48px; padding: 12px;
  background: none; border: none; cursor: pointer;
}
.nav-toggle span {
  display: block; height: 2px; width: 24px; margin: 5px auto;
  background: var(--ink);
  transition: transform .3s var(--ease), opacity .3s var(--ease), background .3s var(--ease);
}

@media (max-width: 1240px) {
  .header-cta { display: none; }
  .nav-toggle { display: block; }
  .site-nav {
    position: fixed; inset: 0; z-index: 110;
    flex-direction: column; justify-content: center; align-items: flex-start;
    gap: 8px; padding: 96px 32px 48px;
    background: var(--ink);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility 0s .3s;
  }
  .site-nav a { color: #fff; font-family: var(--font-display); font-size: 1.6rem; font-weight: 500; padding: 10px 0; }
  .site-nav a.is-current { color: var(--gold); }
  .site-nav a::after { background: var(--gold); }
  body.nav-open .site-nav { opacity: 1; visibility: visible; transform: none; transition: opacity .3s var(--ease), transform .3s var(--ease); }
  body.nav-open .nav-toggle span { background: #fff; }
  body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  body.nav-open { overflow: hidden; }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding-block: 120px; }
.section-alt { background: var(--bg-2); }
.section-dark { background: var(--ink); color: #fff; }
.section-dark .muted, .section-dark p { color: var(--muted-dark); }
.section-dark h2, .section-dark h3 { color: #fff; }

.section-head { max-width: 720px; margin-bottom: 56px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.section-dark .section-head p { color: var(--muted-dark); }

.truss-divider { display: block; width: 100%; height: 40px; color: var(--gold); }

/* --------------------------------------------------------------------------
   Hero (accueil)
   -------------------------------------------------------------------------- */
.hero {
  position: relative; display: flex; align-items: flex-end;
  min-height: 92vh; padding: 160px 0 96px;
  background: var(--ink); color: #fff;
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(26, 32, 44, .82) 0%, rgba(26, 32, 44, .38) 48%, rgba(26, 32, 44, 0) 75%),
    linear-gradient(12deg, rgba(26, 32, 44, .9) 20%, rgba(26, 32, 44, .5) 58%, rgba(26, 32, 44, .28) 100%);
}
.hero-truss {
  position: absolute; right: -4%; top: 10%; width: 56%; opacity: .16;
  color: var(--gold); pointer-events: none;
}
.hero-content { position: relative; z-index: 2; max-width: 880px; }
.hero-content h1 { color: #fff; margin-bottom: 24px; }
.hero-content h1 em { font-style: normal; color: var(--gold); }
.hero-lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: #DCE3EC; max-width: 620px; margin-bottom: 40px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.hero-meta {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 32px;
  margin-top: 64px; padding-top: 24px;
  border-top: 1px solid rgba(226, 232, 240, .25);
  font-size: .85rem; color: var(--muted-dark);
}
.hero-meta strong { display: block; font-family: var(--font-display); font-size: 1.05rem; color: #fff; font-weight: 500; }

/* --------------------------------------------------------------------------
   Stats
   -------------------------------------------------------------------------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.stat { border-top: 2px solid var(--gold); padding-top: 20px; }
.stat-num { font-family: var(--font-display); font-weight: 700; font-size: clamp(2.4rem, 4vw, 3.4rem); line-height: 1; letter-spacing: -.02em; }
.stat-num sup { font-size: .45em; color: var(--copper); }
.stat-label { color: var(--muted); font-size: .9rem; margin-top: 8px; }
.section-dark .stat-label { color: var(--muted-dark); }
@media (max-width: 900px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* --------------------------------------------------------------------------
   Cards expertises
   -------------------------------------------------------------------------- */
.expertise-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 1100px) { .expertise-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .expertise-grid { grid-template-columns: 1fr; } }

.card-expertise {
  display: flex; flex-direction: column;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.card-expertise:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.card-expertise:hover .card-media img { transform: scale(1.05); }
.card-index {
  position: absolute; top: 12px; left: 12px;
  font-family: var(--font-display); font-size: .72rem; font-weight: 500; letter-spacing: .12em;
  background: var(--ink); color: var(--gold);
  padding: 6px 10px;
}
.card-body { display: flex; flex-direction: column; flex: 1; padding: 24px; }
.card-body h3 { margin-bottom: 8px; }
.card-body p { color: var(--muted); font-size: .92rem; flex: 1; }
.card-more {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .85rem; font-weight: 600; color: var(--copper);
  margin-top: 16px;
}
.card-more svg { transition: transform .3s var(--ease); }
.card-expertise:hover .card-more svg { transform: translateX(4px); }

/* --------------------------------------------------------------------------
   Démarche qualité
   -------------------------------------------------------------------------- */
.quality-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 32px; }
@media (max-width: 980px) { .quality-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .quality-grid { grid-template-columns: 1fr; } }
.quality-item h3 { font-size: 1.05rem; margin: 16px 0 8px; }
.quality-item p { color: var(--muted); font-size: .92rem; margin: 0; }
.section-dark .quality-item p { color: var(--muted-dark); }
.quality-icon { color: var(--copper); }
.section-dark .quality-icon { color: var(--gold); }

/* --------------------------------------------------------------------------
   Split média / texte
   -------------------------------------------------------------------------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.split-media { position: relative; }
.split-media img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-1); }
.split-media figcaption {
  position: absolute; left: 16px; bottom: 16px;
  background: rgba(26, 32, 44, .85); color: var(--bg);
  font-size: .78rem; letter-spacing: .06em; text-transform: uppercase;
  padding: 8px 14px;
}
@media (max-width: 980px) { .split { grid-template-columns: 1fr; gap: 40px; } }

.check-list { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 14px; }
.check-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); }
.section-dark .check-list li { color: var(--muted-dark); }
.check-list svg { flex: none; margin-top: 4px; color: var(--copper); }
.section-dark .check-list svg { color: var(--gold); }
.check-list strong { color: var(--ink); font-weight: 600; }
.section-dark .check-list strong { color: #fff; }

/* --------------------------------------------------------------------------
   Réalisations
   -------------------------------------------------------------------------- */
.real-grid { columns: 3 300px; column-gap: 24px; }
.real-card {
  break-inside: avoid; margin: 0 0 24px; position: relative; overflow: hidden;
  border-radius: var(--radius); background: var(--ink);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.real-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.real-card img { width: 100%; transition: transform .7s var(--ease); }
.real-card:hover img { transform: scale(1.05); }
.real-card figcaption {
  position: absolute; inset: auto 0 0;
  padding: 40px 16px 14px;
  background: linear-gradient(0deg, rgba(26, 32, 44, .88), transparent);
  color: #fff; font-size: .9rem; font-weight: 500;
}
.real-card figcaption span { display: block; font-size: .72rem; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin-top: 2px; }

/* --------------------------------------------------------------------------
   Zone d'intervention
   -------------------------------------------------------------------------- */
.map-frame { position: relative; background: var(--ink); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.map-frame img { width: 100%; mix-blend-mode: luminosity; opacity: .9; }
.map-badge {
  position: absolute; top: 16px; left: 16px;
  background: var(--gold); color: var(--ink);
  font-family: var(--font-display); font-size: .75rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 8px 12px;
}
.dept-list { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 24px; }
.dept-list li { display: flex; align-items: baseline; gap: 10px; font-size: .95rem; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.dept-list .dept-num { font-family: var(--font-display); font-weight: 700; color: var(--copper); font-size: .85rem; min-width: 2ch; }
@media (max-width: 640px) { .dept-list { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Bande Scop — statut coopératif (accueil)
   -------------------------------------------------------------------------- */
.scop-band { background: #fff; border-block: 1px solid var(--line); padding-block: 48px; }
.scop-band-inner { display: flex; align-items: center; gap: 40px; }
.scop-plate {
  flex: none; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 22px; background: #fff;
}
.scop-plate img { height: 76px; width: auto; }
.scop-band h2 { font-size: 1.45rem; margin-bottom: 8px; }
.scop-band p { margin: 0; color: var(--muted); max-width: 72ch; }
@media (max-width: 700px) {
  .scop-band-inner { flex-direction: column; align-items: flex-start; gap: 24px; }
}

/* --------------------------------------------------------------------------
   Durabilité
   -------------------------------------------------------------------------- */
.green-badges { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.green-badge {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--green); color: var(--green);
  font-size: .82rem; font-weight: 600;
  padding: 8px 14px; border-radius: var(--radius);
}
.section-dark .green-badge { border-color: #48BB78; color: #9AE6B4; }

/* --------------------------------------------------------------------------
   CTA finale
   -------------------------------------------------------------------------- */
.cta-panel { text-align: left; display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center; }
.cta-panel .btn { justify-self: start; }
@media (max-width: 900px) { .cta-panel { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------------------
   Page hero interne
   -------------------------------------------------------------------------- */
.page-hero {
  position: relative; display: flex; align-items: flex-end;
  min-height: 52vh; padding: 160px 0 64px;
  background: var(--ink); color: #fff; overflow: hidden;
}
.page-hero-media { position: absolute; inset: 0; }
.page-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.page-hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(10deg, rgba(26, 32, 44, .94) 20%, rgba(26, 32, 44, .5) 70%, rgba(26, 32, 44, .35) 100%);
}
.page-hero .container { position: relative; z-index: 2; }
.page-hero h1 { color: #fff; font-size: clamp(2.2rem, 4.5vw, 3.6rem); margin-bottom: 12px; }
.page-hero p { color: #DCE3EC; max-width: 640px; font-size: 1.05rem; margin: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-dark); margin-bottom: 20px; }
.crumbs a { color: var(--muted-dark); text-decoration: none; }
.crumbs a:hover { color: var(--gold); }
.crumbs span[aria-hidden] { color: var(--muted-dark); }

/* --------------------------------------------------------------------------
   Formulaires
   -------------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid .form-field-full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.form-field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.form-field label { font-size: .9rem; font-weight: 600; }
.form-field .optional { font-weight: 400; color: var(--muted); }
.form-field input, .form-field textarea, .form-field select {
  font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; min-height: 48px;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.form-field textarea { min-height: 140px; resize: vertical; }
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
  outline: none; border-color: var(--copper);
  box-shadow: 0 0 0 3px rgba(192, 86, 33, .15);
}
.form-field .field-msg { font-size: .8rem; min-height: 1.2em; margin: 0; }
.form-field.is-error input, .form-field.is-error textarea { border-color: var(--copper); }
.form-field.is-error .field-msg { color: var(--copper-2); }
.form-field.is-valid input, .form-field.is-valid textarea { border-color: var(--green); }
.form-field .field-check {
  position: absolute; right: 14px; top: 40px;
  color: var(--green); opacity: 0; transition: opacity .3s var(--ease);
}
.form-field.is-valid .field-check { opacity: 1; }
.form-note { font-size: .82rem; color: var(--muted); }
.form-success {
  display: none; gap: 12px; align-items: flex-start;
  border: 1px solid var(--green); color: var(--green);
  background: rgba(39, 103, 73, .06);
  padding: 16px; border-radius: var(--radius); margin-top: 20px;
}
.form-success.is-visible { display: flex; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--ink); color: var(--muted-dark); font-size: .92rem; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 48px;
  padding-block: 72px;
}
@media (max-width: 980px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-plates { display: flex; align-items: stretch; gap: 12px; margin-bottom: 20px; }
.footer-brand-plate {
  display: inline-flex; align-items: center; background: var(--bg); padding: 14px 18px; border-radius: var(--radius);
}
.footer-brand-plate img { height: 56px; width: auto; }
.footer-brand-plate .scop-img { height: 60px; }
.footer-col h4 {
  font-family: var(--font-display); font-size: .8rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 18px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { color: var(--muted-dark); text-decoration: none; transition: color .3s var(--ease); }
.footer-col a:hover { color: #fff; }
.footer-contact li { display: flex; gap: 10px; align-items: flex-start; }
.footer-contact svg { flex: none; margin-top: 4px; color: var(--gold); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between;
  border-top: 1px solid var(--ink-2);
  padding-block: 24px; font-size: .8rem;
}
.footer-bottom a { color: var(--muted-dark); text-decoration: none; }
.footer-bottom a:hover { color: #fff; }

/* --------------------------------------------------------------------------
   Reveal — enhancement uniquement (état par défaut : visible)
   -------------------------------------------------------------------------- */
.reveal { opacity: 1; transform: none; }
.js-io .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js-io .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .js-io .reveal { opacity: 1; transform: none; }
}

@media (max-width: 700px) {
  .section { padding-block: 72px; }
  .container { padding-inline: 16px; }
  .hero { min-height: 80vh; padding-top: 120px; }
  .hero-meta { gap: 20px; }
}
