/*
  Neopage — jetons de la charte graphique (design tokens)
  À importer en premier dans toute page du site : <link rel="stylesheet" href="tokens.css">
  Idée : la page de cahier. Papier blanc, réglure Seyès bleu pâle, encre bleue, tampon vermillon.
  Thème clair par défaut ; thème sombre (« la page de nuit ») via prefers-color-scheme
  ou data-theme="dark" sur <html>.
*/

:root {
  color-scheme: light dark;

  /* Couleurs de marque (valeurs fixes, pour le logo et l'impression) */
  --np-encre: #1d3fd8;        /* Bleu encre : couleur dominante (stylo à bille) */
  --np-encre-fonce: #142c9e;  /* Survol, texte sur fond pâle */
  --np-tampon: #e5432a;       /* Vermillon tampon : accent, uniquement ce qui compte */
  --np-tampon-texte: #b8301b; /* Vermillon assombri, lisible en petit texte sur blanc */
  --np-reglure: #c9d4ff;      /* Lignes Seyès */
  --np-marge: #f0a3a3;        /* Ligne de marge rouge du cahier (décor uniquement) */
  --np-papier: #ffffff;
  --np-nuit: #0b1030;         /* Fond du thème sombre */

  /* Rôles (ce que le code doit utiliser) */
  --bg: light-dark(#ffffff, #0b1030);
  --surface: light-dark(#f4f6ff, #141a44);       /* Fond de bloc, carte */
  --ink: light-dark(#10142b, #eef1ff);           /* Texte courant */
  --ink-soft: light-dark(#4a5170, #aab2d9);      /* Texte secondaire (contraste AA) */
  --brand: light-dark(#1d3fd8, #8ea2ff);         /* Liens, boutons, titres de marque */
  --brand-strong: light-dark(#142c9e, #b7c4ff);
  --on-brand: light-dark(#ffffff, #0b1030);      /* Texte posé sur --brand */
  --accent: light-dark(#e5432a, #ff6b4f);        /* Tampon, pastilles « nouveau » */
  --accent-text: light-dark(#b8301b, #ff8a72);
  --rule: light-dark(#c9d4ff, #2a3470);          /* Réglure, filets, bordures */
  --line: light-dark(#dfe4f5, #222a5c);          /* Séparateurs discrets */
  --focus: light-dark(#e5432a, #ff6b4f);

  /* Typographie */
  --font-display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-main: "Caveat", "Segoe Print", "Bradley Hand", cursive; /* Écriture manuscrite : annotations seulement */

  --fs-hero: clamp(2.6rem, 6vw, 4.75rem);  /* 42 → 76 px : titre d'accueil uniquement */
  --fs-h1: clamp(2rem, 4vw, 3.25rem);      /* 32 → 52 px */
  --fs-h2: clamp(1.5rem, 2.6vw, 2.125rem); /* 24 → 34 px */
  --fs-h3: 1.25rem;                        /* 20 px */
  --fs-body: 1.0625rem;                    /* 17 px */
  --fs-small: 0.875rem;                    /* 14 px, minimum absolu 13 px */
  --fs-main: 1.625rem;                     /* 26 px : Caveat paraît petit, on le grossit */

  --lh-tight: 1.05;
  --lh-body: 1.6;
  --tracking-display: -0.02em;

  /* Réglure Seyès : interligne de base 8 px, grand carreau 32 px */
  --seyes: 8px;
  --seyes-big: 32px;

  /* Espacements (multiples de la réglure) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 16px;
  --sp-4: 24px;
  --sp-5: 32px;
  --sp-6: 48px;
  --sp-7: 64px;
  --sp-8: 96px;

  /* Formes */
  --radius: 6px;        /* Boutons, champs */
  --radius-page: 2px;   /* Feuilles, cartes : une page a des coins nets */
  --shadow-page: 6px 6px 0 var(--rule); /* Feuille posée : ombre pleine, jamais floue */
  --content: 1200px;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* Fond réglé Seyès, à réserver aux grandes zones « page » (jamais sous un texte long) */
.np-seyes {
  background-color: var(--bg);
  background-image:
    linear-gradient(90deg, transparent calc(var(--seyes-big) * 2 - 1px), var(--np-marge) calc(var(--seyes-big) * 2 - 1px), var(--np-marge) calc(var(--seyes-big) * 2 + 1px), transparent calc(var(--seyes-big) * 2 + 1px)),
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--rule) 45%, transparent) 1px, transparent 1px);
  background-size: 100% 100%, 100% var(--seyes-big), var(--seyes-big) 100%, 100% var(--seyes);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
