@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/schibsted-grotesk-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/schibsted-grotesk-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/schibsted-grotesk-latin-800-normal.woff2") format("woff2");
}

/* Tableau de voyants : un châssis gris, des modules en relief, et de vraies lampes pour les statuts. */
:root {
  color-scheme: light dark;
  --chassis: #d6d9d1;
  --panel: #e5e7e0;
  --panel-hi: #eff1ea;
  --ink: #1c201d;
  --soft: #596059;
  --line: #aab0a6;
  --hi: rgba(255, 255, 255, 0.7);
  --recess: #252926;
  --bezel: #b9beb4;
  --lamp-off: #5d635e;
  --lamp-up: #35d06b;
  --lamp-warn: #ffa11d;
  --lamp-down: #ff4b3e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --chassis: #1b1e1c;
    --panel: #242826;
    --panel-hi: #2c312e;
    --ink: #e8ebe6;
    --soft: #9aa19b;
    --line: #3a403c;
    --hi: rgba(255, 255, 255, 0.05);
    --recess: #0d0f0e;
    --bezel: #3d433f;
    --lamp-off: #4a504c;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--chassis);
  color: var(--ink);
  font: 400 1rem/1.5 "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
}
/* Chiffres tabulaires seulement là où ils changent (compteurs, heure) : sur du texte, ils espacent la ponctuation. */
.legend b,
.checked,
.fav .n {
  font-variant-numeric: tabular-nums;
}
.wrap {
  max-inline-size: 68rem;
  margin-inline: auto;
  padding: clamp(1.25rem, 4vw, 3rem) clamp(1rem, 4vw, 2rem) 4rem;
}
.sr {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* En-tête */
.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.brand {
  margin: 0;
  font-weight: 800;
  font-size: clamp(2.25rem, 7vw, 3.75rem);
  letter-spacing: -0.045em;
  line-height: 1;
}
.admin {
  color: var(--soft);
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.admin:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* Voyants de synthèse */
.summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem 2rem;
  margin-block: 2rem 2.25rem;
  padding-block: 1rem;
  border-block: 1px solid var(--line);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.legend li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.checked {
  margin: 0;
  color: var(--soft);
  font-size: 0.9rem;
}

/* Lampe : un voyant dans son logement. Le halo coloré est un calque qui s'allume. */
.lamp {
  position: relative;
  flex: none;
  inline-size: 1.1rem;
  block-size: 1.1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--lamp-off) 70%, white), var(--lamp-off));
  box-shadow: 0 0 0 2px var(--recess), 0 0 0 3px var(--bezel);
}
.lamp::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fff 0, var(--c) 38%, color-mix(in srgb, var(--c) 75%, #000) 100%);
  box-shadow: 0 0 0.9rem 0.15rem color-mix(in srgb, var(--c) 60%, transparent);
  transition: opacity 0.25s;
}
.lamp[data-state="up"] {
  --c: var(--lamp-up);
}
.lamp[data-state="warn"] {
  --c: var(--lamp-warn);
}
.lamp[data-state="down"] {
  --c: var(--lamp-down);
}
.lamp[data-state="unknown"]::after {
  opacity: 0;
}

/* Le seul mouvement de la page : à l'ouverture, les voyants s'allument un à un, comme à la mise sous tension. */
@media (prefers-reduced-motion: no-preference) {
  .post .lamp:not([data-state="unknown"])::after {
    animation: lamp-on 0.9s both;
    animation-delay: calc(var(--i, 0) * 90ms + 150ms);
  }
}
@keyframes lamp-on {
  0% {
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  22% {
    opacity: 0.15;
  }
  38% {
    opacity: 0.9;
  }
  50% {
    opacity: 0.35;
  }
  100% {
    opacity: 1;
  }
}

/* Sections */
.section + .section {
  margin-top: 3.25rem;
}
h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.empty {
  margin: 0;
  color: var(--soft);
}

/* Modules de projet */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  block-size: 100%;
  min-block-size: 8.75rem;
  padding: 1.1rem 1.2rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 var(--hi);
  color: inherit;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s;
}
.tile:hover {
  background: var(--panel-hi);
  border-color: color-mix(in srgb, var(--ink) 45%, var(--line));
}
.tile:hover .host {
  color: var(--ink);
  text-decoration: underline;
}
.tile-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.tile-name {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.tile-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  color: var(--soft);
  font-size: 0.95rem;
}
.tile-foot {
  margin-top: auto;
  padding-top: 0.5rem;
  color: var(--soft);
  font-size: 0.85rem;
}

/* Favoris */
.fav-groups {
  columns: 3 15rem;
  column-gap: 2.5rem;
}
.fav {
  break-inside: avoid;
  margin: 0 0 1.75rem;
}
.fav h3 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  font-weight: 600;
}
.fav .n {
  color: var(--soft);
  font-weight: 400;
}
.fav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.fav li + li {
  margin-top: 0.6rem;
}
.fav a {
  display: block;
  color: var(--ink);
  text-decoration: none;
}
.fav a:hover .fav-title {
  text-decoration: underline;
}
.fav-host {
  display: block;
  color: var(--soft);
  font-size: 0.82rem;
}

:where(a):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* Page de connexion */
[hidden] {
  display: none !important;
}
.auth-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-inline-size: 22rem;
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 var(--hi);
}
.auth-help,
.auth-msg {
  margin: 0;
  color: var(--soft);
  font-size: 0.95rem;
}
.auth-msg:empty {
  display: none;
}
.auth-box label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.auth-box input {
  padding: 0.7rem 0.8rem;
  font: 600 1.4rem/1 "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.35em;
  color: var(--ink);
  background: var(--panel-hi);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.auth-btn {
  padding: 0.7rem 1rem;
  font: 600 1rem/1 "Schibsted Grotesk", ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--panel-hi);
  border: 1px solid var(--ink);
  border-radius: 4px;
  cursor: pointer;
}
.auth-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.auth-box :where(input, button):focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
