:root {
  color-scheme: light;
  --surface-1:      #fcfcfb;
  --page-plane:     #f9f9f7;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --gridline:       #e1e0d9;
  --baseline:       #c3c2b7;
  --border:         rgba(11,11,11,0.10);

  --series-1: #2a78d6;
  --series-7: #4a3aa7;
  --status-warning: #fab219;
  --status-critical: #d03b3b;

  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1:      #1a1a19;
    --page-plane:     #0d0d0d;
    --text-primary:   #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted:     #898781;
    --gridline:       #2c2c2a;
    --baseline:       #383835;
    --border:         rgba(255,255,255,0.10);
    --series-1: #3987e5;
    --series-7: #9085e9;
    --status-warning: #fab219;
    --status-critical: #e66767;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1:      #1a1a19;
  --page-plane:     #0d0d0d;
  --text-primary:   #ffffff;
  --text-secondary: #c3c2b7;
  --text-muted:     #898781;
  --gridline:       #2c2c2a;
  --baseline:       #383835;
  --border:         rgba(255,255,255,0.10);
  --series-1: #3987e5;
  --series-7: #9085e9;
  --status-warning: #fab219;
  --status-critical: #e66767;
}
:root[data-theme="light"] {
  color-scheme: light;
  --surface-1:      #fcfcfb;
  --page-plane:     #f9f9f7;
  --text-primary:   #0b0b0b;
  --text-secondary: #52514e;
  --text-muted:     #898781;
  --gridline:       #e1e0d9;
  --baseline:       #c3c2b7;
  --border:         rgba(11,11,11,0.10);
  --series-1: #2a78d6;
  --series-7: #4a3aa7;
  --status-warning: #fab219;
  --status-critical: #d03b3b;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--page-plane);
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body { font-size: 15px; line-height: 1.5; }
h1, h2, h3 { font-weight: 600; line-height: 1.25; margin: 0; }
p { margin: 0; }
a { color: var(--series-1); }
a:visited { color: var(--series-7); }
img { max-width: 100%; display: block; }

/* ---------- Shared nav ---------- */
.site-nav {
  max-width: 1120px; margin: 0 auto; padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.site-nav-brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text-primary); text-decoration: none;
}
.site-nav-logo { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.site-nav-brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.site-nav-brand-name { font-weight: 700; font-size: 17px; }
.site-nav-brand-sub { font-weight: 500; font-size: 10.5px; color: var(--text-muted); }
.site-nav-links { display: flex; align-items: center; gap: 18px; }
.site-nav-links a:not(.btn) { color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 500; }
.site-nav-links a:not(.btn):hover { color: var(--text-primary); }

.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 14px; font-size: 13px; color: var(--text-primary); cursor: pointer;
  white-space: nowrap; font-family: inherit;
}
.theme-toggle:hover { border-color: var(--text-muted); }
.theme-toggle:focus-visible { outline: 2px solid var(--series-1); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 8px; font-size: 14.5px; font-weight: 600;
  text-decoration: none; cursor: pointer; border: 1px solid transparent; font-family: inherit;
  transition: opacity 0.12s ease, border-color 0.12s ease;
}
.btn:hover { opacity: 0.88; }
.btn-primary { background: var(--series-1); color: #fff; }
.btn-secondary { background: transparent; color: var(--text-primary); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--text-muted); opacity: 1; }
.btn-sm { padding: 8px 16px; font-size: 13.5px; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ---------- Footer ---------- */
.site-footer {
  max-width: 1120px; margin: 0 auto; padding: 32px 24px 48px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  color: var(--text-muted); font-size: 13px; border-top: 1px solid var(--border); margin-top: 24px;
}
.site-footer a { color: var(--text-secondary); }
.site-footer-links { display: flex; gap: 16px; }

@media (max-width: 640px) {
  .site-nav-links { gap: 10px; }
  .site-nav-links a:not(.btn):not(.theme-toggle) { display: none; }
}
