/* ==========================================================================
   FinRadar — base.css
   Reset, container, typographie, boutons, icônes, utilitaires, mouvement.
   Ne connaît aucun bloc et ne déclare aucun token (voir tokens.css).
   Référence : .doc/DESIGN.md
   ========================================================================== */

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  interpolate-size: allow-keywords;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-top) + var(--header-h) + var(--space-5));
}

body,
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

body {
  min-height: 100%;
  overflow-x: hidden;
  background-color: var(--c-bg);
  color: var(--c-text);
  font-family: var(--ff-sans);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.is-locked {
  overflow: hidden;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background-color: var(--c-accent);
  color: var(--c-on-accent);
}

:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Container
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container-max) + 2 * var(--pad-x));
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

/* --------------------------------------------------------------------------
   Typographie — titres en extrabold, contrepoint en thin (.t-thin)
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-weight: var(--fw-heavy);
  letter-spacing: -0.03em;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: -0.035em;
}

h2 {
  font-size: var(--fs-h2);
  line-height: var(--lh-h2);
}

h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  line-height: var(--lh-h3);
  letter-spacing: -0.015em;
}

p {
  max-width: var(--measure);
}

strong {
  font-weight: var(--fw-bold);
}

.t-thin {
  font-weight: var(--fw-thin);
  letter-spacing: -0.025em;
}

/* Thin 100 sur grand écran : réservé au titre du hero, avec .t-thin. */
.t-hairline {
  font-weight: var(--fw-hairline);
}

.t-gradient {
  background-image: var(--g-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.t-lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-lead);
  color: var(--c-text-muted);
}

.t-small {
  font-size: var(--fs-small);
  line-height: var(--lh-small);
  color: var(--c-text-muted);
}

.t-eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--c-accent-light);
}

/* --------------------------------------------------------------------------
   Boutons — pill, dégradé et ombre colorée pour le primaire
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap-min);
  padding: var(--space-3) var(--space-6);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition),
    background-color var(--transition), border-color var(--transition), color var(--transition);
}

.btn--primary {
  width: 100%;
  max-width: var(--cta-max);
  background-image: var(--g-button);
  color: var(--c-on-accent);
  box-shadow: inset 0 1px 0 rgb(var(--rgb-white) / 0.35), 0 1px 2px rgb(var(--rgb-shadow) / 0.4),
    0 10px 28px rgb(var(--rgb-accent) / 0.3);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgb(var(--rgb-white) / 0.35), 0 2px 4px rgb(var(--rgb-shadow) / 0.4),
    0 16px 40px rgb(var(--rgb-accent) / 0.42);
}

.btn--ghost {
  width: 100%;
  max-width: var(--cta-max);
  border-color: var(--c-line-strong);
  background-color: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--shadow-inset);
}

.btn--ghost:hover {
  border-color: var(--c-accent-line);
  background-color: var(--c-surface-strong);
}

/* Largeur au contenu : header, FAQ, footer. */
.btn--compact {
  width: auto;
  max-width: none;
  padding-inline: var(--space-5);
}

/* Flèche de fin, qui avance d'un cran au survol. */
.btn--arrow::after {
  content: '';
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: var(--ico-arrow) center / contain no-repeat;
  mask: var(--ico-arrow) center / contain no-repeat;
  transition: transform var(--transition);
}

.btn--arrow:hover::after {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   Icônes — un masque SVG peint en currentColor : la couleur suit le texte.
   -------------------------------------------------------------------------- */
.ico {
  display: inline-block;
  flex: 0 0 auto;
  width: 1.25em;
  height: 1.25em;
  background-color: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
}

.ico--arrow { --ico: var(--ico-arrow); }
.ico--arrow-down { --ico: var(--ico-arrow-down); }
.ico--check { --ico: var(--ico-check); }
.ico--cross { --ico: var(--ico-cross); }
.ico--bell { --ico: var(--ico-bell); }
.ico--shield { --ico: var(--ico-shield); }
.ico--monitor { --ico: var(--ico-monitor); }
.ico--medical { --ico: var(--ico-medical); }
.ico--users { --ico: var(--ico-users); }
.ico--building { --ico: var(--ico-building); }
.ico--download { --ico: var(--ico-download); }
.ico--plug { --ico: var(--ico-plug); }
.ico--code { --ico: var(--ico-code); }
.ico--id { --ico: var(--ico-id); }
.ico--wind { --ico: var(--ico-wind); }
.ico--signal { --ico: var(--ico-signal); }
.ico--linkedin { --ico: var(--ico-linkedin); }

/* --------------------------------------------------------------------------
   Lien d'évitement
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  background-color: var(--c-accent);
  color: var(--c-on-accent);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  transform: translateY(-200%);
}

.skip-link:focus-visible {
  transform: translateY(0);
}

/* --------------------------------------------------------------------------
   Mouvement — déclaré seulement si l'utilisateur ne l'a pas réduit : sinon,
   chaque visuel s'affiche directement dans son état final.
   [data-reveal] : le bloc monte en fondu à sa première apparition.
   .u-in, .u-pop, .u-grow + .u-d1 à .u-d8 : la chorégraphie d'un visuel,
   jouée une fois. js/main.js pose .is-pending (pas encore vu) et .is-paused
   (hors écran) ; sans JS, tout se joue au chargement.
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    transition: opacity var(--dur-reveal) var(--ease-out), transform var(--dur-reveal) var(--ease-out);
  }

  [data-reveal].is-pending {
    opacity: 0;
    transform: translateY(var(--space-5));
  }

  .u-in { animation: in var(--dur-in) var(--ease-out) both; }
  .u-pop { animation: pop var(--dur-in) var(--ease-out) both; }
  .u-grow { animation: grow var(--dur-reveal) var(--ease-out) both; transform-origin: bottom; }

  .u-d1 { animation-delay: 0.2s; }
  .u-d2 { animation-delay: 0.4s; }
  .u-d3 { animation-delay: 0.6s; }
  .u-d4 { animation-delay: 0.8s; }
  .u-d5 { animation-delay: 1s; }
  .u-d6 { animation-delay: 1.2s; }
  .u-d7 { animation-delay: 1.4s; }
  .u-d8 { animation-delay: 1.6s; }
}

/* Plus spécifique que toute règle d'animation : l'emporte quel que soit
   l'ordre des feuilles. */
[data-anim].is-paused *,
[data-anim].is-paused *::before,
[data-anim].is-paused *::after {
  animation-play-state: paused;
}

@keyframes in {
  from { opacity: 0; transform: translateY(var(--space-3)); }
}

@keyframes pop {
  0% { opacity: 0; transform: scale(0.85); }
  60% { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: none; }
}

@keyframes grow {
  from { transform: scaleY(0); }
}

@keyframes spin {
  to { transform: rotate(1turn); }
}

@keyframes ping {
  from { opacity: 0.6; transform: none; }
  to { opacity: 0; transform: scale(3.2); }
}
