/* Lynx Status — charte Lynx Cyber Suite (tokens.css, Plus Jakarta Sans, fond ink).
   Couleurs d'état : tokens de catégorie (contraste AA sur --ink-900). */
:root {
  --st-up: var(--cat-protection);
  --st-degraded: var(--cat-governance);
  --st-down: var(--cat-detection);
  --st-unknown: var(--cat-collaboration);
  --surface: var(--ink-900);
  --surface-2: var(--ink-800);
  --text: #fff;
  --muted: var(--text-muted-dark);
  --content: 1120px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  font-family: var(--font-sans);
  background: var(--ink-950);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 12px; z-index: 30; background: var(--ink-800); padding: 0.5rem 1rem; border-radius: var(--radius-pill); }

/* ── Header (repris de la vitrine) ── */
.header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(10, 10, 12, 0.86);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line-dark);
}
.nav { max-width: var(--content); margin: 0 auto; height: var(--header-h); padding: 0 16px; display: flex; align-items: center; gap: 0.9rem; }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; flex-shrink: 0; }
.brand-logo { width: 40px; height: 40px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-text strong { font-size: 1.15rem; font-weight: 800; letter-spacing: 0.12em; }
.brand-text small { margin-top: 3px; font-size: 0.6rem; font-weight: 600; letter-spacing: 0.32em; color: var(--muted); }
.brand-tag { padding-left: 0.9rem; border-left: 1px solid var(--line-dark); font-weight: 700; font-size: 0.95rem; letter-spacing: -0.01em; }
.env-badge {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.22rem 0.6rem; border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 176, 32, 0.45); color: var(--st-degraded);
}
.nav-actions { margin-left: auto; display: flex; align-items: center; }
.lang-switch {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--radius-pill);
  border: 1px solid var(--line-dark); background: rgba(255, 255, 255, 0.04);
  color: var(--muted); font: 700 0.72rem var(--font-sans); letter-spacing: 0.06em; cursor: pointer;
}
.lang-switch span { padding: 0.3rem 0.55rem; border-radius: var(--radius-pill); transition: background-color 0.2s, color 0.2s; }
.lang-switch span.on { background: #fff; color: var(--ink-950); }

/* ── Hero ── */
main { max-width: var(--content); margin: 0 auto; padding: 0 16px 4rem; }
.hero {
  position: relative; margin: 2rem 0 2.5rem; padding: 2.5rem 2rem;
  border-radius: var(--radius-lg); border: 1px solid var(--line-dark);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(218, 0, 34, 0.18), transparent 55%),
    radial-gradient(90% 120% at 100% 0%, rgba(255, 90, 31, 0.12), transparent 60%),
    var(--surface);
  overflow: hidden;
}
.hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--brand-gradient); }
.kicker { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brand-orange); }
.hero h1 { margin-top: 0.6rem; font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.12; }
.hero-meta { margin-top: 0.8rem; display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.92rem; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--st-unknown); flex-shrink: 0; }
.dot.up { background: var(--st-up); box-shadow: 0 0 0 4px rgba(76, 195, 138, 0.18); }
.dot.degraded { background: var(--st-degraded); box-shadow: 0 0 0 4px rgba(255, 176, 32, 0.18); }
.dot.down { background: var(--st-down); box-shadow: 0 0 0 4px rgba(255, 59, 59, 0.2); }
.stale { margin-top: 0.8rem; padding: 0.6rem 0.9rem; border-radius: var(--radius-sm); background: rgba(255, 176, 32, 0.1); border: 1px solid rgba(255, 176, 32, 0.35); color: var(--st-degraded); font-size: 0.88rem; font-weight: 600; }
.summary { list-style: none; margin-top: 1.4rem; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.summary li { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.85rem; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line-dark); font-size: 0.85rem; font-weight: 600; }
.summary b { font-weight: 800; }

/* ── Blocs ── */
.block { margin-top: 2.5rem; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.block-head h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.legend { display: flex; flex-wrap: wrap; gap: 0.9rem; color: var(--muted); font-size: 0.78rem; }
.legend > span { display: inline-flex; align-items: center; gap: 0.35rem; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; background: var(--st-unknown); }
.sw.up { background: var(--st-up); } .sw.degraded { background: var(--st-degraded); } .sw.down { background: var(--st-down); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 1rem; }
.card {
  background: var(--surface); border: 1px solid var(--line-dark); border-radius: var(--radius-md);
  padding: 1.15rem 1.15rem 0.6rem; display: flex; flex-direction: column; gap: 0.9rem; min-width: 0;
}
.card.down { border-color: rgba(255, 59, 59, 0.45); }
.card.degraded { border-color: rgba(255, 176, 32, 0.4); }
.card-head { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.app-icon {
  flex-shrink: 0; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(218, 0, 34, 0.22), rgba(255, 176, 32, 0.12)); color: #fff;
}
.app-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card-title { min-width: 0; flex: 1; }
.card-title h3 { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; }
.host { display: block; font-size: 0.78rem; color: var(--muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host:hover { color: #fff; text-decoration: underline; }
.pill {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.25rem 0.65rem; border-radius: var(--radius-pill); font-size: 0.74rem; font-weight: 700;
  background: rgba(154, 160, 170, 0.12); color: var(--st-unknown);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.up { background: rgba(76, 195, 138, 0.12); color: var(--st-up); }
.pill.degraded { background: rgba(255, 176, 32, 0.12); color: var(--st-degraded); }
.pill.down { background: rgba(255, 59, 59, 0.14); color: var(--st-down); }

.bars { display: grid; grid-template-columns: repeat(90, 1fr); gap: 2px; height: 30px; }
.bars i { border-radius: 2px; background: var(--ink-700); }
.bars i.up { background: var(--st-up); } .bars i.degraded { background: var(--st-degraded); } .bars i.down { background: var(--st-down); }
.uptime-meta { margin-top: 0.35rem; display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--muted); }
.uptime-meta .pct { color: #fff; font-weight: 700; }

.stack { list-style: none; border-top: 1px solid var(--line-dark); }
.stack li { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 0; font-size: 0.85rem; border-bottom: 1px solid var(--line-dark); }
.stack li:last-child { border-bottom: 0; }
.stack .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack .lbl small { color: var(--muted); font-weight: 500; }
.stack .ms { color: var(--muted); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.stack .pill { font-size: 0.7rem; padding: 0.15rem 0.55rem; }

/* ── Incidents ── */
.incidents { list-style: none; background: var(--surface); border: 1px solid var(--line-dark); border-radius: var(--radius-md); }
.incidents li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; padding: 0.85rem 1.1rem; border-bottom: 1px solid var(--line-dark); font-size: 0.88rem; }
.incidents li:last-child { border-bottom: 0; }
.incidents .what { flex: 1; min-width: 200px; font-weight: 600; }
.incidents .what small { display: block; color: var(--muted); font-weight: 500; }
.incidents .when { color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.incidents .empty { color: var(--muted); }

.footer { max-width: var(--content); margin: 0 auto; padding: 2rem 16px 3rem; border-top: 1px solid var(--line-dark); color: var(--muted); font-size: 0.8rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; }

/* ── Mouvement (charte) ── */
@media (prefers-reduced-motion: no-preference) {
  /* Apparition au premier rendu seulement (la page se rafraîchit toute seule) */
  body:not(.rendered) .reveal, body:not(.rendered) .card { animation: reveal var(--duration-reveal) var(--ease-out) both; }
  body:not(.rendered) .card { animation-delay: calc(var(--i, 0) * var(--stagger)); }
  @keyframes reveal { from { opacity: 0; transform: translateY(var(--distance-reveal)); } to { opacity: 1; transform: none; } }
}

@media (max-width: 560px) {
  .brand-text { display: none; }
  .brand-tag { padding-left: 0.6rem; }
  .hero { padding: 1.75rem 1.25rem; }
  .bars { gap: 1px; height: 26px; }
}
