/* Design tokens and geometry lifted from status.thetriangle.org
   (BetterStack "statuspage v2", dark theme). */
:root {
  --neutral-200: #8a91a5;
  --neutral-600: #2d313c;
  --neutral-700: #21242d;
  --neutral-800: #191c24;
  --neutral-900: #0f121a;
  --green:  #10b981;
  --red:    #f87171;
  --yellow: #f59e0b;
  --shadow-small: 0 4px 7px #00000008;
}

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

html {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background-color: var(--neutral-900);
  color: var(--neutral-200);
  font-size: 13px;      /* --text-statuspage-medium */
  line-height: 150%;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
.icon { vertical-align: -3px; }
.truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.container {
  width: 100%; max-width: 860px;
  margin-inline: auto; padding-inline: 20px;
}

/* ---- header: py-4, border-b neutral-700 ---- */
header {
  display: flex; align-items: center; gap: 10px;
  padding-block: 16px;
  border-bottom: 1px solid var(--neutral-700);
}
header .logo { width: 32px; height: 32px; border-radius: 6px; display: block; }
header .wordmark { font-weight: 500; color: #fff; }

/* ---- hero: mt-20 mb-12, h1 32px/110% bold, p mt-3 ---- */
.hero {
  margin-top: 80px; margin-bottom: 48px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.hero h1 {
  margin: 8px 0 0;
  font-size: 32px; line-height: 110%; font-weight: 700; color: #fff;
}
.hero p { margin: 12px 0 0; font-weight: 500; }

/* ---- card: p-3, neutral-800 on neutral-700 border, rounded-lg, shadow-small ---- */
.card {
  padding: 12px; margin-bottom: 96px;
  background-color: var(--neutral-800);
  border: 1px solid var(--neutral-700);
  border-radius: 8px;
  box-shadow: var(--shadow-small);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px; padding: 12px 12px 12px 16px;
}
.card-title { font-weight: 500; color: #fff; }
.badge {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 8px 4px 4px; border-radius: 9999px;
  background-color: var(--neutral-600);
  font-weight: 500; color: #fff; white-space: nowrap;
}

/* ---- one service: mt-6 pb-6, divided by neutral-700 ---- */
.service {
  margin: 24px 12px 0; padding-bottom: 24px;
  border-bottom: 1px solid var(--neutral-700);
}
.service:last-of-type { padding-bottom: 0; border-bottom: 0; }

.service-head {
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 500; color: #fff;
}
.service-name {
  display: flex; align-items: center; min-width: 0; flex-grow: 1;
  margin-right: 8px; font-size: 15px;   /* --text-statuspage-large */
}
.service-name .icon { margin-right: 4px; flex-shrink: 0; }
.service-uptime { flex-shrink: 0; color: var(--green); }
.service-uptime.downtime { color: var(--red); }
.service-uptime.degraded { color: var(--yellow); }

/* ---- daily ticks: h-3, rounded-[1px], mr-[1px], 4px on the ends ---- */
.ticks { display: flex; margin-top: 12px; }
.tick {
  width: 100%; height: 12px; margin-right: 1px;
  border-radius: 1px; background-color: var(--green);
  transition: background-color .15s ease-in-out;
}
.tick:first-child { border-top-left-radius: 4px; border-bottom-left-radius: 4px; }
.tick:last-child { margin-right: 0; border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.tick:hover { background-color: rgb(16 185 129 / .6); }
.tick.downtime { background-color: var(--red); }
.tick.downtime:hover { background-color: rgb(248 113 113 / .6); }
.tick.degraded { background-color: var(--yellow); }
.tick.degraded:hover { background-color: rgb(245 158 11 / .6); }
.tick.no_data { background-color: var(--neutral-700); }
.tick.no_data:hover { background-color: var(--neutral-600); }

/* ---- tick tooltip: .tooltip-inner from BetterStack (neutral-700 on neutral-600,
   radius-lg 12px, padding 8px 8px 4px, shadow-small, 190px, 4px below the tick) ---- */
.tick { position: relative; }
.tooltip-inner {
  position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  z-index: 200; width: 190px;
  padding: 8px 8px 4px;
  background-color: var(--neutral-700);
  border: 1px solid var(--neutral-600);
  border-radius: 12px;                 /* --radius-lg */
  box-shadow: var(--shadow-small);
  opacity: 0; visibility: hidden; transition: opacity .15s linear;
  pointer-events: none; cursor: default;
}
.tick:hover .tooltip-inner, .tick:focus-visible .tooltip-inner { opacity: 1; visibility: visible; }
/* keep the ends inside the card instead of centring off the edge */
.tick:nth-child(-n+4) .tooltip-inner { left: 0; transform: none; }
.tick:nth-last-child(-n+4) .tooltip-inner { left: auto; right: 0; transform: none; }

.tooltip-state {
  display: flex; align-items: center; gap: 4px;
  padding: 8px; font-weight: 500; color: #fff;
}
.tooltip-state .icon { position: relative; top: -1px; }
.tooltip-inner hr {
  height: 0; margin: 4px 0;
  border: 0; border-bottom: 1px solid var(--neutral-600);
}
.tooltip-date { text-align: center; font-size: 12px; color: #fff; }
.tooltip-meta { text-align: center; font-size: 12px; padding-bottom: 4px; }

.tick-labels {
  display: flex; justify-content: space-between;
  margin: 12px 4px 0; line-height: 1;
}

/* ---- footer: py-10, text-small font-medium ---- */
footer {
  display: flex; justify-content: center; align-items: center;
  padding-block: 40px; font-size: 12px; font-weight: 500;
}

/* BetterStack's sm: breakpoint */
@media (max-width: 639px) {
  .hero { margin-top: 64px; }
  .card { margin-bottom: 40px; }
  .card-head { padding: 8px 8px 8px 12px; }
  .service { margin-inline: 8px; }
}

/* state colours for the status glyphs */
.icon path { fill: currentColor; }
.icon.icon-operational { color: var(--green); }
.icon.icon-downtime { color: var(--red); }
.icon.icon-degraded { color: var(--yellow); }
.icon.icon-not_monitored { color: var(--neutral-200); }
