/* =========================================================
   KADRO TALENTS — base.css
   Tokens · reset · typographie · logo · boutons · révélations
   chargement · curseur · en-tête · menu mobile
   ========================================================= */

:root {
  /* Couleurs de marque (mesurées sur le logo) */
  --navy: #0f2a4a;
  --navy-deep: #0a1f38;
  --navy-2: #1a3a63;
  --red: #d7253d;
  --red-deep: #b81c33;
  --red-soft: #fbeaec;

  /* Neutres */
  --white: #ffffff;
  --paper: #f6f4f0;
  --ink: #0f2a4a;
  --quiet: #5c6577;
  --rule: #e3e6eb;
  --steel: #cbd1da;
  --line-dark: rgba(255, 255, 255, .14);

  /* Typographies */
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --brand: 'Poppins', 'DM Sans', ui-sans-serif, system-ui, sans-serif;

  /* Mise en page */
  --maxw: 1312px;
  --gutter: clamp(16px, 4vw, 48px);
  --header-h: 84px;
  --section-y: clamp(96px, 12vw, 176px);
  --r: 4px;

  /* Courbes */
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-h); }
html:not(.has-smooth) { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--white); color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote, fieldset { margin: 0; }
ul, ol { padding: 0; list-style: none; }
fieldset { padding: 0; border: 0; min-width: 0; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 16px; top: -80px; z-index: 1000; padding: 12px 16px; background: var(--navy); color: #fff; font: 500 12px/1 var(--brand); letter-spacing: .12em; text-transform: uppercase; transition: top .3s var(--ease); }
.skip:focus { top: 16px; }

/* Lenis (défilement fluide) */
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; }

/* ---------- Mise en page ---------- */
.container { width: 100%; max-width: calc(var(--maxw) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section-head { max-width: 900px; margin: 0 auto clamp(56px, 6vw, 96px); display: grid; justify-items: center; gap: 24px; text-align: center; }

/* ---------- Typographie ---------- */
.display {
  font-family: var(--serif); font-weight: 500; font-optical-sizing: auto;
  font-size: clamp(44px, 7vw, 104px); line-height: 1.02; letter-spacing: -.018em;
  text-wrap: balance;
}
.h2 {
  font-family: var(--serif); font-weight: 500; font-optical-sizing: auto;
  font-size: clamp(36px, 4.4vw, 62px); line-height: 1.06; letter-spacing: -.012em;
  text-wrap: balance;
}
.display em, .h2 em { font-style: italic; font-weight: 450; }
.h2 em { color: var(--red); }
.lead { max-width: 640px; font-size: clamp(17px, 1.45vw, 20px); line-height: 1.5; color: var(--quiet); text-wrap: pretty; }
.eyebrow, .label { display: inline-flex; align-items: center; gap: 12px; font: 500 11.5px/1.2 var(--brand); text-transform: uppercase; letter-spacing: .16em; color: var(--ink); }
.label { font-size: 10.5px; color: var(--quiet); }
.eyebrow--light { color: rgba(255, 255, 255, .8); }
.arw { display: inline-block; font-family: var(--sans); transition: transform .5s var(--ease); }

/* Motifs de marque : le carré du O */
.sq { display: inline-block; flex: none; width: 9px; height: 9px; border: 2.5px solid var(--red); }
.mark-o { display: inline-block; flex: none; width: 14px; height: 14px; border: 4.4px solid var(--red); transition: border-width .5s var(--ease), transform .7s var(--ease); }
.live { position: relative; display: inline-block; flex: none; width: 7px; height: 7px; background: var(--red); }
.live::after { content: ""; position: absolute; inset: 0; background: inherit; animation: live 2s var(--ease) infinite; }
@keyframes live { from { transform: scale(1); opacity: .8; } to { transform: scale(3.2); opacity: 0; } }
.tag { display: inline-flex; align-items: center; padding: 6px 9px; font: 500 9.5px/1 var(--brand); text-transform: uppercase; letter-spacing: .14em; color: var(--red); border: 1px solid currentColor; border-radius: 2px; }
.tag--light { color: #fff; }

/* ---------- Logo (reconstruit en texte : remplaçable par le SVG officiel) ---------- */
/* Proportions relevées sur le logo : O = hauteur des minuscules (.58em en Poppins 800),
   cadre = 31 % du O, espace avant le O ≈ 17 % de sa hauteur, approche légèrement positive. */
.logo { --lc: var(--navy); display: inline-grid; gap: .035em; font-size: 28px; line-height: 1; color: var(--lc); }
.logo__word { display: flex; align-items: baseline; font: 800 1em/.82 var(--brand); letter-spacing: .03em; }
.logo__o { display: inline-block; flex: none; width: .58em; height: .58em; margin-left: .045em; border: .18em solid var(--red); transition: border-width .55s var(--ease); }
.logo__sub { display: flex; justify-content: space-between; padding-left: .05em; font: 500 max(.15em, 7.5px)/1 var(--brand); text-transform: uppercase; }
.logo__sub i { font-style: normal; }
a.logo:hover .logo__o { border-width: .29em; }
.logo--light { --lc: #fff; }
.logo--md { font-size: clamp(34px, 3.4vw, 48px); }
.logo--xl { font-size: clamp(64px, 12vw, 150px); }

/* ---------- Liens & boutons ---------- */
.link-mono { position: relative; display: inline-flex; align-items: center; gap: 10px; padding: 7px 0; font: 500 12.5px/1.15 var(--brand); text-transform: uppercase; letter-spacing: .14em; }
.link-mono::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor; transform-origin: left; transition: background-color .3s; }
.link-mono:hover::after, a:hover > .link-mono::after { animation: rule-swap .9s var(--ease); background: var(--red); }
.link-mono:hover .arw, a:hover > .link-mono .arw { transform: translateX(5px); }
.link-mono--light { color: #fff; }
@keyframes rule-swap {
  0% { transform: scaleX(1); transform-origin: right; }
  45% { transform: scaleX(0); transform-origin: right; }
  46% { transform: scaleX(0); transform-origin: left; }
  100% { transform: scaleX(1); transform-origin: left; }
}

.btn {
  --bg: var(--navy); --fg: #fff; --fg-h: #fff; --bd: transparent; --fill: var(--red);
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 14px;
  padding: 19px 26px; white-space: nowrap;
  font: 500 12.5px/1.15 var(--brand); text-transform: uppercase; letter-spacing: .14em;
  color: var(--fg); background-color: var(--bg); border: 1px solid var(--bd); border-radius: var(--r);
  transition: color .45s var(--ease), border-color .45s var(--ease), background-color .45s var(--ease);
}
.btn[data-magnetic] { transition: color .45s var(--ease), border-color .45s var(--ease), background-color .45s var(--ease), transform .6s var(--ease); }
.btn::before { content: ""; position: absolute; inset: -1px; z-index: -1; background: var(--fill); transform: scaleY(0); transform-origin: bottom; transition: transform .55s var(--ease); }
.btn:hover { color: var(--fg-h); }
.btn:hover::before { transform: scaleY(1); }
.btn__txt { position: relative; display: inline-block; overflow: hidden; vertical-align: top; }
.btn__txt > span { display: block; transition: transform .55s var(--ease); }
.btn__txt::after { content: attr(data-text); position: absolute; left: 0; top: 100%; white-space: nowrap; transition: transform .55s var(--ease); }
.btn:hover .btn__txt > span, .btn:hover .btn__txt::after { transform: translateY(-100%); }
.btn:hover .arw { transform: translateX(4px); }
.btn--sm { padding: 13px 18px; font-size: 11.5px; }
.btn--block { width: 100%; }
.btn--solid { --bg: var(--navy); --fill: var(--red); }
.btn--white { --bg: #fff; --fg: var(--navy); --fill: var(--red); --fg-h: #fff; }
.btn--ghost { --bg: transparent; --fg: var(--navy); --bd: var(--steel); --fill: var(--navy); --fg-h: #fff; }

/* ---------- Système de révélation ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(32px); transition: opacity 1s var(--ease) var(--d, 0s), transform 1.2s var(--ease) var(--d, 0s); }
.js [data-reveal="rise"] { transform: translateY(140px); transition-duration: 1.2s, 1.6s; }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-split]:not(.is-split) { opacity: 0; }
[data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding: 0 .06em .12em; margin: 0 -.06em -.12em; }
[data-split] .wi { display: inline-block; }
.js [data-split] .wi { transform: translateY(112%) rotate(4deg); transform-origin: 0 100%; transition: transform 1.15s var(--ease) calc(var(--d, 0s) + var(--i) * 60ms); }
.js [data-split].is-in .wi { transform: none; }
[data-illuminate] .wi { transition: opacity .25s linear; }

/* Le mot « cadre » se fait encadrer */
.framed { position: relative; display: inline-block; padding: 0 .1em; margin: 0 .02em; }
.framed::before, .framed::after { content: ""; position: absolute; border: 0 solid var(--red); pointer-events: none; }
.framed::before { left: -.02em; top: .1em; width: calc(100% + .04em); height: calc(100% - .06em); border-width: .055em 0 0 .055em; }
.framed::after { right: -.02em; bottom: -.04em; width: calc(100% + .04em); height: calc(100% - .06em); border-width: 0 .055em .055em 0; }
.js:not(.is-reduced) .framed::before, .js:not(.is-reduced) .framed::after { width: 0; height: 0; }
.js:not(.is-reduced) .is-in .framed::before { animation: frame-draw .75s var(--ease-io) 1.15s forwards; }
.js:not(.is-reduced) .is-in .framed::after { animation: frame-draw .75s var(--ease-io) 1.65s forwards; }
@keyframes frame-draw {
  0% { width: 0; height: 0; }
  50% { width: calc(100% + .04em); height: 0; }
  100% { width: calc(100% + .04em); height: calc(100% - .06em); }
}

/* ---------- Chargement : le logo se construit ---------- */
.loader { position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 30px; color: #fff; background: var(--navy); clip-path: inset(0 0 0 0); transition: clip-path 1.1s var(--ease-io); }
.no-js .loader, .is-reduced .loader { display: none; }
.js .loader { animation: loader-failsafe .01s 7s forwards; }
@keyframes loader-failsafe { to { visibility: hidden; } }
.loader.is-done { clip-path: inset(0 0 100% 0); }
.loader .logo { --lc: #fff; }
.loader .logo__word { overflow: hidden; padding: .14em .02em .02em; margin: -.14em -.02em -.02em; }
.loader .ch { display: inline-block; transform: translateY(120%); animation: ld-up 1s var(--ease) forwards; }
.loader .ch:nth-child(2) { animation-delay: .07s; } .loader .ch:nth-child(3) { animation-delay: .14s; } .loader .ch:nth-child(4) { animation-delay: .21s; }
.loader .logo__o { transform: scale(0) rotate(-90deg); animation: ld-o 1s var(--ease-back) .4s forwards; }
.loader .logo__sub i { opacity: 0; animation: ld-fade .6s var(--ease) forwards; }
.loader .logo__sub i:nth-child(1) { animation-delay: .7s; } .loader .logo__sub i:nth-child(2) { animation-delay: .75s; }
.loader .logo__sub i:nth-child(3) { animation-delay: .8s; } .loader .logo__sub i:nth-child(4) { animation-delay: .85s; }
.loader .logo__sub i:nth-child(5) { animation-delay: .9s; } .loader .logo__sub i:nth-child(6) { animation-delay: .95s; }
.loader .logo__sub i:nth-child(7) { animation-delay: 1s; }
.loader__line { font: italic 400 clamp(18px, 2vw, 24px)/1.3 var(--serif); color: rgba(255, 255, 255, .7); opacity: 0; animation: ld-fade .9s var(--ease) 1s forwards; }
.loader__line em { color: #fff; }
.loader__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, .08); }
.loader__bar i { display: block; height: 100%; background: var(--red); transform: scaleX(0); transform-origin: left; }
@keyframes ld-up { to { transform: none; } }
@keyframes ld-o { to { transform: none; } }
@keyframes ld-fade { to { opacity: 1; } }

/* ---------- Curseur « cadre » ---------- */
.cursor { position: fixed; left: 0; top: 0; z-index: 300; pointer-events: none; opacity: 0; transition: opacity .3s; }
.has-cursor .cursor.is-visible { opacity: 1; }
.cursor__frame { --cs: 14px; position: absolute; left: 0; top: 0; width: var(--cs); height: var(--cs); transform: translate(-50%, -50%); border: 2px solid var(--red); transition: width .5s var(--ease), height .5s var(--ease), border-width .5s var(--ease), background-color .3s, border-color .3s; }
.cursor.is-hover .cursor__frame { --cs: 42px; border-width: 1.5px; }
.cursor.is-down .cursor__frame { --cs: 10px; }
.cursor.is-label .cursor__frame { --cs: 100px; border-width: 1px; border-color: var(--navy); background: #fff; }
.cursor__label { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); font: 500 10.5px/1 var(--brand); text-transform: uppercase; letter-spacing: .14em; color: var(--navy); white-space: nowrap; opacity: 0; transition: opacity .3s; }
.cursor.is-label .cursor__label { opacity: 1; }

/* ---------- En-tête ---------- */
.header {
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--header-h);
  color: var(--ink); background: #fff; border-bottom: 1px solid var(--rule);
  transition: background-color .5s var(--ease), color .5s var(--ease), border-color .5s var(--ease);
}
.header.is-dark { color: #fff; background: var(--navy); border-color: var(--line-dark); }
.header.is-dark.is-top, .menu-open .header { color: #fff; background: transparent; border-color: var(--line-dark); }
.header__bar { height: 100%; display: flex; align-items: center; gap: 24px; }
.header .logo { --lc: var(--navy); }
.header.is-dark .logo, .menu-open .header .logo { --lc: #fff; }
.header .logo, .header .logo__word { transition: color .5s var(--ease); }
.header__nav { position: relative; display: flex; gap: 2px; margin-left: 36px; }
.header__nav a { position: relative; z-index: 1; padding: 12px 15px; font: 500 14.5px/1 var(--sans); border-radius: var(--r); opacity: .86; transition: opacity .3s; }
.header__nav a:hover, .header__nav a.is-current { opacity: 1; }
.header__nav a.is-current::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px; margin-left: -2.5px; background: var(--red); }
.header__pill { position: absolute; left: 0; top: 0; height: 100%; width: var(--pw, 0); transform: translateX(var(--px, 0)); border-radius: var(--r); background: color-mix(in srgb, currentColor 8%, transparent); opacity: 0; transition: transform .55s var(--ease), width .55s var(--ease), opacity .3s; }
.header__nav.is-pill .header__pill { opacity: 1; }
.header__actions { display: flex; gap: 10px; margin-left: auto; }
.header.is-dark .btn--ghost, .menu-open .header .btn--ghost { --fg: #fff; --bd: rgba(255, 255, 255, .5); --fill: #fff; --fg-h: var(--navy); }
.header.is-dark .btn--solid, .menu-open .header .btn--solid { --bg: #fff; --fg: var(--navy); --fill: var(--red); --fg-h: #fff; }
.header__progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none; }
.header__progress i { display: block; height: 100%; background: var(--red); transform: scaleX(0); transform-origin: left; }

.burger { position: relative; display: none; flex: none; width: 46px; height: 46px; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: var(--r); }
.burger > span:not(.sr-only) { position: absolute; left: 14px; right: 14px; height: 1.5px; background: currentColor; transition: transform .55s var(--ease); }
.burger > span:nth-child(1) { top: 18px; }
.burger > span:nth-child(2) { top: 26px; }
.menu-open .burger > span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.menu-open .burger > span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Menu mobile ---------- */
.menu {
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; justify-content: space-between;
  padding: calc(var(--header-h) + 24px) 0 32px; color: #fff; background: var(--navy);
  clip-path: inset(0 0 100% 0); visibility: hidden;
  transition: clip-path .9s var(--ease-io), visibility 0s .9s;
}
.menu-open .menu { clip-path: inset(0); visibility: visible; transition: clip-path .9s var(--ease-io), visibility 0s 0s; }
.menu__nav { display: grid; }
.menu__nav a { display: flex; align-items: baseline; gap: 18px; padding: 12px 0; font: 500 clamp(38px, 10vw, 64px)/1.1 var(--serif); border-bottom: 1px solid var(--line-dark); opacity: 0; transform: translateY(40px); transition: transform .9s var(--ease), opacity .9s var(--ease), color .3s; }
.menu__nav a:hover { color: var(--red-soft); }
.menu__nav a span { font: 500 11px/1 var(--brand); letter-spacing: .14em; color: var(--red); }
.menu-open .menu__nav a { opacity: 1; transform: none; }
.menu-open .menu__nav a:nth-child(1) { transition-delay: .2s; }
.menu-open .menu__nav a:nth-child(2) { transition-delay: .26s; }
.menu-open .menu__nav a:nth-child(3) { transition-delay: .32s; }
.menu-open .menu__nav a:nth-child(4) { transition-delay: .38s; }
.menu-open .menu__nav a:nth-child(5) { transition-delay: .44s; }
.menu__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }

@media (max-width: 1080px) {
  .header__nav, .header .btn--ghost { display: none; }
  .burger { display: block; }
}
@media (max-width: 330px) {
  .header .btn--solid { display: none; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js [data-reveal], .js [data-split] .wi { opacity: 1 !important; transform: none !important; }
}
.menu-open .menu__nav a:nth-child(6) { transition-delay: .5s; }
abbr[title] { text-decoration: none; cursor: help; }
.menu-open .menu__nav a:nth-child(7) { transition-delay: .56s; }

/* Bouton « Offres d'emploi » de l'en-tête : version compacte sur téléphone */
@media (max-width: 520px) {
  .header__bar { gap: 12px; }
  .header .logo { font-size: 25px; }
  .header .btn--solid { padding: 11px 12px; font-size: 10.5px; letter-spacing: .1em; }
  .header .btn--solid .arw { display: none; }
}

/* Sections repliées : masquées tant qu'on ne les ouvre pas depuis un lien du menu */
.js [data-folded] { display: none !important; }
.is-unfolded { animation: unfold 1s var(--ease) both; }
@keyframes unfold { from { opacity: 0; } to { opacity: 1; } }
