:root {
  --bg: #07111f;
  --bg-2: #0c1727;
  --panel: rgba(13, 24, 41, 0.82);
  --panel-2: rgba(20, 32, 53, 0.9);
  --line: rgba(255, 255, 255, 0.08);
  --text: #edf3ff;
  --muted: #9db0c9;
  --accent: #66b3ff;
  --accent-2: #7ef0c5;
  --accent-3: #a78bfa;
  --danger: #ff8b8b;
  --warning: #ffd27a;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(102, 179, 255, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(126, 240, 197, 0.12), transparent 22%),
    linear-gradient(180deg, #06101c 0%, #0a1423 45%, #08111d 100%);
  min-height: 100vh;
}

.site-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

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

.eyebrow {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-2);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  line-height: 1;
  margin: 14px 0 14px;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 62ch;
}

.hero-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.hero-badges span,
.severity-pill,
.stat-tile,
.disclaimer,
.card,
.formula-card,
.tab-strip {
  backdrop-filter: blur(16px);
}

.hero-badges span {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.92rem;
}

.hero-panel {
  position: relative;
  min-height: 260px;
}

.panel-glow {
  position: absolute;
  inset: 10% 8%;
  background: radial-gradient(circle, rgba(102, 179, 255, 0.28), transparent 55%);
  filter: blur(28px);
}

.formula-card {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, rgba(18, 31, 51, 0.88), rgba(10, 20, 35, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.formula-card code {
  display: block;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: #dff1ff;
  font-size: 0.98rem;
  overflow-x: auto;
}

.formula-label {
  color: var(--accent-2);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tab-strip {
  display: inline-flex;
  gap: 10px;
  padding: 8px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(13, 24, 41, 0.82), rgba(9, 17, 30, 0.92));
  box-shadow: var(--shadow);
}

.tab-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.96rem;
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(102, 179, 255, 0.18), rgba(167, 139, 250, 0.16));
  color: var(--text);
  border-color: rgba(255,255,255,0.08);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
}

.card {
  grid-column: span 6;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--panel), rgba(9, 17, 30, 0.9));
  box-shadow: var(--shadow);
  padding: 24px;
}

.full-width { grid-column: 1 / -1; }

.card-header h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.card-header p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: #dce8f8;
  font-size: 0.95rem;
  font-weight: 600;
}

input, select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px 14px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  outline: none;
  font-size: 1rem;
}

select option {
  background: #0d1727;
  color: var(--text);
}

input:focus, select:focus {
  border-color: rgba(102, 179, 255, 0.65);
  box-shadow: 0 0 0 4px rgba(102, 179, 255, 0.12);
}

.action-row {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

button {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.primary-btn,
.ghost-btn {
  border-radius: 16px;
  padding: 13px 18px;
  font-weight: 700;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.2s ease;
}

.primary-btn:hover,
.ghost-btn:hover,
.small-btn:hover { transform: translateY(-1px); }

.primary-btn {
  background: linear-gradient(135deg, var(--accent), #8fbeff);
  color: #07111f;
}

.ghost-btn {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.small-btn {
  padding: 10px 14px;
  border-radius: 12px;
}

.disclaimer {
  margin-top: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  border-radius: 18px;
  padding: 14px 16px;
  line-height: 1.55;
}

.result-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.result-label {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.result-value {
  font-size: clamp(2rem, 4vw, 3.6rem);
  font-weight: 800;
  line-height: 1;
}

.result-value small {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.severity-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 800;
  letter-spacing: 0.01em;
  border: 1px solid rgba(255,255,255,0.08);
}

.severity-pill.low { background: rgba(126, 240, 197, 0.14); color: var(--accent-2); }
.severity-pill.medium { background: rgba(255, 210, 122, 0.14); color: var(--warning); }
.severity-pill.severe { background: rgba(255, 139, 139, 0.14); color: #ffb3b3; }

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

.stat-tile {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.06);
}

.stat-tile span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 0.92rem;
}

.stat-tile strong {
  display: block;
  font-size: 1.35rem;
}

.accent-tile {
  background: linear-gradient(180deg, rgba(126, 240, 197, 0.08), rgba(126, 240, 197, 0.03));
}

.interpretation {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255,255,255,0.06);
  color: #dce8f8;
  line-height: 1.65;
}

.chart-card canvas {
  width: 100% !important;
  height: 360px !important;
}

.code-block-wrap {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.code-block-wrap-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 18px;
  border-radius: 18px;
  background: #08111d;
  border: 1px solid rgba(255,255,255,0.08);
  color: #dff1ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.65;
  flex: 1;
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .card { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .site-shell { padding: 26px 14px 42px; }
  .form-grid,
  .stats-grid,
  .code-block-wrap-2col { grid-template-columns: 1fr; }
  .tab-strip { width: 100%; display: flex; }
  .tab-btn { flex: 1; }
  .result-hero { flex-direction: column; align-items: flex-start; }
  .code-block-wrap { flex-direction: column; }
}

.hero-copy { max-width: 820px; }
