:root {
  color-scheme: dark;
  --bg: #05030a;
  --panel: rgba(8, 6, 12, 0.86);
  --panel-strong: rgba(12, 9, 18, 0.94);
  --line: rgba(103, 232, 249, 0.2);
  --line-strong: rgba(103, 232, 249, 0.48);
  --text: #f6fbff;
  --muted: #b5bdd3;
  --dim: #7d879f;
  --cyan: #22d3ee;
  --cyan-soft: #67e8f9;
  --violet: #8b5cf6;
  --magenta: #ff3bd4;
  --gold: #facc15;
  --success: #34d399;
  --danger: #fb7185;
  --radius: 6px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 14px 35px rgba(0, 0, 0, 0.28);
  --page-x: max(1rem, calc((100vw - 1120px) / 2));
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 72% 18%, rgba(34, 211, 238, 0.15), transparent 24rem),
    linear-gradient(180deg, rgba(5, 3, 10, 0.28), rgba(5, 3, 10, 0.9) 34%, #020104 100%),
    url("optimized/pingu-snow-wallpaper.webp") center top / cover fixed no-repeat,
    #05030a;
  font-family: var(--font);
  font-feature-settings: "smcp" 1, "c2sc" 1;
  font-variant-caps: all-small-caps;
  letter-spacing: 0.015em;
  line-height: 1.55;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(rgba(103, 232, 249, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.055) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.68;
}

body::after {
  background:
    radial-gradient(circle at 50% 0%, transparent 0 24rem, rgba(2, 1, 4, 0.38) 46rem),
    linear-gradient(90deg, rgba(2, 1, 4, 0.72), transparent 18%, transparent 82%, rgba(2, 1, 4, 0.72));
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid var(--cyan-soft);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  transform: translateY(-160%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #020104;
  color: var(--text);
  padding: 0.75rem 1rem;
  font-weight: 800;
}

.skip-link:focus {
  transform: translateY(0);
}

.status-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
  padding: 0.7rem var(--page-x);
  border-bottom: 1px solid rgba(103, 232, 249, 0.15);
  background: rgba(2, 1, 4, 0.9);
  backdrop-filter: blur(18px);
}

.brand img {
  width: 15rem;
  max-width: 50vw;
  aspect-ratio: 4 / 1;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 0 14px rgba(34, 211, 238, 0.36));
}

.button,
.copy-host {
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: var(--radius);
  background: rgba(17, 12, 26, 0.8);
  color: var(--text);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 10px 0 rgba(0, 0, 0, 0.18),
    0 16px 30px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.78rem 1.05rem;
  font-weight: 900;
  text-transform: uppercase;
}

.button:hover,
.copy-host:hover {
  transform: translateY(-2px);
  border-color: rgba(103, 232, 249, 0.74);
  background: rgba(34, 211, 238, 0.1);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34), 0 0 22px rgba(34, 211, 238, 0.12);
}

.hero {
  min-height: 100vh;
  padding: calc(76px + 3.2rem) var(--page-x) 4rem;
}

.status-shell {
  width: min(100%, 1120px);
  margin: 0 auto;
}

.status-heading,
.status-actions,
.section-head,
.component-main,
.incident-item {
  display: flex;
  gap: 1rem;
}

.status-heading {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.4rem;
}

.status-logo {
  width: 15rem;
  max-width: 52vw;
  filter: drop-shadow(0 0 14px rgba(34, 211, 238, 0.32));
}

.status-actions {
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.timestamp,
.range-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.65rem;
  border: 1px solid rgba(103, 232, 249, 0.22);
  border-radius: var(--radius);
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan-soft);
  padding: 0.5rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-banner,
.status-card,
.overview-card,
.server-card,
.note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    var(--shadow-soft);
}

.status-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1.2rem;
  border-color: rgba(52, 211, 153, 0.36);
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.18), rgba(8, 6, 12, 0.88));
}

.status-banner.is-loading {
  border-color: rgba(250, 204, 21, 0.38);
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.16), rgba(8, 6, 12, 0.9));
}

.status-banner.is-degraded {
  border-color: rgba(250, 204, 21, 0.48);
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.17), rgba(180, 0, 255, 0.1), rgba(8, 6, 12, 0.9));
}

.status-banner.is-outage {
  border-color: rgba(251, 113, 133, 0.46);
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.18), rgba(8, 6, 12, 0.9));
}

.status-banner h1 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 3.1rem);
  line-height: 1.05;
}

.status-banner p {
  margin: 0.3rem 0 0;
  color: var(--muted);
}

.status-light {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 18px rgba(125, 135, 159, 0.42);
}

.status-banner .status-light {
  width: 1.2rem;
  height: 1.2rem;
}

.status-light.is-online,
.server-card.is-online .status-light {
  background: var(--success);
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.58);
}

.status-light.is-loading,
.server-card.is-loading .status-light {
  background: var(--gold);
  box-shadow: 0 0 20px rgba(250, 204, 21, 0.5);
}

.status-light.is-offline,
.server-card.is-offline .status-light {
  background: var(--danger);
  box-shadow: 0 0 20px rgba(251, 113, 133, 0.48);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.overview-card {
  display: grid;
  gap: 0.3rem;
  padding: 1rem;
}

.overview-card span,
.metrics span,
.copy-host span,
.uptime-row > span,
.incident-date {
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.overview-card strong {
  font-size: 1.7rem;
  line-height: 1;
}

.overview-card p,
.section-head p,
.component-main p,
.uptime-percent,
.incident-item p,
.note p,
.server-description {
  margin: 0;
  color: var(--muted);
}

.status-card,
.note {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem;
}

.section-head {
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-head h2,
.section-head p {
  margin: 0;
}

.section-head p {
  margin-top: 0.25rem;
}

.component-list,
.incident-list {
  display: grid;
  gap: 0.8rem;
}

.component-row,
.incident-item {
  padding: 0.95rem;
  border: 1px solid rgba(103, 232, 249, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.028);
}

.component-row {
  display: grid;
  gap: 0.65rem;
}

.component-main {
  align-items: flex-start;
  justify-content: space-between;
}

.component-main h3,
.component-main p,
.uptime-percent,
.incident-item h3,
.incident-item p,
.note h2,
.note p {
  margin: 0;
}

.component-state,
.incident-item > strong {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.component-state.is-online,
.incident-item.clear > strong {
  color: var(--success);
}

.component-state.is-loading,
.incident-item.maintenance > strong {
  color: var(--gold);
}

.component-state.is-offline {
  color: var(--danger);
}

.uptime-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
}

.uptime-bars {
  display: grid;
  grid-template-columns: repeat(60, minmax(2px, 1fr));
  gap: 2px;
  min-height: 2rem;
}

.uptime-bars span {
  border-radius: 2px;
}

.uptime-bars .is-ok {
  background: var(--success);
}

.uptime-bars .is-degraded {
  background: var(--gold);
}

.uptime-bars .is-outage {
  background: var(--danger);
}

.server-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.server-card {
  display: grid;
  gap: 0.9rem;
  align-content: start;
  padding: 1rem;
}

.server-card.is-online {
  border-color: rgba(52, 211, 153, 0.36);
}

.server-card.is-loading {
  border-color: rgba(250, 204, 21, 0.34);
}

.server-card.is-offline {
  border-color: rgba(251, 113, 133, 0.3);
}

.server-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: start;
}

.server-head h3 {
  margin: 0.2rem 0 0;
}

.server-head > strong {
  color: var(--cyan-soft);
  font-size: 0.82rem;
  font-weight: 950;
  text-transform: uppercase;
}

.type {
  margin: 0;
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.copy-host {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  width: 100%;
  padding: 0.75rem;
  text-align: left;
}

.copy-host strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.metrics div {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

.metrics strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.incident-item {
  align-items: flex-start;
  justify-content: space-between;
}

.incident-item p {
  margin-top: 0.25rem;
}

.incident-item > strong {
  color: var(--cyan-soft);
}

.status-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem var(--page-x);
  border-top: 1px solid rgba(103, 232, 249, 0.15);
  background: rgba(2, 1, 4, 0.9);
}

.status-footer p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.status-footer span {
  color: var(--cyan-soft);
  font-weight: 900;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 110;
  max-width: min(22rem, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(2, 1, 4, 0.94);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(0.6rem);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

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

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

@media (max-width: 760px) {
  .status-header,
  .status-heading,
  .section-head,
  .component-main,
  .incident-item,
  .status-footer {
    display: grid;
    align-items: stretch;
  }

  .status-actions {
    justify-content: flex-start;
  }

  .brand img,
  .status-logo {
    width: 12rem;
    max-width: 70vw;
  }

  .hero {
    padding-top: 8.3rem;
  }

  .status-banner {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .overview-grid,
  .server-grid {
    grid-template-columns: 1fr;
  }

  .uptime-row {
    grid-template-columns: 1fr;
  }

  .uptime-bars {
    grid-template-columns: repeat(30, minmax(3px, 1fr));
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .component-state,
  .incident-item > strong {
    justify-self: start;
  }
}

@media (max-width: 480px) {
  .button {
    width: 100%;
  }

  .hero {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .status-card,
  .note,
  .status-banner,
  .overview-card,
  .server-card {
    padding: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
