/* Shinkai — base : jetons, remise à zéro, typographie, utilitaires. */
:root {
  color-scheme: dark;
  --encre: #06080a;
  --nuit: #0c0e12;
  --graphite: #151821;
  --ardoise: #292c36;
  --trait: #3a3f4b;
  --cendre: #7f8490; /* texte tertiaire (5,2:1 sur l'encre) ; --trait n'est jamais une couleur de texte */
  --brume: #9a9faa;
  --papier: #dfe0e0;
  --encre-2: #3d424c; /* texte secondaire sur papier (cases négatives) */

  --police-titre: 'Dela Gothic One', 'Yu Gothic', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  --police-mincho: 'Shippori Mincho B1', 'Yu Mincho', 'Hiragino Mincho ProN', 'Noto Serif JP', serif;
  --police-texte: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --police-mono: 'IBM Plex Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --t-xs: 0.75rem;
  --t-s: 0.875rem;
  --t-m: 1rem;
  --t-l: clamp(1.125rem, 1rem + 0.45vw, 1.375rem);
  --t-xl: clamp(1.5rem, 1.1rem + 1.8vw, 2.5rem);
  --t-2xl: clamp(2.25rem, 1.4rem + 4vw, 4.75rem);
  --t-3xl: clamp(3.25rem, 1.6rem + 8.5vw, 9.5rem);
  /* Titres « Impact » : 24→32, 32→48, 40→72, 48→112 px */
  --t-titre-s: clamp(1.5rem, 1.25rem + 0.9vw, 2rem);
  --t-titre-m: clamp(2rem, 1.45rem + 2vw, 3rem);
  --t-titre-l: clamp(2.5rem, 1.6rem + 3.4vw, 4.5rem);
  --t-titre-xl: clamp(3rem, 1.7rem + 5.2vw, 7rem);

  /* Espacements, sur une grille de 4 px */
  --e-1: 4px;
  --e-2: 8px;
  --e-3: 12px;
  --e-4: 16px;
  --e-5: 20px;
  --e-6: 24px;
  --e-7: 32px;
  --e-8: 40px;
  --e-9: 48px;
  --e-10: 64px;
  --e-11: 80px;
  --e-12: 96px;

  /* Trois traits seulement : les séparations, l'en-tête et les boutons, les cases fortes */
  --trait-fin: 1px;
  --trait-moyen: 2px;
  --trait-fort: 3px;

  --pente: 0.5774; /* cot(60°) : l'angle du S */
  --incl: -30deg; /* inclinaison du S pour skewX() */
  --bordure: var(--trait-fort);
  --gouttiere: clamp(10px, 1.2vw, 16px);
  --marge: clamp(16px, 4vw, 56px);
  --largeur: 1280px;
  --lecture: 68ch;
  --entete: 64px;

  --duree-courte: 150ms;
  --duree: 250ms;
  --duree-longue: 450ms;
  --ease-lame: cubic-bezier(0.7, 0, 0.3, 1);
  --ease-sortie: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--entete) + 16px);
  scrollbar-color: var(--trait) var(--encre);
  scrollbar-width: thin;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--encre);
  color: var(--papier);
  font: 400 var(--t-m) / 1.6 var(--police-texte);
  -webkit-font-smoothing: antialiased;
}

/* Grain d'encre très léger sur toute la page */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

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

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

/* :where() → spécificité nulle : les marges des listes de composants (.clans, .reseaux…) s'appliquent. */
:where(ul[role='list'], ol[role='list']) {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

button {
  cursor: pointer;
}

::selection {
  background: var(--papier);
  color: var(--encre);
}

:focus-visible {
  outline: 2px solid var(--papier);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: var(--police-titre);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.005em;
  text-wrap: balance;
}

h1 {
  font-size: var(--t-2xl);
}

h2 {
  font-size: var(--t-xl);
}

h3 {
  font-size: var(--t-l);
}

p {
  text-wrap: pretty;
}

.etiquette {
  font: 500 0.75rem / 1.4 var(--police-mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brume);
}

.kanji {
  font-family: var(--police-mincho);
  font-weight: 800;
  line-height: 1;
}

.mono {
  font-family: var(--police-mono);
}

.texte-secondaire {
  color: var(--brume);
}

.conteneur {
  width: min(100% - 2 * var(--marge), var(--largeur));
  margin-inline: auto;
}

.prose {
  max-width: 68ch;
}

.prose p + p {
  margin-top: 1em;
}

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

.lien-evitement {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--papier);
  color: var(--encre);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s;
}

.lien-evitement:focus {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
