@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;700&display=swap");

:root {
  --bg-1: #081317;
  --bg-2: #10252d;
  --panel: rgba(15, 26, 34, 0.78);
  --panel-border: rgba(165, 225, 240, 0.18);
  --text: #eaf7ff;
  --muted: #98b3be;
  --accent: #5de2c0;
  --accent-2: #f1c575;
  --ok: #44d48a;
  --bad: #f76a6a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background: radial-gradient(1200px 800px at 20% -10%, #1b4658 0%, transparent 55%),
    radial-gradient(1000px 700px at 90% 10%, #3d2b1f 0%, transparent 50%),
    linear-gradient(165deg, var(--bg-1), var(--bg-2));
}

a {
  color: #b6f5e5;
}

code,
pre {
  font-family: "IBM Plex Mono", monospace;
}

.background-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
}

.topbar {
  margin: 1.25rem auto 0;
  width: min(1360px, calc(100% - 2rem));
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.topbar h1 {
  margin: 0.2rem 0 0.4rem;
  font-size: clamp(1.25rem, 2.4vw, 2.1rem);
  line-height: 1.1;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-2);
  font-size: 0.72rem;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.grid {
  width: min(1360px, calc(100% - 2rem));
  margin: 1rem auto 1.5rem;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  grid-template-areas:
    "hero hero"
    "model model"
    "bench bench"
    "studio telemetry"
    "api telemetry";
  gap: 1rem;
}

.hero {
  grid-area: hero;
}

.studio {
  grid-area: studio;
}

.telemetry {
  grid-area: telemetry;
}

.model {
  grid-area: model;
}

.bench {
  grid-area: bench;
}

.api {
  grid-area: api;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.35);
  padding: 1rem;
}

.reveal {
  animation: rise 550ms ease both;
}

.reveal:nth-of-type(2) {
  animation-delay: 80ms;
}

.reveal:nth-of-type(3) {
  animation-delay: 130ms;
}

.reveal:nth-of-type(4) {
  animation-delay: 170ms;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.status-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.8rem;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 0 rgba(76, 205, 150, 0.6);
}

.status-dot.ok {
  background: var(--ok);
  animation: pulse 1.3s infinite;
}

.status-dot.bad {
  background: var(--bad);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 205, 150, 0.55);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(76, 205, 150, 0);
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.value {
  margin: 0.25rem 0 0;
  font-weight: 600;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h2 {
  margin: 0;
  font-size: 1.08rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.section-actions {
  display: flex;
  gap: 0.5rem;
}

.small {
  font-size: 0.8rem;
}

.muted {
  color: var(--muted);
}

#studioFrame {
  width: 100%;
  height: clamp(420px, 58vh, 760px);
  margin-top: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: #0e141a;
}

.gpu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.gpu-card {
  border: 1px solid rgba(93, 226, 192, 0.25);
  border-radius: 12px;
  padding: 0.75rem;
  background: rgba(4, 20, 26, 0.62);
}

.gpu-card h3 {
  margin: 0;
  font-size: 0.95rem;
}

.gpu-card p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-top: 0.45rem;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4fcbb9, #f1c575);
}

.table-wrap {
  margin-top: 0.75rem;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

thead {
  background: rgba(255, 255, 255, 0.06);
}

th,
td {
  text-align: left;
  padding: 0.58rem 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.api-grid {
  margin-top: 0.8rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}

.api-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.8rem;
  background: rgba(9, 16, 23, 0.7);
}

.api-card h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.api-card p {
  margin: 0;
  line-height: 1.45;
}

.btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  text-decoration: none;
  background: linear-gradient(130deg, rgba(93, 226, 192, 0.2), rgba(26, 50, 61, 0.9));
  border-radius: 10px;
  padding: 0.52rem 0.8rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.42);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.02);
}

.btn-small {
  padding: 0.4rem 0.62rem;
}

.bench-controls {
  display: grid;
  grid-template-columns: 1fr 1.6fr 120px;
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.field span {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field input {
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  padding: 0 0.65rem;
  font-family: "IBM Plex Mono", monospace;
}

.bench-status {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.bench-status.ok {
  color: #7af0bf;
}

.bench-status.bad {
  color: #ff9d9d;
}

.bench-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.65rem;
}

.bench-metrics article {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: rgba(9, 16, 23, 0.55);
}

.model-grid {
  margin-top: 0.65rem;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.65rem;
}

.model-grid article {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  background: rgba(9, 16, 23, 0.55);
}

.value.ok {
  color: #8cf4c8;
}

.value.bad {
  color: #ff9f9f;
}

@media (max-width: 1100px) {
  .grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "model"
      "bench"
      "studio"
      "telemetry"
      "api";
  }

  .hero-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .api-grid {
    grid-template-columns: 1fr;
  }

  .bench-controls {
    grid-template-columns: 1fr;
  }

  .bench-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .model-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #studioFrame {
    height: clamp(380px, 52vh, 620px);
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .bench-metrics {
    grid-template-columns: 1fr;
  }

  .model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #studioFrame {
    height: min(58vh, 460px);
  }
}
