:root {
  --olive: #57573f;
  --olive-dark: #3f4030;
  --olive-darker: #2c2d22;
  --cream: #f1e8d6;
  --cream-dim: #d9d0bc;
  --ink: #23241a;
  --accent: #c1622d;
  --accent-light: #e0855a;
  --radius: 2px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
}

h1, h2, h3, .brand {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

a { color: inherit; text-decoration: none; }

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

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--olive);
  color: var(--cream);
  border-bottom: 1px solid rgba(241,232,214,0.12);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1180px;
  margin: 0 auto;
}

.brand {
  font-size: clamp(1rem, 4vw, 1.5rem);
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.brand .mark {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--cream);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

nav.main-nav a {
  font-size: 0.95rem;
  opacity: 0.9;
}
nav.main-nav a:hover { opacity: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  border: 1.5px solid transparent;
  cursor: pointer;
}

.btn-cream {
  background: var(--cream);
  color: var(--olive-darker);
}
.btn-cream:hover { background: #fff; }

.btn-outline {
  background: transparent;
  border-color: var(--cream);
  color: var(--cream);
}
.btn-outline:hover { background: rgba(241,232,214,0.1); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--cream);
  font-size: 1.6rem;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
  color: var(--cream);
  background: linear-gradient(180deg, rgba(44,45,34,0.35) 0%, rgba(44,45,34,0.55) 55%, rgba(44,45,34,0.92) 100%),
              url('images/chantier-6.jpg') center 30% / cover no-repeat;
}

.hero-inner {
  padding: 80px 24px 64px;
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}

@keyframes ba-fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.hero .eyebrow,
.hero h1,
.hero p,
.hero-actions {
  animation: ba-fade-up .7s cubic-bezier(.2,.7,.3,1) both;
}
.hero h1 { animation-delay: .08s; }
.hero p { animation-delay: .16s; }
.hero-actions { animation-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
  .hero .eyebrow, .hero h1, .hero p, .hero-actions { animation: none; }
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cream-dim);
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.02;
  max-width: 14ch;
}

.hero p {
  margin-top: 22px;
  font-size: 1.15rem;
  max-width: 46ch;
  color: var(--cream-dim);
}

.hero-actions {
  margin-top: 34px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Sections ---------- */
section { padding: 96px 0; }

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}

.section-tag {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  color: var(--olive-darker);
}

.section-head p {
  margin-top: 16px;
  color: #55564a;
  font-size: 1.05rem;
}

/* ---------- Savoir-faire ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(87,87,63,0.18);
  border: 1px solid rgba(87,87,63,0.18);
}

.service-card {
  background: var(--cream);
  padding: 36px 30px;
  transition: background-color .25s ease, transform .25s ease;
}
.service-card:hover {
  background: #fff;
  transform: translateY(-3px);
}

.service-card .num {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 18px;
}

.service-card h3 {
  font-size: 1.15rem;
  color: var(--olive-darker);
  margin-bottom: 10px;
}

.service-card p {
  color: #5c5d50;
  font-size: 0.95rem;
  margin: 0;
}

/* ---------- Chantier band ---------- */
.chantier-section {
  background: var(--olive-darker);
  color: var(--cream);
}

.chantier-section .section-tag { color: var(--accent-light); }
.chantier-section .section-head h2 { color: var(--cream); }
.chantier-section .section-head p { color: var(--cream-dim); }

.chantier-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.chantier-grid a {
  display: block;
  overflow: hidden;
  aspect-ratio: 3/4;
  border-radius: var(--radius);
  box-shadow: 0 0 0 rgba(0,0,0,0);
  transition: box-shadow .3s ease, transform .3s ease;
}

.chantier-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.chantier-grid a:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(0,0,0,0.35);
}
.chantier-grid a:hover img { transform: scale(1.06); }

/* ---------- Réalisations ---------- */
#realisations .wrap { counter-reset: project; }

.project {
  margin-bottom: 96px;
  padding-top: 48px;
  border-top: 1px solid rgba(87,87,63,0.16);
  counter-increment: project;
}
.project:first-of-type { padding-top: 0; border-top: none; }
.project:last-child { margin-bottom: 0; }

.project-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.project-head::before {
  content: "0" counter(project);
  display: block;
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 10px;
  width: 100%;
}

.project-head h3 {
  font-size: 1.7rem;
  color: var(--olive-darker);
}

.project-head p {
  color: #5c5d50;
  max-width: 46ch;
  margin: 8px 0 0;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 300px;
  gap: 12px;
}

.project-grid a { border-radius: var(--radius); overflow: hidden; }
.project-grid img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.project-grid a:hover img { transform: scale(1.05); }

.project-grid .tall { grid-row: span 2; }
.project-grid .wide { grid-column: span 2; }

/* ---------- Contact ---------- */
.contact-section {
  background: var(--olive);
  color: var(--cream);
  text-align: center;
}

.contact-section .mark-lg {
  width: 64px;
  height: 64px;
  border: 1.5px solid var(--cream);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  margin: 0 auto 28px;
}

.contact-section h2 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  max-width: 18ch;
  margin: 0 auto;
}

.contact-section p {
  color: var(--cream-dim);
  margin-top: 16px;
  font-size: 1.05rem;
}

.contact-links {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.contact-links a {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
}

/* ---------- Footer ---------- */
footer {
  background: var(--olive-darker);
  color: var(--cream-dim);
  padding: 28px 0;
  font-size: 0.85rem;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Header scroll state ---------- */
header.site-header {
  transition: box-shadow .25s ease, background-color .25s ease;
}
header.site-header.scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,0.18);
  background: var(--olive-darker);
}

nav.main-nav a {
  position: relative;
  padding-bottom: 4px;
}
nav.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--accent-light);
  transition: width .25s ease;
}
nav.main-nav a.active {
  opacity: 1;
}
nav.main-nav a.active::after {
  width: 100%;
}

/* ---------- Process ---------- */
.process-section {
  padding: 64px 0;
  border-bottom: 1px solid rgba(87,87,63,0.14);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
}

.process-step .num {
  font-family: 'Poppins', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.process-step h3 {
  font-size: 1.1rem;
  color: var(--olive-darker);
  margin-bottom: 8px;
}

.process-step p {
  color: #5c5d50;
  font-size: 0.92rem;
  margin: 0;
}

/* ---------- Scroll-reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.in-view {
  opacity: 1;
  transform: none;
}

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

/* ---------- Mobile call bar ---------- */
.mobile-callbar {
  display: none;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20,20,15,0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 32px;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 88vh;
  border-radius: 2px;
}
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  color: var(--cream);
  font-size: 2rem;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--cream);
  font-size: 2.4rem;
  cursor: pointer;
  padding: 12px;
}
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .project-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 240px; }
  .chantier-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  nav.main-nav { display: none; }
  .nav-toggle { display: block; }
  .header-inner .btn-cream { display: none; }

  .header-inner.menu-open nav.main-nav {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--olive);
    flex-direction: column;
    padding: 20px 24px 28px;
    gap: 18px;
    border-bottom: 1px solid rgba(241,232,214,0.12);
  }
  .header-inner.menu-open .btn-cream { display: inline-flex; }

  section { padding: 64px 0; }
  .services-grid { grid-template-columns: 1fr; }
  .project { padding-top: 36px; margin-bottom: 64px; }
  .project-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 190px; }
  .project-grid .tall { grid-row: span 2; }
  .project-grid .wide { grid-column: span 2; }
  .chantier-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { min-height: 78vh; }
  .footer-inner { flex-direction: column; text-align: center; padding-bottom: 56px; }
  .process-grid { grid-template-columns: 1fr; gap: 28px; }

  .mobile-callbar {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: var(--olive-darker);
    color: var(--cream);
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(241,232,214,0.14);
  }
}
