/* Diacenter : fondations (jetons, police, typographie, boutons, liens, focus). */

@font-face {
  font-family: "Manrope";
  src: url("../fonts/Manrope-VariableFont_wght.ttf") format("truetype");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Couleurs : voir css/theme.css */

  /* Typographie */
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-sm: 0.875rem;
  --fs-base: 1.0625rem;
  --fs-lg: 1.1875rem;
  --fs-h3: 1.125rem;
  --fs-h2: clamp(1.875rem, 1.35rem + 1.9vw, 2.75rem);
  --fs-h1: clamp(2.125rem, 1.4rem + 2.5vw, 3.25rem);

  /* Espacements et formes */
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(64px, 8vw, 112px);
  /* Rayons hiérarchisés : grands éléments arrondis, contrôles nets. */
  --r-xl: 32px;
  --r-lg: 20px;
  --r-md: 12px;
  --r-sm: 6px;
  --r-xs: 3px;

  /* Mouvement */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 200ms;

  interpolate-size: allow-keywords;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

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

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

img {
  height: auto;
}

a {
  color: inherit;
}

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

address {
  font-style: normal;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Focus clavier : anneau net, décalé, visible sur fond clair comme sombre. */
:focus-visible {
  outline: 3px solid var(--sea);
  outline-offset: 3px;
  border-radius: 4px;
}

.footer :focus-visible,
.topbar :focus-visible {
  outline-color: var(--sea-light);
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--night);
  color: var(--on-dark);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus-visible {
  transform: none;
}

/* Boutons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 44px;
  padding: 10px 20px;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  isolation: isolate;
  overflow: hidden;
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

/* Remplissage qui monte depuis le bas au survol. */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--btn-fill, transparent);
  transform: translateY(101%);
  transition: transform 250ms var(--ease);
}

.btn:hover::before {
  transform: none;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
  transition-duration: 80ms;
}

.btn--lg {
  min-height: 52px;
  padding: 14px 28px;
  font-size: 1.0625rem;
}

.btn--primary {
  --btn-fill: var(--red-dark);
  background: var(--red);
  color: var(--on-dark);
}

.btn--primary:hover {
  box-shadow: 0 6px 0 -2px var(--red-dark);
}

.btn--dark {
  --btn-fill: var(--btn-dark-fill);
  background: var(--btn-dark-bg);
  color: var(--on-dark);
}

.btn--dark:hover {
  box-shadow: 0 6px 0 -2px var(--sea);
}

.btn--ghost {
  --btn-fill: var(--ink);
  border-color: var(--ink);
  color: var(--ink);
}

.btn--ghost:hover {
  color: var(--bg);
}

.btn[disabled] {
  opacity: .6;
  cursor: progress;
  transform: none;
}

/* Liens : soulignement qui se dessine de gauche à droite. */
.link {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 250ms var(--ease), color var(--dur) var(--ease);
}

.link:hover,
.link:focus-visible {
  background-size: 100% 1.5px;
}

.link--light {
  color: var(--on-dark);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
  }

  .btn:hover,
  .btn:active {
    transform: none;
  }
}
