/* ============================================================================
   Tsukuya — feuille de style unique.
   Direction : « veille de nuit ». Encre bleu nuit, clair de lune dore,
   telemetrie en mono. Change les variables ci-dessous pour retoucher le site.
   ========================================================================= */

:root {
  /* Couleurs */
  --encre:        #070B18;
  --encre-2:      #0B1124;
  --surface:      #111935;
  --surface-2:    #16204170;
  --ligne:        #1D2748;
  --ligne-vive:   #2B3868;
  --texte:        #EDF0FA;
  --texte-doux:   #8290BC;
  --lune:         #E7C583;   /* accent principal */
  --lune-pale:    #F5E4BE;
  --veille:       #8FA6FF;   /* accent secondaire */
  --ok:           #5FD2A6;
  --alerte:       #E9A13B;
  --erreur:       #F0666E;

  /* Typographie */
  --titre: 'Bricolage Grotesque', 'Trebuchet MS', sans-serif;
  --corps: 'Figtree', system-ui, -apple-system, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, 'Courier New', monospace;

  /* Mesures */
  --largeur: 1160px;
  --rayon: 14px;
  --rayon-s: 8px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--encre);
  color: var(--texte);
  font-family: var(--corps);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--lune); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--lune);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  font-family: var(--titre);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.18rem; letter-spacing: -0.02em; }
p  { margin: 0 0 1em; }

.contenu { width: 100%; max-width: var(--largeur); margin: 0 auto; padding: 0 24px; }
.section { padding: 76px 0; border-top: 1px solid var(--ligne); }
.section--nu { border-top: 0; }
.texte-doux { color: var(--texte-doux); }
.mono { font-family: var(--mono); }

/* Intitules de section : ils nomment le contenu, pas la decoration. */
.eyebrow {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--veille);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: '';
  width: 22px; height: 1px;
  background: var(--ligne-vive);
}

/* ─── Bandeau ────────────────────────────────────────────────────────────── */
.bandeau {
  background: linear-gradient(90deg, #141B36, #101733);
  border-bottom: 1px solid var(--ligne);
  font-size: .84rem;
  text-align: center;
  padding: 9px 16px;
  color: var(--texte-doux);
}
.bandeau a { color: var(--lune-pale); }

/* ─── Navigation ─────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(7, 11, 24, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ligne);
}
.nav__inner {
  display: flex; align-items: center; gap: 22px;
  min-height: 68px;
}
.marque {
  font-family: var(--titre);
  font-weight: 800;
  font-size: 1.32rem;
  letter-spacing: -.04em;
  color: var(--texte);
  display: flex; align-items: center; gap: 9px;
}
.marque:hover { text-decoration: none; color: var(--lune-pale); }
.marque .croissant { color: var(--lune); font-size: 1.05rem; }
.nav__liens { display: flex; gap: 4px; margin-left: 8px; flex: 1; }
.nav__liens a {
  color: var(--texte-doux);
  padding: 8px 12px;
  border-radius: var(--rayon-s);
  font-size: .95rem;
}
.nav__liens a:hover { color: var(--texte); background: var(--surface); text-decoration: none; }
.nav__liens a[aria-current='page'] { color: var(--lune-pale); background: var(--surface); }
.nav__actions { display: flex; align-items: center; gap: 10px; }
.nav__bascule {
  display: none;
  background: none; border: 1px solid var(--ligne-vive); color: var(--texte);
  border-radius: var(--rayon-s); padding: 8px 11px; font-size: 1rem; cursor: pointer;
}

/* ─── Boutons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--corps); font-weight: 600; font-size: .95rem;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background .18s ease, border-color .18s ease;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--lune { background: var(--lune); color: #22190A; }
.btn--lune:hover { background: var(--lune-pale); }
.btn--fantome { background: transparent; color: var(--texte); border-color: var(--ligne-vive); }
.btn--fantome:hover { border-color: var(--lune); color: var(--lune-pale); }
.btn--discret { background: var(--surface); color: var(--texte-doux); border-color: var(--ligne); font-size: .86rem; padding: 8px 13px; }
.btn--discret:hover { color: var(--texte); }
.btn--danger { background: transparent; color: var(--erreur); border-color: #4A2130; font-size: .86rem; padding: 8px 13px; }
.btn--large { padding: 14px 26px; font-size: 1.02rem; }

/* ─── Heros ──────────────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; padding: 92px 0 0; }
.hero::after {
  /* le clair de lune : un seul effet d'ambiance sur tout le site */
  content: '';
  position: absolute; top: -320px; right: -180px;
  width: 720px; height: 720px; border-radius: 50%;
  background: radial-gradient(circle, rgba(231,197,131,.13), rgba(143,166,255,.05) 45%, transparent 68%);
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; max-width: 760px; }
.hero h1 { margin-bottom: .28em; }
.hero h1 .accent { color: var(--lune); }
.hero__accroche { font-size: clamp(1.05rem, 2vw, 1.22rem); color: var(--texte-doux); max-width: 60ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }
.page-entete { padding: 66px 0 34px; position: relative; }
.page-entete h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); }
.page-entete p { color: var(--texte-doux); max-width: 62ch; }

/* ─── Console de veille (element signature) ──────────────────────────────── */
.console {
  margin: 54px 0 0;
  border: 1px solid var(--ligne);
  border-radius: var(--rayon);
  background: linear-gradient(180deg, #0E1430, #0A0F22);
  overflow: hidden;
}
.console__barre {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--ligne);
  font-family: var(--mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--texte-doux);
}
.console__barre .horodatage { margin-left: auto; text-transform: none; letter-spacing: .04em; }
.console__grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.console__cellule { padding: 20px 18px; border-right: 1px solid var(--ligne); }
.console__cellule:last-child { border-right: 0; }
.console__valeur {
  font-family: var(--mono); font-size: 1.72rem; font-weight: 600;
  letter-spacing: -.02em; color: var(--texte); line-height: 1.1;
}
.console__valeur.est-lune { color: var(--lune); }
.console__etiquette {
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--texte-doux); margin-top: 6px;
}
.pastille {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block;
  background: var(--texte-doux); flex: none;
}
.pastille--online { background: var(--ok); box-shadow: 0 0 0 0 rgba(95,210,166,.55); animation: pouls 2.4s infinite; }
.pastille--idle, .pastille--inconnu { background: var(--alerte); }
.pastille--offline { background: var(--erreur); }
@keyframes pouls {
  70%  { box-shadow: 0 0 0 9px rgba(95,210,166,0); }
  100% { box-shadow: 0 0 0 0 rgba(95,210,166,0); }
}

/* Sparkline de latence : barres proportionnelles au ping */
.sparkline { display: flex; align-items: flex-end; gap: 3px; height: 44px; padding: 18px; }
.sparkline span {
  flex: 1; min-width: 2px; border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--veille), #3C4B92);
  transition: height .4s ease;
}
.sparkline span.est-lent { background: linear-gradient(180deg, var(--alerte), #6B4A1A); }
.sparkline .sparkline__vide {
  background: none; align-self: center; flex: 1;
  color: var(--texte-doux); font-size: .85rem; text-align: center;
}

/* ─── Cartes et grilles ──────────────────────────────────────────────────── */
.grille { display: grid; gap: 18px; }
.grille--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grille--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grille--4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.carte {
  background: var(--encre-2);
  border: 1px solid var(--ligne);
  border-radius: var(--rayon);
  padding: 24px;
}
.carte h3 { margin-bottom: .45em; }
.carte p, .carte h3, .tableau td { overflow-wrap: anywhere; }
.carte p:last-child { margin-bottom: 0; }
.carte--vide { text-align: center; color: var(--texte-doux); padding: 44px 24px; }

/* Etapes numerotees : l'ordre compte reellement ici. */
.etape { display: flex; gap: 16px; align-items: flex-start; }
.etape__num {
  font-family: var(--mono); font-size: .8rem; color: var(--lune);
  border: 1px solid var(--ligne-vive); border-radius: 50%;
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
}

/* ─── Avis ───────────────────────────────────────────────────────────────── */
.etoiles { color: var(--lune); letter-spacing: 2px; font-size: 1rem; }
.etoiles .vide { color: var(--ligne-vive); }
.avis__entete { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--surface); flex: none; }
.avis__auteur { font-weight: 600; font-size: .95rem; }
.avis__date { font-size: .78rem; color: var(--texte-doux); font-family: var(--mono); }
.avis__reponse {
  margin-top: 14px; padding: 12px 14px;
  border-left: 2px solid var(--lune); background: var(--surface-2);
  border-radius: 0 var(--rayon-s) var(--rayon-s) 0;
  font-size: .93rem;
}
.resume-note { display: flex; flex-wrap: wrap; gap: 30px; align-items: center; }
.resume-note__chiffre { font-family: var(--mono); font-size: 3.4rem; font-weight: 600; color: var(--lune); line-height: 1; }
.barre-note { display: grid; grid-template-columns: 42px 1fr 46px; align-items: center; gap: 10px; font-size: .82rem; }
.barre-note__piste { height: 6px; background: var(--ligne); border-radius: 99px; overflow: hidden; }
.barre-note__jauge { height: 100%; background: var(--lune); border-radius: 99px; }

/* Selection de la note dans le formulaire.
   Les etoiles sont ecrites de 5 a 1 dans le HTML pour que « ~ » puisse
   remonter la file ; row-reverse les remet dans l'ordre a l'ecran. */
.note-choix { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 6px; }
.note-choix input { position: absolute; opacity: 0; width: 0; height: 0; }
.note-choix label {
  cursor: pointer; font-size: 1.6rem; color: var(--ligne-vive); line-height: 1;
  padding: 2px; transition: color .12s ease;
}
.note-choix input:checked ~ label { color: var(--lune); }
.note-choix label:hover,
.note-choix label:hover ~ label { color: var(--lune-pale); }
.note-choix input:focus-visible + label { outline: 2px solid var(--lune); outline-offset: 2px; }

/* Bloc depliant « modifier mon avis » : le resume sert de bouton. */
details.edition summary { list-style: none; cursor: pointer; }
details.edition summary::-webkit-details-marker { display: none; }
details.edition summary::marker { content: ''; }
details.edition[open] summary { opacity: .6; }

/* ─── Formulaires ────────────────────────────────────────────────────────── */
.champ { margin-bottom: 16px; }
.champ label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
.champ .aide { font-size: .8rem; color: var(--texte-doux); margin-top: 5px; }
input[type='text'], input[type='search'], input[type='number'], textarea, select {
  width: 100%;
  background: var(--encre);
  border: 1px solid var(--ligne-vive);
  border-radius: var(--rayon-s);
  color: var(--texte);
  font-family: var(--corps); font-size: .95rem;
  padding: 11px 13px;
}
textarea { min-height: 130px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--lune); outline: none; }
.ligne-champs { display: flex; gap: 12px; flex-wrap: wrap; }
.ligne-champs > * { flex: 1 1 200px; }

/* ─── Messages ───────────────────────────────────────────────────────────── */
.flash {
  border-radius: var(--rayon-s);
  padding: 12px 16px; margin-bottom: 22px;
  font-size: .93rem; border: 1px solid;
}
.flash--ok { background: #0E2A22; border-color: #1E5343; color: #A8E9CE; }
.flash--erreur { background: #2C1219; border-color: #5A2531; color: #F6B4B8; }

.badge {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 99px; border: 1px solid var(--ligne-vive); color: var(--texte-doux);
}
.badge--ok { color: var(--ok); border-color: #1E5343; }
.badge--attente { color: var(--alerte); border-color: #5A431E; }
.badge--refus { color: var(--erreur); border-color: #5A2531; }

/* ─── Tableaux ───────────────────────────────────────────────────────────── */
.tableau { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tableau th {
  text-align: left; font-family: var(--mono); font-size: .72rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--texte-doux);
  padding: 10px 12px; border-bottom: 1px solid var(--ligne);
}
.tableau td { padding: 12px; border-bottom: 1px solid var(--ligne); vertical-align: middle; }
.tableau tr:last-child td { border-bottom: 0; }
.defile { overflow-x: auto; }

/* ─── Commandes ──────────────────────────────────────────────────────────── */
.filtres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.filtres a {
  font-size: .86rem; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--ligne); color: var(--texte-doux);
}
.filtres a:hover, .filtres a.est-actif { border-color: var(--lune); color: var(--lune-pale); text-decoration: none; }
.commande {
  display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline;
  padding: 14px 0; border-bottom: 1px solid var(--ligne);
}
.commande:last-child { border-bottom: 0; }
.commande__nom { font-family: var(--mono); color: var(--lune-pale); font-size: .95rem; flex: none; min-width: 170px; }
.commande__desc { flex: 1 1 320px; color: var(--texte-doux); font-size: .93rem; }
.commande__perm { font-family: var(--mono); font-size: .74rem; color: var(--veille); }

/* ─── Documentation ──────────────────────────────────────────────────────── */
.doc { display: grid; grid-template-columns: 240px 1fr; gap: 34px; align-items: start; }
.doc__sommaire { position: sticky; top: 96px; }
.doc__sommaire ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.doc__sommaire a {
  display: block; padding: 7px 11px; border-radius: var(--rayon-s);
  color: var(--texte-doux); font-size: .92rem;
}
.doc__sommaire a:hover { background: var(--surface); color: var(--texte); text-decoration: none; }
.doc__corps ul { padding-left: 20px; display: grid; gap: 8px; margin: 0 0 1em; }
.doc__corps li { padding-left: 4px; }
@media (max-width: 860px) {
  .doc { grid-template-columns: 1fr; }
  .doc__sommaire { position: static; }
}

/* ─── Onglets du panel ───────────────────────────────────────────────────── */
.panel-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 30px; padding-bottom: 14px; border-bottom: 1px solid var(--ligne); }
.panel-nav a { font-size: .9rem; padding: 8px 14px; border-radius: var(--rayon-s); color: var(--texte-doux); }
.panel-nav a:hover { background: var(--surface); color: var(--texte); text-decoration: none; }

.slug-boite {
  font-family: var(--mono); font-size: .82rem;
  background: var(--encre); border: 1px dashed var(--ligne-vive);
  border-radius: var(--rayon-s); padding: 10px 13px;
  color: var(--texte-doux); word-break: break-all;
}

/* ─── Pied de page ───────────────────────────────────────────────────────── */
.pied { border-top: 1px solid var(--ligne); padding: 44px 0 56px; color: var(--texte-doux); font-size: .9rem; }
.pied__grille { display: grid; grid-template-columns: 1.6fr repeat(2, 1fr); gap: 30px; }
.pied h4 { font-family: var(--mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--texte); }
.pied ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.pied a { color: var(--texte-doux); }
.pied a:hover { color: var(--lune-pale); }
.pied__bas { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--ligne); font-size: .82rem; display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; }

/* ─── Adaptations ────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .nav__bascule { display: block; }
  .nav__liens {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; gap: 2px; padding: 12px 20px 18px;
    background: var(--encre-2); border-bottom: 1px solid var(--ligne);
  }
  .nav__liens.est-ouvert { display: flex; }
  .nav__inner { position: relative; }
  .console__cellule { border-right: 0; border-bottom: 1px solid var(--ligne); }
  .pied__grille { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .hero { padding-top: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
