/* Vigilo — "phosphor terminal" theme.
   Near-black canvas, green phosphor text, mono-first typography.
   Palette: bg #030806, panel #071009, green #00e68a, text #9df5c4,
   dim #4d7a63, line #0f2418, red #ff3b4f, amber #f5a623. */

:root {
  --bg: #030806;
  --panel: #071009;
  --panel-2: #0a1710;
  --ink: #9df5c4;
  --bright: #00e68a;
  --dim: #4d7a63;
  --line: #0f2418;
  --line-2: #16321f;
  --alert: #ff3b4f;
  --alert-soft: rgba(255, 59, 79, 0.12);
  --amber: #f5a623;
  --amber-soft: rgba(245, 166, 35, 0.12);
  --green-soft: rgba(0, 230, 138, 0.1);
  --radius: 6px;
  --display: "Rajdhani", "Fira Code", monospace;
  --mono: "Fira Code", ui-monospace, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(0, 230, 138, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 230, 138, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
}

.mono { font-family: var(--mono); }

a { color: var(--bright); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 1px solid var(--bright);
  outline-offset: 2px;
}

::selection { background: var(--bright); color: var(--bg); }

/* ------------------------------------------------------------- top bar --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bright);
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: auto; display: block; filter: drop-shadow(0 0 8px rgba(0, 230, 138, 0.35)); }
.topnav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.topnav a {
  color: var(--ink);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.nav-plan {
  border: 1px solid var(--bright);
  color: var(--bright);
  padding: 1px 10px;
  border-radius: 3px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* -------------------------------------------------------------- layout --- */
.page { max-width: 1100px; margin: 0 auto; padding: 28px 22px 64px; }
.page-narrow { max-width: 460px; margin: 48px auto; }
.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px;
  color: var(--dim);
  font-size: 12px;
  border-top: 1px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1, h2, h3 {
  font-family: var(--display);
  line-height: 1.2;
  margin: 0 0 12px;
  color: var(--bright);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
h1 { font-size: 26px; }
h2 { font-size: 15px; margin-top: 6px; }
h2::before { content: "▍"; color: var(--bright); margin-right: 6px; }
.sub { color: var(--dim); margin: 0 0 22px; font-size: 13px; }

/* --------------------------------------------------------------- cards --- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.card-title-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.card-meta { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }

/* --------------------------------------------------------------- forms --- */
label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
  margin: 14px 0 6px;
}
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  background: var(--bg);
  color: var(--ink);
}
input::placeholder { color: var(--dim); opacity: 0.7; }
select option { background: var(--panel); }
.hint { font-size: 11px; color: var(--dim); margin: 5px 0 0; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > div { flex: 1 1 180px; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid var(--bright);
  background: transparent;
  color: var(--bright);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  text-align: center;
}
.btn:hover { background: var(--green-soft); text-decoration: none; }
.btn-primary { background: var(--bright); color: #021207; }
.btn-primary:hover { background: #29f2a4; }
.btn-ghost { border-color: var(--line); color: var(--ink); }
.btn-danger { border-color: var(--alert); color: var(--alert); }
.btn-danger:hover { background: var(--alert-soft); }
.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-block { display: block; width: 100%; margin-top: 18px; }

/* --------------------------------------------------------------- flash --- */
.flash {
  max-width: 1100px;
  margin: 14px auto 0;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 13px;
  border: 1px solid;
}
.flash-ok { background: var(--green-soft); border-color: var(--bright); color: var(--bright); }
.flash-error { background: var(--alert-soft); border-color: var(--alert); color: var(--alert); }

/* ------------------------------------------------------------- monitors --- */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--dim);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 13px; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(0, 230, 138, 0.03); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.status-up { color: var(--bright); }
.status-up::before { background: var(--bright); box-shadow: 0 0 6px var(--bright); }
.status-down { color: var(--alert); }
.status-down::before { background: var(--alert); box-shadow: 0 0 6px var(--alert); animation: blink 1s steps(2) infinite; }
.status-paused { color: var(--dim); }
.status-paused::before { background: var(--dim); }
.status-pending { color: var(--amber); }
.status-pending::before { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
@keyframes blink { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .status-down::before { animation: none; } }

.monitor-name { font-weight: 700; font-size: 13px; }
.monitor-url { font-size: 11px; color: var(--dim); word-break: break-all; }
.type-tag {
  border: 1px solid var(--line);
  color: var(--dim);
  font-size: 10px;
  padding: 0 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* --------------------------------------------------------------- stats --- */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .k { font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); }
.stat .v { font-family: var(--mono); font-size: 24px; font-weight: 700; margin-top: 4px; color: var(--ink); }
.stat .v.good { color: var(--bright); text-shadow: 0 0 12px rgba(0, 230, 138, 0.4); }
.stat .v.bad { color: var(--alert); text-shadow: 0 0 12px rgba(255, 59, 79, 0.4); }

/* --------------------------------------------------------------- charts --- */
.chart { width: 100%; height: auto; display: block; }
.chart-caption { font-size: 11px; color: var(--dim); margin: 6px 0 0; }
.uptime-bars { width: 100%; height: 26px; display: block; }
.row-spark { width: 110px; height: 26px; display: block; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11px; color: var(--dim); margin-top: 8px; }
.legend span::before { content: "■ "; }
.legend .lg-up::before { color: var(--bright); }
.legend .lg-warn::before { color: var(--amber); }
.legend .lg-down::before { color: var(--alert); }
.legend .lg-na::before { color: var(--line); }

#worldmap { width: 100%; min-height: 300px; }
#worldmap svg { display: block; width: 100%; height: auto; }

/* ------------------------------------------------------------- terminal --- */
.term {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  text-align: left;
  max-width: 640px;
  margin: 26px auto 0;
}
.term-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.term-dot { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--line); }
.term-body { padding: 14px 16px; font-size: 12.5px; line-height: 1.9; }
.term-body .p { color: var(--dim); }
.term-body .ok { color: var(--bright); }
.term-body .err { color: var(--alert); }
.cursor { display: inline-block; width: 8px; height: 14px; background: var(--bright); vertical-align: -2px; animation: blink 1s steps(2) infinite; }

/* ------------------------------------------------------------- pricing --- */
.hero { text-align: center; padding: 42px 0 20px; }
.hero h1 { font-size: 34px; max-width: 680px; margin: 0 auto 14px; }
.hero .sub { font-size: 14px; max-width: 540px; margin: 0 auto 26px; }

.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 22px; }
.plan {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
}
.plan.featured { border-color: var(--bright); box-shadow: 0 0 0 1px var(--bright), 0 0 24px rgba(0, 230, 138, 0.15); }
.plan h3 { margin-bottom: 2px; font-size: 14px; }
.plan .price { font-family: var(--mono); font-size: 28px; font-weight: 700; margin: 8px 0 14px; color: var(--ink); }
.plan ul { list-style: none; padding: 0; margin: 0 0 22px; color: var(--dim); font-size: 12.5px; }
.plan li { padding: 4px 0 4px 20px; position: relative; }
.plan li::before { content: ">"; position: absolute; left: 0; color: var(--bright); }
.plan .btn { margin-top: auto; }

/* ------------------------------------------------------------ incidents --- */
.incident { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.incident:last-child { border-bottom: none; }
.incident .when { color: var(--dim); }
.badge-open { color: var(--alert); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

.actions-inline { display: flex; gap: 6px; flex-wrap: wrap; }
.inline-form { display: inline; }

.kv { font-size: 12.5px; color: var(--dim); }
.kv b { color: var(--ink); font-weight: 700; }

@media (max-width: 720px) {
  .hero h1 { font-size: 24px; }
  .table thead { display: none; }
  .table td { display: block; border-bottom: none; padding: 3px 12px; }
  .table tr { display: block; border-bottom: 1px solid var(--line); padding: 10px 0; }
  .row-spark { width: 100%; }
}

/* --------------------------------------------------------------- shell --- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 212px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.side .brand { margin-bottom: 22px; font-size: 17px; }
.sidenav { display: flex; flex-direction: column; gap: 2px; }
.sidenav a {
  color: var(--dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 9px 12px;
  border-radius: 4px;
  border-left: 2px solid transparent;
}
.sidenav a:hover { color: var(--ink); background: rgba(0, 230, 138, 0.05); text-decoration: none; border-radius: 0 4px 4px 0; }
.sidenav a.active {
  color: var(--bright);
  background: var(--green-soft);
  border-left-color: var(--bright);
  border-radius: 0 4px 4px 0;
}
.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main-col .page { width: 100%; }
.main-col .footer { margin-top: auto; }

.group-row td {
  background: var(--panel-2) !important;
  color: var(--bright);
  font-family: var(--display);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 7px 12px;
}
.badge-maint {
  border: 1px solid var(--amber);
  color: var(--amber);
  font-size: 9px;
  padding: 0 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.apikey {
  background: var(--bg);
  border: 1px dashed var(--line-2);
  border-radius: 4px;
  padding: 10px 14px;
  font-size: 13px;
  word-break: break-all;
  color: var(--bright);
}
.docs pre {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 12px 14px;
  font-size: 12px;
  overflow-x: auto;
  color: var(--ink);
}
.docs code { color: var(--bright); }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 10px; }
  .side .brand { margin-bottom: 0; }
  .sidenav { flex-direction: row; flex-wrap: wrap; }
  .side-foot { margin-top: 0; margin-left: auto; border-top: none; padding-top: 0; }
}

/* ---------------------------------------------------------- hero emblem --- */
.hero-brand { margin-bottom: 18px; }
.hero-emblem {
  width: 200px;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 0 22px rgba(0, 230, 138, 0.45));
  animation: hawk-swoop 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes hawk-swoop {
  from { transform: translateY(-22px) scale(0.85); opacity: 0; }
  60%  { opacity: 1; }
  to   { transform: none; opacity: 1; }
}
.hero-word {
  font-family: var(--display);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 0.34em;
  text-indent: 0.34em; /* balance the tracking */
  text-transform: uppercase;
  color: var(--bright);
  text-align: center;
  margin-top: 10px;
  animation: fade-up 0.6s 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes wing-sweep-r { from { transform: translateX(-12px) ; opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes wing-sweep-l { from { transform: translateX(12px);   opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes head-drop    { from { transform: translateY(-10px);  opacity: 0; } to { transform: none; opacity: 1; } }

/* ----------------------------------------------------- screen-load anims --- */
@keyframes fade-up { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes bar-in  { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes draw-line { to { stroke-dashoffset: 0; } }

.page > h1, .page > .sub { animation: fade-up 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.page > .sub { animation-delay: 0.05s; }
.statgrid .stat { animation: fade-up 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.statgrid .stat:nth-child(1) { animation-delay: 0.05s; }
.statgrid .stat:nth-child(2) { animation-delay: 0.10s; }
.statgrid .stat:nth-child(3) { animation-delay: 0.15s; }
.statgrid .stat:nth-child(4) { animation-delay: 0.20s; }
.statgrid .stat:nth-child(5) { animation-delay: 0.25s; }
.statgrid .stat:nth-child(6) { animation-delay: 0.30s; }
.statgrid .stat:nth-child(7) { animation-delay: 0.35s; }
.statgrid .stat:nth-child(8) { animation-delay: 0.40s; }
.page > .card { animation: fade-up 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.page > .card:nth-of-type(1) { animation-delay: 0.12s; }
.page > .card:nth-of-type(2) { animation-delay: 0.20s; }
.page > .card:nth-of-type(3) { animation-delay: 0.28s; }
.page > .card:nth-of-type(4) { animation-delay: 0.36s; }
.page > .card:nth-of-type(5) { animation-delay: 0.44s; }

/* bars grow up from their baseline */
.uptime-bars rect, .chart rect {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: bar-in 0.6s 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.uptime-bars rect:nth-child(2n) { animation-delay: 0.33s; }
.uptime-bars rect:nth-child(3n) { animation-delay: 0.41s; }
.chart rect:nth-child(2n) { animation-delay: 0.33s; }
.chart rect:nth-child(3n) { animation-delay: 0.41s; }

/* latency lines draw themselves */
.chart polyline, .row-spark polyline {
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
  animation: draw-line 1.3s 0.2s ease-out forwards;
}
.chart polygon { animation: fade-up 0.8s 0.7s ease-out both; }

@media (prefers-reduced-motion: reduce) {
  .page > h1, .page > .sub, .statgrid .stat, .page > .card,
  .uptime-bars rect, .chart rect, .chart polygon,
  .hero-emblem, .hero-word {
    animation: none;
  }
  .chart polyline, .row-spark polyline { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; }
}
