@font-face {
  font-family: "Cormorant Garamond";
  src: url("./fonts/CormorantGaramond-latin-400-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("./fonts/Manrope-latin-300-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --mist: #f6f1ea;
  --sand: #f3ece2;
  --surface: #fffdfa;
  --ink: #121011;
  --muted: #71665b;
  --border: #d8cfc3;
  --border-strong: #cbb9a6;
  --accent: #cf130e;
  --operational: #247a52;
  --operational-soft: #edf7f1;
  --degraded: #a46516;
  --degraded-soft: #fff6dc;
  --outage: #b42318;
  --outage-soft: #fff0ee;
  --unknown: #9c9389;
  --shadow: 0 1px 2px rgb(39 31 23 / 5%), 0 12px 35px rgb(39 31 23 / 4%);
}

* {
  box-sizing: border-box;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(to right, rgb(216 207 195 / 18%) 1px, transparent 1px),
    linear-gradient(to bottom, rgb(216 207 195 / 18%) 1px, transparent 1px),
    var(--mist);
  background-size: 80px 80px;
  color: var(--ink);
  font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 9px 13px;
  transform: translateY(-180%);
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

.page-shell {
  width: min(100% - 32px, 720px);
  margin: 0 auto;
  padding: 32px 0 48px;
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  margin-bottom: 26px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand img {
  display: block;
  border-radius: 50%;
}

.brand span {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
}

.page-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.back-link {
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

.overall-card,
.incident-card,
.status-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.overall-card,
.incident-card {
  overflow: hidden;
}

.status-panel {
  position: relative;
  z-index: 1;
  overflow: visible;
}

.overall-card {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 62px;
  margin-bottom: 22px;
  padding: 15px 17px;
}

.overall-card h1,
.overall-card p,
.incident-card h2,
.incident-card p,
.panel-heading h2,
.history-heading h2 {
  margin: 0;
}

.panel-heading h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.overall-card h1 {
  font-size: 15px;
  font-weight: 700;
}

.overall-card p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.overall-card.is-up {
  border-color: #94c7aa;
  background: var(--operational-soft);
}

.overall-card.is-degraded,
.incident-card {
  border-color: #e0b45d;
  background: var(--degraded-soft);
}

.overall-card.is-down {
  border-color: #e7a099;
  background: var(--outage-soft);
}

.overall-card.is-maintenance,
.overall-card.is-unknown {
  border-color: var(--border-strong);
  background: #f4f1ed;
}

.status-icon {
  display: inline-grid;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  place-items: center;
  border-radius: 50%;
  background: var(--unknown);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.is-up .status-icon,
.component-status.is-up {
  background: var(--operational);
}

.is-degraded .status-icon,
.component-status.is-degraded,
.incident-card .status-icon {
  background: var(--degraded);
}

.is-down .status-icon,
.component-status.is-down {
  background: var(--outage);
}

.is-maintenance .status-icon,
.component-status.is-maintenance {
  background: #69798a;
}

.is-unknown .status-icon,
.component-status.is-unknown {
  background: var(--unknown);
}

.incident-card {
  margin-bottom: 22px;
  background: var(--surface);
}

.incident-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 17px;
  background: var(--degraded-soft);
}

.incident-heading h2 {
  font-size: 15px;
}

.incident-entry {
  padding: 16px 17px;
  border-top: 1px solid #eee2c8;
}

.incident-entry h3 {
  margin: 0;
  font-size: 14px;
}

.incident-entry p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  white-space: pre-line;
}

.incident-meta {
  margin-top: 8px;
  color: var(--degraded);
  font-size: 12px;
  font-weight: 600;
}

.panel-heading,
.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading {
  min-height: 53px;
  padding: 0 17px;
  border-bottom: 1px solid var(--border);
}

.panel-heading h2,
.history-heading h2 {
  font-size: 15px;
  font-weight: 700;
}

.panel-heading span,
.history-heading span {
  color: var(--muted);
  font-size: 12px;
}

.component-group + .component-group {
  border-top: 1px solid var(--border);
}

.component-group {
  position: relative;
}

.component-group:hover,
.component-group:focus-within {
  z-index: 20;
}

.group-header {
  display: grid;
  width: 100%;
  min-height: 62px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 17px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: #fbf8f3;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease;
}

.group-header[aria-expanded="true"] {
  border-bottom-color: var(--border);
}

.group-header[aria-expanded="true"] .group-chevron {
  color: var(--ink);
}

.group-header:hover {
  background: #f7f2eb;
}

.group-header:focus-visible {
  position: relative;
  z-index: 2;
  outline: 2px solid rgb(192 40 32 / 42%);
  outline-offset: -2px;
}

.group-identity {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.group-title-line,
.component-name-wrap {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.group-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-count {
  color: var(--muted);
  font-size: 12px;
}

.group-chevron {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--muted);
}

.group-chevron::before {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: rotate(45deg);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.group-header[aria-expanded="true"] .group-chevron::before {
  transform: rotate(225deg);
}

.group-components {
  display: grid;
  grid-template-rows: 1fr;
  opacity: 1;
  transition:
    grid-template-rows 280ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 180ms ease;
}

.group-components.is-collapsed {
  grid-template-rows: 0fr;
  opacity: 0;
}

.group-components-inner {
  min-height: 0;
  overflow: visible;
}

.group-components.is-collapsed .group-components-inner,
.group-components.is-animating .group-components-inner {
  overflow: hidden;
}

.component-row {
  position: relative;
  padding: 14px 17px 15px;
}

.component-row:hover,
.component-row:focus-within {
  z-index: 30;
}

.component-row + .component-row {
  border-top: 1px solid var(--border);
}

.component-topline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.component-status {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  background: var(--unknown);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.component-status::before {
  content: "?";
}

.component-status.is-up::before {
  width: 4px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  content: "";
  transform: translateY(-1px) rotate(45deg);
}

.component-status.is-degraded::before {
  content: "!";
}

.component-status.is-maintenance::before {
  content: "–";
}

.component-status.is-down::before {
  content: "×";
}

.component-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info-tip {
  position: relative;
  display: inline-grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  border-radius: 50%;
  color: #9b9085;
  cursor: help;
}

.info-symbol {
  display: inline-grid;
  width: 15px;
  height: 15px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 4px;
  background: transparent;
  font-family: "Manrope", system-ui, sans-serif;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.info-symbol::before {
  content: "i";
}

.info-tip:hover .info-symbol,
.info-tip:focus .info-symbol,
.info-tip:focus-visible .info-symbol {
  border-color: var(--muted);
  background: var(--sand);
  color: var(--ink);
}

.info-tip:hover,
.info-tip:focus,
.info-tip:focus-visible {
  z-index: 220;
}

.info-tooltip {
  --tooltip-shift-x: 0px;
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  z-index: 100;
  display: none;
  width: min(290px, 76vw);
  padding: 9px 10px;
  transform: translate(calc(-50% + var(--tooltip-shift-x)), -4px);
  border: 1px solid #c7b7a5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgb(39 31 23 / 20%);
  color: var(--ink);
  font-size: 11px;
  font-weight: 450;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 100ms ease, transform 100ms ease;
}

.info-tip:hover .info-tooltip,
.info-tip:focus .info-tooltip,
.info-tip:focus-visible .info-tooltip {
  display: block;
  transform: translate(calc(-50% + var(--tooltip-shift-x)), 0);
  opacity: 1;
}

.component-metrics {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.uptime-bars {
  display: grid;
  grid-template-columns: repeat(90, minmax(2px, 1fr));
  gap: 2px;
  height: 13px;
  margin-top: 10px;
}

.uptime-bar {
  appearance: none;
  position: relative;
  min-width: 2px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--operational);
  cursor: pointer;
  transition: filter 120ms ease;
}

.uptime-bar:hover,
.uptime-bar:focus-visible {
  z-index: 220;
  filter: saturate(1.18) brightness(0.94);
}

.uptime-tooltip {
  --tooltip-shift-x: 0px;
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  z-index: 90;
  display: none;
  width: min(256px, 70vw);
  padding: 4px;
  transform: translate(calc(-50% + var(--tooltip-shift-x)), -4px);
  border: 1px solid #c7b7a5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 30px rgb(39 31 23 / 20%);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transition: opacity 100ms ease, transform 100ms ease;
}

.uptime-bar:hover .uptime-tooltip,
.uptime-bar:focus .uptime-tooltip,
.uptime-bar:focus-visible .uptime-tooltip {
  display: block;
  transform: translate(calc(-50% + var(--tooltip-shift-x)), 0);
  opacity: 1;
}

.uptime-bar:focus-visible {
  z-index: 2;
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.tooltip-date,
.tooltip-detail {
  display: flex;
  min-height: 32px;
  align-items: center;
  text-align: left;
}

.tooltip-date {
  min-height: 28px;
  padding: 4px;
  color: #9c9389;
  font-size: 12px;
  white-space: nowrap;
}

.tooltip-detail {
  gap: 8px;
  padding: 4px 8px;
  color: #9c9389;
  font-size: 12px;
}

.tooltip-icon {
  display: inline-grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  border-radius: 50%;
  background: var(--operational);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.is-up .status-icon,
.tooltip-icon.is-up {
  font-size: 0;
}

.is-up .status-icon::before,
.tooltip-icon.is-up::before {
  width: 4px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  content: "";
  transform: translateY(-1px) rotate(45deg);
}

.tooltip-icon.is-degraded {
  background: #e2a52a;
}

.tooltip-icon.is-down {
  background: var(--outage);
}

.tooltip-icon.is-maintenance {
  background: #69798a;
}

.tooltip-icon.is-unknown {
  background: var(--unknown);
}

.uptime-bar.is-degraded {
  background: #e2a52a;
}

.uptime-bar.is-down {
  background: var(--outage);
}

.uptime-bar.is-maintenance {
  background: #69798a;
}

.uptime-bar.is-unknown {
  background: #ded8d0;
}

.loading-row {
  height: 76px;
  background: linear-gradient(90deg, transparent 0, rgb(243 236 226 / 90%) 48%, transparent 100%);
  background-size: 220% 100%;
  animation: loading 1.2s ease-in-out infinite;
}

.loading-group {
  height: 62px;
  background: linear-gradient(90deg, transparent 0, rgb(243 236 226 / 90%) 48%, transparent 100%);
  background-size: 220% 100%;
  animation: loading 1.2s ease-in-out infinite;
}

.loading-group + .loading-group {
  border-top: 1px solid var(--border);
}

.loading-row + .loading-row {
  border-top: 1px solid var(--border);
}

.muted {
  color: var(--muted);
}

.history-page {
  max-width: 720px;
}

.history-page .brand-header {
  margin-bottom: 18px;
}

.history-navigation {
  margin-bottom: 14px;
}

.history-back-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(39 31 23 / 4%);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease;
}

.history-back-link:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.history-back-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.history-list {
  min-height: 76px;
}

.history-item,
.history-empty {
  margin: 0;
  padding: 17px;
}

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

.history-item h2 {
  margin: 0;
  font-size: 14px;
}

.history-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.history-empty {
  color: var(--muted);
  font-size: 13px;
}

.page-footer {
  display: grid;
  justify-items: center;
  padding-top: 14px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.history-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease;
}

.history-link:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.history-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.noscript {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 12px;
  border: 1px solid var(--outage);
  border-radius: 8px;
  background: var(--outage-soft);
  text-align: center;
}

@keyframes loading {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 24px, 720px);
    padding-top: 20px;
  }

  .brand-header {
    margin-bottom: 18px;
  }

  .component-row {
    padding-right: 14px;
    padding-left: 14px;
  }

  .group-header {
    padding-right: 14px;
    padding-left: 14px;
  }

  .component-topline {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .component-metrics {
    grid-column: 2;
    text-align: left;
  }

  .uptime-bars {
    grid-template-columns: repeat(45, minmax(2px, 1fr));
  }

  .uptime-bar:nth-child(-n + 45) {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .loading-row { animation: none; }
  .loading-group { animation: none; }
  .uptime-bar { transition: none; }
  .group-header,
  .group-chevron::before,
  .group-components { transition: none; }
  .history-back-link { transition: none; }
}
