:root {
  --ink: #081016;
  --panel: #0d1820;
  --fog: #8fa3b5;
  --paper: #e6eef3;
  --signal: #3ee0b0;
  --warn: #e8a35a;
  --line: rgba(230, 238, 243, 0.1);
  --brand: "Syne", "Avenir Next", "Segoe UI", sans-serif;
  --body: "Manrope", "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", "Consolas", ui-monospace, monospace;
  --pad: clamp(1rem, 3.5vw, 2rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--paper);
  font-family: var(--body);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(62, 224, 176, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(232, 163, 90, 0.06), transparent),
    var(--ink);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.demo-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem var(--pad);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(230, 238, 243, 0.65);
  background: #060d12;
  border-bottom: 1px solid var(--line);
}

.demo-bar a {
  color: var(--signal);
  text-decoration: none;
}

.demo-bar a:hover {
  text-decoration: underline;
}

.bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.25rem var(--pad) 0.5rem;
  max-width: 1100px;
  margin: 0 auto;
  animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.device-name {
  margin: 0;
  font-family: var(--brand);
  font-weight: 700;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  letter-spacing: -0.03em;
}

.device-meta {
  margin: 0.35rem 0 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--fog);
}

.bar-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.pill {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(62, 224, 176, 0.45);
  color: var(--signal);
}

.link-back {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fog);
}

.link-back:hover {
  color: var(--paper);
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem var(--pad) 2.5rem;
  display: grid;
  gap: 1.1rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
  animation: rise 0.75s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.metric {
  padding: 1.1rem 1rem 1rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 2px solid rgba(62, 224, 176, 0.55);
}

.metric-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fog);
}

.metric-value {
  margin: 0.55rem 0 0.35rem;
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(1.75rem, 4vw, 2.15rem);
  letter-spacing: -0.03em;
  line-height: 1;
}

.metric-value span {
  font-size: 0.55em;
  margin-left: 0.15rem;
  color: var(--fog);
}

.metric-status {
  color: var(--signal);
}

.metric-note {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(143, 163, 181, 0.9);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 1.15rem 1.1rem 1.25rem;
  animation: rise 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.panel-head h2 {
  margin: 0;
  font-family: var(--brand);
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.panel-head p {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fog);
}

.chart {
  position: relative;
}

.chart svg {
  width: 100%;
  height: clamp(160px, 28vw, 220px);
  display: block;
}

.chart-grid {
  fill: none;
  stroke: rgba(230, 238, 243, 0.06);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--signal);
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw 1.6s ease forwards 0.35s;
}

.chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 0.55rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  color: rgba(143, 163, 181, 0.75);
}

.control-list {
  display: grid;
  gap: 0.65rem;
}

.control {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  background: rgba(8, 16, 22, 0.55);
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.control:hover,
.control.is-on {
  border-color: rgba(62, 224, 176, 0.35);
}

.control strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
}

.control small {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fog);
}

.control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch {
  flex-shrink: 0;
  width: 2.6rem;
  height: 1.4rem;
  border-radius: 999px;
  background: rgba(230, 238, 243, 0.15);
  border: 1px solid rgba(230, 238, 243, 0.2);
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: var(--paper);
  transition: transform 0.2s ease;
}

.control input:checked + .switch {
  background: rgba(62, 224, 176, 0.35);
  border-color: var(--signal);
}

.control input:checked + .switch::after {
  transform: translateX(1.15rem);
  background: var(--signal);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem var(--pad) 2.25rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(143, 163, 181, 0.7);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes draw {
  to {
    stroke-dashoffset: 0;
  }
}

@media (max-width: 860px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .metrics {
    grid-template-columns: 1fr;
  }
}
