/* ==========================================================================
   TRAZIO — « La salle d'ops »
   Tour de contrôle des opérations terrain. Fond sombre, statuts normés,
   heures partout, données en mono.
   Sora (display) · Be Vietnam Pro (texte) · Spline Sans Mono (données)
   Projet démonstratif conçu par Genshi.
   ========================================================================== */

:root {
  --bg: #0E1116;
  --panel: #151B24;
  --carte: #1B2330;
  --carte-2: #222C3C;
  --txt: #E9EDF4;
  --dim: #8A94A6;
  --indigo: #5B6CFF;
  --indigo-deep: #4456E8;
  --vert: #2EE6A8;
  --ambre: #FFB454;
  --rouge: #FF6464;
  --ligne: rgba(233, 237, 244, 0.1);
  --ligne-2: rgba(233, 237, 244, 0.05);
  --ombre: 0 24px 60px -28px rgba(0, 0, 0, 0.7);
  --f-d: "Sora", system-ui, sans-serif;
  --f-b: "Be Vietnam Pro", system-ui, sans-serif;
  --f-m: "Spline Sans Mono", ui-monospace, Menlo, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--f-b);
  background: var(--bg);
  color: var(--txt);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--indigo); color: #fff; }

img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; border-radius: 4px; }

/* ---------- Typographie ---------- */

h1, h2, h3 {
  font-family: var(--f-d);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.2rem; }

h1 .hl, h2 .hl { color: var(--indigo); }

p { text-wrap: pretty; }

.lead { font-size: 1.08rem; color: var(--dim); max-width: 38em; }

.mono { font-family: var(--f-m); font-size: 0.72rem; letter-spacing: 0.04em; color: var(--dim); }

.eyebrow {
  font-family: var(--f-m);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--indigo);
}

/* ---------- Statuts normés ---------- */

.st { display: inline-flex; align-items: center; gap: 7px; font-family: var(--f-m); font-size: 0.72rem; letter-spacing: 0.04em; }
.st i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.st--ok i { background: var(--vert); box-shadow: 0 0 10px rgba(46, 230, 168, 0.6); }
.st--warn i { background: var(--ambre); box-shadow: 0 0 10px rgba(255, 180, 84, 0.5); }
.st--err i { background: var(--rouge); box-shadow: 0 0 10px rgba(255, 100, 100, 0.5); }
.st--ok { color: var(--vert); }
.st--warn { color: var(--ambre); }
.st--err { color: var(--rouge); }

@media (prefers-reduced-motion: no-preference) {
  .st--live i { animation: tpulse 2.2s infinite; }
  @keyframes tpulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
}

/* ---------- Layout ---------- */

.tw { width: min(1240px, 92vw); margin-inline: auto; }
.tsec { padding-block: clamp(56px, 7vw, 104px); }
.tstack > * + * { margin-top: 16px; }

/* ---------- Header ---------- */

.thd {
  position: sticky;
  top: -1px; /* évite le filet de 1px au-dessus du header sticky */
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ligne-2);
}

.thd .tw { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 14px; }

.tlogo { text-decoration: none; display: flex; align-items: center; gap: 10px; }
.tlogo .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--indigo), #7C5BFF);
  display: grid; place-items: center;
  font-family: var(--f-d); font-weight: 700; font-size: 0.95rem; color: #fff;
}
.tlogo .name { font-family: var(--f-d); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; }
.tlogo .name span { color: var(--indigo); }

.tnav { display: flex; align-items: center; gap: 24px; }

.tnav a:not(.tb) { text-decoration: none; font-size: 0.86rem; font-weight: 500; color: var(--dim); transition: color 0.2s; }
.tnav a:not(.tb):hover { color: var(--txt); }
.tnav a:not(.tb)[aria-current="page"] { color: var(--txt); }

.tburger { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 44px; height: 44px; background: none; border: none; cursor: pointer; }
.tburger span { width: 22px; height: 2px; background: var(--txt); border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }

/* ---------- Boutons ---------- */

.tb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: var(--f-b);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  padding: 13px 24px;
  background: var(--indigo);
  color: #fff;
  border: none;
  border-radius: 10px;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.tb:hover { background: var(--indigo-deep); transform: translateY(-1px); box-shadow: 0 12px 28px -12px rgba(91, 108, 255, 0.6); }

.tb--ghost { background: transparent; color: var(--txt); box-shadow: inset 0 0 0 1px var(--ligne); }
.tb--ghost:hover { background: var(--panel); box-shadow: inset 0 0 0 1px var(--dim); }

.tb--sm { padding: 9px 16px; font-size: 0.78rem; border-radius: 8px; }

/* ---------- Cartes / panneaux ---------- */

.tcard { background: var(--carte); border: 1px solid var(--ligne); border-radius: 14px; }
.tpanel { background: var(--panel); border: 1px solid var(--ligne-2); border-radius: 16px; }

/* ---------- Tableaux (outil interne / dashboard) ---------- */

.ttable { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.ttable th {
  font-family: var(--f-m);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ligne);
  font-weight: 400;
  white-space: nowrap;
}
.ttable td { padding: 12px 14px; border-bottom: 1px solid var(--ligne-2); vertical-align: middle; }
.ttable tbody tr { transition: background 0.15s; cursor: pointer; }
.ttable tbody tr:hover { background: rgba(91, 108, 255, 0.06); }
.ttable .num { font-family: var(--f-m); font-size: 0.76rem; }

/* ---------- KPI ---------- */

.kpi { padding: 18px 20px; display: grid; gap: 4px; }
.kpi .k-label { font-family: var(--f-m); font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.kpi .k-val { font-family: var(--f-d); font-weight: 600; font-size: clamp(1.5rem, 2.4vw, 2rem); letter-spacing: -0.02em; }
.kpi .k-delta { font-family: var(--f-m); font-size: 0.7rem; }
.kpi .k-delta.up { color: var(--vert); }
.kpi .k-delta.down { color: var(--rouge); }
.kpi .k-delta.flat { color: var(--dim); }

/* ---------- Barres (graphique) ---------- */

.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; }
.bars i {
  flex: 1;
  background: linear-gradient(to top, rgba(91, 108, 255, 0.25), rgba(91, 108, 255, 0.85));
  border-radius: 4px 4px 0 0;
  min-height: 6px;
  transition: height 0.6s cubic-bezier(0.22, 0.61, 0.36, 1), background 0.3s;
}
.bars i.warn { background: linear-gradient(to top, rgba(255, 180, 84, 0.25), rgba(255, 180, 84, 0.85)); }

/* ---------- Badge / chip ---------- */

.chip {
  font-family: var(--f-m);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  color: var(--dim);
  border: 1px solid var(--ligne);
  border-radius: 100px;
  padding: 4px 11px;
  background: var(--panel);
}

/* ---------- Coquille produit (dashboard / back-office / automatisations) ---------- */

.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
@media (max-width: 980px) { .shell { grid-template-columns: 1fr; } .shell .side { display: none !important; } }

.side { background: var(--panel); border-right: 1px solid var(--ligne-2); padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; }
.side .tlogo { padding: 6px 10px 18px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; text-decoration: none; font-size: 0.86rem; color: var(--dim); transition: background 0.15s, color 0.15s; }
.side a:hover { color: var(--txt); background: rgba(233, 237, 244, 0.04); }
.side a.on { color: var(--txt); background: rgba(91, 108, 255, 0.14); }
.side a .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.side .grow { flex: 1; }
.side .sep { font-family: var(--f-m); font-size: 0.56rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); opacity: 0.6; padding: 14px 12px 4px; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px clamp(16px, 3vw, 28px); border-bottom: 1px solid var(--ligne-2); flex-wrap: wrap; }
.content { padding: clamp(16px, 3vw, 28px); display: grid; gap: 18px; }

a.chip { text-decoration: none; transition: border-color 0.15s, color 0.15s; }
a.chip:hover { border-color: var(--indigo); color: var(--txt); }

/* ---------- Footer ---------- */

.tft { border-top: 1px solid var(--ligne-2); padding-block: 40px; }
.tft .tw { display: grid; gap: 14px; }
.tft-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 28px; font-size: 0.78rem; color: var(--dim); }
.tft a { text-decoration: none; }
.tft a:hover { color: var(--txt); }

/* ---------- Badge démo ---------- */

.g-demo-badge {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 80;
  font-family: var(--f-m);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
  color: var(--dim);
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--ligne);
  border-radius: 999px;
  padding: 6px 12px;
  backdrop-filter: blur(6px);
  pointer-events: none;
  max-width: 70vw;
}

/* sur les écrans produit (shell), le badge ne doit pas recouvrir la sidebar */
.shell ~ .g-demo-badge { left: 236px; }
@media (max-width: 980px) { .shell ~ .g-demo-badge { left: 14px; } }

/* ---------- Révélation ---------- */

@media (prefers-reduced-motion: no-preference) {
  .rv { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .rv.is-in { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 880px) {
  .tnav {
    position: fixed;
    inset: 0;
    z-index: 70;
    flex-direction: column;
    justify-content: center;
    gap: 5vh;
    background: var(--bg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  .tnav a:not(.tb) { font-family: var(--f-d); font-size: 1.7rem; color: var(--txt); }
  .tnav.is-open { opacity: 1; pointer-events: auto; }
  .tburger { display: flex; position: relative; z-index: 75; }
  .tburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .tburger.is-open span:nth-child(2) { opacity: 0; }
  .tburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .g-demo-badge { display: none; }
}
