/* =========================================================
   OCTAV — base : remise à zéro, typographie, mise en page
   ========================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

img {
  height: auto;
}

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

button {
  cursor: pointer;
}

a,
button,
label,
input,
select,
textarea,
summary {
  touch-action: manipulation;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-3xl);
  font-weight: var(--fw-semibold);
}

h2 {
  font-size: var(--fs-2xl);
}

h3 {
  font-size: var(--fs-md);
  line-height: var(--lh-snug);
  letter-spacing: -0.01em;
}

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

p + p {
  margin-top: var(--space-4);
}

ul,
ol {
  margin: 0;
  padding: 0;
}

a {
  color: var(--teal);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--teal-ink);
}

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

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

::selection {
  background: var(--teal-soft);
  color: var(--navy);
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* ---------- Accessibilité ---------- */

.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;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  padding: var(--space-3) var(--space-5);
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-pill);
  font-weight: var(--fw-medium);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--space-3);
  color: #fff;
}

/* ---------- Mise en page ---------- */

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

.container--wide {
  max-width: calc(var(--container-wide) + 2 * var(--gutter));
}

.container--narrow {
  max-width: calc(48rem + 2 * var(--gutter));
}

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

.section--white {
  background: var(--bg-alt);
}

.section--tight {
  padding-block: calc(var(--section-y) * 0.6);
}

.section-head {
  max-width: 44rem;
  margin-bottom: var(--space-12);
}

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

.section-head p {
  margin-top: var(--space-4);
  font-size: var(--fs-md);
  color: var(--text-muted);
}

.eyebrow {
  display: inline-block;
  margin-bottom: var(--space-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
  color: var(--teal);
}

.lead {
  font-size: var(--fs-md);
  color: var(--text-muted);
}

.muted {
  color: var(--text-muted);
}

.small {
  font-size: var(--fs-sm);
}

.stack > * + * {
  margin-top: var(--space-4);
}

.grid {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 768px) {
  .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Apparition au défilement (sans JavaScript) ----------
   Utilise les animations liées au défilement quand le navigateur les connaît.
   Sinon, le contenu est simplement visible. */

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    [data-reveal] {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 40%;
    }
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

[hidden] {
  display: none !important;
}
