/* =====================================================================
   AardDesign — Main CSS
   Design tokens, typography, base layout
   Light theme — "Earth & Ink" palette
   ===================================================================== */

/* =====================================================================
   CHARTE GRAPHIQUE — AardDesign
   ---------------------------------------------------------------------
   Philosophie : design "de la terre". Chaleureux, tangible, artisanal.
   L'ivoire évoque le papier japonais ; le graphite, l'encre de Chine ;
   la terre cuite et l'olive rappellent la nature et l'artisanat.

   Hiérarchie :
     1. Ivoire chaud   — fond, calme, lumière
     2. Graphite noir  — texte, structure, encre
     3. Terre cuite    — accent chaud, action, vivant
     4. Olive          — accent froid, détail, signe

   Typographie :
     - Playfair Display : titres éditoriaux, italiques
     - Inter            : corps, UI, étiquettes
   ===================================================================== */

:root {
  /* ---------- Couleurs — Surfaces ---------- */
  --color-bg:           #f5f1e8;  /* Ivoire chaud — fond principal */
  --color-surface-1:    #fdfbf6;  /* Papier — cartes, panneaux */
  --color-surface-2:    #ebe5d5;  /* Sable — sections alternées */
  --color-surface-3:    #ddd4bf;  /* Pierre — accents de surface */

  /* ---------- Couleurs — Texte ---------- */
  --color-ink:          #1a1611;  /* Encre — titres, liens forts */
  --color-text:         #2a251c;  /* Graphite — texte courant */
  --color-text-muted:   #6b6252;  /* Cendre — texte secondaire */
  --color-text-subtle:  #9a8f78;  /* Brume — texte tertiaire */

  /* ---------- Couleurs — Accents ---------- */
  --color-accent:       #b8632b;  /* Terre cuite — CTA principal */
  --color-accent-hover: #9a4e1d;  /* Terre cuite foncée — hover */
  --color-accent-2:     #5a6b3d;  /* Olive — accent secondaire */
  --color-accent-2-soft:#8a9668;  /* Olive doux */

  /* ---------- Couleurs — Bordures & Overlays ---------- */
  --color-border:        rgba(26, 22, 17, 0.12);
  --color-border-strong: rgba(26, 22, 17, 0.28);
  --color-border-accent: rgba(184, 99, 43, 0.35);
  --color-overlay:       rgba(245, 241, 232, 0.88);

  /* ---------- Couleurs — Feedback ---------- */
  --color-success: #4a7a4a;
  --color-error:   #b84a3a;

  /* ---------- Aliases (compat) ---------- */
  --color-text-on-accent: #fdfbf6;

  /* ---------- Typographie ---------- */
  --font-serif: "Playfair Display", "Cormorant Garamond", Georgia, serif;
  --font-sans: "Inter", "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Échelle fluide (clamp) */
  --fs-xs:   clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --fs-sm:   clamp(0.875rem, 0.82rem + 0.25vw, 1rem);
  --fs-base: 1rem;
  --fs-md:   clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --fs-lg:   clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --fs-xl:   clamp(1.5rem, 1.25rem + 1vw, 2rem);
  --fs-2xl:  clamp(2rem, 1.5rem + 2vw, 3rem);
  --fs-3xl:  clamp(2.5rem, 2rem + 3vw, 4.5rem);
  --fs-4xl:  clamp(3rem, 2rem + 5vw, 7rem);
  --fs-hero: clamp(3.5rem, 2rem + 8vw, 10rem);

  /* ---------- Espaces ---------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;
  --space-11: 12rem;

  /* ---------- Mise en page ---------- */
  --container-max: 1440px;
  --container-pad: clamp(1.5rem, 4vw, 4rem);
  --nav-height: 80px;

  /* ---------- Bordures & rayons ---------- */
  --border-thin: 1px solid var(--color-border);
  --border-strong: 1px solid var(--color-border-strong);
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;

  /* ---------- Z-index ---------- */
  --z-shader: 0;
  --z-base: 10;
  --z-overlay: 20;
  --z-nav: 50;
  --z-modal: 90;
  --z-loader: 100;

  /* ---------- Motion ---------- */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.45, 0, 0.15, 1);
  --dur-fast: 150ms;
  --dur-base: 300ms;
  --dur-slow: 600ms;
  --dur-slower: 1000ms;

  /* ---------- Ombre douce (léger relief sur papier) ---------- */
  --shadow-sm: 0 1px 2px rgba(26, 22, 17, 0.04), 0 2px 6px rgba(26, 22, 17, 0.03);
  --shadow-md: 0 2px 8px rgba(26, 22, 17, 0.06), 0 8px 24px rgba(26, 22, 17, 0.05);
  --shadow-lg: 0 4px 16px rgba(26, 22, 17, 0.08), 0 16px 48px rgba(26, 22, 17, 0.06);
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ---------- Texture papier (grain subtil + motif de lignes) ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-overlay);
  opacity: 0.04;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0 0.06 0 0 0 0.7 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  background-size: 256px 256px;
}

/* Motif subtil de lignes horizontales (effet papier ligné) */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: calc(var(--z-overlay) - 1);
  opacity: 0.35;
  background-image:
    linear-gradient(to bottom,
      transparent 0%, transparent 50%,
      rgba(26, 22, 17, 0.015) 50%, rgba(26, 22, 17, 0.015) 51%,
      transparent 51%);
  background-size: 100% 6px;
}

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

button {
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

figure { margin: 0; }

/* ---------- Typographie ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.018em;
  margin: 0;
  color: var(--color-ink);
}

h1 { font-size: var(--fs-hero); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); }

p {
  margin: 0 0 1rem;
  max-width: 65ch;
  color: var(--color-text);
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-5);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}
.eyebrow::before {
  content: "";
  width: 32px;
  height: 1px;
  background: var(--color-accent);
}

.serif { font-family: var(--font-serif); }
.italic { font-style: italic; }
.muted { color: var(--color-text-muted); }
.accent { color: var(--color-accent); }
.accent-2 { color: var(--color-accent-2); }

/* ---------- Drop cap décoratif (prose) ---------- */
.has-dropcap::first-letter {
  font-family: var(--font-serif);
  font-size: 4.2em;
  float: left;
  line-height: 0.85;
  padding: 0.05em 0.1em 0 0;
  color: var(--color-accent);
  font-style: italic;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section {
  padding-block: clamp(4rem, 10vw, 10rem);
  position: relative;
}

.section--soft {
  background: var(--color-surface-2);
}

.section--paper {
  background: var(--color-surface-1);
}

.section-sm {
  padding-block: clamp(3rem, 6vw, 5rem);
}

.grid { display: grid; gap: var(--space-6); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.text-center { text-align: center; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Décors : séparateurs ornés ---------- */
.rule {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--color-border);
  border: 0;
  margin: 0;
}

/* Séparateur orné avec glyphe central */
.rule--ornament {
  position: relative;
  width: 100%;
  text-align: center;
  margin-block: var(--space-8);
  color: var(--color-accent);
}
.rule--ornament::before,
.rule--ornament::after {
  content: "";
  position: absolute;
  top: 50%;
  width: calc(50% - 40px);
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-border-strong), transparent);
}
.rule--ornament::before { left: 0; }
.rule--ornament::after  { right: 0; }
.rule--ornament span {
  display: inline-block;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 14px;
  background: var(--color-bg);
  position: relative;
  color: var(--color-accent);
}

/* ---------- Focus ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb {
  background: var(--color-surface-3);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--color-accent); }

/* ---------- Selection ---------- */
::selection {
  background: var(--color-accent);
  color: var(--color-text-on-accent);
}

/* ---------- Utilités ---------- */
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-9 { margin-bottom: var(--space-9); }

.max-w-prose { max-width: 65ch; }
.max-w-lg { max-width: 48rem; }
.max-w-xl { max-width: 64rem; }
.mx-auto { margin-inline: auto; }

/* ---------- Décor : motif de grille (optionnel, sur sections d'intérêt) ---------- */
.bg-grid {
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 80px 80px;
  background-position: -1px -1px;
}

/* ---------- Décor : coin orné (pour sections clés) ---------- */
.corner-frame {
  position: relative;
}
.corner-frame::before,
.corner-frame::after {
  content: "";
  position: absolute;
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-accent);
  pointer-events: none;
  z-index: 2;
}
.corner-frame::before {
  top: 0; left: 0;
  border-right: 0;
  border-bottom: 0;
}
.corner-frame::after {
  bottom: 0; right: 0;
  border-left: 0;
  border-top: 0;
}

/* ---------- Décor : marque éditoriale (Aa) ---------- */
.mark-aa {
  display: inline-block;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-accent);
}

/* ---------- Breakpoints ---------- */
@media (max-width: 768px) {
  :root { --nav-height: 68px; }
  .hide-mobile { display: none !important; }
}

@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}
