/*
 * Safari Parks — shared stylesheet of the public site (https://safari-parks.co/fr, /en, 404).
 * Design system (W02 preview): fonts, tokens, base, shared components (buttons, chips, eyebrows,
 * section heads, icons), header, footer and the 404 page. The homepage sections live in home.css,
 * loaded after this file by /fr and /en, and only use the tokens and classes defined here.
 *
 * Static, no JavaScript, no inline style: the CSP only allows the site's own stylesheets
 * (style-src 'self'), fonts and images (no data: URL, no remote url()). The pages link this file
 * with a ?v= content hash computed by tools/landing/build.mjs (browsers cache it a week).
 * Spacing on a 4 px grid; colours from the palette below only (W02, design/tokens).
 */

/* ── Fonts (latin subsets, variable weight axis only; licences next to the files) ───────────── */

@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Handwritten accent (W02 script lines). Downloaded only where an element uses it: those are
   hidden below 1024 px, so phones never fetch it. No preload on purpose. */
@font-face {
  font-family: 'Caveat';
  src: url('fonts/caveat-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ──────────────────────────────────────────────────────────────────────────────── */

:root {
  color-scheme: light;

  /* Palette (W02, design/tokens). Text contrast on ivory: charcoal 15.3, forest-900 12.6,
     muted 6.2, olive 4.6 (12 px semibold minimum). Gold and gold-300 never carry text on light
     backgrounds (2.4 and 1.8); on Forest 900: ivory 12.6, gold-300 7.1, moss 5.9, gold 5.2. */
  --c-forest-900: #26331f;
  --c-forest-700: #3e4a2d;
  --c-olive: #6c754b;
  --c-moss: #aab08d;
  --c-sand: #f2ebdd;
  --c-ivory: #fbf8f1;
  --c-gold: #c79a3b;
  --c-gold-300: #dab96e;
  --c-gold-700: #7a5c1c;
  --c-charcoal: #1f211d;
  --c-warm-gray: #8a877f;
  --c-muted: #5d5d58;
  --c-line: rgba(31, 33, 29, 0.08);
  --c-white: #fff;
  /* Sky of the hero photo measured in W02 (behind the header, behind the title): placeholder
     background while the photo loads, and the 404 sky. */
  --c-sky: #f4e7d6;
  --c-sky-warm: #fad29f;

  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans:
    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-script: 'Caveat', 'Fraunces', Georgia, serif;

  /* Type scale: h1 ≈ 37 px at 390, 56 px from 1280; h2 24 → 28. */
  --fs-h1: clamp(2.25rem, 1.6rem + 3vw, 3.5rem);
  --fs-h2: clamp(1.5rem, 1.3rem + 0.9vw, 1.75rem);
  --fs-h3: 1.0625rem;
  --fs-lead: 1.125rem;
  --fs-body: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.8125rem;
  --fs-eyebrow: 0.75rem;

  /* Spacing, 4 px base. */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  /* Layout: content 1376 px wide at 1440 (32 px gutters, W02), 16 px gutters on phones. */
  --container: 1376px;
  --gutter: clamp(16px, 2.5vw, 32px);
  --header-h: 64px;
  --section-gap: clamp(40px, 5vw, 56px);

  /* Light shadows only (W02 is nearly flat): float = an element laid on a photo. */
  --shadow-float: 0 12px 32px rgba(20, 22, 16, 0.22);
  --shadow-card: 0 1px 2px rgba(31, 33, 29, 0.06);
  /* Focus: 3 px light-gold ring (outline) around a 2 px Forest 900 ring (box-shadow in the
     outline offset), visible on ivory, on Forest 900 and on photos alike. */
  --focus-ring: 0 0 0 2px var(--c-forest-900);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (min-width: 1024px) {
  :root {
    --header-h: 80px;
  }
}

/* ── Base ────────────────────────────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  hyphens: manual;
  scroll-padding-top: var(--sp-6);
}

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

body {
  margin: 0;
  min-width: 320px;
  background: var(--c-ivory);
  color: var(--c-charcoal);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.55;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--c-charcoal);
  font-family: var(--font-serif);
  overflow-wrap: normal;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.025em;
}

h2 {
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* Card titles: two weights only, 700 on light backgrounds (here) and 600 on photos (set by the
   card, home.css) (QA F1-18). */
h3 {
  font-size: var(--fs-h3);
  font-weight: 700;
  line-height: 1.25;
}

h4 {
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: 1.3;
}

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

p,
li,
dt,
dd,
figcaption,
blockquote {
  text-wrap: pretty;
}

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

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

strong,
b {
  font-weight: 600;
}

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

svg {
  max-width: 100%;
}

summary {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:target {
  scroll-margin-top: var(--sp-6);
}

::selection {
  background: var(--c-gold-300);
  color: var(--c-charcoal);
}

:focus-visible {
  outline: 3px solid var(--c-gold-300);
  outline-offset: 2px;
  box-shadow: var(--focus-ring);
}

/* <main tabindex="-1"> is the skip link's target: focused so that the next Tab starts there, it
   is not a control and gets no ring around the whole page content. */
main[tabindex='-1']:focus {
  outline: none;
  box-shadow: none;
}

/* ── Utilities ───────────────────────────────────────────────────────────────────────────── */

.container {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  z-index: 100;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-pill);
  background: var(--c-forest-900);
  color: var(--c-ivory);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

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

/* Read by screen readers only. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Words that must stay on one line (French verbs with hyphens: "sera-t-elle"). */
.nowrap {
  white-space: nowrap;
}

/* Text helpers: lead paragraph (18/1.5) and meta line (13 px, muted, AA on ivory). */
.lead {
  font-size: var(--fs-lead);
  line-height: 1.5;
}

.meta {
  color: var(--c-muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 1.35;
}

/* ── Icons ───────────────────────────────────────────────────────────────────────────────── */

/* components/icons.mjs: 24×24 line icons in currentColor. Size: the width/height attributes
   (icon(name, { size })) unless a rule sets width/height, as below for buttons and circles. */
.icon {
  display: inline-block;
  flex: none;
  vertical-align: -0.2em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* White disc with a Forest glyph (hero quick actions, W01 cards, footer pillars). */
.icon-circle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--c-white);
  color: var(--c-forest-900);
}

.icon-circle .icon {
  width: 20px;
  height: 20px;
}

.icon-circle--forest {
  background: var(--c-forest-900);
  color: var(--c-ivory);
}

.icon-circle--sand {
  background: var(--c-sand);
  color: var(--c-forest-900);
}

/* Transparent with a light-gold ring, for Forest 900 surfaces (not focusable: a focusable element
   with its own box-shadow must restore box-shadow: var(--focus-ring) on :focus-visible). */
.icon-circle--outline {
  background: transparent;
  color: var(--c-gold-300);
  box-shadow: inset 0 0 0 1px rgba(218, 185, 110, 0.55);
}

.icon-circle--sm {
  width: 32px;
  height: 32px;
}

.icon-circle--sm .icon {
  width: 16px;
  height: 16px;
}

.icon-circle--lg {
  width: 48px;
  height: 48px;
}

.icon-circle--lg .icon {
  width: 24px;
  height: 24px;
}

/* ── Buttons (pills, 44 px high; one primary button per screen) ─────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: var(--sp-2) var(--sp-5);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  text-wrap: balance;
  cursor: pointer;
  transition:
    background-color 200ms var(--ease),
    border-color 200ms var(--ease),
    color 200ms var(--ease);
}

.btn .icon {
  width: 18px;
  height: 18px;
  transition: transform 200ms var(--ease);
}

.btn:hover .icon--arrow-right,
.btn:hover .icon--chevron-right {
  transform: translateX(2px);
}

.btn--primary {
  background: var(--c-forest-900);
  color: var(--c-ivory);
}

.btn--primary:hover {
  background: var(--c-forest-700);
}

.btn--secondary {
  border-color: var(--c-forest-900);
  background: transparent;
  color: var(--c-forest-900);
}

.btn--secondary:hover {
  background: rgba(38, 51, 31, 0.06);
}

.btn--light {
  background: var(--c-ivory);
  color: var(--c-forest-900);
}

.btn--light:hover {
  background: var(--c-white);
}

.btn--gold {
  background: var(--c-gold-300);
  color: var(--c-charcoal);
}

.btn--gold:hover {
  background: var(--c-gold);
}

.btn--lg {
  min-height: 48px;
  padding-inline: var(--sp-6);
  font-size: var(--fs-body);
}

.btn--block {
  display: flex;
  width: 100%;
}

/* ── Chips (status labels: 24 px pills, 12 px semibold) ─────────────────────────────────────── */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: 24px;
  padding: var(--sp-1) var(--sp-3);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--c-sand);
  color: var(--c-forest-900);
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.chip .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

/* "Aperçu · données d'exemple": dashed outline, never mistaken for live data. */
.chip--demo {
  border-color: rgba(31, 33, 29, 0.28);
  border-style: dashed;
  background: transparent;
  color: var(--c-muted);
}

/* "Prévu au lancement", "Envisagé", "En développement…". */
.chip--status {
  background: var(--c-sand);
  color: var(--c-forest-900);
}

/* On a photo: "Image générée par IA" (dark translucent plate, no blur). */
.chip--ai {
  background: rgba(20, 22, 16, 0.64);
  color: var(--c-ivory);
  font-weight: 500;
}

/* "Espèce sensible": approximate area only. */
.chip--sensitive {
  background: rgba(199, 154, 59, 0.16);
  color: var(--c-gold-700);
}

/* "Position protégée": never located. */
.chip--protected {
  background: var(--c-forest-900);
  color: var(--c-ivory);
}

/* ── Eyebrows, section heads, links ────────────────────────────────────────────────────────── */

/* Category label: Inter 600, 12 px capitals, olive (4.6:1 on ivory; on sand use
   color: var(--c-forest-700)). */
.eyebrow {
  display: block;
  margin: 0;
  color: var(--c-olive);
  font-family: var(--font-sans);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Editorial eyebrow / tagline (W02 hero bottom-left, W03 "AFRIQUE DU SUD", footer tagline):
   Fraunces 500 capitals, wide tracking, colour of the context. */
.eyebrow--serif {
  color: inherit;
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.24em;
}

/* Gold rule 32×3 under the eyebrow. */
.eyebrow--rule::after {
  content: '';
  display: block;
  width: 32px;
  height: 3px;
  margin-top: var(--sp-3);
  border-radius: 2px;
  background: var(--c-gold);
}

/* Title row of a section or module: H2 on the left, link or meta on the right. */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1) var(--sp-6);
  margin-bottom: var(--sp-4);
}

.section-title {
  margin: 0;
  color: var(--c-charcoal);
  font-family: var(--font-serif);
  font-size: var(--fs-h2);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* "Voir tous… →": arrow as an SVG icon (the font subsets have no U+2192). */
.link-more {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: 44px;
  color: var(--c-charcoal);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
}

.link-more .icon {
  width: 16px;
  height: 16px;
  transition: transform 200ms var(--ease);
}

.link-more:hover {
  text-decoration: underline;
  text-decoration-color: var(--c-gold);
  text-underline-offset: 4px;
}

.link-more:hover .icon {
  transform: translateX(2px);
}

/* Dark surface (Forest 900) context: text, eyebrows, links, outline buttons and demo chips
   switch to their light versions. */
.on-dark {
  color: var(--c-ivory);
}

.on-dark :is(h1, h2, h3, h4, .section-title, .link-more) {
  color: var(--c-ivory);
}

.on-dark .eyebrow {
  color: var(--c-gold-300);
}

.on-dark .eyebrow--serif {
  color: var(--c-ivory);
}

.on-dark .meta {
  color: var(--c-moss);
}

.on-dark .btn--secondary {
  border-color: rgba(251, 248, 241, 0.6);
  color: var(--c-ivory);
}

.on-dark .btn--secondary:hover {
  border-color: var(--c-ivory);
  background: rgba(251, 248, 241, 0.08);
}

.on-dark .chip--demo {
  border-color: rgba(251, 248, 241, 0.4);
  color: var(--c-moss);
}

/* ── Logo ────────────────────────────────────────────────────────────────────────────────── */

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  color: var(--c-charcoal);
  text-decoration: none;
}

.brand__mark {
  display: block;
  flex: none;
  width: 36px;
  height: 23px;
  color: var(--c-forest-900);
}

.brand__text {
  display: flex;
  flex-direction: column;
}

.brand__name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand__tagline {
  display: none;
  margin-top: var(--sp-2);
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand--light {
  color: var(--c-ivory);
}

.brand--light .brand__mark {
  color: var(--c-ivory);
}

.brand--light .brand__tagline {
  color: var(--c-gold-300);
}

.brand--stacked {
  flex-direction: column;
  gap: var(--sp-2);
  text-align: center;
}

.brand--stacked .brand__mark {
  width: 64px;
  height: 40px;
}

.brand--stacked .brand__text {
  align-items: center;
}

.brand--stacked .brand__name {
  font-size: 1.5rem;
}

.brand--stacked .brand__tagline {
  display: block;
  letter-spacing: 0.24em;
}

/* ── Header ──────────────────────────────────────────────────────────────────────────────── */

.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--c-line);
  background: var(--c-ivory);
  color: var(--c-charcoal);
}

/* Over the hero photo (homepage): the hero starts at the top of the page and keeps its text
   clear of the first --header-h px. A light veil keeps charcoal text legible on any sky. */
.site-header--overlay,
.site-header--minimal {
  position: absolute;
  inset: 0 0 auto;
  border-bottom: 0;
  background: transparent;
}

.site-header--overlay::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: calc(100% + var(--sp-10));
  background: linear-gradient(180deg, rgba(251, 248, 241, 0.5), rgba(251, 248, 241, 0));
  pointer-events: none;
}

/* Soft ivory halo around the logo laid on the photo: invisible on the sky, it lifts the letters
   off darker leaves. */
.site-header--overlay .brand__text {
  text-shadow:
    0 0 2px rgba(251, 248, 241, 0.7),
    0 0 10px rgba(251, 248, 241, 0.9);
}

/* The navigation sits on a light plate, like the language switch: its right-hand links fall on the
   branches of the hero photo at most widths (QA F1-15, F2-13: 1.8:1 without it). No blur. */
.site-header--overlay .site-nav__list {
  padding-inline: var(--sp-2);
  border-radius: var(--r-pill);
  background: rgba(251, 248, 241, 0.78);
  box-shadow: inset 0 0 0 1px rgba(31, 33, 29, 0.08);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: var(--header-h);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* When the row is short of room (320 px with WCAG 1.4.12 text spacing, QA F2R-02), the logo's name
   wraps onto two lines (still within --header-h) rather than push the menu off the screen. */
.site-header .brand {
  min-width: 0;
}

.site-header .brand__name {
  white-space: normal;
}

.site-nav,
.site-header__cta {
  display: none;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--sp-3);
  background-image: linear-gradient(var(--c-gold), var(--c-gold));
  background-position: center calc(100% - 6px);
  background-repeat: no-repeat;
  background-size: 0 2px;
  color: var(--c-charcoal);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-size 250ms var(--ease);
}

.site-nav__link:hover {
  background-size: calc(100% - 2 * var(--sp-3)) 2px;
}

/* Language switch and menu button: light plates, legible on a bright sky as on dark leaves. */
.lang-link,
.nav-menu__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--r-pill);
  background: rgba(251, 248, 241, 0.86);
  box-shadow: inset 0 0 0 1px rgba(31, 33, 29, 0.12);
  color: var(--c-charcoal);
  transition:
    background-color 200ms var(--ease),
    color 200ms var(--ease);
}

.lang-link {
  gap: var(--sp-1);
  padding-inline: var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.lang-link:hover,
.nav-menu__toggle:hover {
  background: var(--c-white);
}

.lang-link:focus-visible,
.nav-menu__toggle:focus-visible {
  box-shadow: var(--focus-ring);
}

.lang-link .icon {
  width: 18px;
  height: 18px;
}

/* Menu below 1024 px: native <details>, closed by default. */
.nav-menu__toggle {
  width: 44px;
  height: 44px;
  list-style: none;
}

.nav-menu__toggle::-webkit-details-marker {
  display: none;
}

.nav-menu__toggle::marker {
  content: '';
}

.nav-menu__toggle .icon {
  width: 22px;
  height: 22px;
}

.nav-menu__icon-close,
.nav-menu[open] .nav-menu__icon-open {
  display: none;
}

.nav-menu[open] .nav-menu__icon-close {
  display: inline-block;
}

.nav-menu[open] .nav-menu__toggle {
  background: var(--c-forest-900);
  box-shadow: none;
  color: var(--c-ivory);
}

/* Positioned against the header: full width on phones, a 384 px card from 768 px. */
.nav-menu__panel {
  position: absolute;
  top: calc(100% - var(--sp-1));
  right: var(--gutter);
  left: var(--gutter);
  z-index: 30;
  max-width: 384px;
  margin-left: auto;
  padding: var(--sp-2) var(--sp-4) var(--sp-4);
  border-radius: var(--r-md);
  background: var(--c-ivory);
  box-shadow: var(--shadow-float);
}

.nav-menu__list li + li {
  border-top: 1px solid var(--c-line);
}

.nav-menu__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  min-height: 52px;
  padding-block: var(--sp-2);
  color: var(--c-charcoal);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.nav-menu__link .icon {
  color: var(--c-olive);
}

.nav-menu__link:hover span {
  text-decoration: underline;
  text-decoration-color: var(--c-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.nav-menu__cta {
  margin-top: var(--sp-3);
}

@media (max-width: 359px) {
  .site-header__inner {
    gap: var(--sp-2);
  }

  .brand__name {
    font-size: 1.125rem;
  }
}

/* 1024–1179 px: logo · language · CTA · menu (the five links, CTA hidden in the panel). */
@media (min-width: 1024px) {
  .site-header .brand__mark {
    width: 44px;
    height: 28px;
  }

  .site-header .brand__name {
    font-size: 1.375rem;
  }

  .site-header__actions {
    gap: var(--sp-3);
  }

  .site-header__cta {
    display: inline-flex;
  }

  .nav-menu__cta {
    display: none;
  }
}

/* From 1180 px: logo · navigation centred · language and CTA. Below, the links did not fit once
   WCAG 1.4.12 text spacing is applied (QA F2-05: the CTA ended at x = 1129 on a 1024 px screen).
   The middle column may shrink to its widest link (the list wraps) rather than overflow. */
@media (min-width: 1180px) {
  .site-header__inner {
    display: grid;
    grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
    column-gap: var(--sp-6);
  }

  .site-nav {
    display: block;
  }

  .site-header__actions {
    justify-self: end;
  }

  .nav-menu {
    display: none;
  }
}

@media (min-width: 1280px) {
  .site-header .brand {
    gap: var(--sp-3);
  }

  .site-header .brand__name {
    font-size: 1.5rem;
  }

  .site-header .brand__tagline {
    display: block;
  }

  .site-nav__list {
    gap: var(--sp-2);
  }
}

/* ── Footer ──────────────────────────────────────────────────────────────────────────────── */

/* Layouts of the band (Forest 900):
     < 768      compact: logo | tagline (tagline under the logo below 380 px) · the three pillars
                in a row · app line (≈ 465 px with the bar at 390; mission and handwritten line
                hidden)
     768–1023   logo and mission | tagline · pillars between hairlines · app line
     1024–1279  logo | handwritten line | pillars · app line … tagline
     ≥ 1280     logo | handwritten line | pillars | app above tagline (one row, W02) */

.site-footer {
  color: var(--c-ivory);
}

.site-footer__band {
  background: var(--c-forest-900);
}

.site-footer__band-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'brand tagline'
    'pillars pillars'
    'app app';
  align-items: center;
  gap: var(--sp-6) var(--sp-4);
  padding-block: var(--sp-8);
}

.site-footer__brand {
  display: grid;
  grid-area: brand;
  justify-items: start;
  gap: var(--sp-4);
}

.site-footer__mission {
  display: none;
  max-width: 34em;
  color: var(--c-moss);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

/* Handwritten line with a gold stroke (W02), shown from 1024 px. */
.site-footer__script {
  display: none;
  grid-area: script;
  position: relative;
  width: max-content;
  max-width: 7.5em;
  padding-bottom: var(--sp-3);
  color: var(--c-ivory);
  font-family: var(--font-script);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.05;
  transform: rotate(-6deg);
}

.site-footer__swash {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 75%;
  height: auto;
  color: var(--c-gold);
}

.site-footer__pillars {
  display: grid;
  grid-area: pillars;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-3);
}

.site-footer__pillar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.site-footer__pillar-text,
.site-footer__app-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--fs-xs);
  line-height: 1.35;
}

.site-footer__pillar-title,
.site-footer__app-title {
  color: var(--c-ivory);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.site-footer__pillar-sub,
.site-footer__app-sub {
  color: var(--c-moss);
  text-wrap: balance;
}

.site-footer__app {
  display: flex;
  grid-area: app;
  align-items: center;
  gap: var(--sp-3);
}

.site-footer__app-title {
  font-size: var(--fs-body);
}

/* Tagline with a gold rule (W02 "DES PASSIONNÉS…" block), on two lines, after a hairline. */
.site-footer__tagline {
  grid-area: tagline;
  max-width: calc(10em + var(--sp-4) + 1px);
  padding-left: var(--sp-4);
  border-left: 1px solid rgba(251, 248, 241, 0.2);
  color: var(--c-ivory);
  font-family: var(--font-serif);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-wrap: balance;
}

.site-footer__tagline::after {
  content: '';
  display: block;
  width: 32px;
  height: 3px;
  margin-top: var(--sp-2);
  border-radius: 2px;
  background: var(--c-gold);
}

/* Phones: logo beside its name. The first row is a wrapping flex row (QA F2R-02): the tagline sits
   at the end of the logo's row while both fit, and passes under the logo when they do not (below
   380 px always; up to ≈ 412 px with WCAG 1.4.12 text spacing). The hairline is drawn in the gap,
   one gutter left of the tagline: when the tagline starts a line, it falls past the screen's edge
   (the band clips it). Pillars wrap too rather than overlap (two, then one) when their unbreakable
   sub-lines no longer fit three abreast (320 px with text spacing). */
@media (max-width: 767px) {
  .site-footer__band {
    overflow-x: clip;
  }

  .site-footer__band-inner {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2) var(--sp-8);
  }

  .site-footer__brand {
    flex: 1 0 auto;
  }

  .site-footer__tagline {
    position: relative;
    flex: none;
    max-width: 10em;
    padding-left: 0;
    border-left: 0;
  }

  .site-footer__tagline::before {
    content: '';
    position: absolute;
    inset-block: 0;
    left: calc(-1 * var(--gutter) - 1px);
    width: 1px;
    background: rgba(251, 248, 241, 0.2);
  }

  /* After the tagline (last in the markup, nothing focusable in it). */
  .site-footer__pillars,
  .site-footer__app {
    flex: 1 1 100%;
    order: 1;
    margin-top: var(--sp-4);
  }

  .site-footer__pillars {
    display: flex;
    flex-wrap: wrap;
  }

  .site-footer__pillar {
    flex: 1 1 0;
  }

  .site-footer .brand--stacked {
    flex-direction: row;
    gap: var(--sp-3);
    text-align: left;
  }

  .site-footer .brand--stacked .brand__mark {
    width: 44px;
    height: 28px;
  }

  .site-footer .brand--stacked .brand__name {
    font-size: 1.375rem;
  }

  .site-footer__pillar-text {
    font-size: 0.75rem;
  }
}

/* Below 380 px, the tagline always passes under the logo, on one line (the hairline is clipped). */
@media (max-width: 379px) {
  .site-footer__brand {
    flex-basis: 100%;
  }

  .site-footer__tagline {
    max-width: none;
  }
}

/* Where the three pillars share a narrow space (phones, and the 1024–1439 px rows beside the logo
   and the handwritten line), each is a short column, icon above the words: no lonely last word
   (QA F1-11). Icon beside the words where they have room (768–1023 px, from 1440 px). */
@media (max-width: 767px), (min-width: 1024px) and (max-width: 1439px) {
  .site-footer__pillar {
    flex-direction: column;
    gap: var(--sp-2);
    text-align: center;
  }

  .site-footer__pillar .icon-circle {
    width: 36px;
    height: 36px;
  }

  .site-footer__pillar-text {
    align-items: center;
  }
}

/* Bar, Charcoal. Phones: page links | languages (stacked below 600 px), then © and the AI notice. */
.site-footer__bar {
  background: var(--c-charcoal);
  color: rgba(251, 248, 241, 0.72);
  font-size: var(--fs-xs);
  line-height: 1.35;
}

.site-footer__bar-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    'nav langs'
    'legal legal';
  align-items: start;
  column-gap: var(--sp-4);
  padding-block: var(--sp-2);
}

.site-footer__nav {
  grid-area: nav;
}

.site-footer__langs {
  grid-area: langs;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-inline: calc(-1 * var(--sp-3));
}

.site-footer__langs .site-footer__links {
  flex-direction: column;
  align-items: flex-end;
}

.site-footer__links li {
  display: flex;
  align-items: center;
}

.site-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--sp-3);
  color: var(--c-ivory);
  text-decoration: none;
}

.site-footer__links a:hover {
  text-decoration: underline;
  text-decoration-color: var(--c-gold-300);
}

.site-footer__links a[aria-current='page'] {
  color: var(--c-gold-300);
  font-weight: 600;
}

.site-footer__legal {
  display: flex;
  grid-area: legal;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-1) var(--sp-6);
  min-height: 44px;
}

.site-footer__ai {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

.site-footer__ai .icon {
  color: var(--c-gold-300);
}

/* From 600 px the two languages fit side by side at the end of the links' row (QA F1-42). */
@media (min-width: 600px) {
  .site-footer__langs .site-footer__links {
    flex-direction: row;
  }
}

@media (min-width: 768px) {
  .site-footer__band-inner {
    gap: var(--sp-8) var(--sp-12);
    padding-block: var(--sp-10);
  }

  .site-footer__mission {
    display: block;
  }

  .site-footer__pillars {
    gap: var(--sp-4);
    padding-block: var(--sp-6);
    border-block: 1px solid rgba(251, 248, 241, 0.12);
  }

  .site-footer__tagline {
    max-width: calc(10em + var(--sp-6) + 1px);
    padding-left: var(--sp-6);
  }

  .site-footer__bar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0 var(--sp-8);
    padding-block: var(--sp-3);
  }

  /* W02 separators between links (one line from here: a wrapped line would start with one). */
  .site-footer__links li + li::before {
    content: '';
    width: 1px;
    height: 12px;
    background: rgba(251, 248, 241, 0.24);
  }
}

/* From 1024 px: the pillars move up beside the logo and the handwritten line (QA F1-24: no empty
   stretch in the first row); the app line and the tagline close the band. */
@media (min-width: 1024px) {
  .site-footer__band-inner {
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas:
      'brand script pillars'
      'app app tagline';
    gap: var(--sp-6) var(--sp-8);
    padding-block: var(--sp-8);
  }

  .site-footer__mission {
    display: none;
  }

  .site-footer__script {
    display: block;
  }

  .site-footer__pillars {
    padding-block: 0;
    border-block: 0;
  }

  /* Second row under a full-width hairline: the app line spans it, the tagline sits at its end. */
  .site-footer__app {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: var(--sp-6);
    border-top: 1px solid rgba(251, 248, 241, 0.12);
  }

  .site-footer__tagline {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
    margin-top: calc(var(--sp-6) + 1px);
  }

  .site-footer__bar-inner {
    padding-block: var(--sp-1);
  }
}

/* From 1280 px: one row, the app line above the tagline in the last column (W02). */
@media (min-width: 1280px) {
  .site-footer__band-inner {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    grid-template-areas:
      'brand script pillars app'
      'brand script pillars tagline';
    gap: 0 var(--sp-8);
    padding-block: var(--sp-6);
  }

  .site-footer__pillars {
    gap: var(--sp-4);
  }

  .site-footer__pillar .icon-circle {
    width: 36px;
    height: 36px;
  }

  /* App line and tagline share the hairline on their left. */
  .site-footer__app,
  .site-footer__tagline {
    grid-area: auto;
    justify-self: start;
    padding-left: var(--sp-6);
    border-left: 1px solid rgba(251, 248, 241, 0.2);
  }

  .site-footer__app {
    grid-area: app;
    align-self: end;
    padding-top: 0;
    padding-bottom: var(--sp-3);
    border-top: 0;
  }

  .site-footer__tagline {
    grid-area: tagline;
    align-self: start;
    margin-top: 0;
    padding-top: var(--sp-3);
  }
}

/* 1280–1439 px: the app sub-line wraps under its title rather than widening the last column, so
   that the pillars keep their room. */
@media (min-width: 1280px) and (max-width: 1439px) {
  .site-footer__app-text {
    max-width: 13rem;
  }

  .site-footer__app-sub {
    text-wrap: pretty;
  }
}

/* ── 404 ─────────────────────────────────────────────────────────────────────────────────── */

/* The sky of the hero, then a band of the elephants panorama fading into it, in a column at least
   as tall as the screen. The band takes the room left under the texts (QA F1-41: no scrolling for
   nothing at 1280 × 720 or 1366 × 768), from 176 px up to its own height; the texts are centred in
   any room beyond, so a phone shows no empty stretch. */
.not-found {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: var(--header-h);
  background: linear-gradient(180deg, var(--c-ivory) 0%, var(--c-sky) 45%, var(--c-sky-warm) 100%);
}

.not-found__inner {
  display: grid;
  justify-items: center;
  max-width: 720px;
  margin-block: auto;
  padding-block: var(--sp-8) var(--sp-10);
  text-align: center;
}

.not-found__code {
  color: var(--c-forest-700);
}

.not-found__title {
  margin-top: var(--sp-4);
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
  line-height: 1.04;
}

.not-found__line {
  display: block;
  text-wrap: balance;
}

.not-found__line--en {
  margin-top: var(--sp-3);
  color: var(--c-forest-700);
  font-size: 0.6em;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.not-found__text {
  margin-top: var(--sp-5);
  font-size: var(--fs-lead);
  line-height: 1.5;
}

.not-found__text [lang='en'] {
  color: var(--c-forest-700);
}

.not-found__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-3);
  margin-top: var(--sp-8);
}

/* Decorative photo band: the panorama (6:1) covers it, its sky fades into the page's. Its height
   is at most clamp(176px, 26vw, 360px), which the sizes attribute of the <img>
   (components/not-found.mjs) follows, and at least 176 px. Overflow clip, not hidden: the band
   must not be a scroll container, for the notice to stick to the screen. */
.not-found__band {
  display: flex;
  position: relative;
  flex: 1 0 176px;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  max-height: clamp(176px, 26vw, 360px);
  overflow: clip;
}

/* The panorama is AI-generated: a notice in its bottom corner, like the hero's (QA F1-32; the 404
   has no footer). Sticky: when the band goes on below the screen (360 × 640, 320 × 568), the notice
   stays at the bottom of the screen, on the part of the band in view (QA F1-41). Ivory on the
   chip's dark plate: ≥ 5:1 whatever the photo or sky underneath. Inline text, so that the English
   half passes under the French one rather than overflow (320 px with WCAG 1.4.12 text spacing). */
.not-found__ai {
  display: block;
  position: sticky;
  bottom: var(--sp-3);
  max-width: calc(100% - 2 * var(--gutter));
  margin: 0 var(--gutter) var(--sp-3);
  text-align: right;
  white-space: normal;
}

/* The fade stays within the strip of sky above the elephants' heads (top 14 % of the image). */
.not-found__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 50%;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 14%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 14%);
}

/* Phone in a short screen (320 × 568, or browser bars shown): tighter spacing and a title on two
   lines at 320 px, so that the band and its notice start within the first screen (QA F1-41). */
@media (max-width: 599px) and (max-height: 600px) {
  .not-found__inner {
    padding-block: var(--sp-4) var(--sp-6);
  }

  .not-found__title {
    font-size: 1.75rem;
  }

  .not-found__actions {
    margin-top: var(--sp-6);
  }
}

/* ── Motion and forced colours ─────────────────────────────────────────────────────────────── */

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

@media (forced-colors: active) {
  .btn,
  .chip,
  .lang-link,
  .nav-menu__toggle,
  .icon-circle {
    border: 1px solid CanvasText;
  }

  .site-header--overlay::before {
    display: none;
  }

  :focus-visible {
    outline-color: Highlight;
  }
}
