/* ============================================================
   Base — reset, typography, paper texture
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  font-feature-settings: 'kern', 'liga', 'calt', 'ss01';
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-body);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Texture papier extrêmement subtile — fibres */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.05 0 0 0 0 0.04 0 0 0 0 0.02 0 0 0 0.05 0'/></filter><rect width='400' height='400' filter='url(%23n)'/></svg>");
  background-size: 240px 240px;
}

main { position: relative; z-index: 2; }

/* ----- Typographie ----- */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-regular);
  color: var(--text-strong);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  font-feature-settings: 'kern', 'liga', 'ss01', 'onum';
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
}

h1 { font-size: var(--fs-display-xl); letter-spacing: var(--ls-display-xl); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-display-l);  letter-spacing: var(--ls-display-l); }
h3 { font-size: var(--fs-display-m); }
h4 { font-size: var(--fs-display-s); }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.0625rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 4px;
  text-decoration-thickness: 0.6px;
  transition: color var(--t-base) var(--ease-out);
}
a:hover { color: var(--accent-deep); text-decoration: underline; }

strong, b { font-weight: var(--fw-semibold); color: var(--text-strong); }
em, i { font-style: italic; }
small { font-size: var(--fs-body-small); }

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

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

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

hr {
  border: 0;
  height: 1px;
  background: var(--sn-line);
  margin: var(--space-8) 0;
}

/* ----- Utilitaires éditoriaux ----- */

/* Eyebrow : petite étiquette en mono uppercase */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-medium);
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  color: var(--text-muted);
  line-height: 1.4;
}
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 0.5px;
  background: var(--sn-gold);
  flex-shrink: 0;
}
.eyebrow--no-line::before { display: none; }
.eyebrow--strong { color: var(--accent); }
.eyebrow--strong::before { background: var(--accent); }

/* Roman numeral indicator */
.roman {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: var(--fw-regular);
  color: var(--decor);
  font-feature-settings: 'kern','onum';
}

/* Lead paragraph (intro) */
.lead {
  font-family: var(--font-body);
  font-size: var(--fs-lead);
  line-height: 1.6;
  color: var(--text);
  letter-spacing: -0.005em;
}

/* Section caption (mono small) */
.caption {
  font-family: var(--font-mono);
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  color: var(--text-muted);
}

/* Pull-quote */
.pullquote {
  position: relative;
  padding: var(--space-7) 0 var(--space-7) var(--space-6);
  margin: var(--space-9) 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.5rem, 1.5vw + 1rem, 2.125rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text-strong);
  font-variation-settings: 'opsz' 144, 'SOFT' 80;
  border-left: 1px solid var(--sn-gold);
}
.pullquote cite {
  display: block;
  margin-top: var(--space-5);
  font-family: var(--font-mono);
  font-style: normal;
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  color: var(--text-muted);
}
.pullquote cite::before {
  content: '— ';
  color: var(--decor);
}

/* Fine ligne or */
.gold-rule {
  display: block;
  width: 64px;
  height: 0.5px;
  background: var(--sn-gold);
  border: 0;
  margin: var(--space-5) 0;
}
.gold-rule--center { margin-left: auto; margin-right: auto; }
.gold-rule--full   { width: 100%; }

/* Decorative diamond in line */
.gold-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: var(--decor);
  font-size: 0.6rem;
  margin: var(--space-7) 0;
}
.gold-divider::before, .gold-divider::after {
  content: '';
  flex: 1;
  height: 0.5px;
  background: var(--sn-gold);
  opacity: 0.6;
}

/* Marker — handlettered emphasis (sparingly) */
.marker {
  position: relative;
  display: inline-block;
  color: var(--text-strong);
  font-style: italic;
  white-space: nowrap;
}
.marker::after {
  content: '';
  position: absolute;
  left: -2%;
  right: -2%;
  bottom: 0.05em;
  height: 0.42em;
  background: linear-gradient(90deg, rgba(184,153,104,0.35), rgba(184,153,104,0.18));
  z-index: -1;
  border-radius: 1px;
  transform: skewX(-2deg);
}

/* Numéro d'article géant */
.article-num {
  font-family: var(--font-display);
  font-weight: 200;
  font-size: clamp(4.5rem, 9vw, 7.5rem);
  line-height: 0.85;
  color: var(--decor);
  font-variation-settings: 'opsz' 144;
  letter-spacing: -0.04em;
  font-feature-settings: 'lnum';
}

/* Tabular numerals (chiffres alignés) */
.tnum { font-feature-settings: 'tnum', 'lnum'; }

/* Visually hidden */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Container helpers */
.container { max-width: var(--container-wide); margin: 0 auto; padding: 0 max(1.25rem, 4vw); }
.container--narrow  { max-width: var(--container-narrow); }
.container--prose   { max-width: var(--container-prose); }
.container--medium  { max-width: var(--container-medium); }
.container--xl      { max-width: var(--container-xl); }

/* Section vertical rhythm */
.section { padding: var(--space-10) 0; position: relative; }
.section--tight  { padding: var(--space-9) 0; }
.section--loose  { padding: var(--space-12) 0; }
.section--alt    { background: var(--bg-alt); }
.section--ink {
  background: var(--bg-inverse);
  color: var(--text-on-dark);
}
.section--ink h1, .section--ink h2, .section--ink h3, .section--ink h4 { color: var(--sn-paper); }
.section--ink .eyebrow { color: var(--sn-gold-light); }
.section--ink .eyebrow::before { background: var(--sn-gold); }
.section--ink .lead { color: rgba(245, 239, 226, 0.78); }
.section--ink a { color: var(--sn-gold-light); }

/* Top filet (paper top edge) */
.section--top-rule { border-top: 0.5px solid var(--sn-line); }

/* Reduced motion */
@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; }
}

/* Print */
@media print {
  body::before { display: none; }
  .header, .footer, .sticky-cta { display: none; }
  body { background: white; color: black; }
}
