/* ==========================================================================
   MAINTHERM — Design system
   ========================================================================== */

:root {
  --yellow: #f4c400;
  --yellow-light: #ffd82f;
  --green: #2f6b38;
  --green-dark: #17311f;
  --dark: #111912;
  --dark-soft: #1c2920;
  --paper: #f5f6f1;
  --white: #fff;
  --text: #263129;
  --muted: #68736b;
  --line: #dfe5dd;
  --shadow: 0 18px 50px rgba(20, 35, 24, 0.10);
  --radius: 24px;
  --max-width: 1180px;
  --header-height: 82px;
  --transition: 180ms ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.65;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--dark);
  color: var(--white);
  transform: translateY(-160%);
  transition: transform var(--transition);
}

.skip-link:focus { transform: translateY(0); }

/* Layout */
.container {
  width: min(calc(100% - 36px), var(--max-width));
  margin-inline: auto;
}

.section { padding: 100px 0; }
.paper { background: var(--paper); }
.dark { background: var(--dark); color: var(--white); }
.green { background: var(--green-dark); color: var(--white); }

.intro-grid,
.two-col,
.env-grid,
.parts-grid,
.service-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 70px;
  align-items: center;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 50px;
  margin-bottom: 48px;
}

.section-head > div { max-width: 760px; }
.section-head > p { max-width: 430px; color: var(--muted); }
.dark .section-head > p,
.green .section-head > p { color: rgba(255,255,255,.62); }

/* Typography */
h1, h2, h3 {
  margin: 0 0 18px;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

h1 { max-width: 760px; font-size: clamp(2.8rem, 6vw, 5.6rem); }
h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
h3 { font-size: 1.35rem; }

.lead {
  max-width: 700px;
  font-size: 1.14rem;
  color: var(--muted);
}

.kicker {
  margin-bottom: 8px;
  color: var(--green);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.kicker-yellow { color: var(--yellow); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(20,30,22,.08);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
}

.logo, .footer-logo { width: 170px; height: auto; }

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: .9rem;
  font-weight: 700;
}

.nav a { position: relative; }

.nav a:not(.cta)::after {
  position: absolute;
  right: 100%;
  bottom: -8px;
  left: 0;
  height: 2px;
  background: var(--yellow);
  content: "";
  transition: right 250ms ease;
}

.nav a:hover::after,
.nav a[aria-current="page"]::after { right: 0; }

.nav .cta {
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--dark);
  color: var(--white);
}

.toggle {
  display: none;
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--dark);
  font-size: 1.7rem;
  cursor: pointer;
}

/* Hero */
.hero {
  position: relative;
  display: flex;
  min-height: 690px;
  align-items: center;
  overflow: hidden;
  color: var(--white);
}

.hero::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg,rgba(7,17,10,.88),rgba(7,17,10,.52) 55%,rgba(7,17,10,.08)),
    url("hero.png") center / cover;
  content: "";
}

.hero::after {
  position: absolute;
  right: -5%;
  bottom: -70px;
  left: -5%;
  height: 150px;
  background: var(--white);
  content: "";
  transform: rotate(-3deg);
}

.hero .container {
  position: relative;
  z-index: 2;
  padding: 90px 0 120px;
}

.hero .kicker { color: var(--yellow-light); }
.hero h1 span { color: var(--yellow-light); }
.hero .lead { color: rgba(255,255,255,.82); }

.stats {
  display: flex;
  max-width: 860px;
  gap: 1px;
  margin-top: 45px;
  border-top: 1px solid rgba(255,255,255,.22);
}

.stat { min-width: 180px; padding: 18px 35px 0 0; }
.stat strong { display: block; font-size: 1.6rem; }
.stat span { color: rgba(255,255,255,.62); font-size: .78rem; }

/* Buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 30px 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 21px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 900;
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn:hover { transform: translateY(-2px); }
.primary { background: var(--yellow); color: #171b13; }
.secondary { background: var(--white); color: var(--dark); }
.outline { border-color: rgba(255,255,255,.35); color: var(--white); }

/* Cards */
.note {
  margin-top: 25px;
  padding: 12px 0 12px 22px;
  border-left: 5px solid var(--yellow);
}

.cards {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 24px;
}

.card {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 8px 28px rgba(0,0,0,.08);
}

.dark .card {
  border-color: rgba(255,255,255,.08);
  background: var(--dark-soft);
  box-shadow: none;
}

.card-img { height: 280px; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 30px; }
.card-body p, .card-body li { color: var(--muted); font-size: .93rem; }
.dark .card-body p, .dark .card-body li { color: rgba(255,255,255,.68); }

.number {
  display: inline-grid;
  width: 38px;
  height: 38px;
  margin-bottom: 17px;
  place-items: center;
  border-radius: 50%;
  background: var(--yellow);
  color: #172016;
  font-weight: 900;
}

/* Process / sectors */
.process {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 16px;
}

.step {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}

.step b { display: block; color: var(--yellow); font-size: 2.4rem; }
.step p { color: var(--muted); font-size: .9rem; }

.sectors {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 20px;
}

.sector {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border-radius: 22px;
  background: #222;
}

.sector:first-child { grid-row: span 2; min-height: 680px; }

.sector::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg,rgba(6,14,9,.9),transparent 70%);
  content: "";
}

.sector img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

.sector:hover img { transform: scale(1.04); }

.sector-body {
  position: absolute;
  right: 28px;
  bottom: 24px;
  left: 28px;
  z-index: 2;
  color: var(--white);
}

.sector-body .kicker { color: var(--yellow); }
.sector-body p { color: rgba(255,255,255,.74); font-size: .9rem; }

/* Parts */
.photo-panel {
  padding: 20px;
  border-radius: 28px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.photo-panel img {
  width: 100%;
  height: 520px;
  object-fit: contain;
}

.metric {
  margin: 28px 0;
  padding: 15px 0 15px 20px;
  border-left: 5px solid var(--yellow);
}

.metric strong { display: block; font-size: 2.6rem; line-height: 1; }
.metric span { color: var(--muted); font-size: .86rem; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0 25px;
}

.chip {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: .72rem;
  font-weight: 800;
}

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.parts-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 18px;
  background: var(--white);
}

.parts-table th, .parts-table td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: .84rem;
  vertical-align: top;
}

.parts-table th { background: var(--dark); color: var(--white); }

/* Packs / environment / group / contact */
.pack-grid, .group-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 24px;
}

.pack {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  padding: 44px;
  border-radius: 28px;
}

.pack::after {
  position: absolute;
  top: -100px;
  right: -100px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
  content: "";
}

.pack.yellow { background: var(--yellow); }
.pack.green { background: var(--green); color: var(--white); }
.pack.green p { color: rgba(255,255,255,.75); }

.benefits {
  position: absolute;
  right: 44px;
  bottom: 34px;
  left: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.benefits span {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(0,0,0,.10);
  font-size: .7rem;
  font-weight: 900;
}

.pack.green .benefits span { background: rgba(255,255,255,.13); }

.env-img { overflow: hidden; border-radius: 25px; }
.env-img img { width: 100%; height: 540px; object-fit: cover; }

.env-list { margin-top: 28px; }
.env-list div {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 15px;
  padding: 16px 0;
  border-top: 1px solid rgba(255,255,255,.12);
}
.env-list b { color: var(--yellow); }
.env-list span { color: rgba(255,255,255,.75); font-size: .92rem; }

.group-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
}
.group-card img { width: 100%; height: 280px; object-fit: cover; }
.group-card .body { padding: 28px; }
.group-card p, .group-card li { font-size: .9rem; }

.contact-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 50px;
  padding: 55px;
  border-radius: 30px;
  background: var(--dark);
  color: var(--white);
}

.contact-box p { max-width: 650px; color: rgba(255,255,255,.68); }

.emergency {
  display: inline-flex;
  flex-direction: column;
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: 15px;
  background: var(--yellow);
  color: #182018;
}

.emergency strong { font-size: 1.3rem; }

.contact-links {
  display: flex;
  min-width: 260px;
  flex-direction: column;
  gap: 10px;
}

.contact-links .btn { text-align: center; }

/* Inner pages / forms / footer */
.page-hero {
  padding: 100px 0 90px;
  background: linear-gradient(120deg,#f4f6f1,#fff);
}

.page-hero .lead { max-width: 720px; }

.breadcrumbs {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: .78rem;
}

.breadcrumbs a { text-decoration: underline; }

.service-detail { gap: 55px; }
.service-detail img {
  width: 100%;
  height: 430px;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.image-430 { height: 430px !important; }
.image-460 { height: 460px !important; }
.content-image { width: 100%; border-radius: 24px; object-fit: cover; }

form { display: grid; gap: 16px; }
label { font-size: .8rem; font-weight: 800; }

input, textarea, select {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

textarea { min-height: 150px; resize: vertical; }

.footer {
  padding: 60px 0 22px;
  background: #0c130e;
  color: var(--white);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr .8fr .9fr;
  gap: 50px;
  padding-bottom: 45px;
}

.footer-grid strong { display: block; margin-bottom: 12px; }
.footer-grid a, .footer p { color: rgba(255,255,255,.52); font-size: .85rem; }
.footer-grid a { display: block; margin: 5px 0; }

.footer-bottom {
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.35);
  font-size: .75rem;
}

/* Responsive */
@media (max-width: 900px) {
  :root { --header-height: 72px; }

  .nav {
    position: absolute;
    top: var(--header-height);
    right: 0;
    left: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 18px 22px;
    background: var(--white);
    box-shadow: 0 15px 30px rgba(0,0,0,.08);
  }

  .nav.open { display: flex; }
  .toggle { display: block; }

  .intro-grid, .two-col, .parts-grid, .env-grid, .service-detail {
    grid-template-columns: 1fr;
    gap: 35px;
  }

  .cards, .pack-grid, .group-grid { grid-template-columns: 1fr; }
  .process { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .sectors { grid-template-columns: 1fr; }
  .sector:first-child { grid-row: auto; min-height: 400px; }
  .contact-box { display: block; }
  .contact-links { margin-top: 30px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .container { width: min(calc(100% - 28px),var(--max-width)); }
  .section { padding: 72px 0; }
  .logo, .footer-logo { width: 145px; }

  .hero { min-height: 650px; }
  .hero .container { padding: 80px 0 120px; }

  .stats { display: grid; }
  .stat {
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,.12);
  }

  .process { grid-template-columns: 1fr; }
  .card-img { height: 220px; }

  .pack { min-height: 400px; padding: 30px; }
  .benefits { right: 30px; bottom: 25px; left: 30px; }

  .photo-panel img, .env-img img { height: 300px; }
  .contact-box { padding: 38px 28px; }
  .footer-grid { grid-template-columns: 1fr; }
}

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

/* Formulaire de contact */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

form label {
  display: block;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
}

.consent input {
  width: auto;
  margin-top: 4px;
  flex: 0 0 auto;
}

.hp-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

@media (max-width: 600px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}
