/* ============================================================
   base.css — reset, typo de base, helpers, focus, reveal,
   prefers-reduced-motion. Aligné avec design system v4.
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* font-optical-sizing: auto reste safe meme si la font n'a pas l'axe opsz
     (no-op). Garde au cas ou on revient a Fraunces / autre variable serif. */
  font-optical-sizing: auto;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--bg-primary);
  color: var(--text-body);
  line-height: 1.65;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  /* Satoshi : ss01 active les alternates "tighter" sur a/g/y (cleaner sur ecran) */
  font-feature-settings: 'ss01';
}

/* Body italiques : utiliser la vraie italic de Satoshi (et non du Clash
   Display synthese). Les emphases dans le body (<em>) gardent un caractere
   editorial subtil sans casser le ton moderne du display. */
em, .about-text em, .portfolio-quote em, .offre-foot em, .manifesto-quote em {
  font-family: var(--font-body);
  font-style: italic;
}
/* Sauf dans les titres display ou on garde le `font-family: display` herite
   (Clash Display synthese italic au-dessus de 2rem reste propre). */
h1 em, h2 em, h3 em, .hero-title em, .offre-title em, .deepdive-title em,
.portfolio-name em, .methode-title em, .contact-inner h2 em {
  font-family: var(--font-display);
  font-style: italic;
}

/* Curseur custom — masque le natif sur desktop avec pointer fin */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  body * { cursor: none !important; }
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, [role="button"] { cursor: pointer; }

/* ============================================================
   Helpers typographiques
   ============================================================ */

.serif {
  font-family: var(--font-display);
  font-weight: 300;
}

.serif em,
h1 em, h2 em, h3 em {
  font-style: italic;
  color: var(--accent-light);
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--accent);
  display: block;
  flex-shrink: 0;
  transform-origin: left;
  transform: scaleX(0.4);
  transition: transform 0.6s var(--ease-premium) 0.1s;
}
.eyebrow.center { justify-content: center; }
.eyebrow.center::before { transform-origin: right; }

.reveal.visible .eyebrow::before,
.eyebrow.visible::before { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) {
  .eyebrow::before { transform: scaleX(1); transition: none; }
}

/* ============================================================
   Layout primitives
   ============================================================ */

section {
  padding: var(--section-pad-y) var(--section-pad-x);
  position: relative;
}

.section-head {
  max-width: 900px;
  margin-bottom: 4rem;
}

h2 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.4rem, 3.8vw, 3.2rem);
  /* Fraunces (et avant Cormorant) ont des métriques verticales amples,
     surtout en italique. line-height très serré pour compenser et garder
     des H2 cinématiques. */
  line-height: 0.94;
  color: var(--text-on-navy);
  margin-bottom: 1.25rem;
  letter-spacing: -0.005em;
}
h2 em {
  font-style: italic;
  color: var(--accent-light);
}

.section-lead {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-on-navy-dim);
  max-width: 600px;
}

/* Hors hero/manifesto, sur fond clair en thème Main, les h2 prennent navy.
   Liste maintenue à jour pour TOUTE section avec fond clair. */
[data-theme="main"] .problems h2,
[data-theme="main"] .offre h2,
[data-theme="main"] .methode h2,
[data-theme="main"] .ecosystem h2,
[data-theme="main"] .pourqui h2,
[data-theme="main"] .portfolio h2,
[data-theme="main"] .deepdive h2,
[data-theme="main"] .about h2,
[data-theme="main"] .case-study h2,
[data-theme="main"] .roadmap-section h2,
[data-theme="main"] .programme h2,
[data-theme="main"] .final-cta h2,
[data-theme="main"] .pourquoi-lcc h2 { color: var(--text-primary); }

[data-theme="main"] .problems h2 em,
[data-theme="main"] .offre h2 em,
[data-theme="main"] .methode h2 em,
[data-theme="main"] .ecosystem h2 em,
[data-theme="main"] .pourqui h2 em,
[data-theme="main"] .portfolio h2 em,
[data-theme="main"] .deepdive h2 em,
[data-theme="main"] .about h2 em,
[data-theme="main"] .case-study h2 em,
[data-theme="main"] .roadmap-section h2 em,
[data-theme="main"] .programme h2 em,
[data-theme="main"] .final-cta h2 em { color: var(--accent); }

[data-theme="main"] .problems .section-lead,
[data-theme="main"] .offre .section-lead,
[data-theme="main"] .methode .section-lead,
[data-theme="main"] .ecosystem .section-lead,
[data-theme="main"] .pourqui .section-lead,
[data-theme="main"] .portfolio .section-lead,
[data-theme="main"] .deepdive .section-lead,
[data-theme="main"] .about .section-lead,
[data-theme="main"] .case-study .section-lead,
[data-theme="main"] .roadmap-section .section-lead,
[data-theme="main"] .programme .section-lead,
[data-theme="main"] .final-cta .section-lead { color: var(--text-muted); }

/* Light theme : même problème, h2 reste cream par défaut sur fond blanc. */
[data-theme="light"] .problems h2,
[data-theme="light"] .offre h2,
[data-theme="light"] .methode h2,
[data-theme="light"] .ecosystem h2,
[data-theme="light"] .pourqui h2,
[data-theme="light"] .portfolio h2,
[data-theme="light"] .deepdive h2,
[data-theme="light"] .about h2,
[data-theme="light"] .case-study h2,
[data-theme="light"] .roadmap-section h2,
[data-theme="light"] .programme h2,
[data-theme="light"] .final-cta h2,
[data-theme="light"] .pourquoi-lcc h2 { color: var(--text-primary); }
[data-theme="light"] .problems h2 em,
[data-theme="light"] .offre h2 em,
[data-theme="light"] .methode h2 em,
[data-theme="light"] .ecosystem h2 em,
[data-theme="light"] .pourqui h2 em,
[data-theme="light"] .portfolio h2 em,
[data-theme="light"] .deepdive h2 em,
[data-theme="light"] .about h2 em,
[data-theme="light"] .case-study h2 em,
[data-theme="light"] .roadmap-section h2 em,
[data-theme="light"] .programme h2 em,
[data-theme="light"] .final-cta h2 em { color: var(--accent); }
[data-theme="light"] .deepdive .section-lead,
[data-theme="light"] .case-study .section-lead,
[data-theme="light"] .roadmap-section .section-lead,
[data-theme="light"] .programme .section-lead,
[data-theme="light"] .final-cta .section-lead { color: var(--text-muted); }

/* ============================================================
   Accessibilité
   ============================================================ */

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Reveal-on-scroll
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(56px) scale(0.97);
  filter: blur(8px);
  transition:
    opacity 0.9s var(--ease-spring),
    transform 0.9s var(--ease-spring),
    filter 0.9s var(--ease-spring);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform, filter;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.40s; }

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  filter: blur(6px);
  transition:
    opacity 0.9s var(--ease-spring),
    transform 0.9s var(--ease-spring),
    filter 0.9s var(--ease-spring);
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
  filter: blur(0);
}

/* Magnetic utility — JS attaches mousemove transforms via .magnetic class.
   Reset transition is applied via inline style by site.js on mouseleave. */
.magnetic {
  transition: transform 0.6s var(--ease-spring);
  will-change: transform;
}

/* Parallax tilt target — pour le hero photo frame, JS applique rotateX/Y inline. */
.parallax-tilt {
  transition: transform 0.7s var(--ease-spring);
  transform-style: preserve-3d;
  will-change: transform;
}

/* Eyebrow pill — version premium (badge pilule ar) — skill 4.C */
.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.32rem 0.85rem 0.32rem 0.85rem;
  border-radius: var(--pill-radius);
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid var(--hairline-gold);
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow-pill::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
[data-theme="main"] .eyebrow-pill {
  background: rgba(13, 27, 42, 0.04);
  border-color: rgba(13, 27, 42, 0.10);
  color: var(--text-primary);
}
[data-theme="main"] .eyebrow-pill::before { background: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-left {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
  body { cursor: auto !important; }
  body * { cursor: auto !important; }
  #cursor, #cursor-ring { display: none !important; }
}

/* ============================================================
   Scrollbar fine
   ============================================================ */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-tertiary); }
::-webkit-scrollbar-thumb { background: rgba(201, 168, 76, 0.3); border-radius: 2px; }
