/* Statuspagina. Kleuren, fonts, nav en footer komen uit de kit (https://wesselsmit.com/kit/kit.css). */

:root {
  /* Dagbalken: "online" bewust gedempt, zodat afwijkingen opvallen */
  --bar-up: color-mix(in srgb, var(--ok) 42%, var(--panel));
  --bar-empty: rgba(122, 138, 168, 0.16);
}

main {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 3.5rem 1rem 4rem;
}

/* ---------- Kop ---------- */
.section-head { margin-bottom: 2rem; }

.section-head .cmd {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-head .cmd::before { content: "■ "; color: var(--accent); }

h1, h2 {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 125%;
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: #fff;
}

h1 { margin-top: 0.6rem; font-size: clamp(2rem, 7vw, 3.4rem); }

/* ---------- Samenvatting ---------- */
.summary {
  --c: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
  padding: 1.1rem 1.25rem;
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
}

.summary.up { --c: var(--ok); }
.summary.degraded, .summary.stale { --c: var(--warn); }
.summary.down { --c: var(--bad); }

.summary strong { color: #fff; font-size: 1rem; }
.summary .meta { margin-left: auto; font-size: 0.75rem; color: var(--muted); text-align: right; }

.dot {
  flex-shrink: 0;
  width: 0.75rem;
  height: 0.75rem;
  background: var(--c);
}

/* ---------- Periodekeuze ---------- */
.controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ctl-label {
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.seg { display: flex; }

.seg button {
  margin-left: -1px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.75rem;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line-2);
  cursor: pointer;
}

.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { position: relative; color: var(--bg); background: var(--accent); border-color: var(--accent); }

/* ---------- Services ---------- */
.services { display: flex; flex-direction: column; gap: 1rem; }

.service {
  --c: var(--muted);
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
}

.services:not(.ready) .service { animation: fade-in 0.5s ease both; animation-delay: calc(var(--i, 0) * 0.08s); }

@keyframes fade-in { from { opacity: 0; transform: translateY(12px); } }

.service.up { --c: var(--ok); }
.service.degraded { --c: var(--warn); }
.service.down { --c: var(--bad); }

.service-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.service-head h2 { font-size: 1rem; }
.service-head a { font-size: 0.75rem; color: var(--steel); text-decoration: none; }
.service-head a:hover { text-decoration: underline; }

.state {
  margin-left: auto;
  padding: 0.15rem 0.6rem;
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 8%, transparent);
  border: 1px solid currentColor;
}

/* Dagbalken */
.bars {
  display: grid;
  grid-template-columns: repeat(var(--n, 90), 1fr);
  gap: 2px;
  height: 34px;
  margin-top: 1rem;
}

.bar { background: var(--bar-empty); transition: filter 0.15s; }
.bar.up { background: var(--bar-up); }
.bar.degraded { background: var(--warn); }
.bar.down { background: var(--bad); }
.bar:hover { filter: brightness(1.4); }

.bars-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.45rem;
  font-size: 0.7rem;
  color: var(--muted);
}

.bars-foot .uptime { color: var(--text); }

/* Responstijdgrafiek */
.chart-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-top: 1.1rem;
  font-size: 0.7rem;
  color: var(--muted);
}

.chart-head b { color: var(--text); font-weight: 500; }

.chart {
  position: relative;
  height: 72px;
  margin-top: 0.4rem;
  cursor: crosshair;
  touch-action: pan-y;
}

.chart:focus-visible { outline-offset: 2px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .area { fill: var(--accent); fill-opacity: 0.1; stroke: none; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart .y-label { position: absolute; top: -2px; left: 0; font-size: 0.6875rem; color: var(--muted); pointer-events: none; }
.chart .empty { display: grid; place-items: center; height: 100%; font-size: 0.75rem; color: var(--muted); border: 1px dashed var(--line); }

.crosshair { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-2); pointer-events: none; }

.marker {
  position: absolute;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--panel);
  pointer-events: none;
}

.tip {
  position: absolute;
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 0.4rem 0.6rem;
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  background: var(--panel-2);
  border: 1px solid var(--line-2);
  pointer-events: none;
}

.tip b { font-size: 0.85rem; font-weight: 600; color: #fff; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.5rem;
  margin-top: 0.9rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.stats b { color: var(--text); font-weight: 500; }

/* ---------- Legenda ---------- */
.note { margin-top: 1.5rem; font-size: 0.75rem; color: var(--muted); }
.legend { display: inline-flex; align-items: center; gap: 0.35rem; margin-right: 1rem; }
.legend i { display: inline-block; width: 0.6rem; height: 0.6rem; background: var(--bar-empty); }
.legend i.up { background: var(--bar-up); }
.legend i.degraded { background: var(--warn); }
.legend i.down { background: var(--bad); }

/* ---------- Incidenten ---------- */
.incidents { margin-top: 3rem; }
.incidents h2 { font-size: 1.3rem; }
.incidents ol { margin-top: 1rem; list-style: none; border-top: 1px solid var(--line); }

.incidents li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 0.3rem 0.8rem;
  padding: 0.75rem 0;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--line);
}

.incidents li::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  background: var(--ok);
}

.incidents li.open::before { background: var(--bad); }
.incidents li b { font-weight: 500; color: #fff; }
.incidents li .reason { color: var(--muted); }
.incidents li time, .incidents li .when { color: var(--muted); font-size: 0.75rem; text-align: right; }
.incidents li.none { display: block; color: var(--muted); }
.incidents li.none::before { display: none; }

@media (max-width: 560px) {
  .bars { gap: 1px; height: 28px; }
  .summary { flex-wrap: wrap; }
  .summary .meta { margin-left: 0; text-align: left; width: 100%; }
  .incidents li { grid-template-columns: auto 1fr; }
  .incidents li .when { grid-column: 2; text-align: left; }
}
