/* ============================================================
   LA FORGE — CREST-VOLAND · édition sobre
   base.css — tokens, reset, typographie, nav, footer, boutons
   ============================================================ */

/* ---- TOKENS DE PALETTE ---- */
:root {
  /* défaut = Pierre (chaud, quasi-monochrome, bronze sourd) */
  --paper:        #F6F4EF;
  --paper-2:      #EDE9E1;
  --ink:          #1B1A17;
  --ink-soft:     #34322D;
  --muted:        #8A8276;
  --line:         rgba(27,26,23,0.12);
  --line-strong:  rgba(27,26,23,0.24);
  --accent:       #8C6F4B;
  --accent-soft:  rgba(140,111,75,0.14);
  --on-ink:       #F4F1EA;
  --muted-on-ink: rgba(244,241,234,0.60);
  --line-on-ink:  rgba(244,241,234,0.16);

  --font-display: 'Newsreader', Georgia, serif;
  --font-sans:    'Hanken Grotesk', system-ui, -apple-system, sans-serif;

  --nav-h:        76px;
  --gap-section:  clamp(88px, 11vw, 160px);
  --container:    1240px;
  --measure:      62ch;

  --ease:         cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-palette="ardoise"] {
  --paper:        #F1F2F3;
  --paper-2:      #E5E8EA;
  --ink:          #181B1E;
  --ink-soft:     #2E343A;
  --muted:        #79808A;
  --line:         rgba(24,27,30,0.12);
  --line-strong:  rgba(24,27,30,0.24);
  --accent:       #5C6A73;
  --accent-soft:  rgba(92,106,115,0.16);
  --on-ink:       #EEF1F3;
  --muted-on-ink: rgba(238,241,243,0.60);
  --line-on-ink:  rgba(238,241,243,0.16);
}

:root[data-palette="or"] {
  --paper:        #F5F1EA;
  --paper-2:      #ECE4D6;
  --ink:          #29292C;
  --ink-soft:     #45433F;
  --muted:        #8A7F74;
  --line:         rgba(168,134,91,0.22);
  --line-strong:  rgba(168,134,91,0.42);
  --accent:       #A8865B;
  --accent-soft:  rgba(168,134,91,0.16);
  --on-ink:       #F5F1EA;
  --muted-on-ink: rgba(245,241,234,0.62);
  --line-on-ink:  rgba(168,134,91,0.26);
}

/* ---- POLICE DE TITRE (tweak) ---- */
:root[data-display="spectral"]  { --font-display: 'Spectral', Georgia, serif; }
:root[data-display="cormorant"] { --font-display: 'Cormorant Garamond', Georgia, serif; }

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-weight: 350;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
ul { list-style: none; }

::selection { background: var(--accent); color: var(--paper); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---- TYPOGRAPHIE PARTAGÉE ---- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: attr(data-index);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: 0.1em;
}
.eyebrow[data-index]::after {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.display {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.06;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}
.display em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.section-head .display {
  font-size: clamp(34px, 4.6vw, 60px);
}
.lead {
  font-size: clamp(16px, 1.5vw, 18px);
  font-weight: 350;
  color: var(--ink-soft);
  line-height: 1.75;
  max-width: var(--measure);
  text-wrap: pretty;
}

/* ---- UTILITAIRES ---- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(22px, 5vw, 64px);
}
.section { padding: var(--gap-section) 0; }
.section--tight { padding: clamp(64px, 8vw, 110px) 0; }

.hairline { height: 1px; background: var(--line); border: 0; }

/* ---- RÉVÉLATIONS AU SCROLL ---- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: 0.09s; }
.reveal[data-d="2"] { transition-delay: 0.18s; }
.reveal[data-d="3"] { transition-delay: 0.27s; }
.reveal[data-d="4"] { transition-delay: 0.36s; }

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

/* ---- BOUTONS ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 15px 30px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: background 0.3s var(--ease), color 0.3s var(--ease),
              border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.btn svg { width: 15px; height: 15px; }

.btn--solid {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}
.btn--solid:hover, .btn--solid:focus-visible {
  background: var(--accent); border-color: var(--accent);
}

.btn--line {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn--line:hover, .btn--line:focus-visible {
  border-color: var(--ink); background: var(--ink); color: var(--paper);
}

.btn--ghost {
  background: rgba(255,255,255,0.06);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.5);
  backdrop-filter: blur(4px);
}
.btn--ghost:hover, .btn--ghost:focus-visible {
  background: rgba(255,255,255,0.16); border-color: #fff;
}

.linkmore {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.25s, border-color 0.25s, gap 0.25s;
}
.linkmore svg { width: 14px; height: 14px; color: var(--accent); transition: transform 0.25s var(--ease); }
.linkmore:hover { color: var(--accent); border-color: var(--accent); gap: 14px; }
.linkmore:hover svg { transform: translateX(3px); }

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background 0.45s var(--ease), box-shadow 0.45s var(--ease),
              border-color 0.45s var(--ease);
  border-bottom: 1px solid transparent;
}
/* voile sombre en haut : garantit la lisibilité du logo/menu blanc sur image claire */
.nav::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgba(18,17,15,0.42), rgba(18,17,15,0));
  opacity: 1; transition: opacity 0.45s var(--ease);
  pointer-events: none;
}
.nav.is-scrolled::before { opacity: 0; }
/* sur hero éditorial, la nav surplombe un panneau clair : pas de voile, texte encre */
:root[data-hero="editorial"] .nav:not(.is-scrolled)::before { opacity: 0; }
:root[data-hero="editorial"] .nav:not(.is-scrolled) .brand,
:root[data-hero="editorial"] .nav:not(.is-scrolled) .nav__link,
:root[data-hero="editorial"] .nav:not(.is-scrolled) .nav__phone { color: var(--ink); }
:root[data-hero="editorial"] .nav:not(.is-scrolled) .nav__link { color: var(--ink-soft); }
:root[data-hero="editorial"] .nav:not(.is-scrolled) .nav__cta { background: var(--ink); color: var(--paper); }
:root[data-hero="editorial"] .nav:not(.is-scrolled) .nav__burger { color: var(--ink); }
/* logo crème -> sombre sur le panneau clair du hero éditorial, et la puce CM aussi */
:root[data-hero="editorial"] .nav:not(.is-scrolled) .brand__logo,
:root[data-hero="editorial"] .nav:not(.is-scrolled) .nav__cm img { filter: brightness(0); }
:root[data-hero="editorial"] .nav:not(.is-scrolled) .brand__tag { color: var(--muted); border-color: var(--line); }
.nav__inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(22px, 5vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: nowrap;
}

/* logo */
.brand { display: flex; align-items: center; gap: 13px; color: #fff; }
.brand__logo { height: 38px; width: auto; display: block; flex-shrink: 0; }
.brand__tag {
  font-family: var(--font-sans);
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: rgba(255,255,255,0.62);
  padding: 5px 0 5px 13px;
  border-left: 1px solid rgba(255,255,255,0.28);
  white-space: nowrap;
}
.brand--footer .brand__logo { height: 42px; }
.brand--footer .brand__tag { color: var(--muted-on-ink); border-color: var(--line-on-ink); }

.nav__end { display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.nav__menu { display: flex; align-items: center; gap: 2px; }
.nav__cm {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; flex-shrink: 0;
}
.nav__cm img { height: 100%; width: auto; object-fit: contain; display: block; }
.nav__link {
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.11em; text-transform: uppercase;
  color: rgba(255,255,255,0.78);
  padding: 9px 11px;
  transition: color 0.22s;
  white-space: nowrap;
}
.nav__link:hover, .nav__link:focus-visible { color: #fff; }
.nav__sep { width: 1px; height: 18px; background: rgba(255,255,255,0.22); margin: 0 8px; }
.nav__phone {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.04em;
  color: rgba(255,255,255,0.82); padding: 9px 6px;
  transition: color 0.22s;
}
.nav__phone svg { width: 14px; height: 14px; color: var(--accent); }
.nav__phone:hover { color: #fff; }
.nav__cta {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--ink); background: var(--on-ink);
  padding: 11px 22px; border-radius: 2px;
  transition: background 0.25s, color 0.25s, transform 0.25s;
}
.nav__cta:hover, .nav__cta:focus-visible { background: var(--accent); color: #fff; transform: translateY(-1px); }

/* état défilé : barre sur fond encre */
.nav.is-scrolled {
  background: color-mix(in srgb, var(--ink) 94%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom-color: var(--line-on-ink);
}

.nav__burger { display: none; flex-direction: column; gap: 6px; padding: 8px; color: #fff; }
.nav__burger span { display: block; width: 24px; height: 1.5px; background: currentColor; transition: 0.3s var(--ease); }
.nav__burger.is-open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--ink); color: var(--on-ink); }
.footer__top {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  padding-top: clamp(64px, 8vw, 104px);
  padding-bottom: clamp(40px, 5vw, 64px);
}
.footer__brand .brand { color: var(--on-ink); margin-bottom: 22px; }
.footer__tagline { font-size: 14px; color: var(--muted-on-ink); max-width: 34ch; line-height: 1.7; }
.footer__tagline strong { color: var(--on-ink); font-weight: 600; }

.footer__col h4 {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--muted-on-ink); margin-bottom: 20px;
}
.footer__col nav, .footer__col .footer__lines { display: flex; flex-direction: column; gap: 12px; }
.footer__col a, .footer__lines span {
  font-size: 14px; color: var(--on-ink); opacity: 0.82;
  transition: opacity 0.22s, color 0.22s; width: fit-content;
}
.footer__col a:hover { opacity: 1; color: var(--accent); }

.footer__promoteur { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.footer__cm {
  background: #fff; border-radius: 3px; padding: 9px;
  width: 64px; height: 64px; display: grid; place-items: center; flex-shrink: 0;
}
.footer__cm img { width: 100%; height: 100%; object-fit: contain; }
.footer__promoteur p { font-size: 13px; color: var(--muted-on-ink); line-height: 1.6; }
.footer__promoteur strong { color: var(--on-ink); }

.footer__bottom {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  padding-top: 28px; padding-bottom: 36px;
  border-top: 1px solid var(--line-on-ink);
}
.footer__legal { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted-on-ink); }
.footer__legal a:hover { color: var(--accent); }
.footer__sep { opacity: 0.4; }

@media (max-width: 860px) {
  .footer__top { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .footer__top { grid-template-columns: 1fr; }
}
