/* ==========================================================================
   Jedha AI School — base : reset, typographie, conteneurs, utilitaires
   Points de rupture : 1199 / 991 / 767 / 479 px (max-width)
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

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

img {
  height: auto;
}

a {
  color: var(--royal-blue--600);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

@media (hover: hover) {
  a:hover {
    color: var(--royal-blue--800);
  }
}

/* Liens en JS (data-href, voir initJsLinks dans main.js) */
[data-href] {
  cursor: pointer;
}

button {
  font: inherit;
  color: inherit;
}

/* Inter n'est hébergée qu'en 400, 500 et 600 : le gras utilise 600 pour éviter un faux gras */
strong,
b {
  font-weight: 600;
}

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* --- Typographie --- */
h1,
h2,
h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-heading);
  color: var(--grey--900);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-h1);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--text-h2);
}

h3 {
  font-size: var(--text-h3);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p {
  text-wrap: pretty;
}

/* Mot ou passage mis en avant en bleu dans un texte courant */
.text-accent {
  color: var(--royal-blue--600);
}

.text-size-large {
  font-size: var(--text-large);
  line-height: 1.5;
}

/* Le fond s'arrête à la hauteur de ligne : on le prolonge pour ne pas couper les descendantes (g, p…) */
.text-gradient {
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
  background: var(--gradient-signature);
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--royal-blue--600);
  -webkit-text-fill-color: transparent;
}

.eyebrow {
  display: block;
  margin-bottom: var(--space-m);
  font-family: var(--font-body);
  font-size: var(--text-eyebrow);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--royal-blue--600);
}

/* Surtitre en dégradé : la boîte épouse le texte pour que le dégradé s'étale sur les mots */
.eyebrow:not(:empty) {
  width: fit-content;
  max-width: 100%;
  background: var(--gradient-signature);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Emplacement d'eyebrow sans texte validé : invisible hors relecture */
.eyebrow:empty {
  display: none;
}

/* --- Conteneurs et sections --- */
.container {
  width: 100%;
  max-width: calc(var(--container-max) + 2 * var(--container-gutter));
  margin-inline: auto;
  padding-inline: var(--container-gutter);
}

.section {
  padding-block: var(--space-section);
}

.section--accent {
  background: var(--color-bg-accent);
}

.section__header {
  max-width: 760px;
  margin-bottom: var(--space-2xl);
}

.section__header--full {
  max-width: none;
}

.section__intro {
  max-width: 1040px;
  margin-top: var(--space-m);
  color: var(--grey--700);
}

.section__header--center {
  margin-inline: auto;
  text-align: center;
}

.section__header--center .section__intro {
  margin-inline: auto;
}

/* --- Utilitaires --- */
.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;
}

.skip-link {
  position: absolute;
  top: var(--space-s);
  left: var(--space-s);
  z-index: 200;
  padding: var(--space-s) var(--space-m);
  border-radius: var(--radius-s);
  background: var(--royal-blue--600);
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
  color: var(--white);
}

/* --- Apparition au défilement (activée par JS, désactivée si mouvement réduit) --- */
.js .reveal {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--duration) var(--ease-out), transform var(--duration) var(--ease-out);
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

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

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
