:root {
  --night: #020b18;
  --deep: #052a40;
}

html {
  background: var(--night);
}

body {
  position: relative;
  isolation: isolate;
  background: linear-gradient(135deg, #020b18 0%, #031b2f 34%, #063c51 72%, #071a2c 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  z-index: -2;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 52% at 92% -5%, rgba(34, 211, 238, .24), transparent 67%),
    radial-gradient(ellipse 54% 50% at -8% 72%, rgba(37, 99, 235, .19), transparent 70%),
    radial-gradient(ellipse 45% 34% at 72% 72%, rgba(249, 115, 22, .08), transparent 72%);
}

body::after {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: .2;
  background-image:
    linear-gradient(rgba(125, 211, 252, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 211, 252, .08) 1px, transparent 1px),
    linear-gradient(120deg, transparent 0 48%, rgba(34, 211, 238, .055) 49% 51%, transparent 52%);
  background-size: 64px 64px, 64px 64px, 240px 240px;
  mask-image: linear-gradient(to bottom, black, rgba(0, 0, 0, .7) 60%, transparent 100%);
}

.orb b {
  color: #07182d;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
}

.orb span {
  color: #fff;
}

.legend .good { background: #65c51a; }
.legend .moderate { background: #facc15; }
.legend .unhealthy { background: #f97316; }
.legend .danger { background: #ef2029; }
.legend .hazardous { background: #6d28d9; }

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

.thresholds article {
  --status: #64748b;
  position: relative;
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 14px;
  align-items: center;
  min-height: 172px;
  padding: 20px 18px;
  overflow: hidden;
  background: linear-gradient(145deg, color-mix(in srgb, var(--status) 18%, #08263a), rgba(5, 25, 43, .92));
  border: 1px solid color-mix(in srgb, var(--status) 48%, transparent);
  border-top: 4px solid var(--status);
  border-radius: 22px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, .18), inset 0 1px rgba(255, 255, 255, .06);
}

.thresholds article::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  right: -48px;
  bottom: -55px;
  border-radius: 50%;
  background: var(--status);
  opacity: .12;
}

.thresholds .status-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--status);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, .48), 0 10px 30px rgba(0, 0, 0, .34);
  font-size: 2rem;
  line-height: 1;
}

.thresholds article > div > b {
  display: inline-block;
  min-width: 0;
  height: auto;
  margin-bottom: 8px;
  padding: 5px 10px;
  color: #fff;
  background: color-mix(in srgb, var(--status) 82%, #071827);
  border-radius: 999px;
  font-size: .86rem;
}

.thresholds h3 {
  color: #fff;
  font-size: 1.05rem;
}

.thresholds p {
  margin-top: 7px;
  color: #cbd5e1;
  font-size: .78rem;
  line-height: 1.45;
}

.thresholds .status-good { --status: #65c51a; }
.thresholds .status-moderate { --status: #facc15; }
.thresholds .status-unhealthy { --status: #f97316; }
.thresholds .status-very-unhealthy { --status: #ef2029; }
.thresholds .status-hazardous { --status: #6d28d9; }

footer {
  background: linear-gradient(180deg, rgba(2, 11, 24, .35), rgba(2, 11, 24, .76));
  backdrop-filter: blur(12px);
}

@media (max-width: 1100px) {
  .thresholds {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .thresholds article:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  body {
    background-attachment: scroll;
  }

  body::before,
  body::after {
    position: absolute;
  }

  body::after {
    opacity: .13;
    background-size: 42px 42px, 42px 42px, 180px 180px;
  }
}

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

  .thresholds article:last-child {
    grid-column: auto;
  }

  .thresholds article {
    min-height: 0;
    padding: 18px 16px;
    grid-template-columns: 58px 1fr;
  }

  .thresholds .status-icon {
    width: 54px;
    height: 54px;
  }
}
