/* ===== Thème : couleurs, police, bases ===== */

/* SF Pro chargée explicitement : la police installée « pour l'utilisateur » sous Windows
   n'est pas toujours visible par le navigateur, d'où le repli sur Inter.
   On essaie d'abord la police système, puis les fichiers du dossier Fonts/.
   Regular couvre 100–549, Bold 550–900 (pas de faux gras). */
@font-face {
  font-family: "SFPro";
  src: local("SF Pro Text Regular"), local("SFProText-Regular"), url("../Fonts/SF-Pro-Text-Regular.otf") format("opentype");
  font-weight: 100 549; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "SFPro";
  src: local("SF Pro Text Bold"), local("SFProText-Bold"), url("../Fonts/SF-Pro-Text-Bold.otf") format("opentype");
  font-weight: 550 900; font-style: normal; font-display: swap;
}

/* Palette Zirve (Brand/Colors) : Cream / Ink en clair, Night / Cream en sombre, Platinum en accent.
   Le rouge (--Accent) ne sert qu'aux alertes, erreurs et compteurs.
   Les couleurs lues par les scripts (graphiques, barre de répartition) restent en hexadécimal. */
:root {
  --Bg: #f5f3ef;               /* Cream */
  --Ink: #111111;              /* Ink */
  --Muted: #6b6b6b;            /* Stone */
  --Faint: #b4b7bc;
  --Line: #c9cdd3;             /* Platinum : traits de la carte */
  --LineSoft: #e4e2dd;
  --Panel: rgba(255, 255, 255, .88);
  --PanelSolid: #ffffff;
  --Node: #ffffff;
  --Chip: #eae8e3;
  --ChipHover: #e2e0da;
  --ChipActive: #d8d6d0;
  --Raised: #ffffff;           /* onglet actif dans un sélecteur */
  --Brand: #111111;            /* boutons principaux, sélection */
  --BrandInk: #f5f3ef;
  --Platinum: #8f949c;         /* PlatinumDeep sur fond clair */
  --Accent: #c0362c;
  --AccentInk: #fff;
  --Scroll: rgba(17, 17, 17, .16);
  --ScrollHover: rgba(17, 17, 17, .32);
  /* Seule ombre du site, réservée à ce qui flotte (fenêtres, menus, toasts) : anneau à peine visible + ombre courte */
  --Float: 0 0 0 1px rgba(17, 17, 17, .06), 0 4px 14px -6px rgba(17, 17, 17, .12);
  --Radius: 10px;              /* cartes, fenêtres, menus */
  --RadiusControl: 7px;        /* boutons, champs, sélecteurs */
  --RadiusInner: 5px;          /* élément dans un sélecteur (2 px de marge) */
  --Ease: cubic-bezier(.16, 1, .3, 1);
  --EaseIn: cubic-bezier(.4, 0, 1, 1);
  --Font: -apple-system, BlinkMacSystemFont, "SFPro", "SF Pro Text", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --Bg: #0e0e0e; --Ink: #f5f3ef; --Muted: #8f949c; --Faint: #3c3f44;
    --Line: #4a4e54; --LineSoft: #232323; --Panel: rgba(23, 23, 23, .88); --PanelSolid: #171717;
    --Node: #171717; --Chip: #222222; --ChipHover: #2a2a2a; --ChipActive: #343434; --Raised: #383838;
    --Brand: #c9cdd3; --BrandInk: #0e0e0e; --Platinum: #c9cdd3; --Accent: #e5594f;
    --Scroll: rgba(245, 243, 239, .12); --ScrollHover: rgba(245, 243, 239, .26);
    --Float: 0 0 0 1px rgba(255, 255, 255, .06), 0 6px 18px -8px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  --Bg: #0e0e0e; --Ink: #f5f3ef; --Muted: #8f949c; --Faint: #3c3f44;
  --Line: #4a4e54; --LineSoft: #232323; --Panel: rgba(23, 23, 23, .88); --PanelSolid: #171717;
  --Node: #171717; --Chip: #222222; --ChipHover: #2a2a2a; --ChipActive: #343434; --Raised: #383838;
  --Brand: #c9cdd3; --BrandInk: #0e0e0e; --Platinum: #c9cdd3; --Accent: #e5594f;
  --Scroll: rgba(245, 243, 239, .12); --ScrollHover: rgba(245, 243, 239, .26);
  --Float: 0 0 0 1px rgba(255, 255, 255, .06), 0 6px 18px -8px rgba(0, 0, 0, .6);
}

/* Logo Zirve : une version par thème (dossier Brand/) */
.ForDark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ForLight { display: none; }
  :root:not([data-theme="light"]) .ForDark { display: block; }
}
:root[data-theme="dark"] .ForLight { display: none; }
:root[data-theme="dark"] .ForDark { display: block; }

* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--Bg); color: var(--Ink);
  font: 14px/1.5 var(--Font);
  -webkit-font-smoothing: antialiased;
  /* Largeurs de texte proportionnelles au zoom du navigateur (pas de recalage
     des lettres sur les pixels), donc rien ne se décale d'un niveau à l'autre. */
  text-rendering: geometricPrecision;
}
button, input, select, textarea { font: inherit; color: inherit; }
/* Aucun contour de focus (ni à la souris, ni après Échap / clavier) */
:focus, :focus-visible { outline: none; }
.Tabular { font-variant-numeric: tabular-nums; }

/* Texte sélectionnable partout, aux couleurs du site (encre légère en clair, crème en sombre).
   Les boutons et onglets restent non sélectionnables : un double-clic n'y surligne rien. */
:root { --Selection: rgba(17, 17, 17, .14); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --Selection: rgba(245, 243, 239, .22); } }
:root[data-theme="dark"] { --Selection: rgba(245, 243, 239, .22); }
button, [role="button"], [role="tab"], .Tabs, .ViewSwitch, .Nav { -webkit-user-select: none; user-select: none; }
::selection { background: var(--Selection); color: inherit; }
::-moz-selection { background: var(--Selection); color: inherit; }

/* ===== Scrollbars ===== */
/* Barres WebKit (Chrome, Edge, Safari). Les propriétés standard ne servent qu'aux navigateurs
   sans ::-webkit-scrollbar (Firefox) : dans Chrome, elles remplaceraient le style WebKit
   par la barre fine du système, avec ses flèches. */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--Scroll) transparent; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; margin: 14px 0; }
::-webkit-scrollbar-thumb { background: var(--Scroll); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; min-height: 40px; }
::-webkit-scrollbar-thumb:hover { background: var(--ScrollHover); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }

/* ===== Animations partagées ===== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important; transition-delay: 0s !important;
  }
}
