/* ============================================================
   Machaon — Design Tokens
   Source de vérité : MACHAON-DESIGN-SYSTEM.md §13
   Toutes les couleurs, typo, espacements, rayons, ombres et
   transitions du produit sont déclarés ici.
   ============================================================ */

/* Polices copiées dans le projet (lot 5) : le jeu fonctionne sans Internet. */
@import url('./vendor/fonts/fonts.css');

:root {
  /* ---------- COULEURS ---------- */

  /* Bleus cockpit */
  --abyss:       #1B3556;
  --midnight:    #244A72;
  --horizon:     #3D6A93;
  --horizon-40:  #3D6A9366;
  --horizon-20:  #3D6A9333;

  /* Action / interactif */
  --signal:      #2F7EE0;
  --signal-80:   #2F7EE0CC;
  --signal-40:   #2F7EE066;
  --signal-20:   #2F7EE033;
  --signal-08:   #2F7EE014;

  /* Lavis clair */
  --brume:       #D6E5F1;
  --brume-60:    #D6E5F199;

  /* Surfaces papier / parchemin */
  --papier:           #FBF6E9;
  --parchemin:        #F5E9CB;
  --parchemin-shadow: #E9D9AE;

  /* Accents chauds */
  --or:          #E0A847;
  --or-80:       #E0A847CC;
  --or-20:       #E0A84733;
  --cuivre:      #C46A38;
  --cuivre-20:   #C46A3833;

  /* Textes sur clair */
  --sepia:       #3A2516;
  --encre:       #5B4636;
  --encre-60:    #5B463699;
  --encre-40:    #5B463666;

  /* Textes sur sombre */
  --ivoire:      #F2E9D4;
  --brume-text:  #A8C0D0;
  --brume-dim:   #6A8298;

  /* Sémantique — pas de vert */
  --success:     var(--signal);
  --warning:     var(--or);
  --danger:      var(--cuivre);
  --info:        var(--brume);

  /* Échelle Score Planète — cobalt vers terre cuite */
  --planet-100:  #1E6FD9;
  --planet-80:   #4F89D9;
  --planet-60:   #9BA5BD;
  --planet-40:   #D49B3A;
  --planet-20:   #B8602E;
  --planet-0:    #6B2E14;

  /* Palette des 8 équipes */
  --equipe-1:    #2F7EE0;
  --equipe-2:    #E0A847;
  --equipe-3:    #C46A38;
  --equipe-4:    #244A72;
  --equipe-5:    #7A4F2E;
  --equipe-6:    #7B6FA0;
  --equipe-7:    #A0432B;
  --equipe-8:    #5E7589;

  /* ---------- TYPOGRAPHIE ---------- */

  --font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --font-body:    'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, 'Menlo', monospace;

  /* Échelle base 16 px */
  --fs-xs:   12px;
  --fs-sm:   14px;
  --fs-base: 16px;
  --fs-md:   18px;
  --fs-lg:   22px;
  --fs-xl:   28px;
  --fs-2xl:  36px;
  --fs-3xl:  48px;
  --fs-4xl:  64px;

  /* Hauteurs de ligne */
  --lh-tight:   1.05;
  --lh-snug:    1.2;
  --lh-normal:  1.5;
  --lh-relaxed: 1.65;

  /* Tracking */
  --tracking-tight:   -0.02em;
  --tracking-normal:  0;
  --tracking-wide:    0.04em;
  --tracking-wider:   0.08em;
  --tracking-widest:  0.14em;

  /* Graisses */
  --w-light:    300;
  --w-regular:  400;
  --w-medium:   500;
  --w-semibold: 600;
  --w-bold:     700;

  /* ---------- ESPACEMENTS (échelle 4 px) ---------- */
  --space-0:  0;
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;

  /* ---------- RAYONS ---------- */
  --r-xs:   2px;
  --r-sm:   4px;
  --r-md:   8px;
  --r-lg:   12px;
  --r-xl:   16px;
  --r-2xl:  24px;
  --r-full: 999px;

  /* ---------- OMBRES ---------- */
  --shadow-instrument:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 0 0 1px rgba(0, 0, 0, 0.18),
    0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-card:
    0 1px 2px rgba(58, 37, 22, 0.06),
    0 6px 16px rgba(58, 37, 22, 0.08);
  --shadow-event:
    0 2px 4px rgba(58, 37, 22, 0.06),
    0 16px 40px rgba(58, 37, 22, 0.22);
  --shadow-focus:
    0 0 0 2px var(--papier),
    0 0 0 4px var(--signal);

  /* ---------- TRANSITIONS ---------- */
  --ease-default:    cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-mechanical: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-micro:       120ms;
  --dur-ui:          220ms;
  --dur-event:       400ms;
  --dur-instrument:  700ms;
}

/* ============================================================
   STYLES ÉLÉMENTAIRES — base de tous les écrans
   ============================================================ */

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

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--sepia);
  background: var(--papier);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, .machaon-h1 {
  font-family: var(--font-display);
  font-size: var(--fs-3xl);
  font-weight: var(--w-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--sepia);
  margin: 0;
}

h2, .machaon-h2 {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--w-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--sepia);
  margin: 0;
}

h3, .machaon-h3 {
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--w-semibold);
  line-height: var(--lh-snug);
  color: var(--sepia);
  margin: 0;
}

h4, .machaon-h4 {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: var(--w-semibold);
  line-height: var(--lh-snug);
  color: var(--sepia);
  margin: 0;
}

p, .machaon-p {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--encre);
  margin: 0;
}

small, .machaon-small {
  font-size: var(--fs-sm);
  color: var(--encre-60);
}

/* Label cockpit — MAJUSCULES, tracking large, mono */
.machaon-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--w-medium);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--encre-60);
}

/* Données — chiffres tabulaires */
.machaon-data {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: var(--w-medium);
}

.machaon-data-xl {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: var(--w-medium);
  font-size: var(--fs-2xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
}

/* Surface sombre */
.machaon-on-dark {
  color: var(--ivoire);
  background: var(--abyss);
}
.machaon-on-dark h1,
.machaon-on-dark h2,
.machaon-on-dark h3,
.machaon-on-dark h4 { color: var(--ivoire); }
.machaon-on-dark p { color: var(--brume-text); }
.machaon-on-dark .machaon-eyebrow { color: var(--brume-dim); }

/* Anneau de focus accessible — toujours visible */
*:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Lien « Aller au contenu principal » — visible uniquement au focus clavier.
   Permet à un utilisateur Tab d'éviter de re-traverser tous les écrans à
   chaque navigation. Cible #machaon-app, qui est notre landmark <main>. */
.machaon-skip-link {
  position: fixed;
  top: -100px;
  left: var(--space-3);
  z-index: 9999;
  background: var(--cuivre);
  color: var(--ivoire);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--w-semibold);
  text-decoration: none;
  transition: top 0.18s ease-out;
}
.machaon-skip-link:focus,
.machaon-skip-link:focus-visible {
  top: var(--space-3);
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

/* Respect du préférence de réduction des mouvements.
   Coupe les animations longues, garde les transitions courtes (UX visuelle
   inchangée pour les feedbacks immédiats type focus). */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
