*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
}
img, svg, video { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 0.25em; }
a:hover, a:focus-visible { color: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--navy); padding: 0.5rem 1rem; z-index: 100; }
.skip-link:focus { left: 0; }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-m);
  padding: var(--space-s) var(--gutter);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-logo { font-size: 1.25rem; letter-spacing: 0.04em; text-decoration: none; color: var(--accent); line-height: 1.1; }
.site-logo small { display: block; font-size: 0.7rem; letter-spacing: var(--tracking-label); color: var(--text-muted); }
.site-nav ul { display: flex; flex-wrap: wrap; gap: var(--space-m); margin: 0; padding: 0; list-style: none; }
.site-nav a { text-decoration: none; color: var(--text); font-size: var(--fs-small); letter-spacing: var(--tracking-label); text-transform: lowercase; }
.site-nav a[aria-current="page"], .site-nav a:hover { color: var(--accent); }
.site-nav .lang { border: 1px solid var(--line); padding: 0.1rem 0.6rem; }
.nav-toggle { display: none; }

@media (max-width: 52rem) {
  .nav-toggle { display: block; background: none; border: 1px solid var(--line); color: var(--text); padding: 0.4rem 0.8rem; font: inherit; }
  .site-nav { position: absolute; inset: 100% 0 auto 0; background: var(--bg); border-bottom: 1px solid var(--line); display: none; padding: var(--space-m) var(--gutter); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
}

/* ---------- Sections ---------- */
.section { padding: var(--space-xl) var(--gutter); }
.section--alt { background: var(--bg-alt); }
.wrap { max-width: var(--max-width); margin-inline: auto; }
.measure { max-width: var(--measure); }
.label { font-size: var(--fs-small); letter-spacing: var(--tracking-label); color: var(--accent); margin: 0 0 var(--space-s); }
h1, h2, h3 { font-weight: 400; line-height: 1.1; margin: 0 0 var(--space-m); }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

.hero { min-height: 82vh; display: grid; align-content: center; }
.hero .byline { color: var(--text-muted); letter-spacing: var(--tracking-label); font-size: var(--fs-small); }
.hero .lede { font-size: var(--fs-h3); max-width: 34rem; color: var(--accent-soft); }

/* ---------- Cartes de contes ---------- */
.tales { display: grid; gap: var(--space-m); grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.tale { border: 1px solid var(--line); padding: var(--space-m); display: flex; flex-direction: column; gap: var(--space-s); }
.tale h3 { margin: 0; color: var(--accent); }
.tale p { margin: 0; }
.tale .more { margin-top: auto; }

.btn { display: inline-block; border: 1px solid var(--accent); padding: 0.6rem 1.4rem; text-decoration: none; letter-spacing: var(--tracking-label); font-size: var(--fs-small); }
.btn:hover { background: var(--accent); color: var(--navy); }

.site-footer { padding: var(--space-l) var(--gutter); border-top: 1px solid var(--line); color: var(--text-muted); font-size: var(--fs-small); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: var(--space-m); justify-content: space-between; }

/* ---------- Révélation de texte ---------- */
.js [data-reveal] .w { display: inline-block; opacity: 0; transform: translateY(0.5em); filter: blur(4px);
  transition: opacity var(--reveal-duration) var(--ease), transform var(--reveal-duration) var(--ease), filter var(--reveal-duration) var(--ease);
  transition-delay: calc(var(--i) * var(--reveal-stagger)); }
.js [data-reveal].is-visible .w { opacity: 1; transform: none; filter: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] .w { opacity: 1; transform: none; filter: none; transition: none; }
}

/* ---------- Lightbox ---------- */
a.lb { display: block; cursor: zoom-in; }
dialog.lightbox { border: 0; padding: 0; margin: 0; width: 100%; max-width: 100vw; height: 100%; max-height: 100vh; background: transparent; color: var(--text, #f3eee4); }
dialog.lightbox::backdrop { background: color-mix(in srgb, var(--navy-deep, #0a1224) 94%, transparent); }
dialog.lightbox[open] { display: grid; grid-template-columns: 3.5rem 1fr 3.5rem; align-items: center; }
dialog.lightbox figure { margin: 0; grid-column: 2; display: grid; gap: .75rem; justify-items: center; min-width: 0; }
dialog.lightbox img { max-width: 100%; max-height: 82vh; object-fit: contain; }
dialog.lightbox figcaption { font-size: var(--fs-small, .875rem); color: var(--text-muted, #ccc); text-align: center; }
dialog.lightbox button { background: none; border: 1px solid transparent; color: var(--accent, #c9a24b); font: inherit; font-size: 2.2rem; line-height: 1; cursor: pointer; padding: .4rem .8rem; }
dialog.lightbox button:hover, dialog.lightbox button:focus-visible { border-color: var(--accent, #c9a24b); }
dialog.lightbox .lb-close { position: absolute; top: .75rem; right: .75rem; }
dialog.lightbox .lb-prev { grid-column: 1; grid-row: 1; justify-self: center; }
dialog.lightbox .lb-next { grid-column: 3; grid-row: 1; justify-self: center; }
@media (max-width: 40rem) { dialog.lightbox[open] { grid-template-columns: 2.5rem 1fr 2.5rem; } dialog.lightbox button { padding: .2rem .4rem; } }

/* Bandeau de consentement (statistiques) : deux boutons de même poids, aucun choix préréglé */
#consent { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; padding: 0 max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); pointer-events: none; }
.consent__in { pointer-events: auto; max-width: 48rem; margin: 0 auto; display: grid; gap: 1rem; padding: 1.1rem 1.25rem; background: #fff; color: #2b2a28; border: 1px solid #cfc6b6; border-radius: .5rem; box-shadow: 0 .6rem 2rem rgba(0,0,0,.28); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: .92rem; line-height: 1.5; }
.consent__in p { margin: .25rem 0 0; }
.consent__in a { color: inherit; text-decoration: underline; }
.consent__btns { display: flex; gap: .75rem; justify-content: flex-end; }
.consent__btns button { font: inherit; font-weight: 600; padding: .55rem 1.3rem; border: 1px solid #2b2a28; border-radius: 999px; background: #fff; color: #2b2a28; cursor: pointer; }
.consent__btns button:hover, .consent__btns button:focus-visible { background: #2b2a28; color: #fff; }
@media (min-width: 40rem) { .consent__in { grid-template-columns: 1fr auto; align-items: center; } }
.consent-link { margin-left: auto; background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
