:root {
  color-scheme: light;
  --bg: #f2f5f0;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-solid: #ffffff;
  --text: #182019;
  --muted: #667067;
  --border: rgba(24, 32, 25, 0.12);
  --accent: #176b49;
  --accent-soft: #dcefe5;
  --shadow: 0 18px 45px rgba(31, 49, 38, 0.08);
  --focus: #b45f06;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #111713;
  --surface: rgba(27, 35, 29, 0.88);
  --surface-solid: #1b231d;
  --text: #f0f5f1;
  --muted: #a7b3aa;
  --border: rgba(240, 245, 241, 0.13);
  --accent: #76d3a5;
  --accent-soft: #203f31;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
  --focus: #ffb55a;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(73, 151, 110, 0.17), transparent 30rem),
    radial-gradient(circle at 90% 92%, rgba(226, 168, 78, 0.13), transparent 28rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, a { font: inherit; }

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 5;
  padding: 0.6rem 0.85rem;
  color: var(--surface-solid);
  background: var(--text);
  border-radius: 0.6rem;
  transform: translateY(-160%);
}

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

.shell {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 2rem;
}

.topbar,
.section-heading,
.status-panel,
.status-copy,
.card {
  display: flex;
  align-items: center;
}

.topbar,
.section-heading,
.status-panel { justify-content: space-between; }

.topbar { gap: 1rem; }

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  letter-spacing: -0.025em;
}

.eyebrow {
  margin-bottom: 0.35rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.theme-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.65rem 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.theme-button:hover { border-color: var(--accent); }

.status-panel {
  gap: 1rem;
  margin: 2rem 0 2.4rem;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.status-copy { min-width: 0; gap: 0.85rem; }
.status-copy > div { min-width: 0; }
.status-copy h2 { font-size: 1rem; }

.status-copy p,
.status-time,
.service-count,
footer p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.status-dot {
  width: 0.75rem;
  height: 0.75rem;
  flex: 0 0 auto;
  border: 2px solid var(--surface-solid);
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--border);
}

.status-ok { background: #2ba66a; }
.status-warning { background: #d38a19; }
.status-error { background: #d44747; }
.status-unknown { background: #8b938d; }
.status-time { white-space: nowrap; }

.section-heading { margin-bottom: 1rem; }

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

.card {
  position: relative;
  min-height: 8.9rem;
  gap: 0.9rem;
  padding: 1.1rem;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1.15rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transition: transform 150ms ease, border-color 150ms ease, background-color 150ms ease;
}

.card:hover {
  background: var(--surface-solid);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  transform: translateY(-2px);
}

.card:focus-visible,
.theme-button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.card-icon {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 0.8rem;
  font-size: 0.9rem;
  font-weight: 850;
}

.card-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.card-title { font-size: 1.05rem; font-weight: 750; }

.card-description {
  margin-top: 0.22rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.38;
}

.card-badge {
  width: fit-content;
  margin-top: 0.55rem;
  padding: 0.15rem 0.45rem;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-arrow {
  align-self: flex-start;
  color: var(--muted);
  font-size: 1rem;
}

.loading,
.load-error {
  grid-column: 1 / -1;
  padding: 1.25rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
}

.load-error { color: #b43a3a; }

footer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

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

@media (max-width: 540px) {
  .shell {
    width: min(100% - 1.15rem, 34rem);
    padding-top: 1.15rem;
  }

  .theme-button span:last-child { display: none; }
  .theme-button { width: 2.75rem; justify-content: center; padding: 0; }
  .topbar > div { min-width: 0; flex: 1; }
  .topbar h1 { font-size: 1.7rem; }
  .status-panel { align-items: flex-start; flex-direction: column; margin: 1.35rem 0 2rem; }
  .status-copy { width: 100%; }
  .status-copy p { overflow-wrap: anywhere; }
  .status-time { padding-left: 1.6rem; white-space: normal; }
  .cards { grid-template-columns: 1fr; }
  .card { min-height: 7.4rem; }
}

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