/* ============================================================================
   MOON CAPITAL — Reset, typographie de base, utilitaires
   ========================================================================= */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  font-feature-settings: 'cv05' 1, 'ss03' 1, 'tnum' 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  min-height: 100%;
}

/* Grain global : purement décoratif, ne capte jamais le pointeur. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--grain);
  opacity: var(--grain-opacity);
  pointer-events: none;
  mix-blend-mode: var(--grain-blend);
  z-index: 3;
}

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

input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

table { border-collapse: collapse; width: 100%; }

::selection { background: var(--selection); color: var(--selection-ink); }

/* ── Titres ─────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: var(--tr-tight);
  line-height: var(--lh-snug);
  text-wrap: balance;
}
h1 { font-size: var(--t-h1); line-height: var(--lh-tight); letter-spacing: var(--tr-display); font-weight: 550; }
h2 { font-size: var(--t-h2); line-height: 1.08; letter-spacing: var(--tr-display); font-weight: 550; }
h3 { font-size: var(--t-h3); }
h4 { font-size: var(--t-h4); }

p { text-wrap: pretty; }

strong, b { font-weight: 600; color: var(--accent-soft); }

/* ── Utilitaires typographiques ─────────────────────────────────────────── */
.lead {
  font-size: var(--t-lead);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 46ch;
}

.serif-accent {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -.01em;
  color: var(--accent-soft);
  padding-right: .06em;
}

.gold-text {
  background: linear-gradient(96deg, var(--accent-grad-1) 8%, var(--accent-grad-2) 46%, var(--accent-grad-3) 78%, var(--accent-grad-4) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mono {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' 1, 'zero' 1;
  font-variant-numeric: tabular-nums;
}

.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-family: var(--font-mono);
  font-size: var(--t-2xs);
  font-weight: 500;
  letter-spacing: var(--tr-wide);
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before {
  content: '';
  width: 1.75rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}
.eyebrow--plain::before { display: none; }

.muted { color: var(--ink-2); }
.dim   { color: var(--ink-3); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: 1440px; }
.container--text { max-width: calc(var(--maxw-text) + var(--gutter) * 2); }

.section {
  position: relative;
  padding-block: var(--section-y);
}
.section--tight { padding-block: clamp(3.5rem, 2rem + 6vw, 7rem); }
.section--alt { background: var(--bg-2); }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  max-width: 62ch;
  margin-bottom: clamp(2.75rem, 1.5rem + 3.5vw, 4.75rem);
}
.section-head--center { align-items: center; text-align: center; margin-inline: auto; }
.section-head--center .lead { text-align: center; max-width: 54ch; }

.stack { display: flex; flex-direction: column; }
.row   { display: flex; align-items: center; }
.wrap  { flex-wrap: wrap; }

/* Filet horizontal doré, très discret. */
.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--line-strong) 22%, var(--line-strong) 78%, transparent);
}

/* ── Accessibilité ──────────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: .75rem;
  left: 50%;
  translate: -50% -200%;
  z-index: var(--z-top);
  padding: .7rem 1.15rem;
  border-radius: var(--r-pill);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--t-sm);
  font-weight: 600;
  transition: translate var(--dur) var(--ease-out);
}
.skip-link:focus-visible { translate: -50% 0; }

:where(a, button, summary, input, [tabindex]):focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

/* ── Révélation au scroll ───────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  translate: 0 22px;
  transition:
    opacity .85s var(--ease-out) var(--reveal-delay, 0ms),
    translate .85s var(--ease-out) var(--reveal-delay, 0ms),
    filter .85s var(--ease-out) var(--reveal-delay, 0ms);
  filter: blur(6px);
}
.reveal.is-in { opacity: 1; translate: 0 0; filter: blur(0); }

/* Les enfants d'un groupe se révèlent en cascade. */
.reveal-group > * { --reveal-delay: 0ms; }
.reveal-group > *:nth-child(2)  { --reveal-delay: 70ms; }
.reveal-group > *:nth-child(3)  { --reveal-delay: 140ms; }
.reveal-group > *:nth-child(4)  { --reveal-delay: 210ms; }
.reveal-group > *:nth-child(5)  { --reveal-delay: 280ms; }
.reveal-group > *:nth-child(6)  { --reveal-delay: 350ms; }
.reveal-group > *:nth-child(7)  { --reveal-delay: 420ms; }
.reveal-group > *:nth-child(8)  { --reveal-delay: 490ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; translate: none; filter: none; transition: none; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
