/* ============================================================
   HumanCraft — Charte graphique web (référence : charte-humancraft-web.md)
   Fond blanc, accents PRIMARY #075045 et ACCENT #14867A
   Police : Calibri / Carlito (métriquement compatible)
   Les anciens tokens `--gold-*` sont remappés vers la palette HC
   pour préserver la compatibilité, sans introduire d'accent doré.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Carlito:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {
  /* —— Tokens HumanCraft (charte) —— */
  --hc-primary:        #075045;
  --hc-primary-dark:   #053D35;
  --hc-accent:         #14867A;
  --hc-accent-dark:    #0F6A60;
  --hc-accent-light:   #5DBBAA;
  --hc-neutral:        #595959;
  --hc-text:           #333333;
  --hc-bg-light:       #EEF5F3;
  --hc-bg-row:         #F7FAF9;
  --hc-border:         #BFBFBF;
  --hc-white:          #FFFFFF;
  --hc-focus-ring:     #14867A;

  /* —— Surfaces —— */
  --bg-app:        #ffffff;
  --bg-deep:       #EEF5F3;     /* sections alternées claires */
  --bg-surface:    #ffffff;     /* cartes */
  --bg-elevated:   #F7FAF9;

  /* —— Accents (anciens noms `gold-*`, valeurs HC) —— */
  --gold-primary:  #075045;   /* PRIMARY */
  --gold-light:    #14867A;   /* ACCENT */
  /* Accent pour TEXTE de petite taille — AA (≥4.5:1) sur blanc, --bg-light et fonds teintés.
     Les grands titres accentués restent en --gold-light (AA grands textes). */
  --text-accent:   #0F6A60;
  --gold-subtle:   #5DBBAA;   /* ACCENT clair */

  --text-primary:   #075045;  /* titres en PRIMARY (charte) */
  --text-secondary: #595959;  /* NEUTRAL */
  --text-faint:     #6b6b6b;  /* AA (≥4.5:1) sur blanc et --bg-light */

  --on-gold:        #ffffff;  /* texte sur fond PRIMARY/ACCENT */

  --success: #14867A;
  --warning: #b07a14;
  --danger:  #b03a2e;

  --border-gold:        rgba(20, 134, 122, 0.28);
  --border-gold-hover:  rgba(20, 134, 122, 0.55);
  --border-gold-glow:   0 0 0 1px rgba(20, 134, 122, 0.25);
  --separator:          rgba(7, 80, 69, 0.12);
  --hairline:           #BFBFBF;

  --shadow-card:     0 4px 20px rgba(7, 80, 69, 0.08);
  --shadow-elevated: 0 10px 40px rgba(7, 80, 69, 0.12);
  --shadow-gold:     0 0 24px rgba(20, 134, 122, 0.18);

  --font-display: 'Calibri', 'Carlito', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-ui:      'Calibri', 'Carlito', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'Calibri', 'Carlito', 'Segoe UI', system-ui, ui-monospace, monospace;

  --radius:    0.75rem;
  --radius-sm: 0.5rem;

  --gold-rgb: 20, 134, 122;

  --maxw: 1200px;
  --gutter: clamp(20px, 5vw, 80px);
  --nav-h: 72px;
}

* { box-sizing: border-box; }

html { scrollbar-color: var(--gold-primary) var(--bg-deep); }

html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  opacity: 1;
  background: var(--bg-app);
  color: var(--hc-text);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection { background: rgba(var(--gold-rgb), 0.25); color: var(--hc-primary); }

h1, h2, h3, h4 { font-weight: 700; margin: 0; font-family: var(--font-display); }
h1, h2 { color: var(--hc-primary); line-height: 1.1; letter-spacing: -0.01em; }
h3 { color: var(--hc-accent); }
h4 { color: var(--hc-primary); font-weight: 600; }
p { margin: 0; text-wrap: pretty; color: var(--hc-text); }
a { color: var(--text-accent); text-decoration: none; }
a:hover { color: var(--hc-primary); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--hc-focus-ring); outline-offset: 2px; }

/* —— Accessibilité : utilitaires —— */
/* Texte présent pour les technologies d'assistance, masqué visuellement */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
/* Enveloppe visuelle des titres découpés en caractères (voir core.js splitChars) */
.split-visual { display: contents; }
/* Lien d'évitement : premier élément focusable, visible uniquement au focus */
.skip-link {
  position: absolute; left: 12px; top: -64px; z-index: 300;
  padding: 10px 18px; border-radius: var(--radius-sm);
  background: var(--hc-primary); color: #fff; font-weight: 600; font-size: 14px;
  transition: top .15s ease;
}
.skip-link:focus-visible { top: 12px; color: #fff; }

.font-mono { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }

/* —— Layout —— */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { max-width: 1440px; }
section { position: relative; }

.eyebrow {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-accent);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--gold-primary);
  display: inline-block;
}

.label-uppercase {
  font-size: 12px; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-secondary);
}

.lead {
  font-size: clamp(18px, 2vw, 22px);
  color: var(--text-secondary);
  line-height: 1.55;
}

/* —— Display scale —— */
.d1 { font-size: clamp(44px, 8vw, 104px); }
.d2 { font-size: clamp(36px, 5.5vw, 72px); }
.d3 { font-size: clamp(28px, 3.6vw, 46px); }

/* —— Buttons —— */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  font-family: var(--font-ui); font-weight: 600; font-size: 15px;
  padding: 0 22px; height: 48px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer;
  transition: all .24s cubic-bezier(0.22,1,0.36,1);
  white-space: nowrap;
}
.btn svg { width: 17px; height: 17px; }
.btn-gold { background: var(--gold-primary); color: var(--on-gold); }
.btn-gold:hover { background: var(--gold-light); box-shadow: var(--shadow-gold); transform: translateY(-1px); }
.btn-outline { border-color: var(--border-gold-hover); color: var(--text-accent); }
.btn-outline:hover { background: rgba(var(--gold-rgb), 0.10); border-color: var(--gold-primary); }
.btn-ghost { color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); }
.btn-arrow { transition: transform .24s cubic-bezier(0.22,1,0.36,1); }
.btn:hover .btn-arrow { transform: translateX(3px); }

/* —— Cards —— */
.card-luxury {
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.card-luxury:hover {
  border-color: var(--border-gold-hover);
  box-shadow: var(--shadow-card), var(--border-gold-glow);
}

/* —— Badges —— */
.badge-gold {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  padding: 4px 11px; border-radius: 24px;
  background: rgba(var(--gold-rgb), 0.12);
  color: var(--text-accent);
  border: 1px solid var(--border-gold);
}
.badge-tech {
  display: inline-flex; align-items: center;
  font-family: var(--font-ui); font-size: 12px; font-weight: 500;
  padding: 4px 11px; border-radius: 24px;
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  border: 1px solid var(--hairline);
}

.score-display { font-family: var(--font-mono); font-weight: 600; color: var(--gold-light); }

/* —— Navigation —— */
.nav {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-h);
  z-index: 200; display: flex; align-items: center;
  transition: background .35s ease, border-color .35s ease, backdrop-filter .35s ease;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(245,246,246,0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--separator);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; max-width: 1440px; }
.nav-logo img { height: 30px; width: auto; display: block; filter: brightness(0) saturate(100%); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  font-size: 14px; font-weight: 500; color: var(--text-secondary);
  padding: 8px 14px; border-radius: 6px; position: relative;
  transition: color .2s ease;
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); }
.nav-link.active::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 1px; background: var(--gold-primary);
}
.nav-cta { margin-left: 8px; }
.nav-divider { width: 1px; height: 22px; background: var(--separator); margin: 0 6px; flex: 0 0 auto; }
.nav-login { white-space: nowrap; }
.nav-signup { height: 40px; padding: 0 18px; font-size: 14px; }
.nav-burger { display: none; }

/* —— Mobile menu (hidden by default; shown only under the burger breakpoint) —— */
.nav-mobile { display: none; }

@media (max-width: 1180px) {
  .nav-links { display: none; }
  .nav-burger {
    display: flex; flex-direction: column; gap: 5px; width: 40px; height: 40px;
    align-items: center; justify-content: center; cursor: pointer;
    background: none; border: 1px solid var(--hairline); border-radius: 8px;
  }
  .nav-burger span { width: 18px; height: 1.5px; background: var(--text-primary); transition: .3s; }
  .nav-mobile {
    position: fixed; inset: var(--nav-h) 0 auto 0; z-index: 199;
    background: rgba(245,246,246,0.98); backdrop-filter: blur(16px);
    display: none; flex-direction: column; padding: 12px var(--gutter) 24px;
    border-bottom: 1px solid var(--separator);
  }
  .nav-mobile.open { display: flex; }
  .nav-mobile a { padding: 14px 0; font-size: 18px; border-bottom: 1px solid var(--separator); color: var(--text-secondary); }
  .nav-mobile a:last-of-type { border-bottom: none; }
  .nav-mobile-auth { display: flex; gap: 12px; align-items: center; margin-top: 20px; }
  .nav-mobile-auth .nav-login { border-bottom: none; padding: 12px 0; flex: 0 0 auto; }
  .nav-mobile-auth .btn { flex: 1; justify-content: center; padding: 0 22px; }
}

/* —— Scroll progress bar —— */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: linear-gradient(90deg, var(--gold-primary), var(--gold-light));
  z-index: 250; transform-origin: left;
}

/* —— Footer —— */
.site-footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--separator);
  padding: 80px 0 40px;
  margin-top: 0;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px;
}
.footer-grid img { height: 24px; margin-bottom: 20px; filter: brightness(0) saturate(100%); }
.footer-col h2 { font-family: var(--font-ui); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-accent); margin-bottom: 16px; font-weight: 600; }
.footer-col a, .footer-col p { display: block; color: var(--text-secondary); font-size: 14px; padding: 5px 0; transition: color .2s; }
.footer-col a:hover { color: var(--text-primary); }
.footer-bottom {
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--separator);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-size: 13px; color: var(--text-faint); flex-wrap: wrap;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
.footer-legal { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer-legal a { color: var(--text-faint); transition: color .2s; }
.footer-legal a:hover { color: var(--text-primary); }

/* —— Pages légales —— */
.legal-hero { padding: calc(var(--nav-h) + 9vh) 0 5vh; }
.legal-hero .eyebrow { margin-bottom: 18px; }
.legal-hero h1 { font-family: var(--font-display); font-size: clamp(34px, 5vw, 58px); line-height: 1.05; }
.legal-updated { margin-top: 16px; font-family: var(--font-mono); font-size: 13px; color: var(--text-faint); }
.legal-prose { max-width: 820px; margin: 0 auto; padding-bottom: clamp(60px, 10vh, 120px); }
.legal-prose h2 { font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 30px); color: var(--text-primary); margin: 48px 0 10px; padding-top: 22px; border-top: 1px solid var(--separator); }
.legal-prose h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.legal-prose h3 { font-family: var(--font-ui); font-weight: 600; font-size: 16px; letter-spacing: 0.02em; color: var(--gold-primary); margin: 28px 0 8px; }
.legal-prose h4 { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-accent); margin: 24px 0 6px; }
.legal-prose p { font-size: 15.5px; line-height: 1.7; color: var(--text-secondary); margin: 0 0 14px; }
.legal-prose strong { color: var(--text-primary); font-weight: 600; }
.legal-prose a { color: var(--gold-primary); text-decoration: underline; text-underline-offset: 2px; }
.legal-prose a:hover { color: var(--gold-light); }
.legal-prose ul { margin: 0 0 16px; padding-left: 0; list-style: none; display: grid; gap: 9px; }
.legal-prose ul li { font-size: 15px; line-height: 1.65; color: var(--text-secondary); padding-left: 20px; position: relative; }
.legal-prose ul li::before { content: ""; position: absolute; left: 0; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold-primary); }
.legal-prose table { width: 100%; border-collapse: collapse; margin: 8px 0 20px; font-size: 14.5px; }
.legal-prose th, .legal-prose td { text-align: left; padding: 12px 14px; border: 1px solid var(--separator); vertical-align: top; color: var(--text-secondary); }
.legal-prose th { background: var(--bg-surface); color: var(--text-primary); font-weight: 600; }
.legal-prose .legal-meta { background: var(--bg-surface); border: 1px solid var(--border-gold); border-radius: var(--radius); padding: 22px 24px; margin: 0 0 20px; }
.legal-prose .legal-meta p { margin: 0 0 6px; }
.legal-prose .legal-meta p:last-child { margin-bottom: 0; }
@media (max-width: 640px) { .legal-prose table, .legal-prose thead, .legal-prose tbody, .legal-prose tr, .legal-prose th, .legal-prose td { display: block; width: 100%; } .legal-prose th { border-bottom: 0; } }

/* —— Section rhythm —— */
.section-pad { padding: clamp(80px, 12vh, 160px) 0; }
.section-pad-sm { padding: clamp(56px, 8vh, 100px) 0; }

/* —— Page hero (shared vertical position across inner pages) —— */
.page-hero { padding: calc(var(--nav-h) + 12vh) 0 8vh; position: relative; }
.page-hero .eyebrow { margin-bottom: 22px; }
.bg-deep { background: var(--bg-deep); }
.bg-surface-sec { background: var(--bg-surface); }

.grain::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  opacity: 0.035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* —— Reveal utilities (JS-driven, with reduced-motion fallback) —— */
.reveal { opacity: 0; transform: translateY(40px); }
.reveal-up { opacity: 0; transform: translateY(24px); }

.split-char { display: inline-block; will-change: transform, opacity; }
.split-line-mask { overflow: hidden; display: block; }

/* draw-on SVG paths */
.draw-path { will-change: stroke-dashoffset; }

/* —— Generic helpers —— */
.muted { color: var(--text-secondary); }
.gold { color: var(--gold-light); }
.center { text-align: center; }
.stack-sm > * + * { margin-top: 12px; }
.stack > * + * { margin-top: 20px; }
.stack-lg > * + * { margin-top: 32px; }
.divider { height: 1px; background: var(--separator); border: 0; margin: 0; }

.kicker-num {
  font-family: var(--font-mono); font-size: 13px; color: var(--gold-primary);
  letter-spacing: 0.04em;
}

/* marquee */
.marquee { overflow: hidden; position: relative; width: 100%; }
.marquee-track { display: flex; align-items: center; gap: 64px; width: max-content; animation: marquee 38s linear infinite; }

@keyframes marquee { to { transform: translateX(-50%); } }
/* Pause du défilement (RGAA 13.8) : bouton .marquee-toggle dans la section clients */
.marquee.paused .marquee-track { animation-play-state: paused; }
.marquee-toggle {
  display: flex; align-items: center; justify-content: center;
  margin: 14px 8px 0 auto;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border-gold-hover); background: var(--bg-surface);
  color: var(--text-accent); font-size: 14px; line-height: 1; cursor: pointer;
}
.marquee-toggle:hover { border-color: var(--hc-primary); color: var(--hc-primary); }
.marquee::before, .marquee::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 120px; z-index: 2; pointer-events: none;
}
.marquee::before { left: 0; background: linear-gradient(90deg, var(--bg-app), transparent); }
.marquee::after { right: 0; background: linear-gradient(-90deg, var(--bg-app), transparent); }

/* pin spacer helper visuals */
.scene-stage { position: relative; height: 100vh; width: 100%; overflow: hidden; display: flex; align-items: center; }

/* counters */
.counter { font-family: var(--font-mono); font-weight: 600; color: var(--gold-light); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-up { opacity: 1 !important; transform: none !important; }
  .marquee-track { animation: none; }
  html { scroll-behavior: auto; }
  .split-char { opacity: 1 !important; transform: none !important; }
  .animate-fade-in, .animate-pulse-gold { animation: none !important; }
}

/* ============================================================
   Charte « Midnight Gold » — utilitaires documentés (§5.5, §6, §7)
   ============================================================ */

/* —— Statuts sémantiques (texte) —— */
.status-success { color: var(--success); }
.status-warning { color: var(--warning); }
.status-danger  { color: var(--danger); }

/* —— Statuts sémantiques (fond translucide) —— */
.bg-success { background: rgba(28,160,120,0.14); color: var(--success); }
.bg-warning { background: rgba(232,154,41,0.14); color: var(--warning); }
.bg-danger  { background: rgba(217,84,43,0.14);  color: var(--danger); }

/* —— Animations nommées (easing signature easeOutExpo) —— */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.animate-fade-in { animation: fadeInUp 0.4s cubic-bezier(0.22,1,0.36,1) both; }
@keyframes pulseGold { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }
.animate-pulse-gold { animation: pulseGold 2s ease-in-out infinite; }
.animate-marquee { animation: marquee 30s linear infinite; }

/* —— Section landing contrastée (fondu latéral pour marquees) —— */
.bg-landing-contrast {
  background: var(--bg-deep);
  position: relative;
}

/* —— KPICard (composant signature §7) —— */
.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.kpi-card .kpi-label { font-size: 12px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-secondary); }
.kpi-card .kpi-value { font-family: var(--font-mono); font-weight: 600; font-size: 28px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.kpi-card .kpi-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--gold-light); background: rgba(201,168,76,0.08); }
.kpi-card .kpi-trend { font-family: var(--font-mono); font-size: 13px; }
.kpi-card .kpi-trend.up { color: var(--success); }
.kpi-card .kpi-trend.down { color: var(--danger); }
.kpi-card .kpi-trend.flat { color: var(--text-secondary); }

/* ============================================================
   Thème clair « Refined Gold » (variante, §2.2)
   Le site reste sombre par défaut ; ajouter .theme-light sur
   <html> ou un conteneur pour basculer la variante claire.
   ============================================================ */
/* ============================================================
   Thème sombre « Midnight Gold » (variante opt-in, réversible)
   Le site est clair par défaut ; ajouter .theme-dark sur <html>
   ou un conteneur pour retrouver le thème sombre d'origine.
   ============================================================ */
.theme-dark {
  --bg-app:        hsl(218 42% 9%);
  --bg-deep:       hsl(219 46% 6%);
  --bg-surface:    hsl(221 38% 18%);
  --bg-elevated:   hsl(224 38% 25%);

  --gold-primary:  hsl(43 50% 54%);
  --gold-light:    hsl(43 72% 66%);
  --gold-subtle:   hsl(43 78% 85%);

  --text-primary:   hsl(200 20% 97%);
  --text-secondary: hsl(218 22% 72%);
  --text-faint:     hsl(218 18% 52%);
  --text-accent:    hsl(43 72% 66%);

  --on-gold:        hsl(218 42% 9%);

  --success: hsl(160 70% 37%);
  --warning: hsl(37 80% 52%);
  --danger:  hsl(16 68% 52%);

  --border-gold:        rgba(201, 168, 76, 0.15);
  --border-gold-hover:  rgba(201, 168, 76, 0.40);
  --border-gold-glow:   0 0 0 1px rgba(201, 168, 76, 0.20);
  --separator:          rgba(255, 255, 255, 0.06);
  --hairline:           rgba(255, 255, 255, 0.09);

  --shadow-card:     0 4px 24px rgba(0,0,0,0.30);
  --shadow-elevated: 0 8px 40px rgba(0,0,0,0.40);
  --shadow-gold:     0 0 20px rgba(201,168,76,0.10);

  --gold-rgb: 201, 168, 76;
}
