/* NavKids API status and documentation pages. Palette from the driver app. */
:root {
  --blue: #2563eb; --blue-dark: #1d4ed8; --blue-soft: #dbeafe;
  --green: #16a34a; --green-soft: #dcfce7;
  --amber: #f59e0b; --amber-soft: #fef3c7;
  --red: #dc2626; --red-soft: #fee2e2;
  --navy: #0d1630; --ink: #111827; --muted: #4b5563; --line: rgb(15 23 42 / .09);
  --glass: rgb(255 255 255 / .84);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); line-height: 1.55;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, #cfe0ff 0%, #e8f1ff 45%, #e3f8ea 100%) fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-dark); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* 3D background */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.page { position: relative; z-index: 1; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }

/* Header */
.top { position: sticky; top: 0; z-index: 5; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); background: rgb(255 255 255 / .62); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 17px; }
.brand img { width: 36px; height: 36px; border-radius: 11px; background: #fff; box-shadow: 0 2px 8px rgb(13 22 48 / .12); }
.brand span b { color: var(--blue); }
.top nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.top nav a { text-decoration: none; color: var(--muted); font-weight: 650; font-size: 14.5px; padding: 8px 12px; border-radius: 10px; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--ink); background: rgb(255 255 255 / .8); }

main { padding: 40px 0 72px; }
.card { background: var(--glass); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); border: 1px solid rgb(255 255 255 / .7); border-radius: 22px; box-shadow: 0 1px 2px rgb(13 22 48 / .05), 0 18px 40px -22px rgb(13 22 48 / .35); }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: 20px; }
.muted { color: var(--muted); }

/* Overall status */
.overall { display: flex; align-items: center; gap: 18px; padding: 26px 28px; }
.overall .pulse { position: relative; width: 22px; height: 22px; border-radius: 50%; flex: none; background: var(--green); }
.overall .pulse::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; background: inherit; opacity: .25; animation: ring 1.8s ease-out infinite; }
.overall.degraded .pulse { background: var(--amber); }
.overall.down .pulse { background: var(--red); }
@keyframes ring { from { transform: scale(.6); opacity: .45; } to { transform: scale(1.5); opacity: 0; } }
.overall h1 { font-size: clamp(24px, 3.2vw, 34px); font-weight: 800; }
.overall p { margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }
.overall .env { margin-left: auto; align-self: flex-start; padding: 5px 12px; border-radius: 999px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

/* Checks */
.checks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 16px 0 0; padding: 0; list-style: none; }
.check { padding: 18px; }
.check .name { font-weight: 750; }
.check .detail { margin-top: 6px; color: var(--muted); font-size: 14px; }
.state { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 750; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state.operational { background: var(--green-soft); color: #166534; }
.state.degraded { background: var(--amber-soft); color: #92400e; }
.state.down { background: var(--red-soft); color: #991b1b; }
.state.unknown { background: #f1f5f9; color: #475569; }

/* Uptime */
.uptime { margin-top: 16px; padding: 24px 26px; }
.uptime-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 22px; }
.tile { padding: 14px 16px; border-radius: 16px; background: rgb(255 255 255 / .75); border: 1px solid var(--line); }
.tile b { display: block; font-size: 28px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tile span { font-size: 13px; color: var(--muted); font-weight: 600; }
.bars { display: grid; grid-template-columns: repeat(30, 1fr); gap: 4px; margin: 0; padding: 0; list-style: none; height: 46px; }
.bars li { border-radius: 4px; background: #cbd5e1; transition: transform .15s ease; }
.bars li:hover { transform: scaleY(1.08); }
.bars li.good { background: var(--green); }
.bars li.minor { background: #84cc16; }
.bars li.partial { background: var(--amber); }
.bars li.major { background: var(--red); }
.bars-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted); }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.note { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--blue-soft); color: #1e3a8a; font-size: 14px; }

/* Incidents and links */
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; margin-top: 16px; }
.panel { padding: 22px 24px; }
.incidents { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.incidents li { padding: 12px 14px; border-radius: 14px; background: rgb(255 255 255 / .75); border: 1px solid var(--line); font-size: 14px; }
.incidents .when { font-weight: 700; }
.incidents .kind { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.incidents .offline { background: var(--red-soft); color: #991b1b; }
.incidents .degraded { background: var(--amber-soft); color: #92400e; }
.empty { margin-top: 14px; display: flex; align-items: center; gap: 10px; color: #166534; font-weight: 650; }
.links { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.links a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 14px; background: rgb(255 255 255 / .8); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 700; }
.links a:hover { border-color: var(--blue); color: var(--blue-dark); }
.links small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; }
.links .arrow { font-size: 18px; color: var(--blue); }

footer { position: relative; z-index: 1; padding: 0 0 32px; text-align: center; font-size: 13px; color: #334155; }

/* Documentation */
.docs { display: grid; grid-template-columns: 230px 1fr; gap: 24px; align-items: start; }
.toc { position: sticky; top: 84px; padding: 18px; }
.toc h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.toc ol { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.toc a { display: block; padding: 6px 10px; border-radius: 9px; text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 600; }
.toc a:hover { background: var(--blue-soft); color: var(--blue-dark); }
.doc { padding: 30px 34px; min-width: 0; }
.doc h1 { font-size: 34px; font-weight: 800; }
.doc h2 { margin-top: 34px; padding-top: 4px; font-size: 22px; scroll-margin-top: 84px; }
.doc p, .doc li { color: #1f2937; }
.doc code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; background: #eef2ff; color: #1e3a8a; padding: 1px 6px; border-radius: 6px; }
.doc pre { background: var(--navy); color: #e2e8f0; padding: 14px 16px; border-radius: 14px; overflow-x: auto; }
.doc pre code { background: none; color: inherit; padding: 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; display: block; overflow-x: auto; }
.doc th { text-align: left; background: #f1f5f9; color: #334155; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
.doc th, .doc td { padding: 9px 12px; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.doc td:first-child { white-space: nowrap; font-weight: 700; color: var(--blue-dark); }

@media (max-width: 900px) {
  .checks { grid-template-columns: 1fr 1fr; }
  .two, .docs { grid-template-columns: 1fr; }
  .toc { position: static; }
}
@media (max-width: 560px) {
  .checks, .tiles { grid-template-columns: 1fr; }
  .overall { flex-wrap: wrap; padding: 22px; }
  .overall .env { margin-left: 0; }
  .bars { gap: 2px; height: 38px; }
  .doc { padding: 22px 18px; }
  .top nav a { padding: 6px 8px; font-size: 13.5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
