/* ============================================================================
 * FrenchHive - Charte graphique partagee (design system V3)
 * ----------------------------------------------------------------------------
 * Source : adaptation de D:/DEV/Pilote_IA/static/theme.css ("FrenchHive V3").
 * Palette "nid d'abeille" : surfaces sombres profondes + accent jaune ruche.
 *
 * Regles projet :
 *  - ASCII uniquement (aucun caractere unicode/emoji).
 *  - 100% portable / hors-ligne : AUCUNE police ni ressource telechargee du web.
 *    Les piles de polices ont un repli systeme propre.
 *  - Theme clair ET sombre via l'attribut data-theme sur <html>.
 *
 * Contrainte d'accessibilite : le jaune ruche vif (#ffcc00) est illisible avec
 * du texte blanc. Donc --primary = ambre/miel lisible, et le jaune vif est
 * reserve aux accents (bordures, halos, remplissage de boutons avec texte sombre).
 * ==========================================================================*/

:root {
  /* --- Or de marque (tokens officiels FrenchHive, tokens.json 2026-05-16) --- */
  --hive: #F0B040;           /* hive_gold : couleur signature du logo */
  --hive-soft: #F5CC6B;      /* sun_bee : or clair, fonds d'accent legers */
  --hive-deep: #C08820;      /* honey_amber : or fonce, hover/etats actifs */
  --hive-glow: rgba(240, 176, 64, 0.30);

  /* En-tetes / bandes dorees : texte sombre par-dessus */
  --header-1: #F0B040;
  --header-2: #C08820;
  --header-fg: #1a1205;

  /* Remplissage accent (boutons, pastilles, etats actifs) : or + texte sombre */
  --accent-fill: #F0B040;
  --accent-fill-2: #C08820;
  --on-accent: #1a1205;

  /* --- Tokens applicatifs (theme CLAIR par defaut) --- */
  /* primary = ambre lisible pour texte/liens (AA sur fond clair) ; les FONDS
     dores utilisent --accent-fill / --hive, pas --primary. */
  --primary: #8a5e10;
  --primary-dark: #6e4b0c;
  --primary-light: #fbeccb;
  --on-primary: #ffffff;

  --success: #2E5E3E;        /* forest_hive (conformite, validation) */
  --success-light: #dceee2;
  --warning: #C08820;
  --warning-light: #fbeccb;
  --danger: #C0392B;         /* alert_coral (risque, SLA non tenu) */
  --danger-light: #f7dcd8;
  --info: #2563eb;

  --bg: #ffffff;             /* background_default */
  --bg-alt: #F7F4ED;         /* linen : bandes alternees, fonds d'accent */
  --card-bg: #ffffff;
  --text: #1A1A1A;           /* charcoal */
  --text-muted: #6b7280;     /* derive de slate_mist, assombri pour lisibilite */
  --border: #ece5d8;
  --shadow: rgba(120, 90, 0, 0.08);
  --shadow-hover: rgba(120, 90, 0, 0.16);

  /* Barre de navigation globale (noir nightcomb -> charbon) */
  --nav-bg-1: #0d0d0d;
  --nav-bg-2: #1A1A1A;
  --nav-fg: #f5f0e6;
  --nav-accent: var(--hive);

  /* Polices officielles (Aptos = Win11/M365) ; repli systeme, aucune
     dependance reseau (regle 100% portable / hors-ligne). */
  --font-sans: "Aptos", "Segoe UI", Calibri, system-ui, Arial, sans-serif;
  --font-display: "Aptos Display", "Aptos", "Segoe UI", Calibri, system-ui, sans-serif;
  --font-mono: "Consolas", ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, monospace;

  --radius: 12px;
  --radius-lg: 20px;
  --maxw: 1180px;

  --space-1: 6px;
  --space-2: 12px;
  --space-3: 20px;
  --space-4: 32px;
  --space-5: 56px;
  --space-6: 88px;
}

/* html[data-theme] (specificite 0,1,1) gagne toujours sur :root local d'une page */
html[data-theme="dark"] {
  --bg: #070708;
  --bg-alt: #0e0e10;
  --card-bg: #131316;
  --text: #f5f5f7;
  --text-muted: #8a8a94;
  --border: rgba(255, 255, 255, 0.10);
  --shadow: rgba(0, 0, 0, 0.45);
  --shadow-hover: rgba(0, 0, 0, 0.6);

  --primary: #F0B040;        /* hive_gold : accent-texte lisible sur noir */
  --primary-dark: #C08820;
  --primary-light: #3a2c08;
  --on-primary: #1a1205;

  --success: #5fb87e;
  --success-light: #123a23;
  --warning: #F5CC6B;
  --warning-light: #4a3608;
  --danger: #e07a6f;
  --danger-light: #4a1c17;
  --info: #60a5fa;

  --nav-bg-1: #0c0c0e;
  --nav-bg-2: #131316;
  --nav-fg: #f5f5f7;
  --nav-accent: var(--hive);
}

/* ----------------------------- Base ------------------------------------- */
* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
html[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-sans);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }
code, pre, kbd, samp { font-family: var(--font-mono); }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--hive-deep); text-decoration: underline; }

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

/* ----------------------------- Layout ----------------------------------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--space-3); }
.section { padding: var(--space-6) 0; }
.section--alt { background: var(--bg-alt); }
.center { text-align: center; }
.muted { color: var(--text-muted); }
.lead { font-size: 1.15rem; color: var(--text-muted); max-width: 60ch; }
.center .lead { margin-left: auto; margin-right: auto; }

.grid { display: grid; gap: var(--space-3); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) {
  .grid--3, .grid--2 { grid-template-columns: 1fr; }
}

/* ----------------------------- Cartes ----------------------------------- */
.card {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
  box-shadow: 0 1px 3px var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card--link:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px var(--shadow-hover);
  border-color: var(--hive);
}
.card h3 { color: var(--primary); }

/* ----------------------------- Badges ----------------------------------- */
.badge {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.badge--prod   { background: var(--success-light); color: var(--success); }
.badge--actif  { background: var(--primary-light); color: var(--primary-dark); }
.badge--mvp    { background: var(--warning-light); color: var(--warning); }
.badge--soon   { background: var(--bg-alt); color: var(--text-muted); border: 1px solid var(--border); }

/* ----------------------------- Boutons ---------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 11px 22px;
  font-family: var(--font-sans);
  font-size: .98rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s ease, background-color .15s ease, transform .1s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--accent-fill); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-fill-2); color: var(--on-accent); }
.btn--ghost { background: transparent; color: var(--primary); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--hive); color: var(--hive-deep); }

/* ----------------------------- Pastilles de confiance ------------------- */
.trust { display: inline-flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.trust span {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: .85rem;
}

/* ----------------------------- Motif d'alveoles ------------------------- */
/* Injecte par hive.js dans #fh-hive ; reste derriere tout le contenu. */
#fh-hive {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.50;
  --gut: calc((100vw - var(--maxw)) / 2);
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(var(--gut) - 40px),
    transparent var(--gut), transparent calc(100% - var(--gut)),
    #000 calc(100% - var(--gut) + 40px), #000 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(var(--gut) - 40px),
    transparent var(--gut), transparent calc(100% - var(--gut)),
    #000 calc(100% - var(--gut) + 40px), #000 100%);
}
[data-theme="dark"] #fh-hive { opacity: 0.30; }
#fh-hive svg { display: block; width: 100%; height: 100%; }
#fh-hive .fh-hexcell { fill: none; stroke: var(--hive-deep); stroke-width: 1.4; }
[data-theme="dark"] #fh-hive .fh-hexcell { stroke: var(--hive); }
@media (max-width: 1280px) { #fh-hive { display: none; } }

/* ----------------------------- Divers ----------------------------------- */
::selection { background: var(--hive); color: #1a1205; }
* { scrollbar-color: var(--hive-deep) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--hive-deep) 60%, transparent);
  border-radius: 8px; border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--hive-deep); background-clip: padding-box; }

body, .card, input, select, textarea, .site-nav {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

/* Accessibilite : focus clavier visible (WCAG 2.4.7). Ne s'affiche qu'au clavier
   (focus-visible), pas au clic souris. */
a:focus-visible, button:focus-visible, .card:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--hive);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Lien d'evitement clavier (skip to content). */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 1000;
  background: var(--accent-fill); color: var(--on-accent);
  padding: 10px 16px; border-radius: 8px; font-weight: 700; text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 12px; }

/* Respect de prefers-reduced-motion : coupe les animations/hovers transformants. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .card--link:hover { transform: none; }
}
