/* status-kit page styles. One file for every status host; the brand accent comes from
   /theme.css. Light and dark are equals and follow the reader's system setting. Status
   colours are fixed (good, warning, serious, critical, plus maintenance blue) and always
   travel with an icon or a label, never colour alone. */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fbfbfc;
  --line: #e7e9ee;
  --line-strong: #d8dbe2;
  --ink: #101217;
  --ink-2: #3c4250;
  --muted: #646b78;
  --subtle: #8d94a1;
  --accent: #4f46e5;

  --ok: #0ca30c;
  --degraded: #e9a20f;
  --partial: #ec835a;
  --major: #d03b3b;
  --maintenance: #3b82f6;
  --none: #e3e6eb;
  --ok-ink: #077a07;
  --degraded-ink: #9a6400;
  --partial-ink: #b4511f;
  --major-ink: #b42f2f;
  --maintenance-ink: #1f5fd1;

  --radius: 12px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 2px 10px -2px rgba(16, 24, 40, 0.06);
  --shadow-lift: 0 1px 2px rgba(16, 24, 40, 0.06), 0 12px 32px -12px rgba(16, 24, 40, 0.18);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --page: 960px;
  --gutter: 24px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c0f;
    --surface: #131519;
    --surface-2: #171a1f;
    --line: #23262d;
    --line-strong: #2f333b;
    --ink: #eef0f4;
    --ink-2: #c3c8d2;
    --muted: #979eab;
    --subtle: #6f7682;
    --none: #262a31;
    --ok-ink: #3fcf3f;
    --degraded-ink: #f5bd45;
    --partial-ink: #f39a76;
    --major-ink: #f07272;
    --maintenance-ink: #79a8f8;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 12px -2px rgba(0, 0, 0, 0.35);
    --shadow-lift: 0 1px 2px rgba(0, 0, 0, 0.5), 0 16px 40px -12px rgba(0, 0, 0, 0.6);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15.5px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

h1,
h2,
h3,
p {
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

main.wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 48px;
}

.i {
  width: 18px;
  height: 18px;
  flex: none;
}
.i-sm {
  width: 15px;
  height: 15px;
}
.i-lg {
  width: 26px;
  height: 26px;
  stroke-width: 2.4;
}

/* ---------- top bar ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  min-width: 0;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex: none;
}
.brand-name {
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand-page {
  font-weight: 450;
  font-size: 17px;
  color: var(--muted);
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
  line-height: 1.1;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  --h: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: var(--h);
  padding: 0 14px;
  border-radius: calc(var(--h) * 0.24);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  color: var(--ink);
  font: 550 14px/1 var(--font);
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn .i {
  width: 15px;
  height: 15px;
  color: var(--muted);
}
.btn:hover {
  text-decoration: none;
  border-color: var(--subtle);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), 0 4px 12px -6px rgba(16, 24, 40, 0.2);
}
.btn-icon {
  width: var(--h);
  padding: 0;
}
.btn-icon .i {
  width: 17px;
  height: 17px;
}

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

.hero {
  --tone: var(--ok);
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 30px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--tone) 28%, var(--line));
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--tone) 11%, transparent), transparent 60%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
@media (prefers-color-scheme: dark) {
  .hero {
    background:
      radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--tone) 18%, transparent), transparent 62%),
      linear-gradient(180deg, var(--surface), var(--surface-2));
  }
}
.hero-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  flex: none;
  color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tone) 86%, #fff), var(--tone));
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12), 0 8px 22px -8px color-mix(in srgb, var(--tone) 70%, transparent);
}
.hero-mark::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--tone) 45%, transparent);
  animation: halo 2.6s ease-out infinite;
}
.hero-text {
  min-width: 0;
}
.hero h1 {
  font-size: clamp(22px, 3.2vw, 30px);
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.hero-sub,
.inc-body,
.comp-desc,
.tl-body {
  text-wrap: pretty;
}
.hero-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14.5px;
}

.tone-ok {
  --tone: var(--ok);
  --tone-ink: var(--ok-ink);
}
.tone-degraded {
  --tone: var(--degraded);
  --tone-ink: var(--degraded-ink);
}
.tone-partial {
  --tone: var(--partial);
  --tone-ink: var(--partial-ink);
}
.tone-major {
  --tone: var(--major);
  --tone-ink: var(--major-ink);
}
.tone-maintenance {
  --tone: var(--maintenance);
  --tone-ink: var(--maintenance-ink);
}
.tone-none {
  --tone: var(--subtle);
  --tone-ink: var(--muted);
}

@keyframes halo {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--tone) 42%, transparent);
  }
  70%,
  100% {
    box-shadow: 0 0 0 12px color-mix(in srgb, var(--tone) 0%, transparent);
  }
}

/* ---------- cards ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 24px 4px;
}
.card-head h2 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.card-note {
  color: var(--muted);
  font-size: 13.5px;
}
.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 550;
}

/* ---------- incidents (active, upcoming, detail) ---------- */

.incident {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: 0 1px 1px rgba(16, 24, 40, 0.04);
}
.chip .i {
  width: 14px;
  height: 14px;
}
.chip[class*="tone-"] {
  color: var(--tone-ink);
  background: color-mix(in srgb, var(--tone) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--tone) 28%, var(--line));
}
.incident h2 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.incident h2 a,
.inc-title {
  color: var(--ink);
}
.incident.detail h1 {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.inc-body {
  color: var(--ink-2);
  max-width: 72ch;
}
/* A meta row wraps item by item: each item keeps its words together, no separators to
   strand at a line start. */
.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  color: var(--muted);
  font-size: 13.5px;
}
.meta .m {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.meta .m-dur {
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 550;
}
.meta .i {
  color: var(--subtle);
}

/* ---------- services ---------- */

.comp-list {
  list-style: none;
  margin: 0;
  padding: 0 24px 6px;
}
.comp {
  padding: 18px 0 16px;
}
.comp + .comp {
  border-top: 1px solid var(--line);
}
.comp-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.comp-name {
  min-width: 0;
}
.comp h3 {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.35;
}
.comp-desc {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 1px;
}
.state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--tone-ink);
  white-space: nowrap;
  padding-top: 1px;
}
.dot {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--tone);
  flex: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 18%, transparent);
}
.state .dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  animation: ping 2.4s cubic-bezier(0, 0, 0.2, 1) infinite;
  background: var(--tone);
}
@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  80%,
  100% {
    transform: scale(2.6);
    opacity: 0;
  }
}

.bars {
  display: flex;
  gap: 2px;
  height: 34px;
}
.bar {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 3px;
  background: var(--none);
  transition: filter 0.12s ease, transform 0.12s ease;
}
.bar.l-ok {
  background: var(--ok);
}
.bar.l-degraded {
  background: var(--degraded);
}
.bar.l-partial {
  background: var(--partial);
}
.bar.l-major {
  background: var(--major);
}
.bar.l-maintenance {
  background: var(--maintenance);
}
.bar:hover,
.bar.is-on {
  filter: brightness(0.86) saturate(1.1);
  transform: scaleY(1.06);
}
@media (prefers-color-scheme: dark) {
  .bar.l-ok {
    background: color-mix(in srgb, var(--ok) 88%, #000);
  }
  .bar:hover,
  .bar.is-on {
    filter: brightness(1.25);
  }
}
.bar-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  color: var(--subtle);
  font-size: 12.5px;
  white-space: nowrap;
}
.bar-legend .rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}
.bar-legend .u90,
.bar-legend .u30 {
  color: var(--muted);
  font-weight: 550;
}
.d30,
.u30,
.lbl-short {
  display: none;
}

/* ---------- recent incidents and history ---------- */

.inc-list {
  list-style: none;
  margin: 0;
  padding: 4px 24px 8px;
}
.inc-item {
  padding: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.inc-item + .inc-item {
  border-top: 1px solid var(--line);
}
.inc-title {
  font-weight: 600;
  font-size: 15px;
}
.inc-item .dot {
  width: 8px;
  height: 8px;
  margin-left: 3px; /* the 3px halo stays inside the text edge */
}
.empty {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px 22px;
  color: var(--muted);
}
.empty .i {
  color: var(--ok-ink);
}
.empty-card {
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.back {
  margin-top: 4px;
}
.back a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 550;
  font-size: 14px;
}
.page-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 650;
  letter-spacing: -0.02em;
}
.more {
  display: flex;
  justify-content: center;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 2px 0 6px;
}
.facts div {
  min-width: 0;
}
.facts dt {
  color: var(--subtle);
  font-size: 12.5px;
  font-weight: 550;
}
.facts dd {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
}

.timeline {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.tl-item {
  position: relative;
  padding: 16px 0 16px 22px;
}
.tl-item + .tl-item {
  border-top: 1px solid var(--line);
}
.tl-item::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 23px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-strong);
}
.tl-item:first-child::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: 14px;
  color: var(--muted);
}
.tl-head strong {
  color: var(--ink);
  font-weight: 650;
}
.tl-body {
  margin-top: 4px;
  color: var(--ink-2);
  max-width: 72ch;
}

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

.foot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding-top: 22px;
  padding-bottom: 32px;
  color: var(--muted);
  font-size: 13.5px;
}
/* The rule spans the content column, not the gutters, so it ends where the cards end. */
.foot::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--gutter);
  right: var(--gutter);
  height: 1px;
  background: var(--line);
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.foot-links a {
  color: var(--muted);
}
.foot-links a:hover {
  color: var(--ink);
}

/* ---------- tooltip (one element, placed by status.js) ---------- */

.tip {
  position: fixed;
  z-index: 50;
  top: 0;
  left: 0;
  max-width: min(280px, calc(100vw - 24px));
  padding: 10px 13px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.45;
  box-shadow: 0 2px 4px rgba(16, 24, 40, 0.06), 0 14px 36px -6px rgba(16, 24, 40, 0.26);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.tip.is-on {
  opacity: 1;
  transform: none;
}
@media (prefers-color-scheme: dark) {
  .tip {
    background: #1d2026;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), 0 16px 40px -6px rgba(0, 0, 0, 0.7);
  }
}
.tip-day {
  font-weight: 650;
}
.tip-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
  color: var(--ink-2);
}
.tip-row .dot {
  width: 8px;
  height: 8px;
}
.tip-inc {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

/* ---------- narrow screens ---------- */

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }
  body {
    font-size: 15px;
  }
  .top {
    min-height: 64px;
  }
  .lbl-long {
    display: none;
  }
  .lbl-short {
    display: inline;
  }
  .top .btn:not(.btn-icon) {
    padding: 0 12px;
  }
  .hero {
    padding: 20px;
    gap: 14px;
    align-items: flex-start;
  }
  .hero-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
  }
  .i-lg {
    width: 22px;
    height: 22px;
  }
  .card-head,
  .incident {
    padding-left: 16px;
    padding-right: 16px;
  }
  .comp-list,
  .inc-list {
    padding-left: 16px;
    padding-right: 16px;
  }
  .empty {
    padding-left: 16px;
    padding-right: 16px;
  }
  .bar:nth-child(-n + 60) {
    display: none;
  }
  .bars {
    gap: 3px;
    height: 30px;
  }
  .d90,
  .u90 {
    display: none;
  }
  .d30,
  .u30 {
    display: inline;
  }
}

@media (max-width: 400px) {
  .brand-page {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-mark::after,
  .state .dot::after {
    animation: none;
  }
  .bar,
  .tip,
  .btn {
    transition: none;
  }
}
