:root {
  color-scheme: dark;
  --bg: #08111d;
  --bg2: #0d1727;
  --panel: rgba(13, 23, 39, 0.72);
  --panel-strong: rgba(17, 30, 49, 0.92);
  --border: rgba(161, 184, 222, 0.18);
  --text: #edf4ff;
  --muted: #a5b7d4;
  --accent: #65d9ff;
  --accent-2: #9b7bff;
  --good: #46d39c;
  --warn: #f4c56a;
  --bad: #ff7a90;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(101, 217, 255, 0.12), transparent 28%),
    radial-gradient(circle at 90% 15%, rgba(155, 123, 255, 0.16), transparent 26%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--text);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

body {
  position: relative;
  overflow-x: hidden;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.7), transparent 90%);
  pointer-events: none;
  z-index: 0;
}

.bg-orb {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(25px);
  opacity: 0.7;
  pointer-events: none;
  z-index: 0;
}

.orb-a {
  top: -140px;
  right: -120px;
  background: radial-gradient(circle, rgba(101, 217, 255, 0.26), transparent 68%);
}

.orb-b {
  left: -140px;
  bottom: -170px;
  background: radial-gradient(circle, rgba(155, 123, 255, 0.24), transparent 68%);
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.eyebrow,
.card-kicker,
.panel-label {
  margin: 0 0 10px;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 4vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  max-width: 12ch;
}

.lede {
  max-width: 62ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.65;
}

.hero-panel,
.card {
  background: linear-gradient(180deg, rgba(18, 31, 51, 0.92), rgba(10, 18, 31, 0.85));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
}

.hero-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.panel-value {
  font-size: clamp(1.7rem, 2.8vw, 2.6rem);
  line-height: 1.1;
  font-weight: 700;
}

.panel-meta {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}

.mini-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.mini-pills span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #d7e6ff;
  font-size: 0.9rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.metric {
  padding: 22px;
  min-height: 152px;
  position: relative;
  overflow: hidden;
}

.metric::after {
  content: "";
  position: absolute;
  inset: auto -20px -40px auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(101, 217, 255, 0.16), transparent 72%);
}

.metric .label {
  color: var(--muted);
  font-size: 0.92rem;
}

.metric .value {
  margin-top: 12px;
  font-size: clamp(1.8rem, 2.8vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.05em;
}

.metric .sub {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.layout-two {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  margin-bottom: 18px;
}

.card {
  padding: 22px;
}

.card-wide {
  min-height: 420px;
}

.card-head {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.card h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  color: var(--muted);
  font-size: 0.88rem;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.tp { background: var(--good); }
.dot.fp { background: var(--warn); }
.dot.tn { background: var(--accent); }
.dot.fn { background: var(--bad); }

.matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  min-height: 280px;
}

.matrix-cell {
  border-radius: 22px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
}

.matrix-cell .kicker {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}

.matrix-cell .num {
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1;
  font-weight: 700;
  margin-top: 10px;
}

.matrix-cell .desc {
  margin-top: 12px;
  color: var(--muted);
}

.matrix-cell.tp { box-shadow: inset 0 0 0 1px rgba(70, 211, 156, 0.18); }
.matrix-cell.fp { box-shadow: inset 0 0 0 1px rgba(244, 197, 106, 0.18); }
.matrix-cell.fn { box-shadow: inset 0 0 0 1px rgba(255, 122, 144, 0.18); }
.matrix-cell.tn { box-shadow: inset 0 0 0 1px rgba(101, 217, 255, 0.18); }

.snapshot,
.scenario-list {
  display: grid;
  gap: 12px;
}

.snapshot-item,
.scenario-row {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
}

.snapshot-item .key,
.scenario-row .key {
  color: var(--muted);
  font-size: 0.86rem;
}

.snapshot-item .val,
.scenario-row .val {
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 500;
}

.scenario-row .bar {
  margin-top: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
}

.scenario-row .fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

svg {
  width: 100%;
  height: auto;
  display: block;
}

.axis-label {
  fill: var(--muted);
  font-size: 22px;
  font-family: "IBM Plex Mono", monospace;
}

.series-line {
  fill: none;
  stroke: url(#gradient);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.series-area {
  fill: url(#areaGradient);
}

.grid-line {
  stroke: rgba(255,255,255,0.08);
  stroke-width: 1;
}

.point {
  fill: var(--accent);
  stroke: #08111d;
  stroke-width: 3;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

td {
  font-size: 0.98rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-family: "IBM Plex Mono", monospace;
}

.badge.good { background: rgba(70, 211, 156, 0.16); color: #bff4de; }
.badge.warn { background: rgba(244, 197, 106, 0.16); color: #ffe2a7; }
.badge.bad { background: rgba(255, 122, 144, 0.16); color: #ffcad3; }

@media (max-width: 1100px) {
  .hero,
  .layout-two,
  .cards {
    grid-template-columns: 1fr;
  }

  .card-wide {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 20px 14px 34px;
  }

  .hero-panel,
  .card {
    padding: 18px;
  }

  h1 {
    font-size: clamp(2.1rem, 12vw, 3.5rem);
  }

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

  .card-head {
    flex-direction: column;
  }
}
