/* =========================================================
   base.css
   Jetons de design, reset, typographie et utilitaires globaux.
   ========================================================= */

/* ─────────────────────────────────────────────────────────
   1. JETONS DE DESIGN
   Source unique de vérité : changer une valeur ici se
   répercute sur tout le site.
   ───────────────────────────────────────────────────────── */

:root {
  /* Palette */
  --navy: #0d1f3c;
  --navy-mid: #162d55;
  --navy-light: #1e3d72;
  --navy-deep: #080e1a;
  --gold: #b8922e;
  --gold-light: #d4aa4a;
  --gold-pale: #f5ecd4;
  --white: #fff;
  --off-white: #f9f7f3;
  --text-muted: #6b7a93;

  /* Surfaces et bordures dérivées */
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-gold: rgba(184, 146, 46, 0.2);
  --border-gold-strong: rgba(184, 146, 46, 0.35);
  --surface-glass: rgba(255, 255, 255, 0.04);
  --on-dark: rgba(255, 255, 255, 0.7);
  --on-dark-muted: rgba(255, 255, 255, 0.55);
  --on-dark-faint: rgba(255, 255, 255, 0.4);

  /* Typographie */
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-small: 0.875rem;
  --fs-micro: 0.75rem;

  /* Espacements */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --section-pad: 6rem 0;

  /* Gabarit */
  --container: 1200px;
  --gutter: 2rem;
  --nav-height: 70px;

  /* Rayons et ombres */
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 100px;
  --shadow-card: 0 1px 2px rgba(13, 31, 60, 0.04);

  /* Animation */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --duration-fast: 0.2s;
  --duration-slow: 0.6s;

  /* Ordre d'empilement */
  --z-menu: 90;
  --z-nav: 100;
  --z-skip-link: 200;
}

@media (max-width: 600px) {
  :root {
    --section-pad: 4rem 0;
    --gutter: 1.25rem;
  }
}

/* ─────────────────────────────────────────────────────────
   2. RESET
   ───────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a {
  color: inherit;
}

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

button {
  background: none;
  border: none;
  cursor: pointer;
}

/* Les ancres s'arrêtent sous l'en-tête fixe au lieu de passer dessous. */
:target,
section[id] {
  scroll-margin-top: var(--nav-height);
}

/* Le focus clavier reste visible ; le clic souris reste discret. */
:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

/* Respect du réglage système « réduire les animations ». */
@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;
    scroll-behavior: auto !important;
  }
}

/* ─────────────────────────────────────────────────────────
   3. TYPOGRAPHIE
   ───────────────────────────────────────────────────────── */

body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--navy);
  background: var(--white);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.8rem, 5.5vw, 4.5rem);
  line-height: 1.08;
  color: var(--white);
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--navy);
  margin-bottom: 1.25rem;
}

/* Accent doré en italique à l'intérieur des titres. */
h1 em {
  color: var(--gold-light);
  font-style: italic;
}

h2 em {
  color: var(--gold);
  font-style: italic;
}

p {
  text-wrap: pretty;
}

/* Le trait d'union de « Pierre-Olivier » est plus juste dans la sans que
   dans la serif, où il tombe trop bas et trop large. */
.name-dash {
  font-family: var(--sans);
  font-weight: 500;
  display: inline-block;
  margin: 0 0.07em;
  transform: translateY(-0.04em);
}

h1 .name-dash {
  font-size: 0.68em;
  margin: 0 0.045em;
  transform: translateY(-0.12em);
}

/* ─────────────────────────────────────────────────────────
   4. UTILITAIRES
   ───────────────────────────────────────────────────────── */

/* Visible uniquement par les lecteurs d'écran. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Premier arrêt de tabulation : saute directement au contenu. */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-md);
  z-index: var(--z-skip-link);
  padding: 0.75rem 1.25rem;
  background: var(--gold);
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-xs);
  transition: top var(--duration-fast) var(--ease);
}

.skip-link:focus {
  top: var(--space-md);
}

/* Apparition au défilement.
   L'état masqué est conditionné à la classe `.js` : sans JavaScript, le
   contenu reste visible. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--duration-slow) var(--ease),
    transform var(--duration-slow) var(--ease);
}

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

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
