:root {
  --bg: #071117;
  --bg-2: #0d1821;
  --panel: rgba(9, 18, 25, 0.78);
  --panel-strong: rgba(6, 13, 19, 0.9);
  --line: rgba(149, 211, 255, 0.15);
  --line-strong: rgba(149, 211, 255, 0.28);
  --text: #e8f6ff;
  --muted: #95aebe;
  --accent: #66e1ff;
  --accent-2: #a6ff7c;
  --accent-3: #ffb86c;
  --danger: #ff6b6b;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(102, 225, 255, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(166, 255, 124, 0.12), transparent 28%),
    linear-gradient(180deg, #061017 0%, #09141b 42%, #0d1821 100%);
  font-family: "Sora", sans-serif;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(40px);
  z-index: -3;
  opacity: 0.45;
}

.ambient-a {
  width: 340px;
  height: 340px;
  top: -80px;
  left: -100px;
  background: rgba(102, 225, 255, 0.35);
  animation: driftA 14s ease-in-out infinite;
}

.ambient-b {
  width: 420px;
  height: 420px;
  right: -140px;
  bottom: -130px;
  background: rgba(166, 255, 124, 0.24);
  animation: driftB 16s ease-in-out infinite;
}

.grid-noise {
  position: fixed;
  inset: 0;
  z-index: -4;
  background-image:
    linear-gradient(to right, rgba(149, 211, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(149, 211, 255, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.82), transparent 98%);
}

.shell {
  width: min(1280px, calc(100vw - 2rem));
  margin: 1.2rem auto 4rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.hero-copy,
.hero-console,
.metric-card,
.panel {
  background: linear-gradient(180deg, rgba(10, 19, 27, 0.92), rgba(7, 16, 23, 0.82));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
}

.hero-copy {
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.hero-copy::before {
  content: "";
  position: absolute;
  inset: auto -10% -35% auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(102, 225, 255, 0.18), transparent 68%);
}

.eyebrow,
.console-kicker,
.panel-kicker {
  margin: 0;
  color: var(--accent-2);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.77rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.9rem 0 1.2rem;
}

.runtime-badge,
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 32px;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  background: rgba(14, 27, 36, 0.72);
  color: var(--text);
  font-size: 0.82rem;
}

.runtime-badge.local {
  color: var(--accent-3);
  border-color: rgba(255, 184, 108, 0.32);
}

.runtime-badge.online {
  color: var(--accent);
  border-color: rgba(102, 225, 255, 0.32);
}

.runtime-badge.error {
  color: #ffc0c0;
  border-color: rgba(255, 107, 107, 0.35);
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: -0.04em;
}

h1 {
  max-width: 12ch;
  font-size: clamp(2.7rem, 6vw, 5rem);
  line-height: 0.96;
}

.hero-text {
  max-width: 62ch;
  margin: 1rem 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.6rem;
}

.hero-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  text-decoration: none;
  font-weight: 700;
  color: #061017;
  background: linear-gradient(135deg, var(--accent), #98f5ff);
}

.hero-link.ghost {
  color: var(--text);
  background: rgba(14, 27, 36, 0.72);
  border: 1px solid var(--line);
}

.hero-console {
  padding: 1.4rem;
  position: relative;
  overflow: hidden;
}

.hero-console::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(102, 225, 255, 0.1), transparent 30%, transparent 70%, rgba(166, 255, 124, 0.08));
  pointer-events: none;
}

.console-head,
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.console-head h2 {
  margin-top: 0.28rem;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
}

.console-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 8px rgba(166, 255, 124, 0.09);
}

.score-board {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 1rem;
  align-items: center;
}

.score-core {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(8, 20, 28, 0.82) 0 48%, transparent 49% 100%),
    conic-gradient(from 90deg, var(--accent) 0deg, var(--accent-2) 120deg, rgba(102, 225, 255, 0.12) 260deg, rgba(102, 225, 255, 0.12) 360deg);
  border: 1px solid rgba(102, 225, 255, 0.16);
  box-shadow: inset 0 0 60px rgba(102, 225, 255, 0.08);
}

.score-core span {
  display: block;
  font-size: 3rem;
  font-weight: 800;
}

.score-core small {
  display: block;
  margin-top: -0.25rem;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.score-item {
  padding: 0.95rem;
  border-radius: 18px;
  background: rgba(9, 22, 30, 0.72);
  border: 1px solid rgba(149, 211, 255, 0.12);
}

.score-item span,
.metric-card span,
.panel-meta,
.panel-helper,
.story-copy,
.scenario-label,
.scenario-text,
.recommendations-list p,
.notes-list li,
label,
th,
td {
  color: var(--muted);
}

.score-item span {
  display: block;
  font-size: 0.75rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.score-item strong {
  display: block;
  margin-top: 0.45rem;
  font-size: 1rem;
  color: var(--text);
}

.story-copy {
  margin: 1rem 0 0;
  line-height: 1.65;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.9rem;
  margin-bottom: 1rem;
}

.metric-card {
  padding: 1rem;
}

.metric-card span {
  display: block;
  font-size: 0.76rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.metric-card strong {
  display: block;
  margin-top: 0.75rem;
  font-size: clamp(1.15rem, 1.8vw, 1.7rem);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel {
  padding: 1.3rem;
}

.panel-head h3 {
  margin-top: 0.28rem;
  font-size: 1.35rem;
}

.chart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(240px, 0.9fr);
  gap: 1rem;
  align-items: center;
}

.chart-wrap {
  min-height: 260px;
}

.category-rail {
  display: grid;
  gap: 0.72rem;
}

.rail-item {
  padding: 0.8rem;
  border-radius: 18px;
  background: rgba(9, 22, 30, 0.72);
  border: 1px solid rgba(149, 211, 255, 0.1);
}

.rail-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.55rem;
}

.rail-item-head span {
  color: var(--text);
  font-weight: 600;
}

.rail-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(149, 211, 255, 0.09);
  overflow: hidden;
}

.rail-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.scenario-box {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(102, 225, 255, 0.08), rgba(166, 255, 124, 0.05));
  border: 1px solid rgba(149, 211, 255, 0.12);
}

.scenario-label {
  margin: 0;
  font-size: 0.76rem;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.scenario-text {
  margin: 0.55rem 0 0;
  line-height: 1.7;
}

.recommendations-list,
.notes-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.8rem;
}

.recommendations-list li,
.notes-list li {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(9, 22, 30, 0.72);
  border: 1px solid rgba(149, 211, 255, 0.1);
}

.recommendations-list strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.impact {
  margin-top: 0.55rem;
  color: var(--accent-3);
  font-weight: 700;
}

.form-grid {
  display: grid;
  gap: 0.85rem;
}

label {
  display: grid;
  gap: 0.45rem;
  font-size: 0.88rem;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  color: var(--text);
  background: rgba(7, 18, 24, 0.88);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 4px rgba(102, 225, 255, 0.08);
}

textarea {
  resize: vertical;
  min-height: 180px;
}

button {
  border: 0;
  border-radius: 16px;
  min-height: 48px;
  font-weight: 700;
  color: #061017;
  background: linear-gradient(135deg, var(--accent), #9ef5ff);
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.table-panel {
  overflow: hidden;
}

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

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

th,
td {
  text-align: left;
  padding: 0.85rem 0.65rem;
  border-bottom: 1px solid rgba(149, 211, 255, 0.1);
  font-size: 0.94rem;
}

th {
  color: #b2cad8;
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0.18rem 0.58rem;
  border-radius: 999px;
  background: rgba(102, 225, 255, 0.12);
  border: 1px solid rgba(102, 225, 255, 0.2);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: min(460px, calc(100vw - 2rem));
  padding: 0.9rem 1rem;
  border-radius: 16px;
  color: var(--text);
  background: rgba(4, 11, 16, 0.95);
  border: 1px solid rgba(149, 211, 255, 0.14);
  transform: translateY(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.reveal {
  animation: rise 0.65s ease both;
}

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

@keyframes driftA {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(18px, 22px);
  }
}

@keyframes driftB {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-22px, -18px);
  }
}

@media (max-width: 1180px) {
  .hero,
  .dashboard-grid,
  .chart-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 820px) {
  .shell {
    width: min(1280px, calc(100vw - 1rem));
  }

  .hero-copy,
  .hero-console,
  .panel {
    padding: 1rem;
    border-radius: 22px;
  }

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

  .score-board {
    grid-template-columns: 1fr;
  }

  .score-core {
    width: 150px;
    height: 150px;
    margin: 0 auto;
  }
}

@media (max-width: 560px) {
  h1 {
    max-width: none;
    font-size: 2.4rem;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

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