/* justtype status: the app's own dark and light themes, its font, its
   header, its hover cards. */

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2');
}

:root {
  color-scheme: dark;
  --bg: #050505;
  --bg2: #0a0a0a;
  --text: #e5e5e5;
  --muted: #888888;
  --dim: #4a4a4a;
  --border: #1a1a1a;
  --border-light: #141414;
  --accent: #e5e5e5;
  --blue: #4cc9f0;
  --orange: #f77f00;
  --red: #e94560;
  --green: #06d6a0;
  /* a minute or a day with nothing wrong: there, but quiet */
  --quiet: #262626;
  --shadow: rgba(0, 0, 0, 0.45);
}
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #faf9f7;
    --bg2: #ffffff;
    --text: #1a1a1a;
    --muted: #4a4a4a;
    --dim: #888888;
    --border: #d4d2cf;
    --border-light: #e8e7e5;
    --accent: #1a1a1a;
    --blue: #0066cc;
    --orange: #b85c00;
    --red: #b33000;
    --green: #008800;
    --quiet: #dcdad6;
    --shadow: rgba(0, 0, 0, 0.12);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--muted);
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  font-size: 14px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }

.red { color: var(--red); }
.orange { color: var(--orange); }
.blue { color: var(--blue); }
.green { color: var(--green); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }

/* ---- the app's page header ---- */
.page-header {
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
}
.page-header .logo { font-size: 18px; font-weight: 500; color: var(--muted); user-select: none; }
.page-header .logo:hover { color: var(--accent); }
.page-header .label { font-size: 12px; color: var(--dim); }
@media (min-width: 768px) {
  .page-header { height: 80px; padding: 0 32px; }
  .page-header .logo { font-size: 20px; }
}

main {
  flex: 1;
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding: 56px 16px 0;
}

/* ---- now ---- */
.headline {
  position: relative;
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--accent);
}
.dot {
  position: absolute;
  left: -20px;
  top: 0.7em;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--dim);
}
.dot.green { background: var(--green); }
.dot.red { background: var(--red); }
.dot.orange { background: var(--orange); }
.dot.blue { background: var(--blue); }
@media (max-width: 720px) {
  .dot { position: static; display: inline-block; vertical-align: middle; margin: -3px 10px 0 0; }
}
/* each new check: one beat */
.dot.beat { animation: beat 0.9s ease-out; }
@keyframes beat {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 0%, transparent); transform: scale(1); }
  30% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.sub { margin: 4px 0 0; color: var(--muted); }

.strip {
  display: grid;
  gap: 2px;
  margin-top: 28px;
}
.strip.hour { grid-template-columns: repeat(60, 1fr); height: 24px; }
.strip.days { grid-template-columns: repeat(90, 1fr); height: 32px; margin-top: 16px; }
@media (max-width: 520px) { .strip { gap: 1px; } }
.strip > span { border-radius: 1px; background: var(--border); }
.strip > span.ok { background: var(--quiet); }
.strip > span.now { background: var(--muted); }
.strip > span.slow { background: var(--orange); opacity: 0.6; }
.strip > span.miss, .strip > span.down { background: var(--red); }
.strip > span.short { background: var(--orange); }
.strip > span.maint { background: var(--blue); }
.strip > span:hover { filter: brightness(1.6); }
@media (prefers-color-scheme: light) { .strip > span:hover { filter: brightness(0.8); } }
.strip > span.arrive { animation: arrive 0.6s ease-out; }
@keyframes arrive { from { opacity: 0; transform: scaleY(0.4); } }

.axis {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--dim);
}

/* ---- incidents and maintenance ---- */
.open { margin-top: 56px; display: grid; gap: 40px; }
.entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.entry-title { margin: 0; font-size: 14px; font-weight: 500; color: var(--accent); }
.entry-state { font-size: 12px; white-space: nowrap; }
.entry-meta { margin: 2px 0 0; font-size: 12px; color: var(--dim); }

.updates { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.updates li {
  display: grid;
  grid-template-columns: 6ch 13ch 1fr;
  column-gap: 12px;
  font-size: 13px;
}
.updates time { color: var(--dim); }
.updates .msg { color: var(--muted); overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .updates li { grid-template-columns: 6ch 1fr; }
  .updates .msg { grid-column: 1 / -1; }
}

/* ---- the record ---- */
.record { margin-top: 72px; }
.record-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.record-head h2 { margin: 0; font-size: 14px; font-weight: 500; color: var(--accent); }
.record-head .uptime { font-size: 12px; color: var(--muted); }

.history { list-style: none; margin: 36px 0 0; padding: 0; }
.history > li + li { margin-top: 2px; }
.history .row {
  width: 100%;
  display: grid;
  grid-template-columns: 7ch 1fr auto;
  column-gap: 16px;
  align-items: baseline;
  padding: 6px 0;
  text-align: left;
}
.history .row .date { font-size: 12px; color: var(--dim); }
.history .row .title { color: var(--muted); display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.history .row .title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history .row:hover .title { color: var(--accent); }
.history .row .took { font-size: 12px; color: var(--dim); white-space: nowrap; }
.mark { flex: none; width: 6px; height: 6px; border-radius: 1px; align-self: center; background: var(--dim); }
.mark.red { background: var(--red); }
.mark.orange { background: var(--orange); }
.mark.blue { background: var(--blue); }
.history .updates { margin: 6px 0 14px calc(7ch + 16px); }
.history .updates li { grid-template-columns: 6ch 13ch 1fr; }
@media (max-width: 520px) { .history .updates { margin-left: 0; } }
.empty { margin: 36px 0 0; color: var(--dim); }

footer {
  margin-top: 96px;
  padding: 32px 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 12px;
  color: var(--dim);
}

/* ---- hover cards, as in the app ---- */
.hover-card { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; }
.hover-card-box {
  display: block;
  width: max-content;
  max-width: calc(100vw - 16px);
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--text) 11%, transparent);
  background: color-mix(in srgb, var(--bg2) 62%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(1.7);
  backdrop-filter: blur(22px) saturate(1.7);
  box-shadow: 0 12px 34px -10px var(--shadow);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.hover-card-box b { display: block; font-weight: 400; color: var(--accent); }
.hover-card-box .line { display: block; }
[data-note] { cursor: default; }
.noted { text-decoration: underline dotted var(--dim); text-underline-offset: 4px; }
.noted:hover { color: var(--accent); }

/* ---- manage ---- */
.manage h1 { margin: 0; font-size: 20px; font-weight: 500; color: var(--accent); }
.manage section { margin-top: 56px; }
.manage #manage > section:first-child { margin-top: 0; }
.manage .history { margin-top: 0; }
.signout { margin-left: 20px; }
.manage h2 { margin: 0 0 16px; font-size: 14px; font-weight: 500; color: var(--accent); }
.field { display: grid; gap: 6px; margin-top: 18px; }
.field > span { font-size: 12px; color: var(--dim); }
input[type=text], input[type=password], input[type=datetime-local], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--dim); }
textarea { min-height: 84px; resize: vertical; line-height: 1.6; }
.choices { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.choices button { color: var(--dim); transition: color 0.2s; }
.choices button:hover { color: var(--muted); }
.choices button[aria-pressed=true].red { color: var(--red); }
.choices button[aria-pressed=true].orange { color: var(--orange); }
.choices button[aria-pressed=true].blue { color: var(--blue); }
.choices button[aria-pressed=true].green { color: var(--green); }
.choices button[aria-pressed=true].muted, .choices button[aria-pressed=true]:not([class]) { color: var(--accent); }
.kinds { display: flex; gap: 24px; }
.kinds button { color: var(--dim); font-size: 14px; }
.kinds button[aria-pressed=true] { color: var(--accent); }
.actions { display: flex; align-items: baseline; gap: 20px; margin-top: 20px; }
.go {
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 14px;
  transition: border-color 0.2s;
}
.go:hover { border-color: var(--dim); }
.go:disabled { color: var(--dim); cursor: default; }
.quiet-action { font-size: 12px; color: var(--dim); }
.quiet-action:hover { color: var(--muted); }
.quiet-action.sure { color: var(--red); }
.error { font-size: 12px; color: var(--red); }
.window-note { font-size: 12px; color: var(--dim); }
.manage .entry + .entry { margin-top: 48px; }
.manage .entry .reply { margin-top: 8px; }
.manage .updates li { grid-template-columns: 6ch 13ch 1fr auto; }
@media (max-width: 520px) { .manage .updates li { grid-template-columns: 6ch 1fr auto; } }

/* ---- local preview switcher (only on 127.0.0.1) ---- */
.preview {
  position: fixed;
  left: 12px;
  bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 11px;
  color: var(--dim);
}
.preview button[aria-pressed=true] { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .dot.beat, .strip > span.arrive { animation: none; }
  a, .choices button { transition: none; }
}
