:root {
  --bg: #071019;
  --bg-top: #0d1f2f;
  --surface: rgba(9, 19, 31, 0.84);
  --surface-soft: rgba(16, 28, 42, 0.78);
  --line: rgba(255, 255, 255, 0.12);
  --line-accent: rgba(34, 197, 94, 0.34);
  --text: #f5fbff;
  --muted: rgba(230, 244, 255, 0.72);
  --green: #6ef7a1;
  --blue: #39d0ff;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  color: var(--text);
  background:
    radial-gradient(circle at 10% 12%, rgba(34, 197, 94, 0.18), transparent 32%),
    radial-gradient(circle at 88% 16%, rgba(57, 208, 255, 0.14), transparent 24%),
    linear-gradient(180deg, var(--bg-top), var(--bg));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    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: 92px 92px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 82%);
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

.page-shell {
  width: min(1200px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 60px;
}

.site-header,
.hero-copy,
.hero-panel,
.section,
.site-footer {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brand-copy strong,
h1,
h2,
h3 {
  font-family: var(--display);
  letter-spacing: -0.03em;
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.92rem;
}

.header-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.header-nav a,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.header-nav a:hover,
.header-nav a:focus-visible,
.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.86fr);
  gap: 22px;
  margin-top: 22px;
}

.hero-copy {
  padding: 34px;
}

.hero-panel {
  padding: 22px;
  display: grid;
  gap: 14px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.78rem;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 4.4vw, 4.2rem);
  line-height: 0.97;
  max-width: 12ch;
}

h2,
h3 {
  margin: 0;
}

.hero-lead,
.hero-note,
.quick-meta,
.stat-meta,
.powered-by,
.site-footer p {
  color: var(--muted);
  line-height: 1.7;
}

.hero-lead {
  margin-top: 18px;
  max-width: 64ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.btn-primary {
  color: #06130d;
  background: linear-gradient(135deg, #7affb3, #d9fff0);
  border-color: transparent;
}

.btn-secondary {
  background: rgba(57, 208, 255, 0.12);
  border-color: rgba(57, 208, 255, 0.35);
  color: var(--text);
}

.btn-ghost,
.header-nav a:hover,
.header-nav a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.btn-small {
  min-height: 38px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.hero-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.quick-card,
.stat-card,
.panel-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.quick-card {
  padding: 18px;
}

.quick-card-accent {
  border-color: var(--line-accent);
  background:
    linear-gradient(135deg, rgba(34, 197, 94, 0.14), rgba(57, 208, 255, 0.09)),
    var(--surface-soft);
}

.quick-label,
.stat-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.quick-value,
.stat-value {
  display: block;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 800;
}

.quick-value {
  font-size: 1rem;
  line-height: 1.6;
  word-break: break-word;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.logo-row img {
  width: 28px;
  height: 28px;
}

.section {
  margin-top: 22px;
  padding: 28px;
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: clamp(1.65rem, 3vw, 2.5rem);
}

.split-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  padding: 20px;
}

.stat-value-accent {
  color: var(--green);
}

.panel-card {
  padding: 20px;
  margin-top: 16px;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.period-tabs {
  display: flex;
  gap: 8px;
}

.period-tab {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.period-tab:hover,
.period-tab:focus-visible {
  transform: translateY(-1px);
  color: var(--text);
}

.period-tab.active {
  color: #08120f;
  background: linear-gradient(135deg, #7affb3, #d9fff0);
  border-color: transparent;
}

.chart-wrap {
  width: 100%;
  height: 250px;
  margin-top: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

.table-wrap {
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th {
  padding: 12px 16px;
  text-align: left;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  border-bottom: 1px solid var(--line);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: top;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.table-highlight td {
  background: rgba(34, 197, 94, 0.08);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}

.badge-good {
  background: rgba(34, 197, 94, 0.15);
  color: #88ffb6;
}

.badge-warn {
  background: rgba(250, 204, 21, 0.15);
  color: #ffe87d;
}

.badge-low {
  background: rgba(248, 113, 113, 0.15);
  color: #ff9e9e;
}

.loading,
.error-msg,
.empty-msg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 24px;
  color: var(--muted);
}

.spinner {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--green);
  animation: spin 0.7s linear infinite;
}

code {
  font-family: var(--mono);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding: 18px 24px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1080px) {
  .hero {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .page-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 12px;
  }

  .site-header,
  .hero-copy,
  .hero-panel,
  .section,
  .site-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-nav {
    justify-content: flex-start;
  }

  .split-heading,
  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .data-table {
    font-size: 0.88rem;
  }

  .data-table th,
  .data-table td {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
