:root {
  --bg: #0d0f12;
  --bg-soft: #14171c;
  --bg-card: #181b22;
  --fg: #e8e8e8;
  --fg-muted: #8a8f99;
  --border: #2a2f38;
  --accent: #ff7a59;
  --accent-soft: #ffb199;
  --ok: #28c840;
  --warn: #febc2e;
  --bad: #ff5f57;
  --link: #79b8ff;
  --term-bar: #1d2128;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.frame {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.hdr { margin-bottom: 28px; }
.hdr .ascii {
  color: var(--accent);
  font-size: 12px;
  line-height: 1.2;
  margin: 0 0 12px;
  white-space: pre;
  overflow-x: auto;
}
.hdr .lede { color: var(--fg-muted); margin: 0 0 4px; font-size: 13px; }
.hdr .back { margin: 0; font-size: 12px; }

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(12, 1fr);
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px 16px;
  position: relative;
  overflow: hidden;
  grid-column: span 6;
}
.card.cpu     { grid-column: span 12; }
.card.disk    { grid-column: span 6; }
.card.net     { grid-column: span 6; }
.card.mc      { grid-column: span 6; }
.card.uptime  { grid-column: span 6; }

@media (max-width: 720px) {
  .card { grid-column: span 12 !important; }
}

.card h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  margin: 0 0 10px;
  color: var(--fg-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card h2 .hint { font-weight: 400; letter-spacing: 0; color: var(--fg-muted); font-size: 10px; text-transform: none; }
.hint { color: var(--fg-muted); font-size: 12px; }

.meter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.meter-bar {
  flex: 1;
  height: 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ok) 0%, var(--ok) 60%, var(--warn) 75%, var(--bad) 95%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: 0 0;
  transition: width 600ms cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 0 12px rgba(255,122,89,0.15);
}
.meter-val { font-variant-numeric: tabular-nums; font-size: 13px; min-width: 60px; text-align: right; }

.cores {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 6px;
  margin: 10px 0 6px;
}
.core {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 6px 8px;
  font-size: 11px;
}
.core .core-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}
.core .core-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 600ms cubic-bezier(.2,.8,.2,1);
}

.kv {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.kv span:first-child { color: var(--fg-muted); }

.disk-row {
  margin-bottom: 8px;
}
.disk-row:last-child { margin-bottom: 0; }
.disk-row .disk-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 4px;
  color: var(--fg-muted);
}

.net-ratio {
  display: flex;
  width: 100%;
  height: 14px;
  margin-top: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.net-ratio-rx, .net-ratio-tx {
  height: 100%;
  width: 50%;
  transition: width 600ms cubic-bezier(.2,.8,.2,1);
}
.net-ratio-rx {
  background: linear-gradient(90deg, var(--ok) 0%, color-mix(in srgb, var(--ok) 70%, transparent) 100%);
  box-shadow: 0 0 8px rgba(40, 200, 64, 0.25) inset;
}
.net-ratio-tx {
  background: linear-gradient(270deg, var(--bad) 0%, color-mix(in srgb, var(--bad) 70%, transparent) 100%);
  box-shadow: 0 0 8px rgba(255, 95, 87, 0.25) inset;
}
.ratio-legend { margin-top: 4px; gap: 12px; }
.ratio-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.ratio-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.ratio-dot-rx { background: var(--ok); }
.ratio-dot-tx { background: var(--bad); }

.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: var(--bad);
  box-shadow: 0 0 6px currentColor;
  color: var(--bad);
}
.status-dot.on  { background: var(--ok);  color: var(--ok); animation: pulse 2s ease-in-out infinite; }
.status-dot.off { background: var(--bad); color: var(--bad); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 4px currentColor; }
  50%      { box-shadow: 0 0 14px currentColor; }
}

.card.mc .ascii.small {
  position: absolute;
  right: 12px;
  bottom: 6px;
  margin: 0;
  color: var(--accent);
  font-size: 16px;
  line-height: 1;
  opacity: 0.4;
}

.big {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 4px 0 8px;
}

.ftr {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--fg-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.ftr p { margin: 0; }

::selection { background: var(--accent); color: var(--bg); }
