:root {
  --bg: #faf8f4;
  --bg-alt: #f1ece3;
  --ink: #1f1b16;
  --ink-soft: #5c544a;
  --brand: #c0392b;        /* rouge brique, évoque les camions / la Suisse */
  --brand-dark: #97291d;
  --accent: #1f6f5c;       /* vert "responsable" */
  --line: #e3dccf;
  --white: #ffffff;
  --shadow: 0 12px 32px rgba(31, 27, 22, 0.10);
  --radius: 16px;
  --maxw: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: "Fraunces", Georgia, serif; font-weight: 600; line-height: 1.12; margin: 0 0 .4em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .76rem;
  font-weight: 700;
  color: var(--brand);
  margin: 0 0 .6em;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .7rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(250, 248, 244, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--brand); color: #fff;
  font-family: "Fraunces", serif; font-weight: 600; font-size: 1.4rem;
}
.brand-text { display: flex; flex-direction: column; font-weight: 700; font-size: 1.25rem; line-height: 1; }
.brand-text small { font-weight: 500; font-size: .68rem; color: var(--ink-soft); letter-spacing: .04em; margin-top: 3px; }

.nav-list { list-style: none; display: flex; align-items: center; gap: 1.4rem; margin: 0; padding: 0; }
.nav-list a { color: var(--ink); font-weight: 500; font-size: .95rem; }
.nav-list a:hover { color: var(--brand); text-decoration: none; }
.nav-cta {
  background: var(--brand); color: #fff !important; padding: .5rem .9rem;
  border-radius: 999px; font-weight: 600 !important;
}
.nav-cta:hover { background: var(--brand-dark); }
.nav-toggle { display: none; background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .4rem; padding: .8rem 1.5rem; border-radius: 999px;
  font-weight: 600; font-size: 1rem; cursor: pointer; border: 2px solid transparent;
  transition: transform .12s ease, background .2s ease, box-shadow .2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(192,57,43,.28); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(192,57,43,.10), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-alt) 100%);
  padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 2.5rem);
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--ink-soft); margin: 0 0 1.8rem; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-bottom: 2rem; }
.hero-badges { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem 1.4rem; padding: 0; margin: 0; color: var(--ink-soft); font-size: .92rem; font-weight: 500; }
.hero-art img { width: 100%; height: auto; display: block; border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Sections ---------- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(3rem, 7vw, 5.5rem) clamp(1rem, 4vw, 2.5rem); }
.section-alt { max-width: none; background: var(--bg-alt); }
.section-alt > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section-head { max-width: 720px; margin: 0 auto 3rem; text-align: center; }
.section-sub { color: var(--ink-soft); font-size: 1.05rem; }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 1.4rem; }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.8rem; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(31,27,22,.14); }
.card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card > :not(.card-img) { padding-left: 1.8rem; padding-right: 1.8rem; }
.card-img { width: 100%; height: 190px; object-fit: cover; display: block; border-bottom: 1px solid var(--line); background: var(--bg-alt); }
.hero-art img, .about-img { background: var(--bg-alt); }

/* Le logo "Demag" est désormais cuit directement dans les fichiers photo
   (voir assets/brand_photos.py) — plus de surcouche CSS fragile. */
.about-media { display: block; }
.card h3 { margin-top: 1.2rem; }
.card ul { margin-bottom: 1.8rem; }
.card-icon { font-size: 1.6rem; margin: -2.4rem 1.8rem .4rem auto; width: 48px; height: 48px; display: grid; place-items: center; background: var(--white); border-radius: 12px; box-shadow: var(--shadow); position: relative; padding: 0 !important; }
.card p { color: var(--ink-soft); }
.card ul { margin: .8rem 0 0; padding-left: 1.1rem; color: var(--ink-soft); font-size: .92rem; }
.card li { margin-bottom: .25rem; }

/* ---------- About ---------- */
.about { display: grid; grid-template-columns: 1.6fr 1fr; gap: 3rem; align-items: start; }
.about-text p { color: var(--ink-soft); }
.values { display: grid; gap: 1rem; margin-top: 1.8rem; }
.value { padding-left: 1rem; border-left: 3px solid var(--brand); }
.value strong { display: block; }
.value span { color: var(--ink-soft); font-size: .92rem; }
.about-side { position: sticky; top: 96px; display: grid; gap: 1.2rem; }
.about-img { width: 100%; height: auto; display: block; border-radius: var(--radius); box-shadow: var(--shadow); }
.about-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow);
}
.stat { text-align: center; padding: .8rem .4rem; }
.stat-num { display: block; font-family: "Fraunces", serif; font-size: 1.9rem; color: var(--brand); font-weight: 600; }
.stat-label { font-size: .82rem; color: var(--ink-soft); }

/* ---------- Estimator ---------- */
.estimator { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.8rem; align-items: start; }
.estimator-form {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow);
}
.field { border: 0; padding: 0; margin: 0 0 1.6rem; }
.field legend { font-weight: 700; padding: 0; margin-bottom: .8rem; font-size: 1rem; }
.choices { display: flex; flex-wrap: wrap; gap: .6rem; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: inline-block; padding: .6rem 1rem; border: 2px solid var(--line);
  border-radius: 999px; font-weight: 500; font-size: .95rem; cursor: pointer; transition: all .15s ease;
}
.choice input:checked + span { border-color: var(--brand); background: rgba(192,57,43,.08); color: var(--brand-dark); }
.choice input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.svc-panel { border: 1px solid var(--line); border-radius: 12px; padding: 1.2rem 1.2rem .2rem; margin-bottom: 1.2rem; background: #fdfcfa; }
.svc-panel-title { margin: 0 0 1rem; font-size: 1.05rem; display: flex; align-items: center; gap: .5rem; }
.svc-panel-title::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--brand); }

.control { margin-bottom: 1.3rem; }
.control > label { display: block; font-weight: 600; margin-bottom: .45rem; }
.control .hint { font-weight: 400; color: var(--ink-soft); font-size: .85rem; }
.range-row { display: flex; align-items: center; gap: 1rem; }
.range-row input[type="range"] { flex: 1; accent-color: var(--brand); }
.range-val { min-width: 84px; text-align: right; font-weight: 700; color: var(--brand-dark); }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"],
select, textarea {
  width: 100%; padding: .7rem .8rem; border: 1.5px solid var(--line);
  border-radius: 10px; font: inherit; background: var(--white); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
textarea { resize: vertical; }

.toggle-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.toggle { position: relative; }
.toggle input { position: absolute; opacity: 0; }
.toggle span {
  display: inline-block; padding: .5rem .9rem; border: 2px solid var(--line);
  border-radius: 10px; cursor: pointer; font-size: .9rem; transition: all .15s ease;
}
.toggle input:checked + span { border-color: var(--accent); background: rgba(31,111,92,.09); color: var(--accent); font-weight: 600; }

.estimator-note { font-size: .82rem; color: var(--ink-soft); margin: 0; }

.estimator-result {
  background: linear-gradient(160deg, #2a2420, #1f1b16); color: #fff;
  border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow);
  position: sticky; top: 96px;
}
.result-label { text-transform: uppercase; letter-spacing: .12em; font-size: .76rem; color: #e8b4ad; margin: 0 0 .3rem; }
.result-amount { font-family: "Fraunces", serif; font-size: 2.6rem; font-weight: 600; margin: 0 0 1rem; }
.result-breakdown { list-style: none; padding: 0; margin: 0 0 1.4rem; border-top: 1px solid rgba(255,255,255,.15); }
.result-breakdown li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid rgba(255,255,255,.12); font-size: .92rem; }
.result-breakdown li span:last-child { font-weight: 600; white-space: nowrap; }
.result-breakdown .bd-head { margin-top: .5rem; color: #f0b8b0; font-family: "Fraunces", serif; font-size: 1rem; border-bottom: 1px solid rgba(255,255,255,.25); }
.result-breakdown .bd-row span:first-child { color: rgba(255,255,255,.78); padding-left: .6rem; }
.result-empty { color: rgba(255,255,255,.7); font-size: .92rem; margin: 0 0 1.2rem; }
.result-help { font-size: .8rem; color: rgba(255,255,255,.6); margin: .8rem 0 0; text-align: center; }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; align-items: start; }
.contact-text p { color: var(--ink-soft); }
.contact-coords { list-style: none; padding: 0; margin: 1.6rem 0 0; display: grid; gap: 1rem; }
.contact-coords li { display: flex; flex-direction: column; }
.contact-coords strong { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); }
.contact-form {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.8rem; box-shadow: var(--shadow);
  display: grid; gap: 1rem;
}
.contact-form label { display: block; font-weight: 600; font-size: .92rem; }
.contact-form input, .contact-form select, .contact-form textarea { margin-top: .35rem; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.estimate-attached input { background: var(--bg-alt); font-weight: 600; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-feedback { margin: 0; font-weight: 600; min-height: 1.2em; }
.form-feedback.ok { color: var(--accent); }
.form-feedback.err { color: var(--brand); }

/* ---------- Footer ---------- */
.site-footer { background: #1f1b16; color: #d9d2c7; padding: 3rem clamp(1rem, 4vw, 2.5rem) 1.5rem; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 2rem; justify-content: space-between; }
.footer-inner p { margin: .6rem 0 0; line-height: 1.5; }
.site-footer a { color: #f0b8b0; }
.footer-legal { max-width: var(--maxw); margin: 2rem auto 0; padding-top: 1.4rem; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; color: #9b9388; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-inner, .about, .estimator, .contact { grid-template-columns: 1fr; }
  .hero-art { order: -1; max-width: 460px; margin: 0 auto; }
  .about-side, .estimator-result { position: static; }
  .nav-toggle { display: block; }
  .nav-list {
    position: absolute; top: 100%; right: 0; left: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: .5rem 1rem 1rem; display: none;
  }
  .nav-list.open { display: flex; }
  .nav-list li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
  .nav-cta { text-align: center; }
}
@media (max-width: 520px) {
  .form-grid { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; }
}
