/* Colours from the Fidectus GEN palette; every text pair meets WCAG 2.1 AA (4.5:1) and every state colour 3:1. */
:root {
  --color-text: #26272c;
  --color-muted: #54565f;
  --color-page: #f9f9fa;
  --color-surface: #ffffff;
  --color-border: #dcdce0;
  --color-header: #26272c;
  --color-accent: #0e4fbe;
  --color-ok: #0c7d3d;
  --color-ok-cell: #0f9549;
  --color-maintenance: #7a4900;
  --color-maintenance-cell: #a86500;
  --color-maintenance-stripe: #ffda8f;
  --color-maintenance-soft: #fff6e3;
  --color-platform: #aa091e;
  --color-unknown: #383b42;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-page);
  overflow-wrap: anywhere;
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  padding: 8px 12px;
  background: var(--color-surface);
  color: var(--color-accent);
  z-index: 10;
}

.skip-link:focus {
  top: 8px;
}

.site-header {
  background: var(--color-header);
  color: #ffffff;
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  min-height: 64px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.site-header__logo {
  display: block;
  height: 32px;
  width: auto;
}

.site-header__product {
  font-weight: 600;
  font-size: 1.125rem;
}

.environment {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 999px;
  background: #ffc95c;
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 600;
}

main {
  padding-top: 24px;
  padding-bottom: 32px;
}

main:focus {
  outline: none;
}

h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  margin: 0 0 16px;
}

h2 {
  font-size: 1.25rem;
  margin: 0;
}

h3 {
  font-size: 1rem;
  margin: 0;
}

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 1.25rem;
  font-weight: 600;
  border: 2px solid transparent;
}

.banner__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid currentColor;
  font-weight: 700;
}

.banner--loading {
  background: #ebebef;
  color: var(--color-text);
}

.banner--operational {
  background: var(--color-ok);
  color: #ffffff;
}

.banner--partial {
  background: var(--color-maintenance-soft);
  color: var(--color-maintenance);
  border-color: var(--color-maintenance-cell);
}

.banner--platform {
  background: var(--color-platform);
  color: #ffffff;
}

.banner--unavailable {
  background: var(--color-unknown);
  color: #ffffff;
}

.last-updated {
  margin: 8px 0 0;
  color: var(--color-muted);
  font-size: 0.875rem;
}

.notice {
  margin: 16px 0 0;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.section {
  margin-top: 32px;
}

.section h2 {
  margin-bottom: 12px;
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.section__head h2 {
  margin: 0;
}

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

.unavailable {
  margin: 0;
  padding: 8px 12px;
  border: 1px dashed var(--color-muted);
  border-radius: 6px;
  color: var(--color-muted);
  font-weight: 600;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 6px solid var(--color-accent);
  border-radius: 8px;
  padding: 12px 16px;
}

.card--maintenance {
  border-left-color: var(--color-maintenance-cell);
}

.card--full {
  border-left-color: var(--color-platform);
}

.card__title {
  margin-bottom: 4px;
}

.message {
  margin: 4px 0;
  white-space: pre-line;
}

.when {
  margin: 4px 0 0;
}

.utc {
  color: var(--color-muted);
  font-size: 0.875rem;
  margin: 0;
}

.facts {
  margin: 8px 0 0;
  display: grid;
  gap: 4px;
}

.facts__item {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
}

.facts dt {
  font-weight: 600;
  min-width: 7.5rem;
}

.facts dd {
  margin: 0;
}

.overdue {
  margin: 8px 0 0;
  color: var(--color-platform);
  font-weight: 600;
}

.badge {
  display: inline-block;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--color-accent);
  color: #ffffff;
  font-size: 0.75rem;
  line-height: 1.25rem;
  font-weight: 600;
  vertical-align: middle;
}

.year-toggle {
  font: inherit;
  font-size: 0.875rem;
  padding: 6px 12px;
  border: 1px solid var(--color-accent);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-accent);
  cursor: pointer;
}

.legend {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  font-size: 0.875rem;
  color: var(--color-muted);
}

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

.rows {
  display: grid;
  gap: 12px;
}

.row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 8px 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 16px;
}

.row__state {
  margin: 4px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid currentColor;
  font-size: 0.75rem;
  flex: none;
}

.state--operational {
  color: var(--color-ok);
}

.state--maintenance,
.state--partial {
  color: var(--color-maintenance);
}

.state--platform {
  color: var(--color-platform);
}

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

.row__history {
  min-width: 0;
}

/* 365 = 73 x 5 and 90 = 30 x 3, so every line is full and the last cell (today) sits under "Today". */
.timeline {
  display: grid;
  grid-template-columns: repeat(73, minmax(0, 1fr));
  gap: 3px 2px;
}

.day,
.swatch {
  display: block;
  min-width: 0;
  height: 18px;
  border-radius: 2px;
  border: 0;
  padding: 0;
  margin: 0;
}

.swatch {
  flex: none;
  width: 8px;
  height: 14px;
}

button.day {
  cursor: pointer;
  font: inherit;
}

button.day[aria-expanded='true'] {
  outline: 2px solid var(--color-text);
  outline-offset: 1px;
}

button.day:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 1px;
}

.day--none {
  background: var(--color-ok-cell);
}

/* Marks differ by pattern as well as colour: stripes for maintenance, a centre dot for platform-wide. */
.day--maintenance,
.day--partial {
  background: repeating-linear-gradient(
    45deg,
    var(--color-maintenance-cell) 0 3px,
    var(--color-maintenance-stripe) 3px 5px
  );
  box-shadow: inset 0 0 0 1px var(--color-maintenance);
}

.day--full {
  background: radial-gradient(circle at 50% 50%, #ffffff 0 2px, transparent 2.5px), var(--color-platform);
}

.axis {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--color-muted);
}

.axis--top {
  margin: 0 0 4px;
}

.axis--bottom {
  justify-content: flex-end;
}

/* The latest 90 days by default, the full year on demand, at every width. */
.rows:not(.rows--full-year) .day--older,
.rows:not(.rows--full-year) .axis__start--year,
.rows--full-year .axis__start--recent {
  display: none;
}

.row__summary {
  margin: 4px 0 0;
  font-size: 0.875rem;
  color: var(--color-muted);
}

.day-details {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-page);
}

.day-details__title {
  font-size: 0.9375rem;
  margin: 0 0 4px;
}

.windows {
  margin: 0;
  padding-left: 20px;
}

.window {
  margin: 4px 0;
}

.window__unit {
  font-weight: 600;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.875rem;
  padding: 16px 0 24px;
}

.site-footer p {
  margin: 4px 0;
}

/* One bordered list with a one-line 90-day strip per row. */
@media (min-width: 640px) {
  .rows {
    gap: 0;
  }

  .row {
    padding: 12px 16px;
    border-width: 0 1px 1px;
    border-radius: 0;
  }

  .row:first-child {
    border-top-width: 1px;
    border-radius: 8px 8px 0 0;
  }

  .row:last-child {
    border-radius: 0 0 8px 8px;
  }

  #row-OVERALL {
    background: var(--color-page);
  }

  .row__state {
    margin-top: 0;
  }

  .rows:not(.rows--full-year) .timeline {
    grid-template-columns: repeat(90, minmax(0, 1fr));
  }

  .day {
    height: 28px;
  }

  .rows--full-year .day {
    height: 18px;
  }
}

@media (min-width: 960px) {
  .row {
    align-items: start;
  }

  /* Lines the name up with the strip below the "From" label. */
  .row__head {
    padding-top: 16px;
  }
}

@media (max-width: 959.98px) {
  .row {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 639.98px) {
  h1 {
    font-size: 1.5rem;
  }

  .banner {
    font-size: 1.125rem;
    padding: 12px 16px;
  }

  .row {
    padding: 12px;
  }

  #row-OVERALL {
    border-width: 2px;
  }

  .timeline {
    grid-template-columns: repeat(30, minmax(0, 1fr));
  }

  /* 365 = 12 x 30 + 5: the short line goes first, so the full year also ends at the right edge. */
  .rows--full-year .timeline > :first-child {
    grid-column-start: 26;
  }

  .environment {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .day--none {
    background: Canvas;
    border: 1px solid CanvasText;
  }

  .day--maintenance,
  .day--partial,
  .day--full {
    background: Highlight;
    forced-color-adjust: none;
  }
}
