:root {
  --bg: #05070d;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-soft: rgba(255, 255, 255, 0.06);
  --text: #eef1f8;
  --text-dim: #9aa4bd;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-3: #22d3ee;
  --good: #34d399;
  --bad: #fb7185;
  --warn: #fbbf24;
  --grad: linear-gradient(100deg, #818cf8 0%, #a78bfa 45%, #22d3ee 100%);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Prompt", "Inter", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1060px; margin: 0 auto; padding: 0 20px; }

/* ---------------- Navbar ---------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(5, 7, 13, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 26px;
}
.logo { font-size: 18px; color: #fff; text-decoration: none; letter-spacing: .4px; }
.logo b { font-weight: 700; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color .15s;
}
.nav-links a:hover { color: #fff; }
.nav-cta {
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--grad);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(99, 102, 241, .35);
  transition: transform .12s, box-shadow .12s;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(139, 92, 246, .45); }

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-inner { gap: 12px; }
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  padding: 96px 20px 64px;
  text-align: center;
  overflow: hidden;
}
.aurora { position: absolute; inset: 0; pointer-events: none; filter: blur(70px); opacity: .55; }
.blob { position: absolute; border-radius: 50%; }
.b1 { width: 460px; height: 460px; left: -80px; top: -120px; background: radial-gradient(circle, #4f46e5, transparent 70%); animation: float 12s ease-in-out infinite; }
.b2 { width: 420px; height: 420px; right: -60px; top: -60px; background: radial-gradient(circle, #0891b2, transparent 70%); animation: float 15s ease-in-out infinite reverse; }
.b3 { width: 380px; height: 380px; left: 50%; bottom: -180px; transform: translateX(-50%); background: radial-gradient(circle, #7c3aed, transparent 70%); animation: float 18s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-26px) scale(1.06); }
}

.hero-inner { position: relative; max-width: 720px; margin: 0 auto; }
.badge {
  display: inline-block;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #c7d2fe;
  background: rgba(99, 102, 241, .12);
  border: 1px solid rgba(129, 140, 248, .35);
}
.badge.dark {
  color: #c7d2fe;
  background: rgba(99, 102, 241, .10);
  border: 1px solid rgba(129, 140, 248, .25);
}
.hero h1 {
  margin: 22px 0 14px;
  font-size: clamp(34px, 7vw, 64px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -1px;
}
.hero h1 .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub { margin: 0 auto 30px; max-width: 560px; color: var(--text-dim); font-size: 17px; font-weight: 300; line-height: 1.7; }

.calc-form { max-width: 600px; margin: 0 auto; }
.input-shell {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
.input-prefix {
  flex: 0 0 auto;
  padding: 12px 4px 12px 14px;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 15px;
}
#num-input {
  flex: 1;
  min-width: 0;
  padding: 14px 6px;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: "Space Grotesk", "Prompt", monospace;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 3px;
  text-align: center;
}
#num-input::placeholder { color: #4a5368; letter-spacing: 1px; font-size: 16px; }
.btn {
  flex: 0 0 auto;
  padding: 14px 26px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 10px 26px rgba(99, 102, 241, .4);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 14px 32px rgba(139, 92, 246, .5); }
.btn:active { transform: translateY(0); }
.error { display: none; margin-top: 14px; color: var(--bad); font-size: 14px; font-weight: 500; }

.hero-stats { display: flex; justify-content: center; gap: 42px; margin-top: 42px; }
.stat { text-align: center; }
.stat b {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  font-size: 26px;
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat span { font-size: 13px; color: var(--text-dim); }

/* ---------------- Result ---------------- */
.result { display: none; padding: 30px 0 20px; }
.result.show { display: block; animation: fade .45s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(14px);} to { opacity: 1; transform: none;} }

.card {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
  backdrop-filter: blur(6px);
}

/* Score overview */
.score-card { padding: 26px; display: grid; gap: 22px; }
.score-main { display: flex; align-items: baseline; gap: 14px; }
.score-number {
  font-family: "Space Grotesk", "Prompt", monospace;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 700;
  letter-spacing: 2px;
}
.score-meta { color: var(--text-dim); font-size: 14px; }
.score-meta b { color: #fff; }

.score-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.score-value { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.score-label { color: var(--text-dim); font-size: 14px; }
.score-big {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(44px, 7vw, 64px);
  font-weight: 700;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}
.score-unit { color: var(--text-dim); font-size: 14px; }

.grade-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 16px 22px;
  border-radius: 16px;
  background: rgba(99, 102, 241, .08);
  border: 1px solid rgba(129, 140, 248, .3);
  min-width: 110px;
}
.grade-letter { font-size: 40px; font-weight: 800; line-height: 1; }
.grade-text { font-size: 12px; color: var(--text-dim); }

.gender-line { color: var(--text-dim); font-size: 14px; }
.gender-line b { color: #fff; }

.grade-bar { display: flex; gap: 5px; }
.grade-cell {
  flex: 1;
  text-align: center;
  padding: 8px 0;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
}
.grade-cell.active {
  color: #fff;
  background: var(--grad);
  border-color: rgba(255, 255, 255, .15);
  box-shadow: 0 8px 20px rgba(99, 102, 241, .45);
}

/* Section headings */
.section-head { margin: 44px 0 18px; }
.section-head.center { text-align: center; }
.section-head h2 { margin: 0 0 6px; font-size: 24px; font-weight: 700; }
.section-head p { margin: 0; color: var(--text-dim); font-size: 14px; }
.section-head.center p { margin: 8px auto 0; max-width: 460px; }

/* Charts */
.charts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-panel { padding: 20px; }
.chart-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.chart-box { position: relative; height: 280px; }
.chart-fallback { color: var(--text-dim); text-align: center; padding: 60px 0; font-size: 14px; }

/* Aspects */
.aspect-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.aspect-item {
  padding: 18px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  transition: border-color .2s, transform .2s;
}
.aspect-item:hover { border-color: rgba(129, 140, 248, .4); transform: translateY(-2px); }
.aspect-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.aspect-name { font-weight: 600; font-size: 15px; }
.aspect-score { font-family: "Space Grotesk", sans-serif; font-weight: 700; color: #a5b4fc; }
.stars { letter-spacing: 1px; line-height: 1; margin-bottom: 8px; }
.star { color: rgba(255, 255, 255, 0.12); font-size: 15px; }
.star.on { color: var(--warn); text-shadow: 0 0 8px rgba(251, 191, 36, .5); }
.aspect-desc { font-size: 13px; color: var(--text-dim); line-height: 1.65; }

/* Pairs */
.pair-list { display: flex; flex-direction: column; gap: 8px; }
.pair-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-left: 4px solid var(--good);
}
.pair-row.pair-bad { border-left-color: var(--bad); }
.pair-no { flex: 0 0 auto; min-width: 54px; font-size: 13px; font-weight: 600; color: var(--text-dim); }
.pair-main { flex: 1; min-width: 0; }
.pair-split {
  display: inline-flex;
  gap: 3px;
  font-family: "Space Grotesk", "Prompt", monospace;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
}
.split-prefix, .split-suffix { color: #4a5368; }
.split-pair {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  padding: 1px 8px;
  border-radius: 6px;
}
.pair-row.pair-bad .split-pair { background: linear-gradient(135deg, #f43f5e, #fb7185); }
.pair-meaning { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.pair-power { font-weight: 700; margin-left: 8px; font-family: "Space Grotesk", sans-serif; }
.pair-power.pos { color: var(--good); }
.pair-power.neg { color: var(--bad); }

/* Summary */
.summary-card { padding: 22px 24px; }
.summary-head { font-weight: 600; font-size: 15px; margin: 0 0 8px; }
.summary-list { margin: 0 0 10px; padding-left: 20px; line-height: 2; color: var(--text-dim); }
.summary-list b { color: #fff; }
.disclaimer { font-size: 12px; color: #4a5368; margin: 0; }

/* ---------------- Sections (features / how) ---------------- */
.section { padding: 40px 0; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 30px; }
.feature-card {
  padding: 26px 24px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  transition: border-color .2s, transform .2s;
}
.feature-card:hover { border-color: rgba(129, 140, 248, .35); transform: translateY(-3px); }
.feature-icon {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  border-radius: 13px;
  font-size: 22px;
  background: rgba(99, 102, 241, .14);
  border: 1px solid rgba(129, 140, 248, .3);
  margin-bottom: 16px;
}
.feature-card h3 { margin: 0 0 8px; font-size: 17px; }
.feature-card p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.7; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 30px; }
.step {
  padding: 24px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  text-align: center;
}
.step-num {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  color: #fff;
  background: var(--grad);
  margin-bottom: 12px;
}
.step b { display: block; margin-bottom: 4px; font-size: 16px; }
.step p { margin: 0; color: var(--text-dim); font-size: 13px; }

/* ---------------- Footer ---------------- */
footer { border-top: 1px solid var(--border-soft); padding: 30px 0 40px; margin-top: 20px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner p { margin: 0; color: var(--text-dim); font-size: 13px; }

/* ---------------- Responsive ---------------- */
@media (max-width: 820px) {
  .aspect-grid, .feature-grid, .steps, .charts-grid { grid-template-columns: 1fr 1fr; }
  .score-hero { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .aspect-grid, .feature-grid, .steps, .charts-grid { grid-template-columns: 1fr; }
  .input-shell { flex-direction: column; align-items: stretch; }
  .input-prefix { display: none; }
  #num-input { text-align: center; }
  .btn { width: 100%; }
  .hero-stats { gap: 24px; }
  .pair-row { flex-wrap: wrap; }
  .footer-inner { flex-direction: column; text-align: center; }
}
