/* Ekleya, base commune : polices, réinitialisation, typographie, grille, en-tête, focus. */

@font-face {
  font-family: "Newsreader";
  src: url("../assets/fonts/newsreader-roman.woff2") format("woff2");
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Newsreader";
  src: url("../assets/fonts/newsreader-italique.woff2") format("woff2");
  font-weight: 300 500;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Host Grotesk";
  src: url("../assets/fonts/host-grotesk.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

/* Replis ajustés pour limiter le décalage pendant le chargement des polices. */
@font-face {
  font-family: "Newsreader repli";
  src: local("Georgia");
  size-adjust: 96%;
  ascent-override: 92%;
  descent-override: 26%;
}

@font-face {
  font-family: "Host Grotesk repli";
  src: local("Arial");
  size-adjust: 99%;
  ascent-override: 98%;
  descent-override: 30%;
}

/* Réinitialisation */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--h-entete);
  background: var(--fond);
  color: var(--texte);
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--fond);
  font-family: var(--serif);
  font-size: var(--t-texte);
  font-variation-settings: "opsz" 16;
  line-height: 1.55;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

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

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

img {
  height: auto;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

::selection {
  background: var(--encre);
  color: var(--blanc);
}

/* Typographie */

h1,
h2,
h3 {
  color: var(--encre);
  font-weight: 300;
  text-wrap: balance;
  hyphens: manual;
}

p {
  text-wrap: pretty;
}

.t-ouverture {
  font-size: var(--t-ouverture);
  font-variation-settings: "opsz" 72;
  font-weight: 300;
  line-height: .92;
  letter-spacing: -0.028em;
}

.t-titre {
  font-size: var(--t-titre);
  font-variation-settings: "opsz" 72;
  font-weight: 300;
  line-height: .9;
  letter-spacing: -0.04em;
}

/* Italique d’insistance : un segment par titre au plus. */
.t-titre em,
.t-constat em {
  font-style: italic;
  font-weight: 300;
  letter-spacing: -0.02em;
}

.t-constat {
  font-size: var(--t-constat);
  font-variation-settings: "opsz" 48;
  font-weight: 340;
  line-height: 1.14;
  letter-spacing: -0.012em;
}

/* v2 : les chiffres passent en grotesque, pour qu’elle soit réellement visible face à la serif. */
.t-chiffre {
  font-family: var(--grotesque);
  font-size: var(--t-chiffre);
  font-weight: 400;
  line-height: .8;
  letter-spacing: -0.065em;
}

.t-label {
  font-family: var(--grotesque);
  font-size: var(--t-micro);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.t-grand {
  font-size: var(--t-grand);
  font-variation-settings: "opsz" 28;
  font-weight: 380;
  line-height: 1.36;
}

.t-texte {
  font-size: var(--t-texte);
  font-variation-settings: "opsz" 16;
  font-weight: 400;
  line-height: 1.55;
  max-width: var(--mesure);
}

.t-petit {
  font-family: var(--grotesque);
  font-size: var(--t-petit);
  font-weight: 400;
  line-height: 1.45;
}

.t-micro {
  font-family: var(--grotesque);
  font-size: var(--t-micro);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

/* Liens */

/* v2 : plus aucun lien bleu. Les liens prennent la couleur du lien d’action de l’en-tête. */
a {
  color: var(--encre);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
}

a:hover {
  color: var(--encre);
  text-decoration-thickness: 2px;
}

/* Thème nuit : sections sombres (data-theme="nuit"). */
[data-theme="nuit"] {
  background: var(--nuit);
  color: var(--nuit-texte);
}

[data-theme="nuit"] h2,
[data-theme="nuit"] h3 {
  color: var(--nuit-titre);
}

[data-theme="nuit"] a {
  color: var(--nuit-titre);
}

[data-theme="nuit"] :focus-visible {
  outline-color: var(--nuit-titre);
}

/* Le CTA construit : un filet de 1 px qui se remplit vers le haut au survol et forme un bloc plein.
   Pas de pilule, pas de fond bleu. */
.cta {
  --cta-plein: var(--encre);
  --cta-creux: var(--fond);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.25em 3em;
  flex-wrap: wrap;
  min-width: min(100%, 28rem);
  padding: .85em .75em .8em;
  color: var(--cta-plein);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  transition: color .5s var(--courbe-cta);
}

.cta::before {
  content: "";
  position: absolute;
  inset: 0 0 -1px;
  z-index: -1;
  background: var(--cta-plein);
  transform: scaleY(0);
  transform-origin: 50% 100%;
  transition: transform .5s var(--courbe-cta);
}

.cta:hover,
.cta:focus-visible {
  color: var(--cta-creux);
}

.cta:hover::before,
.cta:focus-visible::before {
  transform: scaleY(1);
}

[data-theme="nuit"] .cta {
  --cta-plein: var(--nuit-titre);
  --cta-creux: var(--nuit);
}

.cta__texte {
  font-family: var(--serif);
  font-size: var(--t-grand);
  font-variation-settings: "opsz" 28;
  font-weight: 380;
  line-height: 1.2;
}

.cta__signe {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-family: var(--grotesque);
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.cta__fleche {
  width: 1.15em;
  height: 1.15em;
  transition: transform .5s var(--courbe-cta);
}

.cta:hover .cta__fleche,
.cta:focus-visible .cta__fleche {
  transform: translate(2px, -2px);
}

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

:focus:not(:focus-visible) {
  outline: none;
}

/* Utilitaires */

.visuellement-cache {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.lien-evitement {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: var(--encre);
  color: var(--blanc);
  font-family: var(--grotesque);
  font-size: var(--t-petit);
  text-decoration: none;
  transform: translateY(-200%);
}

.lien-evitement:focus-visible {
  transform: none;
  color: var(--blanc);
}

.contenu {
  width: 100%;
  max-width: calc(var(--largeur-max) + 2 * var(--marge));
  margin-inline: auto;
  padding-inline: var(--marge);
}

.grille {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gouttiere);
}

/* En-tête */

.entete {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--h-entete);
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
  padding-inline: var(--marge);
  border-bottom: 1px solid transparent;
  transition: background-color .3s ease, border-color .3s ease;
}

.entete.est-defile {
  background: var(--fond);
  border-bottom-color: var(--filet);
}

/* Zone tactile : 44 px de haut sans déplacer la lettre (le retrait compense le rembourrage). */
.mot-symbole {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-block: -9px;
  font-family: var(--serif);
  font-size: 1.625rem;
  font-variation-settings: "opsz" 72;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--encre);
  text-decoration: none;
}

.mot-symbole:hover {
  color: var(--encre);
}

.entete__nav {
  margin-inline-start: auto;
}

.entete__liste {
  display: flex;
  gap: clamp(18px, 2.4vw, 36px);
}

.entete__lien {
  font-family: var(--grotesque);
  font-size: var(--t-petit);
  color: var(--texte);
  text-decoration: none;
}

.entete__lien:hover {
  color: var(--encre);
}

.entete__lien.est-actif {
  color: var(--encre);
  text-decoration-line: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
}

/* En-tête au-dessus d’une section nuit (classe posée par js/main.js). */
.entete.est-sur-nuit {
  color: var(--nuit-titre);
}

.entete.est-sur-nuit.est-defile {
  background: var(--nuit);
  border-bottom-color: var(--nuit-filet);
}

.entete.est-sur-nuit .mot-symbole,
.entete.est-sur-nuit .entete__action,
.entete.est-sur-nuit .entete__lien.est-actif {
  color: var(--nuit-titre);
  text-decoration-color: currentColor;
}

.entete.est-sur-nuit .entete__lien {
  color: var(--nuit-texte);
}

.entete.est-sur-nuit :focus-visible {
  outline-color: var(--nuit-titre);
}

.entete__action {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-block: -12px;
  font-family: var(--grotesque);
  font-size: var(--t-petit);
  font-weight: 500;
  color: var(--encre);
  text-decoration-color: var(--encre);
}

.entete__action:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.entete__action-court {
  display: none;
}

@media (max-width: 719.98px) {
  .entete__nav {
    display: none;
  }

  .entete__action {
    margin-inline-start: auto;
  }

  .entete__action-long {
    display: none;
  }

  .entete__action-court {
    display: inline;
  }
}

/* Mouvement réduit : rien ne transite, rien ne défile tout seul. */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

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