/* Ridebase status page. Light and dark follow the visitor's system setting. */

:root {
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f1f1ed;
  --border: #e5e4df;
  --text: #16171a;
  --text-2: #3f4247;
  --muted: #676a70;
  --faint: #8f9298;
  --brand: #ff6e00;

  --ok: #1f9d55;
  --ok-strong: #157a41;
  --ok-soft: #e9f7ef;
  --ok-line: #c3e7d1;
  --minor: #e5a11a;
  --minor-strong: #9a6300;
  --minor-soft: #fdf5e3;
  --minor-line: #f2d9a2;
  --major: #dc3b3b;
  --major-strong: #b02222;
  --major-soft: #fdeeee;
  --major-line: #f4c4c4;
  --mnt: #3b6fe0;
  --mnt-strong: #2753b8;
  --mnt-soft: #edf2fd;
  --mnt-line: #c8d6f6;
  --none: #dededa;
  --neutral-soft: #f0f0ec;
  --neutral-strong: #5b5e63;
  --neutral-line: #e0dfda;
  --chart: #4a5260;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(17, 18, 20, 0.04), 0 6px 20px rgba(17, 18, 20, 0.04);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f11;
    --surface: #16181b;
    --surface-2: #1d2024;
    --border: #272a30;
    --text: #ecedee;
    --text-2: #c9ccd0;
    --muted: #9ca1a7;
    --faint: #70757c;

    --ok: #2fbf6b;
    --ok-strong: #62d892;
    --ok-soft: rgba(47, 191, 107, 0.12);
    --ok-line: rgba(47, 191, 107, 0.3);
    --minor: #e9a93a;
    --minor-strong: #f3c467;
    --minor-soft: rgba(233, 169, 58, 0.12);
    --minor-line: rgba(233, 169, 58, 0.3);
    --major: #ef5350;
    --major-strong: #ff8a87;
    --major-soft: rgba(239, 83, 80, 0.13);
    --major-line: rgba(239, 83, 80, 0.32);
    --mnt: #5b8cf0;
    --mnt-strong: #93b3f8;
    --mnt-soft: rgba(91, 140, 240, 0.13);
    --mnt-line: rgba(91, 140, 240, 0.32);
    --none: #2b2f35;
    --neutral-soft: #1c1f23;
    --neutral-strong: #a6abb1;
    --neutral-line: #2c3036;
    --chart: #c3c8cf;

    --shadow: none;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  border-top: 3px solid var(--brand);
}

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

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-color: var(--faint);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.shell {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

/* Header */

.top {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 26px 0 22px;
}

.top__brand {
  display: inline-flex;
  line-height: 0;
}

.top__brand img {
  height: 40px;
  width: auto;
}

.top__divider {
  width: 1px;
  height: 26px;
  background: var(--border);
}

.top__label {
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.top__link {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
}

/* Overall banner */

.overall {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px 16px;
  padding: 22px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--neutral-line);
  background: var(--neutral-soft);
  --tone: var(--neutral-strong);
  --tone-solid: var(--faint);
}

.overall--operational {
  background: var(--ok-soft);
  border-color: var(--ok-line);
  --tone: var(--ok-strong);
  --tone-solid: var(--ok);
}

.overall--degraded {
  background: var(--minor-soft);
  border-color: var(--minor-line);
  --tone: var(--minor-strong);
  --tone-solid: var(--minor);
}

.overall--partial,
.overall--major {
  background: var(--major-soft);
  border-color: var(--major-line);
  --tone: var(--major-strong);
  --tone-solid: var(--major);
}

.overall--maintenance {
  background: var(--mnt-soft);
  border-color: var(--mnt-line);
  --tone: var(--mnt-strong);
  --tone-solid: var(--mnt);
}

.overall__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--tone-solid);
  color: #fff;
}

.overall__title {
  font-size: 22px;
  line-height: 1.25;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}

.overall__sub {
  margin-top: 3px;
  font-size: 14.5px;
  color: var(--text-2);
}

.overall__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.live-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone-solid);
}

.live-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--tone-solid);
  opacity: 0;
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

[data-stale="true"] .live-dot {
  background: var(--faint);
}

[data-stale="true"] .live-dot::after {
  display: none;
}

[data-stale="true"] .overall__meta::after {
  content: "· reconnecting";
  color: var(--faint);
}

/* Announcement */

.notice {
  margin-top: 16px;
  padding: 16px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--mnt);
  box-shadow: var(--shadow);
}

.notice--incident {
  border-left-color: var(--major);
}

.notice--info {
  border-left-color: var(--brand);
}

.notice__title {
  font-weight: 600;
  font-size: 15px;
}

.notice__body {
  margin-top: 4px;
  color: var(--text-2);
  font-size: 14px;
  white-space: pre-line;
}

.notice__until {
  margin-top: 6px;
  color: var(--faint);
  font-size: 13px;
}

/* Cards */

.card {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.card__title {
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.card__note {
  font-size: 13px;
  color: var(--faint);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12px;
  color: var(--muted);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--none);
}

.swatch--ok,
.bar--ok {
  background: var(--ok);
}

.swatch--minor,
.bar--minor {
  background: var(--minor);
}

.swatch--major,
.bar--major {
  background: var(--major);
}

.swatch--maintenance,
.bar--maintenance {
  background: var(--mnt);
}

.swatch--none,
.bar--none {
  background: var(--none);
}

/* Services */

.service {
  padding: 20px 24px 18px;
}

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

.service__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.service__name {
  font-size: 15.5px;
  font-weight: 600;
}

.service__desc {
  margin-top: 1px;
  font-size: 13.5px;
  color: var(--muted);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  padding: 4px 11px 4px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--neutral-soft);
  color: var(--neutral-strong);
  --dot: var(--faint);
}

.pill--operational {
  background: var(--ok-soft);
  color: var(--ok-strong);
  --dot: var(--ok);
}

.pill--degraded {
  background: var(--minor-soft);
  color: var(--minor-strong);
  --dot: var(--minor);
}

.pill--outage {
  background: var(--major-soft);
  color: var(--major-strong);
  --dot: var(--major);
}

.pill--maintenance {
  background: var(--mnt-soft);
  color: var(--mnt-strong);
  --dot: var(--mnt);
}

.pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dot);
}

.strip {
  display: flex;
  gap: 2px;
  height: 32px;
  margin-top: 14px;
}

.bar {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 2px;
  transition: opacity 120ms ease;
}

@media (hover: hover) {
  .strip:hover .bar {
    opacity: 0.5;
  }

  .strip:hover .bar:hover {
    opacity: 1;
  }
}

.strip .bar.is-active {
  opacity: 1;
  box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 3px var(--text-2);
}

.strip__foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.strip__start,
.strip__end {
  flex-shrink: 0;
}

.strip__uptime {
  flex: 1;
  min-width: 0;
  text-align: center;
  color: var(--muted);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strip__uptime.is-day {
  color: var(--text);
}

.range--60,
.range--30 {
  display: none;
}

/* Fewer days on narrower screens so each bar stays wide enough to read. */
@media (max-width: 720px) {
  .strip .bar:nth-child(-n + 30) {
    display: none;
  }

  .range--90 {
    display: none;
  }

  .range--60 {
    display: inline;
  }
}

@media (max-width: 480px) {
  .strip .bar:nth-child(-n + 60) {
    display: none;
  }

  .range--60 {
    display: none;
  }

  .range--30 {
    display: inline;
  }
}

/* Row details */

.service__message {
  margin-top: 10px;
  padding: 8px 11px;
  border-radius: 8px;
  background: var(--mnt-soft);
  color: var(--mnt-strong);
  font-size: 13.5px;
  white-space: pre-line;
}

.more {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.more__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  border-radius: 6px;
}

.more__summary::-webkit-details-marker {
  display: none;
}

.more__summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.more__headline strong {
  margin-left: 4px;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.more__toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
}

.more__toggle::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 150ms ease;
}

.more[open] .more__toggle::after {
  transform: translateY(1px) rotate(-135deg);
}

.more__summary:hover .more__toggle {
  color: var(--text);
}

.more__body {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.chart {
  padding: 12px 14px 10px;
  border-radius: 10px;
  background: var(--surface-2);
}

.chart__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.chart__title {
  font-weight: 600;
  color: var(--text-2);
}

.chart__svg {
  display: block;
  width: 100%;
  height: 64px;
  margin-top: 10px;
  overflow: visible;
}

.chart__line {
  fill: none;
  stroke: var(--chart);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart__area {
  fill: var(--chart);
  opacity: 0.1;
}

.chart__empty {
  display: grid;
  place-items: center;
  height: 64px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--faint);
}

.chart__foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--faint);
}

.chart__foot span:nth-child(2) {
  text-align: center;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.stat {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
}

.stat dt {
  font-size: 12px;
  color: var(--muted);
}

.stat dd {
  margin: 2px 0 0;
}

.stat__value {
  display: block;
  font-size: 17px;
  font-weight: 650;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat__hint {
  display: block;
  margin-top: 1px;
  font-size: 11.5px;
  color: var(--faint);
}

/* Incidents */

.incident {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: start;
  gap: 14px;
  padding: 16px 24px;
}

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

.incident__mark {
  width: 10px;
  height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--major);
}

.incident--degraded .incident__mark {
  background: var(--minor);
}

.incident--maintenance .incident__mark {
  background: var(--mnt);
}

.incident__title {
  font-size: 14.5px;
}

.incident__time {
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.tag {
  align-self: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}

.tag--ongoing {
  background: var(--major-soft);
  color: var(--major-strong);
}

.empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  color: var(--muted);
  font-size: 14px;
}

.empty svg {
  width: 20px;
  height: 20px;
  color: var(--ok);
  flex-shrink: 0;
}

/* Footer */

.foot {
  margin-top: 28px;
  text-align: center;
  font-size: 13px;
  color: var(--faint);
}

.foot p + p {
  margin-top: 4px;
}

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

/* Small screens */

@media (max-width: 640px) {
  .top {
    padding: 20px 0 18px;
  }

  .top__brand img {
    height: 34px;
  }

  .overall {
    grid-template-columns: auto 1fr;
    padding: 18px;
  }

  .overall__icon {
    width: 40px;
    height: 40px;
  }

  .overall__title {
    font-size: 19px;
  }

  .overall__sub {
    font-size: 14px;
  }

  .overall__meta {
    grid-column: 1 / -1;
    margin-top: 10px;
    white-space: normal;
  }

  .card__head,
  .service,
  .incident,
  .empty {
    padding-left: 16px;
    padding-right: 16px;
  }

  .service__top {
    flex-direction: column;
    gap: 8px;
  }

  .incident {
    grid-template-columns: 10px 1fr;
  }

  /* Stats as a compact list on phones: label left, value right. */
  .stats {
    grid-template-columns: 1fr;
    gap: 0;
    border-radius: 10px;
    background: var(--surface-2);
  }

  .stat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 0;
    background: none;
  }

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

  .stat dd {
    margin: 0;
  }

  .stat__value {
    font-size: 15px;
  }

  .stat__hint {
    display: none;
  }

  .chart__foot span:nth-child(2) {
    display: none;
  }

  .incident .tag {
    grid-column: 2;
    justify-self: start;
  }
}

/* Wide screens: a wider page, with the app rows as two columns of cards.
   Each row is its own card aligned to the top, so opening one row's details
   grows that card only. */

@media (min-width: 1024px) {
  .shell {
    max-width: 1140px;
    padding: 0 32px 56px;
  }

  .top {
    padding: 30px 0 26px;
  }

  .card--services {
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  .card--services .card__head {
    padding: 0 4px 12px;
    border-bottom: 0;
  }

  .services {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 16px;
  }

  .service,
  .service + .service {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
  }

  /* 90 bars in half the width: thinner gaps keep each day readable. */
  .strip {
    gap: 1px;
  }

  .chart__foot span:nth-child(2) {
    display: none;
  }
}

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

  .bar {
    transition: none;
  }
}
