/* Portalis Status — dezelfde tokens als portalis.sh (calm-modern). */

:root {
  --bg: #fbfcfe;
  --bg-tint: #f2f6fb;
  --card: #ffffff;
  --ink: #0e1726;
  --ink-2: #475467;
  --ink-3: #667085;
  --line: #e8edf4;
  --blue: #0079d2;
  --blue-hi: #2ea3ff;
  --blue-soft: #e8f3fc;
  --blue-ink: #005a9e;
  --green: #12b76a;
  --green-ink: #027a48;
  --amber: #f79009;
  --amber-ink: #b54708;
  --red: #f04438;
  --red-ink: #b42318;
  --nodata: #e7ecf3;
  --radius: 16px;
  --shadow-sm: 0 1px 2px #10182808, 0 1px 3px #1018280d;
  --shadow-md: 0 12px 32px -12px #10182818, 0 2px 6px -2px #10182808;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Donkere variant: dezelfde rollen, andere waarden. Kleuren voor status blijven
   herkenbaar maar worden iets lichter, anders vallen ze weg op donker. */
:root[data-theme="auto"] { color-scheme: light dark; }

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #080f19;
  --bg-tint: #0d1725;
  --card: #0f1a2a;
  --ink: #eaf1fa;
  --ink-2: #a9b8ca;
  --ink-3: #808fa3;
  --line: #1c2b3f;
  --blue-soft: #12283c;
  --blue-ink: #7cc5ff;
  --green-ink: #3ddc97;
  --amber-ink: #fdb022;
  --red-ink: #ff8577;
  --nodata: #1a2536;
  --shadow-sm: 0 1px 2px #0006;
  --shadow-md: 0 16px 40px -18px #000a;
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --bg: #080f19;
    --bg-tint: #0d1725;
    --card: #0f1a2a;
    --ink: #eaf1fa;
    --ink-2: #a9b8ca;
    --ink-3: #808fa3;
    --line: #1c2b3f;
    --blue-soft: #12283c;
    --blue-ink: #7cc5ff;
    --green-ink: #3ddc97;
    --amber-ink: #fdb022;
    --red-ink: #ff8577;
    --nodata: #1a2536;
    --shadow-sm: 0 1px 2px #0006;
    --shadow-md: 0 16px 40px -18px #000a;
  }
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Zacht licht achter de kop, zoals de hero op portalis.sh */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 480px;
  background: radial-gradient(70% 100% at 50% -10%, color-mix(in oklab, var(--blue) 12%, transparent) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.wrap { max-width: 940px; margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
main, header, footer { position: relative; z-index: 1; }

a { color: var(--blue); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

.skip {
  position: absolute; left: -9999px;
  background: var(--card); color: var(--ink);
  padding: 0.6rem 1rem; border-radius: 8px; z-index: 10;
}
.skip:focus { left: 1rem; top: 1rem; }

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

/* ---------- header ---------- */

.head { padding: 1.5rem 0 0; }
.head-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.brand {
  display: inline-flex; align-items: center; gap: 0.7rem;
  font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand img { border-radius: 9px; }
.brand-dim { color: var(--ink-3); font-weight: 600; }

.head-right { display: flex; align-items: center; gap: 0.75rem; }

.checked {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; color: var(--ink-3); font-variant-numeric: tabular-nums;
}

.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  animation: ping 2.6s var(--ease) infinite;
}

@keyframes ping {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--green) 50%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.theme-btn {
  display: grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--card); color: var(--ink-2); cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.theme-btn:hover { color: var(--blue); border-color: var(--blue); transform: translateY(-1px); }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }

/* ---------- hero ---------- */

.hero { padding: 2.4rem 0 2.2rem; }

.hero-title {
  /* Blijft de grootste tekst op de pagina, maar hoeft geen halve viewport te
     vullen: de kop draagt één zin, de cijfers eronder doen het echte werk. */
  font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.8rem);
  font-weight: 800; letter-spacing: -0.025em; line-height: 1.15;
  display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap;
}

.hero-title .status-dot {
  width: 0.62em; height: 0.62em; border-radius: 50%; flex: none;
  background: var(--green);
  box-shadow: 0 0 0 5px color-mix(in oklab, var(--green) 16%, transparent);
}
.hero-title.is-degraded .status-dot { background: var(--amber); box-shadow: 0 0 0 5px color-mix(in oklab, var(--amber) 18%, transparent); }
.hero-title.is-down .status-dot { background: var(--red); box-shadow: 0 0 0 5px color-mix(in oklab, var(--red) 18%, transparent); }

.hero-stats {
  display: flex; gap: 2.5rem; flex-wrap: wrap;
  margin-top: 1.3rem; padding-top: 1.2rem; border-top: 1px solid var(--line);
}
.hero-stats dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--ink-3); font-weight: 700; }
.hero-stats dd { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ---------- groups & components ---------- */

.group { margin-bottom: 2.5rem; }

.group h2 {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-3); font-weight: 700; margin-bottom: 0.9rem; padding-left: 0.15rem;
}

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.comp { padding: 1.25rem 1.4rem; border-bottom: 1px solid var(--line); }
.comp:last-child { border-bottom: none; }
.comp:hover { background: var(--bg-tint); }
.comp { transition: background 0.25s var(--ease); }

.comp-top { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }

.comp-name { font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; }

.pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.01em;
  background: color-mix(in oklab, var(--green) 12%, transparent); color: var(--green-ink);
}
.pill.down { background: color-mix(in oklab, var(--red) 14%, transparent); color: var(--red-ink); }
.pill.pending, .pill.unknown { background: color-mix(in oklab, var(--amber) 14%, transparent); color: var(--amber-ink); }
.pill.maintenance { background: var(--blue-soft); color: var(--blue-ink); }

.comp-meta { margin-left: auto; display: flex; align-items: center; gap: 1.1rem; color: var(--ink-3); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.comp-meta b { color: var(--ink-2); font-weight: 700; }

.spark { display: block; width: 120px; height: 26px; overflow: visible; }
.spark path { fill: none; stroke: var(--blue); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.spark .area { fill: color-mix(in oklab, var(--blue) 12%, transparent); stroke: none; }

/* 90-dagen strip */
.bars {
  display: flex; gap: 2px; margin-top: 1rem; height: 34px; align-items: stretch;
}
.bar {
  flex: 1 1 0; min-width: 2px; border-radius: 2px; background: var(--green);
  transform-origin: bottom; animation: grow 0.5s var(--ease) both;
  transition: filter 0.15s var(--ease), transform 0.15s var(--ease);
}
.bar.degraded { background: var(--amber); }
.bar.down { background: var(--red); }
.bar.nodata { background: var(--nodata); }
.bar:hover { filter: brightness(1.12); transform: scaleY(1.08); }

@keyframes grow { from { transform: scaleY(0.15); opacity: 0; } to { transform: none; opacity: 1; } }

.bars-legend {
  display: flex; justify-content: space-between;
  font-size: 0.7rem; color: var(--ink-3); margin-top: 0.5rem;
}

/* ---------- incidents ---------- */

.incidents { margin: 3rem 0 4rem; }
.incidents h2 { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 1rem; }

.inc {
  padding: 1rem 1.2rem; border: 1px solid var(--line); border-left: 3px solid var(--red);
  border-radius: 12px; background: var(--card); margin-bottom: 0.7rem;
}
.inc.resolved { border-left-color: var(--green); }
.inc-head { display: flex; gap: 0.7rem; align-items: baseline; flex-wrap: wrap; }
.inc-name { font-weight: 700; }
.inc-when { color: var(--ink-3); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.inc-msg { color: var(--ink-2); font-size: 0.88rem; margin-top: 0.2rem; }

.empty {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 1.4rem; border: 1px dashed var(--line); border-radius: 12px;
  color: var(--ink-2); font-size: 0.92rem;
}

.muted { color: var(--ink-3); font-size: 0.85rem; }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--line); padding: 1.8rem 0 3rem; }
.foot-inner { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; color: var(--ink-2); }

/* ---------- tooltip ---------- */

.tip {
  position: fixed; z-index: 20; pointer-events: none;
  background: var(--ink); color: var(--bg);
  padding: 0.45rem 0.65rem; border-radius: 8px;
  font-size: 0.75rem; line-height: 1.35; font-weight: 600;
  opacity: 0; transform: translate(-50%, -6px);
  transition: opacity 0.15s var(--ease);
  white-space: nowrap;
}
.tip.on { opacity: 1; }

/* ---------- entrance ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.hero, .group, .incidents, .foot { animation: rise 0.7s var(--ease) both; }
.group:nth-of-type(2) { animation-delay: 0.06s; }
.group:nth-of-type(3) { animation-delay: 0.12s; }
.incidents { animation-delay: 0.16s; }
.foot { animation-delay: 0.2s; }

.skeleton-text { color: var(--ink-3); }

@media (max-width: 620px) {
  .comp-meta { margin-left: 0; width: 100%; }
  .spark { width: 90px; }
  .hero-stats { gap: 1.6rem; }
  /* 90 balkjes × (2px + 2px gap) past niet op een telefoon en liep over de
     kaartrand. Smaller en strakker: 90 × 2px = 180px past wél. */
  .bars { gap: 1px; height: 30px; }
  .bar { min-width: 1px; border-radius: 1px; }
}

/* Beweging is hier decoratie, nooit informatie. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
