/* ============================================================================
   Site vitrine Djed — design system (handoff design_handoff_djed_vitrine)
   Typo unique Hanken Grotesk · noir & blanc · accent or --acc.
   Le gros du styling est en inline dans les vues (port fidèle des maquettes) ;
   ce fichier porte les tokens, le reset, les keyframes, la nav et les
   utilitaires de hover/mobile réutilisés partout.
   ========================================================================== */

:root {
  --acc: #a87b2a;           /* accent or, fond clair */
  --acc-hi: #e0bb63;        /* accent or, fond sombre */
  --ink: #111110;           /* encre / texte principal */
  --ink-2: #55544e;         /* texte secondaire */
  --ink-3: #8a897f;         /* labels / tertiaire */
  --ink-4: #c5c4bb;         /* très faible (mentions) */
  --surf: #f6f6f3;          /* surface carte claire */
  --surf-2: #f1efe9;        /* surface carte alt */
  --dark: #111110;          /* surfaces sombres */
  --hero: #100f0e;          /* base hero sous les bandes */

  /* tokens motion (motion-design) */
  --ease-out-quart: cubic-bezier(.165, .84, .44, 1);
  --ease-out-expo: cubic-bezier(.19, 1, .22, 1);
  --ease-in-out-quart: cubic-bezier(.77, 0, .175, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* clip (pas hidden) : hidden casse position:sticky (leçon djed-sofi) */
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
a:hover { opacity: .7; }
::selection { background: var(--ink); color: #fff; }

img { max-width: 100%; display: block; }

@keyframes rise  { from { transform: translateY(118%); } to { transform: translateY(0); } }
@keyframes fadeup{ from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* Titres : lignes équilibrées (pas de mot orphelin). */
h1, h2, h3 { text-wrap: balance; }

/* Eyebrows : signature — petit trait or devant le label. */
.eyebrow-dash::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: 18px; height: 2px; border-radius: 2px;
  background: var(--acc); margin-right: 10px; margin-top: -2px;
}

/* barre de progression du scroll (haut de page) */
#pgbar {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: var(--ink); z-index: 80;
}

/* ── Navigation ─────────────────────────────────────────────────────────── */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 4.5vw, 64px);
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, padding .3s cubic-bezier(.22, .8, .24, 1);
}
/* La nav « s'assoit » quand on scrolle : hairline + légèrement plus compacte. */
.site-nav.is-scrolled { border-bottom-color: rgba(17, 17, 16, .08); padding-top: 14px; padding-bottom: 14px; }
.site-nav .brand { display: flex; align-items: center; gap: 10px; }
.site-nav .brand b { font-weight: 700; font-size: 18px; letter-spacing: -.02em; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link {
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  padding: 9px 14px; border-radius: 999px; transition: background .2s;
}
.nav-link:hover { background: #f2f2ef; opacity: 1; }
.nav-link[aria-current="page"] { color: var(--ink); background: #f2f2ef; }
.nav-cta {
  font-size: 14px; font-weight: 600; background: var(--ink); color: #fff;
  padding: 12px 24px; border-radius: 999px; margin-left: 10px;
  transition: transform .25s cubic-bezier(.22, .8, .24, 1);
}
.nav-cta:hover { transform: scale(1.05); opacity: 1; }
.nav-burger {
  display: none; align-items: center; justify-content: center;
  width: 42px; height: 42px; border: 1px solid rgba(17, 17, 16, .14);
  border-radius: 999px; background: #fff; cursor: pointer; padding: 0;
}
.nav-burger span {
  display: block; width: 16px; height: 2px; background: var(--ink);
  box-shadow: 0 5px 0 var(--ink); margin-bottom: 5px;
}
.nav-menu {
  display: none; position: fixed; top: 70px; left: 12px; right: 12px; z-index: 59;
  background: #fff; border: 1px solid rgba(17, 17, 16, .1); border-radius: 20px;
  box-shadow: 0 24px 60px -24px rgba(17, 17, 16, .3);
  padding: 10px; flex-direction: column; gap: 2px;
}
.nav-menu a { font-size: 15px; font-weight: 600; padding: 13px 16px; border-radius: 12px; }
.nav-menu a:hover { background: var(--surf); opacity: 1; }
.nav-menu a.cta { padding: 14px 16px; border-radius: 999px; background: var(--ink); color: #fff; text-align: center; margin-top: 6px; }

/* ── Utilitaires de hover (remplacent les style-hover des maquettes) ─────── */
.u-scale:hover    { transform: scale(1.05); opacity: 1; }
.u-scale-sm:hover { transform: scale(1.03); opacity: 1; }
.u-lift           { transition: transform .35s cubic-bezier(.22, .8, .24, 1), box-shadow .35s cubic-bezier(.22, .8, .24, 1); }
.u-lift:hover     { transform: translateY(-4px); opacity: 1; box-shadow: 0 24px 48px -28px rgba(17, 17, 16, .22); }
.u-navlink:hover  { background: #f2f2ef; opacity: 1; }
.u-ghost:hover    { background: rgba(255, 255, 255, .14); opacity: 1; }
.u-soft:hover     { background: var(--surf); opacity: 1; }
.u-soft2:hover    { background: #fdfdfc; opacity: 1; }

/* ── Voile de transition + splash de marque (_page_veil, piloté par site.js)
   Deux modes :
   · html.veil-splash — PREMIÈRE arrivée sur le site (une fois par session) :
     voile couvrant → le pilier s'assemble segment par segment → wordmark →
     le voile se lève (700ms expo).
   · html.veil-arrive — navigation interne : simple volet nu et rapide
     (couvre à la sortie ~300ms, se lève à l'arrivée ~450ms). Pas de marque.
   Jamais sous reduced-motion. ─────────────────────────────────────────────── */
.page-veil {
  position: fixed; inset: 0; z-index: 90;
  background: var(--hero);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  clip-path: inset(100% 0 0 0); /* caché */
}
.veil-brand {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
  opacity: 0;
}
.veil-pillar { width: 58px; height: auto; color: var(--acc-hi); filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .45)); }
.veil-word {
  font-size: 24px; font-weight: 700; letter-spacing: -.02em; color: #fff;
}
@keyframes veilDrop { from { opacity: 0; transform: translateY(-26px); } to { opacity: 1; transform: none; } }
@keyframes veilRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* sortie (nav interne) : volet nu qui couvre, rapide */
.page-veil.is-covering {
  clip-path: inset(0 0 0 0);
  transition: clip-path .3s var(--ease-in-out-quart);
  pointer-events: auto;
}

/* arrivée (nav interne) : couvrant sans transition, puis volet levé vite */
html.veil-arrive .page-veil { clip-path: inset(0 0 0 0); }
html.veil-arrive .page-veil.is-leaving {
  clip-path: inset(0 0 100% 0);
  transition: clip-path .45s var(--ease-out-expo);
}

/* splash (première arrivée) : assemblage du pilier en cascade + wordmark */
html.veil-splash .page-veil { clip-path: inset(0 0 0 0); }
html.veil-splash .page-veil .veil-brand { opacity: 1; }
html.veil-splash .page-veil .vs { opacity: 0; }
html.veil-splash .page-veil .vs1 { animation: veilDrop .5s var(--ease-out-quart) .10s forwards; }
html.veil-splash .page-veil .vs2 { animation: veilDrop .5s var(--ease-out-quart) .26s forwards; }
html.veil-splash .page-veil .vs3 { animation: veilDrop .5s var(--ease-out-quart) .42s forwards; }
html.veil-splash .page-veil .vs4 { animation: veilDrop .5s var(--ease-out-quart) .56s forwards; }
html.veil-splash .page-veil .vs5 { animation: veilDrop .5s var(--ease-out-quart) .68s forwards; }
html.veil-splash .page-veil .vs6 { animation: veilDrop .5s var(--ease-out-quart) .78s forwards; }
html.veil-splash .page-veil .veil-word { opacity: 0; animation: veilRise .55s var(--ease-out-quart) .92s forwards; }
html.veil-splash .page-veil.is-leaving {
  clip-path: inset(0 0 100% 0);
  transition: clip-path .7s var(--ease-out-expo);
}
html.veil-splash .page-veil.is-leaving .veil-brand {
  opacity: 0; transform: translateY(-16px);
  transition: opacity .3s var(--ease-out-quart), transform .3s var(--ease-out-quart);
}
@media (prefers-reduced-motion: reduce) {
  .page-veil, .page-veil.is-covering,
  html.veil-arrive .page-veil, html.veil-splash .page-veil { clip-path: inset(100% 0 0 0); transition: none; }
}

/* ── Split 50/50 : colonne épinglée pendant que l'autre défile ────────────
   (.sticky-col dans une grille 2 colonnes — pattern Linear/Stripe, même
   famille que le scrollytelling de la page Mythe). Désactivé en mobile. ─── */
.split-5050 {
  display: grid;
  grid-template-columns: minmax(300px, .85fr) minmax(0, 1.15fr);
  gap: clamp(28px, 4vw, 72px);
  align-items: start;
}
.sticky-col { position: sticky; top: 110px; align-self: start; }
/* Texte de pilier (page Fonctionnalités) : la hauteur donne la course du
   scroll pendant laquelle la carte d'en face reste épinglée. */
.pillar-text {
  min-height: 68vh;
  display: flex; flex-direction: column; justify-content: center;
}
@media (max-width: 820px) {
  .split-5050 { grid-template-columns: minmax(0, 1fr); }
  .sticky-col { position: static; }
  .pillar-text { min-height: 0; padding: 26px 0 4px; }
}

/* ── Barre CTA sticky (rendue par _sticky_cta, pilotée par site.js) ──────── */
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: flex; justify-content: center; padding: 0 12px 18px;
  pointer-events: none;
  opacity: 0; transform: translateY(16px);
  transition: opacity .45s cubic-bezier(.22, .8, .24, 1), transform .45s cubic-bezier(.22, .8, .24, 1);
}
.sticky-cta.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.sticky-cta-in {
  max-width: 920px; width: 100%;
  background: rgba(17, 17, 16, .92); backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px;
  padding: 12px 12px 12px 26px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .5);
}
.sticky-cta-txt { display: flex; align-items: center; gap: 14px; color: #fff; min-width: 0; }
.sticky-cta-txt b { font-size: 15px; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky-cta-txt span { font-size: 12.5px; color: rgba(255, 255, 255, .6); }
.sticky-cta a {
  flex: none; font-size: 14.5px; font-weight: 600;
  background: #fff; color: var(--ink);
  padding: 14px 26px; border-radius: 999px;
  transition: transform .2s cubic-bezier(.22, .8, .24, 1);
}

/* ── Comparatif tableur ⇄ Djed : empilé en mobile, flèche pivotée ────────── */
@media (max-width: 820px) {
  [data-compare] { grid-template-columns: minmax(0, 1fr) !important; }
  [data-compare] > div:first-child { border-radius: 28px 28px 0 0 !important; }
  [data-compare] > div:last-child  { border-radius: 0 0 28px 28px !important; }
  [data-compare-sep] { height: 56px; background: linear-gradient(90deg, var(--surf), var(--dark)) !important; }
  [data-compare-sep] span { transform: rotate(90deg); }
}

/* ── Mobile ≤ 820px : bascules gérées surtout par site.js (inline), quelques
   garde-fous CSS ici. ───────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .sticky-cta-txt b { font-size: 13.5px; }
  .sticky-cta-txt span { display: none; }
  .sticky-cta-in { padding-left: 18px; }
  .sticky-cta a { padding: 12px 20px; }
  [data-2col-footer] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  [data-2col-footer] > div:first-child { grid-column: 1 / -1; }
}

/* ── Polish conversion & accessibilité (emil / ui-ux-pro-max) ───────────── */
/* Feedback de pression : le bouton « répond » au clic (scale-feedback). */
.u-scale, .u-scale-sm, .nav-cta { will-change: transform; }
.u-scale:active, .u-scale-sm:active, .nav-cta:active { transform: scale(.97); }
.u-soft:active, .u-soft2:active { transform: scale(.98); }

/* Focus clavier visible : accessibilité + arbre a11y lisible par les agents IA. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Pas de faux hover au tap sur écrans tactiles. */
@media (hover: none) {
  .u-lift:hover,
  .u-scale:hover,
  .u-scale-sm:hover,
  .nav-cta:hover { transform: none; }
}

/* ── Prose légale (mentions, CGU, confidentialité, cookies) ─────────────── */
.legal-prose { max-width: 72ch; }
.legal-prose h2 {
  margin: 44px 0 0; font-weight: 700; font-size: 1.35rem; letter-spacing: -.02em;
}
.legal-prose h2::after {
  content: ""; display: block; width: 26px; height: 2px; border-radius: 2px;
  background: var(--acc); margin-top: 10px;
}
.legal-prose h3 { margin: 26px 0 0; font-weight: 700; font-size: 1.05rem; }
.legal-prose p, .legal-prose li { font-size: 15px; line-height: 1.75; color: var(--ink-2); }
.legal-prose p { margin: 14px 0 0; }
.legal-prose ul { margin: 12px 0 0; padding-left: 20px; }
.legal-prose li { margin-top: 6px; }
.legal-prose strong { color: var(--ink); }
.legal-prose a { color: var(--acc); font-weight: 600; }
.legal-prose table { margin-top: 16px; border-collapse: collapse; width: 100%; font-size: 14px; }
.legal-prose th, .legal-prose td { text-align: left; padding: 10px 14px; border-bottom: 1px solid rgba(17, 17, 16, .1); color: var(--ink-2); vertical-align: top; }
.legal-prose th { color: var(--ink); font-weight: 700; }
.legal-todo {
  background: rgba(168, 123, 42, .08); border: 1px dashed rgba(168, 123, 42, .45);
  border-radius: 8px; padding: 1px 7px; font-weight: 600; color: var(--acc); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* On garde opacité/fond, on coupe les transforms. */
  .u-scale, .u-scale-sm, .u-lift, .nav-cta { transition-property: opacity, background; }
  .u-scale:hover, .u-scale-sm:hover, .u-lift:hover, .nav-cta:hover,
  .u-scale:active, .u-scale-sm:active, .nav-cta:active { transform: none; }
}
