/* ============================================================
   Menuiserie Groupe — Refonte 2026
   Design system : tokens, type, base components
   Self-host fonts en prod (RGPD). CDN ici = maquette.
   ============================================================ */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { line-height: 1.55; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --brand: #d8431c;        /* vermillon logo — couleur d'action */
  --brand-700: #b3350f;
  --brand-050: #fceee8;
  --teal: #0e3a47;         /* teal-navy : sections sombres, header */
  --teal-900: #0a2c37;
  --teal-700: #145063;
  --blue: #2f6fd6;         /* bleu logo, élevé en accent moderne */

  /* Accent (pilotable via Tweaks) — bleu par défaut */
  --accent: var(--blue);
  --accent-050: #ecf2fd;
  --accent-700: #1f55b0;

  /* Neutres chauds */
  --paper: #f7f5f2;
  --surface: #ffffff;
  --surface-2: #fbfaf8;
  --line: #e8e3db;
  --line-2: #d8d2c8;
  --text: #1b2429;
  --muted: #5c6a72;
  --muted-2: #8a949a;

  /* Type */
  --font-head: "Archivo", system-ui, sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;

  /* Geometry */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --shadow-sm: 0 1px 2px rgba(15,30,40,.06), 0 2px 6px rgba(15,30,40,.05);
  --shadow: 0 4px 14px rgba(15,30,40,.08), 0 12px 34px rgba(15,30,40,.07);
  --shadow-lg: 0 18px 50px rgba(12,42,55,.20);

  /* Layout */
  --maxw: 1240px;
  --gutter: clamp(18px, 5vw, 56px);
  --section-y: clamp(56px, 8vw, 104px);
}

/* Accent presets */
[data-accent="teal"]  { --accent: #0f7b8c; --accent-050: #e6f4f6; --accent-700: #0a5c69; }
[data-accent="brand"] { --accent: var(--brand); --accent-050: var(--brand-050); --accent-700: var(--brand-700); }
[data-accent="blue"]  { --accent: var(--blue); --accent-050: #ecf2fd; --accent-700: #1f55b0; }

/* Font presets */
[data-font="grotesk"]  { --font-head: "Hanken Grotesk", system-ui, sans-serif; --font-body: "Hanken Grotesk", system-ui, sans-serif; }
[data-font="archivo"]  { --font-head: "Archivo", system-ui, sans-serif; --font-body: "Archivo", system-ui, sans-serif; }
[data-font="mixed"]    { --font-head: "Fraunces", Georgia, serif; --font-body: "Hanken Grotesk", system-ui, sans-serif; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--text);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.04; letter-spacing: -0.02em; color: var(--text); font-weight: 800; text-wrap: balance; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .55em;
  font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 26px; height: 2px; background: var(--accent); border-radius: 2px; }
.eyebrow.on-dark { color: #fff; }
.eyebrow.on-dark::before { background: var(--brand); }

.display {
  font-size: clamp(2.3rem, 6vw, 4.3rem);
  font-weight: 800; line-height: .98; letter-spacing: -0.025em;
  text-transform: uppercase;
}
.h2 { font-size: clamp(1.7rem, 3.6vw, 2.7rem); }
.h3 { font-size: clamp(1.2rem, 2vw, 1.55rem); letter-spacing: -.01em; }
.lead { font-size: clamp(1.02rem, 1.4vw, 1.18rem); color: var(--muted); line-height: 1.6; text-wrap: pretty; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* highlight pill behind words (rappel du live) */
.mark { background: var(--brand); color: #fff; padding: .04em .34em; border-radius: 8px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.mark-accent { background: var(--accent); color: #fff; padding: .04em .34em; border-radius: 8px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ---------- Layout helpers ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.center { text-align: center; }
.stack-sm > * + * { margin-top: .6rem; }
.section-head { max-width: 660px; margin-inline: auto; text-align: center; }
.section-head .h2 { margin-top: .5rem; }
.section-head .lead { margin-top: .9rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font-family: var(--font-head); font-weight: 700; font-size: 1rem; line-height: 1;
  padding: 1.05em 1.5em; border-radius: var(--r);
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-lg { font-size: 1.08rem; padding: 1.2em 1.8em; }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(216,67,28,.28); }
.btn-primary:hover { background: var(--brand-700); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(216,67,28,.34); }
.btn-accent { background: var(--accent); color: #fff; box-shadow: 0 6px 18px color-mix(in oklab, var(--accent), transparent 70%); }
.btn-accent:hover { background: var(--accent-700); transform: translateY(-2px); }
.btn-dark { background: var(--teal); color: #fff; }
.btn-dark:hover { background: var(--teal-900); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--text); background: var(--surface); }
.btn-ghost.on-dark { color: #fff; border-color: rgba(255,255,255,.34); }
.btn-ghost.on-dark:hover { background: rgba(255,255,255,.1); border-color: #fff; }
.btn-white { background: #fff; color: var(--teal); box-shadow: var(--shadow-sm); }
.btn-white:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn .arrow { transition: transform .2s ease; }
.btn:hover .arrow { transform: translateX(4px); }

/* ---------- Chips / tags ---------- */
.chip {
  display: inline-flex; align-items: center; gap: .45em;
  font-size: .85rem; font-weight: 600; padding: .5em .85em;
  border-radius: 999px; border: 1.5px solid var(--line-2); color: var(--text); background: var(--surface);
  transition: all .15s ease;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.on-dark { border-color: rgba(255,255,255,.28); color: #fff; background: rgba(255,255,255,.06); }
.chip.on-dark:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.6); }

.tag-mat {
  font-family: var(--font-head); font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; padding: .32em .6em; border-radius: 6px;
}
.tag-alu { background: #1b2429; color: #fff; }
.tag-pvc { background: var(--accent-050); color: var(--accent-700); }
.tag-bois { background: # efe6d8; color: #7a5a2e; }
.tag-bois { background: #efe6d8; color: #7a5a2e; }

/* ---------- Inputs ---------- */
.field { display: block; }
.field > label, .label {
  display: block; font-size: .76rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin-bottom: .45em;
}
.label .req { color: var(--brand); }
.input, .select, .textarea {
  width: 100%; background: var(--surface); border: 1.5px solid var(--line-2);
  border-radius: var(--r-sm); padding: .85em 1em; font-size: 1rem; color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent), transparent 86%);
}
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c6a72' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1em center; padding-right: 2.6em; }

/* product picker (chips with checkbox feel) */
.picker { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.picker .opt {
  display: flex; align-items: center; gap: .5em; padding: .8em .9em; font-size: .94rem; font-weight: 600;
  border: 1.5px solid color-mix(in oklab, var(--brand) 36%, #fff); border-radius: var(--r-sm); background: #fff; color: var(--text);
  transition: all .15s ease; text-align: left;
}
.picker .opt .ico { width: 18px; height: 18px; color: var(--muted); flex: none; transition: color .15s ease; }
.picker .opt:hover { border-color: var(--brand); background: var(--brand-050); color: var(--brand-700); }
.picker .opt:hover .ico { color: var(--brand-700); }
.picker .opt[aria-pressed="true"] {
  border-color: var(--brand); background: var(--brand-050); color: var(--brand-700);
}
.picker .opt[aria-pressed="true"] .ico { color: var(--brand-700); }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }

/* ---------- Placeholder imagery (remplacer par WebP) ---------- */
.ph {
  position: relative; overflow: hidden; background: var(--surface-2);
  background-image: repeating-linear-gradient(135deg, var(--line) 0 1px, transparent 1px 11px);
  display: grid; place-items: center; color: var(--muted-2);
}
.ph::after {
  content: attr(data-label);
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .72rem; letter-spacing: .02em;
  color: var(--muted); background: rgba(255,255,255,.82); padding: .4em .7em; border-radius: 6px;
  border: 1px solid var(--line); text-align: center; max-width: 80%;
}
.ph.dark { background: var(--teal-900); background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 1px, transparent 1px 11px); }
.ph.dark::after { background: rgba(10,44,55,.7); color: rgba(255,255,255,.78); border-color: rgba(255,255,255,.16); }

/* ---------- Star rating ---------- */
.stars { display: inline-flex; gap: 2px; color: #f5a623; }
.stars svg { width: 16px; height: 16px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Utility ---------- */
.hide-mobile { display: none; }
@media (min-width: 900px) { .hide-mobile { display: revert; } .hide-desktop { display: none; } }
.divider { height: 1px; background: var(--line); border: 0; }
.nowrap { white-space: nowrap; }
