/* ==========================================================================
   ÉLÉGANCE FRANÇAISE — design system
   Direction: "Chaudronnerie & silence" — raw aluminium, hand-set rivets,
   an electric motor's silence, set against Antillean limestone light.
   Palette and rules documented in /DESIGN.md
   ========================================================================== */

:root {
  /* -- palette -------------------------------------------------------- */
  --stone:        #FFFFFF;   /* limestone base — TEST: forced to white */
  --stone-dim:    #FFFFFF;   /* recessed panels, alt rows — TEST: forced to white */
  --stone-line:   #D9D1BD;   /* hairlines on light */
  --paper:        #FFFFFF;   /* cards, lifted surfaces — TEST: forced to white */
  --ink:          #15171A;   /* near-black graphite, primary text */
  --ink-soft:     #4B4E4F;   /* secondary text on stone */
  --ink-faint:    #656760;   /* tertiary / meta text on LIGHT bg — 4.9:1 on --stone, passes WCAG AA */
  --faint-on-dark: #9A9C93; /* tertiary / meta text on DARK bg (--ink) — 6.5:1, passes WCAG AA */
  --metal:        #B7B9B1;   /* brushed aluminium */
  --metal-dark:   #74766E;   /* aluminium in shadow */
  --marine:       #1C355C;   /* muted marine blue — from the wordmark bars */
  --marine-dim:   #14274580;
  --brick:        #7E2A34;   /* muted brick red — from the wordmark bars */
  --teal:         #24433F;   /* Antilles sea — Rent/island context only */
  --teal-dim:     #FFFFFF;   /* TEST: forced to white */
  --line-on-dark: #3A3D38;

  /* -- type ------------------------------------------------------------ */
  --f-display: "Fraunces", "Iowan Old Style", ui-serif, Georgia, serif;
  --f-body:    "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --f-mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --step--1: clamp(0.79rem, 0.77rem + 0.1vw, 0.89rem);
  --step-0:  clamp(0.95rem, 0.92rem + 0.15vw, 1.05rem);
  --step-1:  clamp(1.14rem, 1.08rem + 0.28vw, 1.3rem);
  --step-2:  clamp(1.37rem, 1.27rem + 0.5vw, 1.66rem);
  --step-3:  clamp(1.64rem, 1.48rem + 0.82vw, 2.15rem);
  --step-4:  clamp(1.97rem, 1.71rem + 1.28vw, 2.8rem);
  --step-5:  clamp(2.4rem, 1.99rem + 2.02vw, 3.7rem);
  --step-6:  clamp(2.9rem, 2.28rem + 3.1vw, 4.9rem);
  --step-7:  clamp(3.5rem, 2.55rem + 4.7vw, 6.5rem);

  /* -- layout ------------------------------------------------------------ */
  --container: 1280px;
  --container-narrow: 760px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 0;
  --nav-h: 76px;

  color-scheme: light;
}

/* -- reset ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, picture, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure { margin: 0; }
input, textarea, select { font: inherit; color: inherit; }

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

/* -- type roles ------------------------------------------------------------ */
.display {
  font-family: var(--f-display);
  font-weight: 600;
  font-optical-sizing: auto;
  letter-spacing: -0.01em;
  line-height: 1.04;
}
.display-italic { font-style: italic; font-weight: 500; }
.eyebrow {
  font-family: var(--f-mono);
  font-size: var(--step--1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.lede { font-size: var(--step-1); color: var(--ink-soft); line-height: 1.5; max-width: 46ch; }
.mono { font-family: var(--f-mono); }

/* -- layout helpers ---------------------------------------------------- */
.wrap { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-narrow { max-width: var(--container-narrow); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 10vw, 140px); }
.section-tight { padding-block: clamp(40px, 6vw, 84px); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 12px 18px;
  border-radius: 0; transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

/* -- focus / a11y ------------------------------------------------------ */
:focus-visible { outline: 2px solid var(--marine); outline-offset: 3px; }
a:focus-visible, button:focus-visible { outline-offset: 4px; }

/* ==========================================================================
   Rivet line — the signature motif.
   A row of hand-set aviation rivets, echoing the 827 that hold each
   DEVINCI body panel together. Used as every section boundary; on first
   scroll into view, the rivets seat themselves one by one.
   ========================================================================== */
.rivets {
  --n: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-inline: var(--gutter);
  max-width: var(--container);
  margin-inline: auto;
  height: 18px;
}
.rivets span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--metal-dark);
  opacity: 0.18;
  transform: scale(0.3);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2,.8,.2,1);
}
.rivets.is-seated span { opacity: 0.55; transform: scale(1); }
@media (prefers-reduced-motion: no-preference) {
  .rivets.is-seated span { transition-delay: calc(var(--i, 0) * 16ms); }
}
.rivets.on-dark span { background: var(--metal); }

/* ==========================================================================
   Nav
   ========================================================================== */
.site-nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  background: transparent;
  transition: background .35s ease, border-color .35s ease, height .3s ease;
  border-bottom: 1px solid transparent;
}
.site-nav.is-solid {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom-color: var(--stone-line);
}
.site-nav .wrap { display: flex; align-items: center; gap: clamp(16px, 3vw, 40px); width: 100%; }
.brand-mark {
  display: flex; align-items: center;
  margin-right: auto;
}
.brand-mark .brand-logo { height: 64px; width: 73px; aspect-ratio: 400 / 350; display: block; flex: none; }

.nav-links { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 34px); }
.nav-links a {
  font-size: var(--step--1); letter-spacing: 0.04em; text-transform: uppercase;
  font-weight: 500; padding-block: 6px; position: relative;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: currentColor; transition: right .25s ease;
}
.nav-links a:hover::after, .nav-links a[aria-current="page"]::after { right: 0; }
.nav-links a[aria-current="page"] { font-weight: 600; }

.lang-switch { position: relative; }
.lang-switch button {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: .08em;
  padding: 6px 4px;
}
.lang-switch button svg { width: 10px; height: 10px; }
.lang-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 148px;
  background: var(--paper); border: 1px solid var(--stone-line); border-radius: 0;
  box-shadow: 0 18px 40px rgba(20,20,15,.14);
  padding: 6px; display: none; flex-direction: column;
}
.lang-switch.open .lang-menu { display: flex; }
.lang-menu a { padding: 9px 12px; border-radius: 0; font-size: var(--step--1); display: flex; justify-content: space-between; }
.lang-menu a:hover { background: var(--stone); }
.lang-menu a[aria-current="true"] { font-weight: 600; }

.nav-cta {
  font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: .04em;
  text-transform: uppercase; white-space: nowrap;
  padding-block: 6px; border-bottom: 1px solid currentColor;
  transition: opacity .2s ease;
}
.nav-cta:hover { opacity: .6; }

.nav-burger { display: none; }

@media (max-width: 880px) {
  .nav-links, .lang-switch { display: none; }
  .nav-burger {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex-direction: column; gap: 5px;
  }
  .nav-burger span { width: 22px; height: 1.5px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
  .nav-cta { display: none; }
}

/* Mobile drawer */
.mobile-drawer {
  position: fixed; inset: 0; z-index: 99;
  background: var(--stone);
  display: flex; flex-direction: column;
  padding: calc(var(--nav-h) + 24px) var(--gutter) 40px;
  transform: translateY(-100%);
  transition: transform .38s cubic-bezier(.2,.8,.2,1);
}
.mobile-drawer.open { transform: translateY(0); }
.mobile-drawer a {
  font-family: var(--f-display); font-size: var(--step-3); padding-block: 14px;
  border-bottom: 1px solid var(--stone-line);
}
.mobile-drawer .lang-row { display: flex; gap: 10px; margin-top: 30px; }
.mobile-drawer .lang-row a {
  font-family: var(--f-mono); font-size: var(--step--1); border: 1px solid var(--stone-line);
  border-radius: 0; padding: 8px 16px; flex: 0 0 auto;
}

/* ==========================================================================
   Buttons / forms
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: .04em;
  padding: 15px 26px; border-radius: 0; min-height: 48px;
  transition: background .2s ease, color .2s ease, border-color .2s ease, opacity .2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: var(--stone); }
.btn-primary:hover { opacity: .8; }
.btn-ghost { border: 1px solid currentColor; }
.btn-ghost:hover { background: var(--ink); color: var(--stone); border-color: var(--ink); }
.btn-ghost.on-dark:hover { background: var(--stone); color: var(--ink); }
.btn-block { width: 100%; }
.btn-lg { padding: 22px 44px; font-size: var(--step-0); letter-spacing: .03em; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.field {
  display: flex; flex-direction: column; gap: 7px; margin-bottom: 20px;
  min-width: 0;
}
.field label {
  font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-soft);
}
.field input, .field select, .field textarea {
  background: var(--paper);
  border: 1px solid var(--stone-line);
  border-radius: 0;
  padding: 13px 14px;
  font-size: var(--step-0);
  min-height: 48px;
  width: 100%;
  max-width: 100%;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--marine); box-shadow: 0 0 0 3px rgba(28,53,92,.12); outline: none;
}
.field .hint { font-size: var(--step--1); color: var(--ink-faint); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--brick); }
.field-error { display: none; font-size: var(--step--1); color: var(--brick); font-family: var(--f-mono); }
.field.has-error .field-error { display: block; }

.honeypot { position: absolute; left: -9999px; top: -9999px; }

.form-status {
  margin-top: 18px; padding: 16px 18px; border-radius: 0;
  font-size: var(--step--1); display: none; gap: 10px; align-items: flex-start;
}
.form-status.show { display: flex; }
.form-status.success { background: var(--teal-dim); color: #17332e; }
.form-status.error { background: #F6E2E0; color: var(--brick); }

/* ==========================================================================
   Cards / misc components
   ========================================================================== */
.chip {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-soft);
}
.chip .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--brick); flex: none; }

.spec-row {
  display: grid; grid-template-columns: 1fr auto; gap: 10px 24px;
  padding-block: 16px; border-top: 1px solid var(--stone-line);
  align-items: baseline;
}
.spec-row .k { font-size: 11.4px; color: var(--ink-soft); white-space: nowrap; }
.spec-row .v { font-family: var(--f-mono); font-size: 13.4px; text-align: right; white-space: nowrap; }
.spec-row .v small { color: var(--ink-faint); font-size: 0.78em; margin-left: 4px; }
.spec-note { padding-block: 6px 14px; font-size: var(--step--1); color: var(--ink-faint); }
@media (max-width: 640px) {
  /* Sur mobile, une valeur longue ("15 kW bridée pour l'homologation...") ne
     tient jamais sur une ligne à côté du libellé sans forcer la page entière
     à déborder horizontalement (grid-template-columns: 1fr auto + nowrap).
     On empile libellé/valeur au lieu de les mettre côte à côte. */
  .spec-row { grid-template-columns: 1fr; gap: 4px; }
  .spec-row .v { text-align: left; white-space: normal; }
}

.wa-btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: .03em;
  color: var(--ink); border: 1px solid currentColor; background: none;
  padding: 12px 18px; transition: background .2s ease, color .2s ease;
}
.wa-btn:hover { background: var(--ink); color: var(--stone); }
.wa-btn svg { width: 16px; height: 16px; flex: none; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--ink); color: var(--stone-dim); padding-block: 64px 32px; }
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px;
  padding-bottom: 48px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h3 {
  font-family: var(--f-mono); font-size: var(--step--1); letter-spacing: .1em;
  text-transform: uppercase; color: var(--metal); margin-bottom: 16px;
}
.footer-grid ul li { margin-bottom: 10px; font-size: var(--step--1); color: var(--stone-dim); }
.contact-icons { display: flex; gap: 14px; margin: 4px 0 14px; }
.contact-icons a { color: var(--stone-dim); display: flex; }
.contact-icons a:hover { color: #fff; }
.contact-icon { width: 19px; height: 19px; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  border-top: 1px solid var(--line-on-dark); padding-top: 24px;
  font-size: var(--step--1); color: var(--faint-on-dark);
}
.footer-brand { font-family: var(--f-display); font-size: var(--step-2); color: var(--stone); margin-bottom: 14px; }

/* ==========================================================================
   Reveal-on-scroll (progressive enhancement; content visible without JS)
   ========================================================================== */
.reveal { opacity: 1; transform: none; }
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.js .reveal.in { opacity: 1; transform: none; }

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

/* Scroll-driven progressive enhancement where supported; IntersectionObserver
   reveal above already covers every browser, this only adds extra polish. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero picture, .hero img {
      animation: hero-zoom linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 60%;
    }
    @keyframes hero-zoom { from { transform: scale(1.09); } to { transform: scale(1); } }

    .photo-break img {
      animation: pb-zoom linear both;
      animation-timeline: view();
      animation-range: cover 0% cover 100%;
    }
    @keyframes pb-zoom { from { transform: scale(1.12); } to { transform: scale(1); } }
  }
}

/* ==========================================================================
   Language suggestion toast
   ========================================================================== */
.lang-suggest {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(140%);
  z-index: 150; display: flex; align-items: center; gap: 14px;
  background: var(--ink); color: var(--stone); border-radius: 0;
  padding: 14px 16px 14px 20px; box-shadow: 0 20px 50px rgba(0,0,0,.25);
  font-size: var(--step--1); transition: transform .4s cubic-bezier(.2,.8,.2,1);
  max-width: calc(100vw - 32px);
}
.lang-suggest.show { transform: translateX(-50%) translateY(0); }
.lang-suggest a { text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.lang-suggest button { font-size: 1.1rem; line-height: 1; color: var(--faint-on-dark); padding: 2px; }
.lang-suggest button:hover { color: var(--stone); }
@media (max-width: 560px) { .lang-suggest { flex-wrap: wrap; text-align: center; justify-content: center; } }
