/* Customer status page. Light only; tokens and type registers follow the
   HEYLIM design system (l_color / lt-* names). progressGreen (#92FB13) is
   deliberately absent: it means in-progress in the app, not "up". */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/Inter-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/Inter-Medium.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/Inter-Italic.woff2") format("woff2");
}

/* The lt-voiceStatus register is italic 500; a real face, never synthesized. */
@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/Inter-MediumItalic.woff2") format("woff2");
}

:root {
  --lim-dark-blue: #10069c;
  --black: #02020a;
  --paynes-gray: #4b5663;
  --paynes-gray-40: #b9bdc3;
  --online: #3ee06c;
  --success-light: #6ef442;
  --offline: #ff674d;
  --system-error: #b5402c;
  --warning: #ee9500;
  --white: #ffffff;
  --online-banner-bg: #eaf7ee;
  --offline-banner-bg: #fef7ea;
  /* ambient blue: the heylim.com elevation hue, low alpha only */
  --page-grid: rgba(0, 24, 168, 0.02);
  --hairline: rgba(0, 24, 168, 0.1);
  --hover-tint: rgba(0, 24, 168, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0 auto;
  max-width: 40rem;
  padding: 0 16px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--black);
  background-color: var(--white);
  background-image:
    linear-gradient(var(--page-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--page-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  background-attachment: fixed;
}

a {
  color: var(--lim-dark-blue);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

summary {
  cursor: pointer;
  list-style: none;
}

summary::marker,
summary::-webkit-details-marker {
  display: none;
}

summary:focus-visible {
  outline: 2px solid var(--lim-dark-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

/* header */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
}

.wordmark img {
  display: block;
}

.page-links {
  display: flex;
  gap: 20px;
  font-size: 14px;
}

/* hero */

.hero {
  margin-top: 40px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 32px);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--lim-dark-blue);
  text-wrap: balance;
}

/* voice line: lt-voiceStatus — italic 500, limDarkBlue */
.hero-line {
  margin: 10px 0 0;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(18px, 4vw, 22px);
  color: var(--lim-dark-blue);
  transition: color 250ms ease;
}

/* lt-sticker: the one celebratory mark, hero only, all-good only */
[data-hero-state="operational"] .hero-line {
  display: inline-block;
  background: var(--success-light);
  padding: 2px 12px 4px;
}

[data-hero-state="degraded"] .hero-line,
[data-hero-state="disrupted"] .hero-line {
  color: var(--system-error);
}

[data-hero-state="checking"] .hero-line,
[data-hero-state="unknown"] .hero-line {
  color: var(--paynes-gray);
}

/* announcements */

.announcements {
  margin-top: 32px;
}

.announcement {
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
}

.announcement-outage,
.announcement-warning {
  background: var(--offline-banner-bg);
  border-color: transparent;
}

.announcement-operational {
  background: var(--online-banner-bg);
  border-color: transparent;
}

.announcement-message {
  margin: 0;
  font-style: italic;
  font-weight: 500;
}

/* every renderable type below sets the dot color; "none" removes the dot */
.announcement-message::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 10px;
}

.announcement-none .announcement-message::before {
  content: none;
}

.announcement-outage .announcement-message::before {
  background: var(--offline);
}

.announcement-warning .announcement-message::before {
  background: var(--warning);
}

.announcement-information .announcement-message::before {
  background: var(--paynes-gray);
}

.announcement-operational .announcement-message::before {
  background: var(--online);
}

.announcement-time {
  margin: 4px 0 0 18px;
  font-size: 13px;
  color: var(--paynes-gray);
}

/* systems */

.updated-line {
  margin: 40px 0 -30px;
  font-size: 12px;
  color: var(--paynes-gray);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.systems {
  margin-top: 40px;
}

.system {
  padding: 20px 0 24px;
  border-top: 1px solid var(--hairline);
}

.system-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.system-label {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.system-checked {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--paynes-gray);
  font-variant-numeric: tabular-nums;
}

.system-line {
  margin: 0;
  font-style: italic;
  font-weight: 500;
  font-size: 16px;
  white-space: nowrap;
  transition: color 250ms ease;
}

.system-operational .system-line {
  color: var(--lim-dark-blue);
}

.system-unknown .system-line {
  color: var(--paynes-gray);
}

.system-degraded .system-line,
.system-disrupted .system-line {
  color: var(--system-error);
}

/* components */

.component {
  margin-top: 14px;
}

.component-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: 6px;
}

.component-summary:hover {
  background: var(--hover-tint);
}

.component-summary::after {
  content: "";
  align-self: center;
  flex: none;
  width: 7px;
  height: 7px;
  margin-left: -6px;
  border-right: 1.5px solid var(--paynes-gray-40);
  border-bottom: 1.5px solid var(--paynes-gray-40);
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

.component-disclosure[open] > .component-summary::after {
  transform: rotate(225deg) translate(-2px, -2px);
}

.component-label {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
}

.component-unknown .component-label {
  color: var(--paynes-gray);
}

.component-uptime {
  margin-left: auto;
  font-size: 12px;
  color: var(--paynes-gray);
  font-variant-numeric: tabular-nums;
}

.component-disclosure[open] .component-uptime {
  display: none;
}

/* component panel */

.component-panel {
  display: grid;
  gap: 12px;
  margin: 8px 0 14px;
  animation: panel-in 200ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.panel-row {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.panel-label {
  flex: none;
  width: 4.5rem;
  font-size: 12px;
  color: var(--paynes-gray);
}

.uptime-grid {
  display: flex;
  gap: 28px;
}

.uptime-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.uptime-value {
  min-height: 21px;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.uptime-window {
  font-size: 11px;
  color: var(--paynes-gray);
}

/* full-width so the line's columns sit over the ticks in the strip below */
.response-block {
  min-width: 0;
}

.response-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.spark-wrap {
  position: relative;
  margin-top: 4px;
}

.response-chart {
  display: block;
  width: 100%;
  height: 36px;
}

.response-chart .spark-line {
  fill: none;
  stroke: var(--paynes-gray);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.response-chart .median-rule {
  stroke: var(--paynes-gray-40);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.spark-max,
.spark-min {
  position: absolute;
  right: 0;
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.75);
  font-size: 10px;
  line-height: 1;
  color: var(--paynes-gray);
  font-variant-numeric: tabular-nums;
}

.spark-max {
  top: -2px;
}

.spark-min {
  bottom: -2px;
}

.response-typical {
  font-size: 12px;
  color: var(--paynes-gray);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.component-note {
  margin: 0;
  font-size: 13px;
  font-style: italic;
  font-weight: 500;
  color: var(--lim-dark-blue);
}

.component-disrupted .component-note {
  color: var(--system-error);
}

/* ticks */

.ticks {
  display: flex;
  gap: 3px;
  height: 24px;
  margin-top: 4px;
}

.tick {
  position: relative;
  flex: 1 1 0;
  min-width: 2px;
  border-radius: 2px;
}

.tick[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 8px;
  border-radius: 4px;
  background: var(--black);
  color: var(--white);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  z-index: 1;
}

.tick-ok {
  background: var(--online);
}

.tick-bad {
  background: var(--offline);
}

.tick-unknown {
  background: var(--paynes-gray-40);
  opacity: 0.6;
}

.tick-range {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 12px;
  color: var(--paynes-gray);
  font-variant-numeric: tabular-nums;
}

/* skeleton (first paint only; replaced by the first render) */

.skeleton-label {
  width: 8rem;
  height: 14px;
  border-radius: 4px;
  background: var(--paynes-gray-40);
  opacity: 0.5;
}

.skeleton-ticks {
  height: 24px;
  margin-top: 14px;
  border-radius: 2px;
  background: repeating-linear-gradient(
    90deg,
    var(--paynes-gray-40) 0 5px,
    transparent 5px 8px
  );
  opacity: 0.5;
}

/* also the empty strip of a component with no history yet */
.component .skeleton-ticks {
  margin-top: 4px;
}

/* footer */

.help-line {
  margin: 40px 0 48px;
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  .hero-line,
  .system-line,
  .component-summary::after {
    transition: none;
  }

  .component-panel {
    animation: none;
  }
}
