/* ================================================================
   RAYFLECTIONS V2 — DESIGN TOKENS
   Système de pilotage visuel : noir profond + or + ivoire + bleu nuit
   Métaphore : route, cockpit, miroir, horizon, instruments
   ================================================================ */

:root {
  /* === Couleurs primaires (palette stricte) === */
  --ink-deep:        #07101F;  /* Noir bleuté — fond hero, autorité */
  --ink-night:       #0B1320;  /* Bleu nuit — fond dominant */
  --ink-elevated:    #0F1A2E;  /* Bleu nuit élevé — cards */
  --ink-glass:       #121F3530;/* Glass surface */
  --ink-line:        rgba(255, 255, 255, 0.07);

  --paper:           #F5F2EB;  /* Ivoire — texte sur fond sombre */
  --paper-soft:      rgba(245, 242, 235, 0.78);
  --paper-mute:      rgba(245, 242, 235, 0.54);
  --paper-faint:     rgba(245, 242, 235, 0.22);

  /* Or officiel Rayflections — du logo SVG #D8B27A */
  --gold:            #D8B27A;
  --gold-light:      #E2C97E;
  --gold-warm:       #C9A96A;
  --gold-deep:       #8B6B34;  /* Gold profond pour fond clair (day mode) */
  --gold-glow:       rgba(201, 169, 106, 0.18);
  --gold-line:       rgba(201, 169, 106, 0.32);
  --gold-faint:      rgba(201, 169, 106, 0.10);

  /* Bleus interface (instruments, KPI, jauges) */
  --instrument:      #6B8AB5;
  --instrument-soft: rgba(107, 138, 181, 0.18);

  /* === Palette éditoriale étendue V330.3 ===
     Système de tons bleu/gold/ivoire pour signature visuelle premium. */
  --midnight:        #07101F;  /* Le plus profond — fonds night dominants */
  --marine:          #14233A;  /* Bleu nuit — titres day, fonds élevés night */
  --cobalt:          #1F3358;  /* Bleu profond — accents narratifs, cards */
  --sky:             #6B8AB5;  /* Bleu instrument — KPI, infographies */
  --sky-soft:        rgba(107, 138, 181, 0.24);
  --ivory:           #F5F2EB;  /* Ivoire — fond day, texte night */
  --ivory-pure:      #FFFCF6;  /* Ivoire le plus pur — fond day premium */
  --ivory-warm:      #F8F4EB;  /* Ivoire chaleureux — fond day alternatif */
  --ivory-deep:      rgba(20, 35, 58, 0.06); /* Voile ivoire transparent */

  /* Tokens day mode (façade premium ivoire) */
  --day-bg:          var(--ivory-pure);
  --day-bg-alt:      var(--ivory-warm);
  --day-text:        var(--marine);
  --day-text-soft:   rgba(20, 35, 58, 0.78);
  --day-text-mute:   rgba(20, 35, 58, 0.58);
  --day-accent:      var(--gold-deep);
  --day-line:        rgba(184, 148, 85, 0.28);
  --day-card:        rgba(255, 252, 246, 0.94);
  --day-glass:       rgba(255, 252, 246, 0.78);

  /* Accents modules (utilisés avec parcimonie) */
  --m-daily:         #6FA0C2;  /* Daily Care — bleu calme */
  --m-reset:         #C9A96A;  /* Mental Reset — or rupture */
  --m-mirror:        #E0CFAA;  /* Miroir — ivoire-or */
  --m-vision:        #8B7BBF;  /* Vision — violet projection */
  --m-direction:     #7DA88A;  /* Direction — vert exécution */

  /* === Typographie === */
  --serif: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Alias pour --font-display (utilisé dans v2-glass.css) */
  --font-display: var(--serif);

  /* Échelle fluide (clamp viewport) */
  --t-display: clamp(2.5rem, 1rem + 6.5vw, 6rem);
  --t-h1:      clamp(2.1rem, 1rem + 4.5vw, 4.4rem);
  --t-h2:      clamp(1.7rem, 1rem + 2.6vw, 3rem);
  --t-h3:      clamp(1.2rem, 1rem + 1vw, 1.6rem);
  --t-lead:    clamp(1.05rem, 0.95rem + 0.5vw, 1.25rem);
  --t-body:    1rem;
  --t-small:   0.875rem;
  --t-eyebrow: 0.7rem;

  /* Charte ecriture V2 — socle commun audit 2026-06-05 */
  --rf-font-title: var(--serif);
  --rf-font-body: var(--sans);
  --font-head: var(--rf-font-title);
  --font-body: var(--rf-font-body);
  --rf-type-display-title: clamp(3.15rem, 6vw, 5.15rem);
  --rf-type-hero-title: clamp(3.15rem, 5.85vw, 5.15rem);
  --rf-type-hero-title-mobile: clamp(2.85rem, 12.8vw, 3.95rem);
  --rf-type-hero-subtitle: clamp(1.38rem, 2.2vw, 1.86rem);
  --rf-type-hero-copy: clamp(1rem, 1.05vw, 1.12rem);
  --rf-type-section-title: clamp(2.15rem, 3.7vw, 3.7rem);
  --rf-type-card-title: clamp(1.35rem, 2vw, 1.95rem);
  --rf-type-lead: clamp(1.06rem, 1.2vw, 1.24rem);
  --rf-type-body: clamp(0.98rem, 0.34vw + 0.9rem, 1.06rem);
  --rf-type-small: 0.875rem;
  --rf-type-kicker: 0.72rem;
  --rf-type-cta: 0.76rem;
  --rf-type-quote: clamp(1.25rem, 2.05vw, 1.82rem);
  --rf-line-tight: 0.96;
  --rf-line-title: 1.04;
  --rf-line-copy: 1.68;
  --rf-letter-kicker: 0.16em;
  --rf-color-night: var(--ink-deep);
  --rf-color-cream: var(--ivory-pure);
  --rf-color-cream-soft: rgba(255, 252, 246, 0.78);
  --rf-color-gold: var(--gold);
  --rf-color-gold-day: var(--gold-deep);
  --rf-color-ink: var(--marine);

  /* === Spacing fluide === */
  --s-1:   4px;
  --s-2:   8px;
  --s-3:   12px;
  --s-4:   16px;
  --s-5:   20px;
  --s-6:   24px;
  --s-8:   32px;
  --s-10:  40px;
  --s-12:  48px;
  --s-16:  64px;
  --s-20:  80px;
  --s-24:  96px;
  --s-32:  128px;

  --section-y: clamp(60px, 9vw, 140px);
  --gutter:    clamp(20px, 4vw, 64px);
  --shell:     min(100% - var(--gutter) * 2, 1280px);

  /* === Radii === */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-2xl: 38px;

  /* === Ombres === */
  --shadow-card:   0 14px 40px rgba(4, 8, 16, 0.45);
  --shadow-glass:  0 22px 60px rgba(4, 8, 16, 0.55), inset 0 1px 0 rgba(255,255,255,0.05);
  --shadow-cta:    0 12px 30px rgba(201, 169, 106, 0.22);
  --shadow-lift:   0 24px 64px rgba(4, 8, 16, 0.6);

  /* === Transitions === */
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft:   cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast:      180ms;
  --t-base:      280ms;
  --t-slow:      520ms;
}

/* ================================================================
   RESET + BASE
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--paper);
  background: var(--ink-night);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

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

/* Scrollbar discrète */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-deep); }
::-webkit-scrollbar-thumb { background: var(--gold-line); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ================================================================
   TYPOGRAPHIE PREMIUM
   ================================================================ */

.t-display, .t-h1, .t-h2 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0;
}

.t-display { font-size: var(--t-display); line-height: 0.98; }
.t-h1 { font-size: var(--t-h1); line-height: 1.02; }
.t-h2 { font-size: var(--t-h2); line-height: 1.08; }
.t-h3 {
  font-family: var(--serif);
  font-size: var(--t-h3);
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
}

.t-em { font-style: italic; color: var(--gold-light); }
.t-lead {
  font-size: var(--t-lead);
  line-height: 1.55;
  color: var(--paper-soft);
  max-width: 60ch;
  margin: 0;
}
.t-body { font-size: var(--t-body); line-height: 1.7; color: var(--paper-soft); }
.t-small { font-size: var(--t-small); color: var(--paper-mute); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: var(--t-eyebrow);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}
.eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--gold);
  display: inline-block;
}

/* ================================================================
   LAYOUT
   ================================================================ */

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.section {
  padding-block: var(--section-y);
  position: relative;
}

.section-head {
  display: grid;
  gap: var(--s-5);
  max-width: 720px;
  margin-bottom: var(--s-12);
}

/* ================================================================
   CTA SYSTEM
   ================================================================ */

.btn {
  --btn-bg: var(--paper);
  --btn-fg: var(--ink-deep);
  --btn-bd: transparent;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 26px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  cursor: pointer;
  transition:
    transform var(--t-base) var(--ease),
    background var(--t-base) var(--ease),
    box-shadow var(--t-base) var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-cta);
}

.btn .arrow {
  width: 16px;
  height: 16px;
  display: inline-block;
  transition: transform var(--t-base) var(--ease);
}
.btn:hover .arrow { transform: translateX(4px); }

.btn--gold {
  --btn-bg: var(--gold);
  --btn-fg: var(--ink-deep);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--paper);
  --btn-bd: var(--paper-faint);
}
.btn--ghost:hover {
  --btn-bg: rgba(245, 242, 235, 0.06);
  --btn-bd: var(--gold-line);
}

.btn--lg { padding: 20px 32px; font-size: 1rem; }

/* ================================================================
   GLASS CARD
   ================================================================ */

.glass {
  position: relative;
  background:
    linear-gradient(155deg, rgba(15, 26, 46, 0.75), rgba(11, 19, 32, 0.95));
  border: 1px solid var(--ink-line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: var(--shadow-glass);
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle at top right, var(--gold-glow), transparent 40%);
}

/* ================================================================
   SCROLL-DRIVEN UTILITIES
   ================================================================ */

@supports (animation-timeline: view()) {
  .reveal {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 30%;
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Fallback (IntersectionObserver) */
.reveal-fallback { opacity: 0; transform: translateY(28px); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.reveal-fallback.is-in { opacity: 1; transform: translateY(0); }

/* ================================================================
   ACCESSIBILITY
   ================================================================ */

@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;
  }
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ================================================================
   SKIP LINK — caché par défaut, visible au focus (clavier)
   ================================================================ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 12px 20px;
  background: var(--gold);
  color: var(--ink-deep);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  border-radius: 0 0 8px 0;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
}

.skip-link:focus,
.skip-link:focus-visible {
  left: 0;
  top: 0;
  outline-offset: 0;
}
