/* ==========================================================================
   GlobalExam Duel : styles communs (socle, navigation, composants partagés).
   Les styles propres à chaque écran sont dans css/screens/*.css.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-md);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 700ms var(--ease), color 700ms var(--ease);
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--team-a); outline-offset: 4px; border-radius: 8px; }
::selection { background: var(--team-a); color: #fff; }
[v-cloak] { display: none; }

/* --------------------------------------------------------------- Navigation */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
  padding: 0 var(--gutter);
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  transition: background-color 700ms var(--ease), border-color 700ms var(--ease);
}
.nav__brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; justify-self: start; }
.nav__brand img { height: 20px; width: auto; }
.nav__brand span { color: var(--text-2); font-weight: 500; }
.nav__links { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 40px); }
.nav__link {
  position: relative; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2);
  transition: color 200ms var(--ease); white-space: nowrap;
}
.nav__link:hover, .nav__link.is-active { color: var(--text); }
.nav__link.is-active { font-weight: 600; }
.nav__live { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--team-b); margin-right: 8px; vertical-align: 2px; animation: pulse-dot 2s var(--ease) infinite; }
.nav__me { justify-self: end; display: flex; align-items: center; gap: 10px; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); white-space: nowrap; }
.nav__me:hover, .nav__me.is-active { color: var(--text); }
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 100, 16, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(242, 100, 16, 0); }
}

/* Sous-navigation d'un espace (RH, Décideur) */
.subnav { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 0 auto clamp(40px, 7vh, 80px); }
.subnav a {
  height: 40px; padding: 0 18px; display: inline-flex; align-items: center; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); transition: background 240ms var(--ease), color 240ms var(--ease);
}
.subnav a:hover { color: var(--text); }
.subnav a.is-active { background: var(--text); color: var(--bg); font-weight: 600; }
/* onglet-action (ex. « Nouveau duel ») : séparé par un filet, en couleur de marque */
.subnav a.is-cta { position: relative; margin-left: 29px; gap: 8px; background: var(--team-a-soft); color: var(--team-a); font-weight: 600; }
.subnav a.is-cta::before { content: ''; position: absolute; left: -18px; top: 8px; bottom: 8px; width: 1px; background: var(--line-strong); }
.subnav a.is-cta:hover { color: var(--team-a); background: color-mix(in srgb, var(--team-a) 16%, transparent); }
.subnav a.is-cta.is-active { background: var(--team-a); color: #fff; }
.subnav__plus { font-size: 1.2em; line-height: 1; font-weight: 500; }

/* ------------------------------------------------------------------ Pages */
.page {
  min-height: 100vh;
  padding: calc(var(--nav-h) + clamp(48px, 9vh, 120px)) var(--gutter) clamp(64px, 10vh, 140px);
  max-width: 1440px; margin: 0 auto;
}
.page--center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.page--full { max-width: none; }
.section { padding: var(--section) 0; }
.section--alt { background: var(--bg-alt); }

/* Transitions entre écrans */
.screen-enter-active { transition: opacity 500ms var(--ease), transform 700ms var(--ease), filter 500ms var(--ease); }
.screen-leave-active { transition: opacity 220ms var(--ease); }
.screen-enter-from { opacity: 0; transform: translateY(20px); filter: blur(6px); }
.screen-leave-to { opacity: 0; }

/* ------------------------------------------------------------- Typographie */
.eyebrow { font-size: var(--fs-md); font-weight: 600; color: var(--team-a); letter-spacing: -0.01em; }
.eyebrow--muted { color: var(--text-2); }
.title-hero { font-size: var(--fs-hero); font-weight: 700; line-height: 1.04; letter-spacing: -0.045em; }
.title-xl { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.06; letter-spacing: -0.04em; }
.title-lg { font-size: var(--fs-xl); font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; }
.lead { font-size: var(--fs-lg); font-weight: 400; color: var(--text-2); line-height: 1.38; letter-spacing: -0.015em; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.05em; line-height: 0.95; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.team-a { color: var(--team-a); }
.team-b { color: var(--team-b); }
.gold { color: var(--gold); }
.gradient-text {
  background: linear-gradient(100deg, var(--team-a) 10%, #C2489A 52%, var(--team-b) 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------------------------------------------------------------- Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px; padding: 0 28px; border-radius: 999px;
  font-size: var(--fs-md); font-weight: 600; letter-spacing: -0.01em; white-space: nowrap;
  background: var(--text); color: var(--bg);
  transition: transform 240ms var(--ease), background 240ms var(--ease), opacity 240ms var(--ease), box-shadow 240ms var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.3; pointer-events: none; }
.btn--lg { height: 64px; padding: 0 40px; font-size: var(--fs-lg); }
.btn--brand { background: var(--team-a); color: #fff; }
.btn--brand:hover { box-shadow: 0 12px 32px rgba(124, 58, 237, 0.32); }
.btn--orange { background: var(--team-b); color: #fff; }
.btn--orange:hover { box-shadow: 0 12px 32px rgba(242, 100, 16, 0.3); }
.btn--ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px var(--text); }
.btn--sm { height: 42px; padding: 0 20px; font-size: var(--fs-sm); }
.link-arrow { font-weight: 600; color: var(--team-a); white-space: nowrap; }
.link-arrow::after { content: '\00A0\203A'; display: inline-block; transition: transform 200ms var(--ease); }
.link-arrow:hover::after { transform: translateX(3px); }

/* -------------------------------------------- Contrôle segmenté (façon iOS) */
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--bg-sunken); }
.segmented button {
  height: 40px; padding: 0 20px; border-radius: 999px; font-size: var(--fs-sm); font-weight: 500; color: var(--text-2);
  transition: background 260ms var(--ease), color 260ms var(--ease), box-shadow 260ms var(--ease);
}
.segmented button:hover { color: var(--text); }
.segmented button.is-active { background: var(--bg-raised); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10), 0 4px 12px rgba(0, 0, 0, 0.06); }
.dark .segmented, body.is-dark .segmented { background: #1C1C1E; }
.dark .segmented button.is-active, body.is-dark .segmented button.is-active { background: #3A3A3C; }

/* ------------------------------------------------------- Ceinture CECR
   Une pastille sobre : un petit morceau de ceinture coloré + le niveau. */
.belt {
  --belt: var(--belt-b1);
  display: inline-flex; align-items: center; gap: 0.5em; height: 1.9em; padding: 0 0.75em 0 0.6em; border-radius: 999px;
  background: var(--bg-alt); color: var(--text);
  font-size: var(--fs-sm); font-weight: 700; letter-spacing: -0.01em; line-height: 1; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.belt i { display: block; width: 1.1em; height: 0.42em; border-radius: 0.12em; background: var(--belt); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.belt[data-level="A1"] { --belt: var(--belt-a1); }
.belt[data-level="A2"] { --belt: var(--belt-a2); }
.belt[data-level="B1"] { --belt: var(--belt-b1); }
.belt[data-level="B2"] { --belt: var(--belt-b2); }
.belt[data-level="C1"] { --belt: var(--belt-c1); }
.belt[data-level="C2"] { --belt: var(--belt-c2); }
.belt[data-level="C2"] i { box-shadow: inset 0 0 0 1px var(--gold); }
.belt--lg { font-size: var(--fs-lg); }
.belt--plain { background: transparent; padding: 0; }

/* ------------------------------------------------------ Logo entreprise
   Plat, net, comme une icône d'app. */
.clogo {
  --c: #888; --size: 56px;
  position: relative; flex: none; width: var(--size); height: var(--size);
  display: grid; place-items: center; border-radius: 26%;
  background: var(--c); color: #fff;
}
.clogo--circle { border-radius: 50%; }
.clogo__mono { font-family: var(--font); font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-size: calc(var(--size) * 0.38); }
.clogo--long .clogo__mono { font-size: calc(var(--size) * 0.28); letter-spacing: -0.03em; }
.clogo--light { color: #1D1D1F; }

/* ----------------------------------------------------------- Avatar */
.avatar {
  --c: var(--team-a); --size: 44px;
  flex: none; width: var(--size); height: var(--size); border-radius: 50%;
  display: grid; place-items: center; font-weight: 600; font-size: calc(var(--size) * 0.36); letter-spacing: -0.02em;
  background: color-mix(in srgb, var(--c) 14%, var(--bg)); color: color-mix(in srgb, var(--c) 72%, var(--text));
}

/* ------------------------------------------------------------- Surfaces */
.card { background: var(--bg-alt); border-radius: var(--radius-lg); }
.card--raised { background: var(--bg-raised); box-shadow: var(--shadow); }

/* ------------------------------------------- Apparition au fil du récit
   v-reveal ajoute .reveal puis .is-in quand l'élément entre à l'écran. */
.reveal { opacity: 0; transform: translateY(32px); filter: blur(8px); transition: opacity 900ms var(--ease), transform 1100ms var(--ease), filter 900ms var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.reveal.is-in { opacity: 1; transform: none; filter: none; }
.rise { animation: rise 900ms var(--ease) both; animation-delay: calc(var(--i, 0) * 80ms); }
@keyframes rise { from { opacity: 0; transform: translateY(20px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* ---------------------------------------------------- Modale de partage */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: var(--gutter);
  background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%);
}
.modal { width: min(1000px, 100%); display: flex; flex-direction: column; align-items: center; gap: 28px; }
.modal__canvas { width: 100%; height: auto; aspect-ratio: 1200 / 630; border-radius: 24px; box-shadow: 0 40px 120px rgba(0, 0, 0, 0.45); }
.modal__actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.modal__actions .btn { background: #fff; color: #1D1D1F; }
.modal__actions .btn--ghost { background: rgba(255, 255, 255, 0.14); color: #fff; box-shadow: none; }
.modal__close {
  position: fixed; top: 22px; right: 26px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-size: 24px; color: #fff; background: rgba(255, 255, 255, 0.14);
}
.modal__close:hover { background: rgba(255, 255, 255, 0.24); }
.fade-enter-active, .fade-leave-active { transition: opacity 320ms var(--ease); }
.fade-enter-active .modal { transition: transform 520ms var(--ease-spring); }
.fade-enter-from, .fade-leave-to { opacity: 0; }
.fade-enter-from .modal { transform: scale(0.94) translateY(16px); }

/* ------------------------------------------------------------- Toast */
.toast {
  position: fixed; left: 50%; bottom: 36px; z-index: 120; transform: translateX(-50%);
  padding: 14px 26px; border-radius: 999px; background: #1D1D1F; color: #fff;
  font-weight: 600; font-size: var(--fs-sm); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.toast-enter-active, .toast-leave-active { transition: opacity 300ms var(--ease), transform 400ms var(--ease-spring); }
.toast-enter-from, .toast-leave-to { opacity: 0; transform: translate(-50%, 20px); }

/* ------------------------------------------------------------ Corde */
.rope { display: block; width: 100%; height: auto; overflow: visible; }

/* ----------------------------------------------------- Compte à rebours */
.countdown { display: inline-flex; align-items: baseline; gap: 0.5em; font-weight: 600; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.countdown__unit { display: inline-flex; align-items: baseline; gap: 0.1em; }
.countdown__unit i { font-style: normal; font-size: 0.45em; font-weight: 500; color: var(--text-2); letter-spacing: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}

@media (max-width: 900px) {
  .nav { display: flex; gap: 14px; }
  .nav__brand span, .nav__me { display: none; }
  .nav__links {
    flex: 1; min-width: 0; height: 100%; overflow-x: auto; scrollbar-width: none; gap: 22px;
    mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .nav__links::-webkit-scrollbar { display: none; }
}

/* ---------------------------------------- Vecteur de viralité (share-cta) */
.share-cta {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px;
  padding: clamp(48px, 7vw, 88px) clamp(24px, 5vw, 72px); border-radius: var(--radius-lg); background: var(--bg-alt);
}
.share-cta::before {
  content: ''; position: absolute; inset: auto -10% -60% -10%; height: 80%; z-index: -1; filter: blur(60px); opacity: 0.35;
  background: radial-gradient(40% 60% at 30% 50%, var(--team-a), transparent 70%), radial-gradient(40% 60% at 70% 50%, var(--team-b), transparent 70%);
}
.share-cta__icon {
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; color: #fff; margin-bottom: 6px;
  background: linear-gradient(135deg, var(--team-a), var(--team-b));
}
.share-cta__eyebrow { font-size: var(--fs-sm); font-weight: 600; color: var(--team-a); }
.share-cta__title { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; max-width: 22ch; }
.share-cta__text { font-size: var(--fs-md); color: var(--text-2); max-width: 46ch; }
.share-cta__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 24px; align-items: center; margin-top: 18px; }

/* ------------------------------------------- Menu de Claire (espaces dédiés) */
.nav__me-wrap { justify-self: end; position: relative; }
.nav__me { padding: 4px 6px 4px 4px; border-radius: 999px; transition: background 200ms var(--ease), color 200ms var(--ease); }
.nav__me:hover, .nav__me.is-active { background: var(--bg-alt); }
.nav__burger { display: inline-flex; flex-direction: column; gap: 3px; margin-left: 4px; padding: 0 6px; }
.nav__burger i { display: block; width: 14px; height: 1.6px; border-radius: 1px; background: currentColor; }
.nav__menu {
  position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; padding: 8px; border-radius: 18px;
  display: flex; flex-direction: column; background: var(--glass); box-shadow: var(--shadow-lg), 0 0 0 1px var(--line);
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
}
.nav__menu a { padding: 12px 16px; border-radius: 12px; font-size: var(--fs-sm); font-weight: 500; color: var(--text); white-space: nowrap; }
.nav__menu a:hover { background: var(--bg-alt); }
.nav__menu a.is-active { font-weight: 700; color: var(--team-a); }
.menu-enter-active, .menu-leave-active { transition: opacity 200ms var(--ease), transform 300ms var(--ease-spring); transform-origin: top right; }
.menu-enter-from, .menu-leave-to { opacity: 0; transform: scale(0.94) translateY(-6px); }
@media (max-width: 900px) { .nav__me-wrap .nav__me { display: flex; } .nav__me-wrap .nav__me > :not(.avatar):not(.nav__burger) { display: none; } }
