:root {
  --bg:        #0f0f0f;
  --surface:   #1a1a1a;
  --border:    #2a2a2a;
  --text:      #e0e0e0;
  --muted:     #666;
  --green:     #4caf6e;
  --yellow:    #e6b84a;
  --red:       #e05c5c;
  --accent:    #5b8dee;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Helvetica Neue", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Nav --- */

header {
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
}

nav {
  max-width: 900px;
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-name {
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text);
}

nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

nav a.active,
nav a:hover {
  color: var(--text);
  border-color: var(--accent);
}

/* --- Main --- */

main {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* --- Current reading --- */

.current {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.db-display {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  line-height: 1;
}

#db-value {
  font-size: clamp(5rem, 18vw, 9rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  transition: color 0.4s;
}

#db-value.green  { color: var(--green); }
#db-value.yellow { color: var(--yellow); }
#db-value.red    { color: var(--red); }

.db-unit {
  font-size: 2rem;
  color: var(--muted);
  font-weight: 400;
}

/* --- Status dot --- */

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.3s;
}

.dot.live    { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.offline { background: var(--red); }

/* --- Chart --- */

.chart-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.chart-section h2 {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
}

.chart-wrapper {
  position: relative;
  height: 280px;
}

/* --- Footer --- */

footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* --- Responsive --- */

@media (max-width: 600px) {
  header, main { padding-left: 1rem; padding-right: 1rem; }
  .chart-wrapper { height: 200px; }
}
