/* Feuille de style commune au site Meshamoto.
 *
 * PARTAGEE PAR TOUTES LES PAGES, et c'est la raison de son existence : la page
 * d'accueil portait ses styles en ligne, et le guide en a ajoute trois autres.
 * Quatre copies d'un meme jeu de regles divergent — c'est le garde-fou anti-derive
 * que le projet applique partout ailleurs. Un test verifie que plus aucune page ne
 * porte de bloc <style>.
 *
 * Aucune etape de construction : Caddy sert ce fichier tel quel, comme les pages.
 * Sombre par defaut, clair pour qui le demande.
 */

  /* Sombre par défaut, clair pour qui le demande. Le sombre est le mode « premier » :
     c'est celui dans lequel la page est conçue, l'autre en est la transposition. */
  :root {
    --fond: #0a0e11;      --fond-2: #0e1418;   --surface: #131b20;
    --surface-2: #182228; --trait: #23303a;    --trait-vif: #2f4250;
    --texte: #e9f0f4;     --doux: #8ba0ad;     --faible: #6b8290;
    --accent: #2ee6a0;    --accent-fonce: #17c886; --accent-voile: rgba(46,230,160,.09);
    --violet: #9b8cff;    --ambre: #ffc061;
    --ombre: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.28);
  }
  @media (prefers-color-scheme: light) {
    :root {
      --fond: #fbfcfd;      --fond-2: #f3f6f8;   --surface: #ffffff;
      --surface-2: #f6f9fa; --trait: #dfe6ea;    --trait-vif: #c6d2d9;
      --texte: #0e1a20;     --doux: #556b78;     --faible: #6b8290;
      --accent: #067a52;    --accent-fonce: #05613f; --accent-voile: rgba(6,122,82,.07);
      --violet: #5b46d6;    --ambre: #a86a00;
      --ombre: 0 1px 2px rgba(16,32,40,.06), 0 8px 24px rgba(16,32,40,.06);
    }
  }

  * { box-sizing: border-box; }
  html { scroll-behavior: smooth; }
  body {
    margin: 0; background: var(--fond); color: var(--texte);
    font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
    -webkit-font-smoothing: antialiased;
  }
  .large { max-width: 68rem; margin: 0 auto; padding: 0 1.5rem; }
  h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; }
  h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 .6rem; }
  h3 { font-size: 1.02rem; margin: 0 0 .4rem; letter-spacing: -.01em; }
  p { margin: 0 0 1rem; }
  a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
  ul { padding-left: 1.15rem; } li { margin-bottom: .45rem; }
  code, .mono { font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, monospace; }
  code { background: var(--surface-2); border: 1px solid var(--trait);
         padding: .08rem .35rem; border-radius: 5px; font-size: .88em; }

  /* Micro-étiquette monospace : le liant visuel entre les sections. */
  .eyebrow {
    font: 600 .72rem/1 ui-monospace, monospace; letter-spacing: .16em;
    text-transform: uppercase; color: var(--accent); margin: 0 0 .9rem;
    display: flex; align-items: center; gap: .55rem;
  }
  .eyebrow::before { content: ""; width: 1.4rem; height: 1px; background: var(--accent); opacity: .55; }

  section { padding: 4.5rem 0; border-top: 1px solid var(--trait); }
  section:first-of-type { border-top: 0; }
  .intro { color: var(--doux); max-width: 44rem; font-size: 1.05rem; }

  /* ---- barre de navigation ---- */
  .barre {
    position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px);
    background: color-mix(in srgb, var(--fond) 86%, transparent);
    border-bottom: 1px solid var(--trait);
  }
  .barre .large { display: flex; align-items: center; gap: 1.5rem; height: 3.75rem; }
  .logo { display: flex; align-items: center; gap: .55rem; font-weight: 700;
          letter-spacing: -.02em; font-size: 1.05rem; color: var(--texte); text-decoration: none; }
  .logo svg { display: block; }
  .liens { margin-left: auto; display: flex; gap: 1.4rem; align-items: center; }
  .liens a { color: var(--doux); text-decoration: none; font-size: .92rem; }
  .liens a:hover { color: var(--texte); }
  @media (max-width: 46rem) { .liens a.optionnel { display: none; } }

  /* ---- boutons ---- */
  .bouton {
    display: inline-flex; align-items: center; gap: .5rem; text-decoration: none;
    padding: .62rem 1.15rem; border-radius: 9px; font-weight: 600; font-size: .95rem;
    border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  }
  .bouton.plein { background: var(--accent); color: #04120c; }
  .bouton.plein:hover { background: var(--accent-fonce); }
  .bouton.vide { border-color: var(--trait-vif); color: var(--texte); background: var(--surface); }
  .bouton.vide:hover { border-color: var(--accent); }

  /* ---- héros ---- */
  .heros { position: relative; padding: 5rem 0 3.5rem; overflow: hidden; }
  .heros::before {
    content: ""; position: absolute; inset: -40% 20% auto -10%; height: 34rem;
    background: radial-gradient(ellipse at 30% 40%, var(--accent-voile), transparent 62%);
    pointer-events: none;
  }
  .heros h1 {
    font-size: clamp(2.3rem, 6vw, 3.9rem); margin: 0 0 1rem; max-width: 20ch;
  }
  .heros h1 em { font-style: normal; color: var(--accent); }
  .heros .intro { font-size: 1.15rem; }
  .actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.9rem; }
  .sous-actions { margin-top: .9rem; font-size: .87rem; color: var(--faible); }

  /* ---- bandeau de chiffres ---- */
  .chiffres {
    display: grid; gap: 1px; background: var(--trait); border: 1px solid var(--trait);
    border-radius: 14px; overflow: hidden; margin-top: 3.2rem;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  }
  .chiffre { background: var(--surface); padding: 1.15rem 1.25rem; }
  .chiffre b { display: block; font-size: 1.5rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
  .chiffre span { color: var(--faible); font-size: .82rem; line-height: 1.4; display: block; margin-top: .15rem; }

  /* ---- panneau façon navigateur de serveurs ---- */
  .panneau {
    background: var(--surface); border: 1px solid var(--trait); border-radius: 14px;
    overflow: hidden; box-shadow: var(--ombre); margin: 1.75rem 0 1rem;
  }
  .panneau-tete {
    display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem;
    background: var(--surface-2); border-bottom: 1px solid var(--trait);
    font: 600 .78rem/1 ui-monospace, monospace; letter-spacing: .06em;
    text-transform: uppercase; color: var(--faible);
  }
  .pastille { width: .55rem; height: .55rem; border-radius: 50%; background: var(--trait-vif); }
  .pastille.vive { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-voile); }
  .panneau-tete .titre { margin-left: .35rem; }
  .tableau-defilant { overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; font-size: .93rem; }
  thead th {
    text-align: left; padding: .7rem 1rem; font: 600 .72rem/1 ui-monospace, monospace;
    letter-spacing: .12em; text-transform: uppercase; color: var(--faible);
    border-bottom: 1px solid var(--trait); white-space: nowrap;
  }
  tbody td { padding: .78rem 1rem; border-bottom: 1px solid var(--trait); vertical-align: middle; }
  tbody tr:last-child td { border-bottom: 0; }
  .num { font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; color: var(--doux); }
  .etat { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }
  .point { width: .5rem; height: .5rem; border-radius: 50%; flex: none; }
  .point.vert { background: var(--accent); } .point.ambre { background: var(--ambre); }
  .point.gris { background: var(--trait-vif); }
  .jeu { font-weight: 600; } .carte-jeu { color: var(--doux); }
  .cta-ligne {
    font: 600 .78rem/1 ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase;
    color: var(--accent); border: 1px solid var(--accent); border-radius: 6px;
    padding: .32rem .6rem; white-space: nowrap;
  }
  .legende { color: var(--faible); font-size: .88rem; margin: 0; }

  /* ---- grilles de cartes ---- */
  .grille { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin-top: 2rem; }
  .carte {
    background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; padding: 1.35rem;
  }
  .carte p { margin: 0; color: var(--doux); font-size: .93rem; }
  .icone {
    width: 2.1rem; height: 2.1rem; border-radius: 8px; display: grid; place-items: center;
    background: var(--accent-voile); border: 1px solid var(--trait); margin-bottom: .85rem;
  }
  .icone svg { stroke: var(--accent); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

  /* ---- « ne jamais laisser deviner » ---- */
  .avant-apres { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr)); margin-top: 2rem; }
  .cas { background: var(--surface); border: 1px solid var(--trait); border-radius: 12px; overflow: hidden; }
  .cas .situation {
    padding: .85rem 1.15rem; background: var(--surface-2); border-bottom: 1px solid var(--trait);
    font-size: .9rem; color: var(--doux);
  }
  .cas .reponse { padding: 1.05rem 1.15rem; font-size: .93rem; }
  .cas .reponse b { color: var(--accent); font-weight: 600; }

  /* ---- comparatif ---- */
  .comparatif { background: var(--surface); border: 1px solid var(--trait); border-radius: 14px; overflow: hidden; margin-top: 2rem; }
  .comparatif td.oui { color: var(--accent); font-weight: 600; }
  .comparatif td:first-child { color: var(--texte); }
  .comparatif td { color: var(--doux); }
  .places { color: var(--faible); font-size: .9rem; margin-top: 1rem; }

  /* ---- formulaire ---- */
  form { background: var(--surface); border: 1px solid var(--trait); border-radius: 14px; padding: 1.75rem; margin-top: 2rem; }
  label { display: block; font-weight: 600; margin: 1.15rem 0 .35rem; font-size: .92rem; }
  label:first-child { margin-top: 0; }
  .aide { font-weight: 400; color: var(--faible); font-size: .85rem; }
  input, select {
    width: 100%; padding: .65rem .75rem; font: inherit; color: var(--texte);
    background: var(--fond-2); border: 1px solid var(--trait); border-radius: 9px;
  }
  input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
  form button { margin-top: 1.6rem; }
  button:disabled { opacity: .5; cursor: default; }
  .resultat { margin-top: 1.35rem; padding: 1.1rem 1.25rem; border-radius: 10px; display: none; }
  .resultat.ok { display: block; background: var(--accent-voile); border: 1px solid var(--accent); }
  .resultat.erreur { display: block; background: var(--surface-2); border: 1px solid var(--trait); }
  .cle { font-family: ui-monospace, monospace; font-size: 1.35rem; font-weight: 700;
         letter-spacing: .06em; margin: .6rem 0; user-select: all; word-break: break-all; color: var(--accent); }

  footer { border-top: 1px solid var(--trait); padding: 3rem 0 4rem; color: var(--doux); font-size: .9rem; }
  footer h3 { color: var(--texte); }
  .mentions { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--trait); color: var(--faible); font-size: .84rem; }

/* ─────────────────────────────────────────────────────────────────────────
   Composants du guide (/guide, /guide/services, /guide/serveur)
   ───────────────────────────────────────────────────────────────────────── */

.fil { font-size: .88rem; color: var(--faible); margin: 0 0 1.2rem; }
.fil a { color: var(--faible); text-decoration: none; }
.fil a:hover { color: var(--accent); }

.doc { max-width: 46rem; }
.doc h2 { margin: 3.2rem 0 .8rem; scroll-margin-top: 5rem; }
.doc h3 { margin: 2.2rem 0 .6rem; font-size: 1.12rem; scroll-margin-top: 5rem; }
.doc p, .doc li { color: var(--doux); }
.doc strong { color: var(--texte); }
.doc h2 + p, .doc h3 + p { margin-top: 0; }

/* Sommaire de page */
.sommaire {
  background: var(--surface); border: 1px solid var(--trait); border-radius: 12px;
  padding: 1.1rem 1.35rem; margin: 2rem 0;
}
.sommaire p {
  font: 600 .72rem/1 ui-monospace, monospace; letter-spacing: .14em;
  text-transform: uppercase; color: var(--faible); margin: 0 0 .7rem;
}
.sommaire ol { margin: 0; padding-left: 1.2rem; }
.sommaire li { margin-bottom: .3rem; color: var(--doux); }
.sommaire a { text-decoration: none; }
.sommaire a:hover { text-decoration: underline; }

/* Étapes numérotées */
.etapes { list-style: none; counter-reset: etape; padding: 0; margin: 1.5rem 0; }
.etapes > li {
  counter-increment: etape; position: relative; padding: 0 0 1.4rem 3rem;
  margin: 0; border-left: 1px solid var(--trait); 
}
.etapes > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.etapes > li::before {
  content: counter(etape); position: absolute; left: -.95rem; top: -.15rem;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--trait-vif); color: var(--accent);
  display: grid; place-items: center;
  font: 700 .82rem/1 ui-monospace, monospace;
}
.etapes > li > b { display: block; color: var(--texte); font-size: 1rem; margin-bottom: .3rem; }

/* Encarts */
.note, .attention {
  border-radius: 10px; padding: .95rem 1.15rem; margin: 1.4rem 0; font-size: .93rem;
  border: 1px solid var(--trait); background: var(--surface);
}
.note { border-left: 3px solid var(--accent); }
.attention { border-left: 3px solid var(--ambre); }
.note p:last-child, .attention p:last-child { margin-bottom: 0; }
.note .titre, .attention .titre {
  display: block; font-weight: 700; color: var(--texte); margin-bottom: .3rem;
  font-size: .88rem; letter-spacing: .01em;
}
.attention .titre { color: var(--ambre); }

/* Bloc de commande */
pre {
  background: var(--fond-2); border: 1px solid var(--trait); border-radius: 10px;
  padding: .95rem 1.1rem; overflow-x: auto; margin: 1.1rem 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .87rem;
  line-height: 1.55; color: var(--texte);
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }
pre .commentaire { color: var(--faible); }

/* Fiche de jeu mesurée */
.recette {
  background: var(--surface); border: 1px solid var(--trait); border-radius: 12px;
  padding: 1.25rem 1.4rem; margin: 1.2rem 0;
}
.recette h3 { margin: 0 0 .2rem; color: var(--texte); }
.recette .mesure {
  font: 600 .7rem/1 ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .9rem; display: block;
}
.recette dl { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.1rem; margin: 0; }
.recette dt { font: 600 .82rem/1.5 ui-monospace, monospace; color: var(--faible); }
.recette dd { margin: 0; font-size: .93rem; color: var(--doux); }
.recette dd strong { color: var(--texte); }
@media (max-width: 34rem) {
  .recette dl { grid-template-columns: 1fr; gap: .1rem .5rem; }
  .recette dt { margin-top: .6rem; }
}

/* Navigation de bas de page entre les volets du guide */
.suite { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin-top: 3rem; }
.suite a {
  display: block; text-decoration: none; background: var(--surface);
  border: 1px solid var(--trait); border-radius: 12px; padding: 1.1rem 1.25rem;
}
.suite a:hover { border-color: var(--accent); }
.suite span {
  font: 600 .7rem/1 ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase;
  color: var(--faible); display: block; margin-bottom: .35rem;
}
.suite b { color: var(--texte); font-size: 1rem; }
