/* Public status page - layout on top of the shared tokens in theme.css. */

body {
  background: radial-gradient(900px 320px at 50% -140px, rgba(127, 48, 194, 0.16), transparent 70%) no-repeat, var(--bg);
}

/* --- Top bar ------------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(12, 6, 20, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 22px;
}

.topnav-link {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.15s ease;
}

.topnav-link:hover {
  color: var(--text);
}

.topbar .btn-primary {
  height: 36px;
  font-size: 13px;
}

/* --- Page head ---------------------------------------------------------------- */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 40px 0 24px;
}

.head-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 4px;
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
}

.head-meta time {
  color: var(--text);
}

/* --- Overview strip ------------------------------------------------------------ */

/* 1px gaps over a line-colored background draw the dividers, so they stay
   right whichever way the cells wrap. */
.overview {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.ov-cell {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px;
  background: var(--surface);
  min-width: 0;
}

.ov-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.ov-value {
  margin-top: 2px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #fff;
}

.ov-of {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-2);
}

.ov-headline {
  margin-top: 3px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
}

.ov-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-2);
}

.ov-sub .hl-down {
  color: var(--down-text);
  font-weight: 600;
}

.ov-sub .hl-maint {
  color: var(--maint-text);
  font-weight: 600;
}

/* --- Maintenance notices --------------------------------------------------------- */

.notices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.notices:empty {
  display: none;
}

.notice {
  --tone: var(--maint);
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--tone) 38%, transparent);
  background: color-mix(in srgb, var(--tone) 7%, var(--surface));
}

.notice.emergency {
  --tone: var(--partial);
}

.notice-body {
  flex: 1;
  min-width: 0;
}

.notice-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.notice-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
}

.notice-message {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--text-2);
  white-space: pre-line;
}

.notice-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-2);
}

.notice-meta .when {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  color: var(--text);
}

/* --- Toolbar + legend ------------------------------------------------------------ */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 12px;
}

.legend-bar {
  margin-bottom: 14px;
}

/* --- Groups --------------------------------------------------------------------- */

.group {
  margin-bottom: 14px;
  overflow: hidden;
}

.group-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  min-height: 60px;
}

.group-toggle {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
  min-width: 0;
  padding: 16px 0;
  border: none;
  background: none;
  text-align: left;
}

.group-chevron {
  color: var(--text-3);
  transition: transform 0.2s var(--ease);
}

.group-chevron .icon {
  width: 16px;
  height: 16px;
}

.group.collapsed .group-chevron {
  transform: rotate(-90deg);
}

.group-count {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
}

.group-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
}

.group-uptime {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
}

.group.collapsed .group-body {
  display: none;
}

/* Service table: service | daily uptime strip | uptime | response | status */
.svc-head,
.svc-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(240px, 2.6fr) 84px 84px 132px;
  align-items: center;
  column-gap: 20px;
  padding: 0 20px;
}

.svc-head {
  height: 38px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  background: rgba(255, 255, 255, 0.012);
}

.num {
  text-align: right;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.svc-head .num {
  font-family: var(--font);
}

/* Time axis for the strip: "90 days ago ... Today" (span follows the
   number of days the breakpoint shows). */
.axis {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.axis .ax-60,
.axis .ax-30 {
  display: none;
}

.loc-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 20px 6px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
}

.loc-count {
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-3);
}

.svc-row {
  min-height: 62px;
  padding-top: 10px;
  padding-bottom: 10px;
  border-top: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.12s ease;
}

.loc-row + .svc-row {
  border-top-color: transparent;
}

.svc-row:hover {
  background: var(--surface-2);
}

.svc-row:focus-visible {
  outline-offset: -2px;
}

.svc-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.svc-name > div {
  min-width: 0;
}

.svc-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.svc-sub {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.c-up,
.c-resp {
  font-size: 13px;
  color: var(--text);
}

.c-status {
  display: flex;
  justify-content: flex-end;
}

.dim {
  color: var(--text-3);
}

/* Daily uptime strip - one thin cell per day, 2px surface gap between. */
.strip {
  display: flex;
  gap: 2px;
  height: 26px;
}

.strip i {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 2px;
  background: var(--tier, var(--nodata));
  transition: filter 0.1s ease;
}

.strip i.hover {
  filter: brightness(1.45);
}

.strip-axis {
  display: none;
}

.no-results {
  padding: 40px 0;
  text-align: center;
  color: var(--text-2);
}

/* --- Footer ---------------------------------------------------------------------- */

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-top: 28px;
  padding: 24px 0 48px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-2);
}

.fetch-info {
  display: grid;
  grid-template-columns: auto auto;
  gap: 4px 14px;
  margin: 0;
}

.fetch-info dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 19px;
  text-transform: uppercase;
}

.fetch-info dd {
  margin: 0;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* --- Service history modal ------------------------------------------------------- */

.modal-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}

.modal-stat {
  padding: 12px 14px;
  background: var(--surface-2);
}

.modal-stat .ov-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
}

.modal-stat .ov-value {
  font-size: 20px;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 20px 0 12px;
}

.cal-month {
  font-size: 15px;
  font-weight: 700;
  font-style: italic;
  color: #fff;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-dow {
  padding-bottom: 2px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
}

/* A wash of the tier color plus a solid bar - quiet at month scale, the
   printed % carries the value. */
.cal-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  aspect-ratio: 1 / 0.66;
  padding: 7px 8px 9px;
  overflow: hidden;
  border-radius: 8px;
  background: color-mix(in srgb, var(--tier, transparent) 13%, var(--surface-2));
}

.cal-cell::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--tier);
}

.cal-cell.t-none {
  background: var(--surface-2);
}

.cal-cell.t-none::after {
  display: none;
}

.cal-cell.empty {
  background: transparent;
}

.cal-cell.future {
  opacity: 0.35;
}

.cal-day {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.cal-pct {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
}

.cal-legend {
  margin-top: 14px;
}

.section-label {
  margin: 24px 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-2);
}

.incident {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.incident-body {
  flex: 1;
  min-width: 0;
}

.incident-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
}

.incident-when {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-2);
}

.incident-detail {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-2);
}

/* --- Responsive ------------------------------------------------------------------- */

@media (max-width: 1099px) {
  .strip i:nth-child(-n + 30) {
    display: none;
  }
  .axis .ax-90 {
    display: none;
  }
  .axis .ax-60 {
    display: inline;
  }
}

@media (max-width: 960px) {
  .overview {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .strip i:nth-child(-n + 60) {
    display: none;
  }
  .axis .ax-60 {
    display: none;
  }
  .axis .ax-30 {
    display: inline;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
    padding: 28px 0 20px;
  }

  .toolbar .search {
    width: 100%;
  }

  .svc-head {
    display: none;
  }

  .svc-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "svc status"
      "strip strip"
      "up resp";
    row-gap: 10px;
    padding: 14px 16px;
  }

  .svc-name { grid-area: svc; }
  .svc-title { white-space: normal; }
  .c-status { grid-area: status; }
  .c-strip { grid-area: strip; }
  .c-up { grid-area: up; text-align: left; }
  .c-resp { grid-area: resp; }

  .c-up::before,
  .c-resp::before {
    content: attr(data-label) " ";
    font-family: var(--font);
    color: var(--text-2);
  }

  .strip-axis {
    display: flex;
    margin-top: 5px;
    font-size: 11px;
    color: var(--text-3);
  }

  .group-head,
  .loc-row {
    padding-left: 16px;
    padding-right: 16px;
  }

  .group-stats .group-uptime-label {
    display: none;
  }
}

@media (max-width: 560px) {
  .overview {
    grid-template-columns: 1fr;
  }

  .topnav {
    gap: 12px;
  }

  .topnav-link {
    display: none;
  }

  .brand-tag {
    display: none;
  }

  .modal-stats {
    grid-template-columns: 1fr 1fr;
  }

  .modal-stats .modal-stat:last-child {
    grid-column: span 2;
  }

  .cal-grid {
    gap: 4px;
  }

  .cal-cell {
    aspect-ratio: 1 / 0.9;
    padding: 5px 5px 7px;
    border-radius: 6px;
  }

  .cal-pct {
    font-size: 9.5px;
  }

  .group-count {
    display: none;
  }
}
