/* Nivaronix Status — Obsidian tokens, hand-copied from
   packages/design-system/tokens.css (this page runs outside the Next.js
   build/token pipeline, so values are inlined rather than imported). */

:root {
  color-scheme: dark;

  --background: #050505;
  --surface: #0f1115;
  --surface-elevated: #16181d;

  --text-primary: #ffffff;
  --text-secondary: #b8c0cc;
  --text-muted: #7c8494;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);

  /* Accent — interaction/focus only. Never used for status meaning. */
  --accent: #00d4ff;
  --accent-hover: #3adeff;

  /* Status */
  --status-success: #2fbf71;
  --status-warning: #e5a13a;
  --status-partial: #d97a2b; /* deeper amber — visually distinct from degraded's warning tone */
  --status-critical: #e5484d;
  --status-idle: #7c8494;

  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

@media (max-width: 480px) {
  .wrap {
    padding: 36px 18px 56px;
  }
}

/* ---------- Header ---------- */

.header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 48px;
}

.brand-mark {
  height: 20px;
  width: auto;
  color: var(--text-primary);
  display: block;
}

.tagline {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.back-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

@media (max-width: 480px) {
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
}

/* ---------- Status dot ---------- */

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}

.banner:not(.state-operational) .dot,
.active .dot {
  animation: dot-pulse 2.4s ease-in-out infinite;
}

@keyframes dot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@media (prefers-reduced-motion: reduce) {
  .dot {
    animation: none !important;
  }
}

/* ---------- Banner ---------- */

.banner {
  border-radius: 14px;
  border: 1px solid var(--border-default);
  background: var(--surface-elevated);
  padding: 28px;
  margin-bottom: 20px;
  animation: rise 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@media (prefers-reduced-motion: reduce) {
  .banner {
    animation: none;
  }
}

.banner-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.banner h1 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}

.banner-description {
  margin: 10px 0 0;
  padding-left: 22px;
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 56ch;
}

.meta {
  margin: 16px 0 0;
  padding-left: 22px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: -0.01em;
}

.state-operational { color: var(--status-success); }
.state-maintenance { color: var(--status-idle); }
.state-degraded { color: var(--status-warning); }
.state-partial { color: var(--status-partial); }
.state-major { color: var(--status-critical); }

.state-operational.banner { background: color-mix(in srgb, var(--status-success) 7%, var(--surface-elevated)); border-color: color-mix(in srgb, var(--status-success) 30%, var(--border-default)); }
.state-maintenance.banner { background: color-mix(in srgb, var(--status-idle) 10%, var(--surface-elevated)); border-color: color-mix(in srgb, var(--status-idle) 35%, var(--border-default)); }
.state-degraded.banner { background: color-mix(in srgb, var(--status-warning) 8%, var(--surface-elevated)); border-color: color-mix(in srgb, var(--status-warning) 30%, var(--border-default)); }
.state-partial.banner { background: color-mix(in srgb, var(--status-partial) 8%, var(--surface-elevated)); border-color: color-mix(in srgb, var(--status-partial) 30%, var(--border-default)); }
.state-major.banner { background: color-mix(in srgb, var(--status-critical) 8%, var(--surface-elevated)); border-color: color-mix(in srgb, var(--status-critical) 30%, var(--border-default)); }

.banner h1,
.active h2 {
  color: var(--text-primary);
}

/* ---------- Active notice ---------- */

.active {
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
  padding: 24px 28px;
  margin-bottom: 40px;
}

.active-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.active h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.active p:not(.meta) {
  margin: 10px 0 0;
  padding-left: 22px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  max-width: 56ch;
}

/* ---------- Section headings / dividers ---------- */

.section-heading {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 40px 0 14px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
}

section:first-of-type .section-heading {
  padding-top: 0;
  border-top: none;
}

/* ---------- Systems list ---------- */

.systems-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
}

.systems-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-primary);
}

.systems-list li + li {
  border-top: 1px solid var(--border-subtle);
}

.system-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

/* ---------- History ---------- */

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.history-list li {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: baseline;
  gap: 14px;
  padding: 14px 0;
}

.history-list li + li {
  border-top: 1px solid var(--border-subtle);
}

.history-date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.history-body {
  min-width: 0;
}

.history-title {
  font-size: 14px;
  color: var(--text-primary);
  margin: 0;
}

.history-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 3px 0 0;
}

.history-badge {
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--status-success);
  white-space: nowrap;
  justify-self: end;
}

.history-badge.ongoing {
  color: var(--status-warning);
}

@media (max-width: 480px) {
  .history-list li {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "date badge"
      "body body";
    row-gap: 4px;
  }
  .history-date { grid-area: date; }
  .history-badge { grid-area: badge; }
  .history-body { grid-area: body; }
}

/* ---------- Footer ---------- */

.footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer p {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer a:hover,
.footer a:focus-visible {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ---------- Fallback / empty states ---------- */

.empty-note {
  font-size: 13px;
  color: var(--text-muted);
  padding: 16px 0;
}
