:root {
  --bg: #050507;
  --bg-alt: #08090c;
  --text: #f2f2f5;
  --muted: #8b8d98;
  --line: rgba(255,255,255,0.08);
  --accent: #4de1ff;
  --accent-2: #7c5cff;
  --xrp: #4de1ff;
  --btc: #f7931a;
  --eth: #a892ff;
  --sol: #ff6bd6;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
  position: relative;
}

#starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* NAV */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(5,5,7,0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-weight: 800;
  letter-spacing: 4px;
  font-size: 15px;
  color: var(--text);
}
.logo.small { font-size: 13px; letter-spacing: 3px; color: var(--muted); }
.nav-links { display: flex; gap: 36px; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.5px;
  transition: color 0.2s ease;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: 10px 20px;
  border-radius: 100px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(255,255,255,0.15); }

/* HERO */
.hero {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 220px 32px 100px;
  text-align: center;
}
.hero-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 500px;
  background: radial-gradient(circle, rgba(77,225,255,0.18) 0%, rgba(124,92,255,0.08) 40%, transparent 70%);
  filter: blur(20px);
  z-index: -1;
}
.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: 58px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -1.5px;
  margin-bottom: 24px;
}
.grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.6;
  max-width: 620px;
  margin: 0 auto 40px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 90px;
}
.btn-primary {
  background: var(--text);
  color: var(--bg);
  border: none;
  padding: 14px 28px;
  border-radius: 100px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(77,225,255,0.25); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 14px 28px;
  border-radius: 100px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.03); }

.stat-row {
  display: flex;
  justify-content: center;
  gap: 60px;
  border-top: 1px solid var(--line);
  padding-top: 36px;
}
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-num { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.stat-label { font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }

/* SECTIONS */
.section {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 140px 32px;
}
.section.alt { background: linear-gradient(180deg, transparent, rgba(255,255,255,0.015), transparent); max-width: 100%; }
.section.alt > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
.section-head { text-align: center; margin-bottom: 60px; }
.section-head h2 {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -1px;
  margin: 12px 0 16px;
}
.section-sub {
  color: var(--muted);
  font-size: 16px;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

.chart-wrap {
  position: relative;
  background: radial-gradient(circle at 50% 40%, rgba(77,225,255,0.05), transparent 60%), var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  height: 560px;
}
.line-wrap { height: 420px; }
#orbitChart, #lineChart { width: 100%; height: 100%; display: block; }

.legend {
  position: absolute;
  top: 32px;
  left: 32px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
}
.legend-item { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

.toggle-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}
.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  font-family: var(--font);
}
.toggle.active { color: var(--text); border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.04); }
.toggle-dot { width: 8px; height: 8px; border-radius: 50%; }

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.pillar {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 28px;
  background: rgba(255,255,255,0.015);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.pillar:hover { border-color: rgba(255,255,255,0.2); transform: translateY(-4px); }
.pillar-num {
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 16px;
}
.pillar h3 { font-size: 19px; margin-bottom: 10px; font-weight: 600; }
.pillar p { color: var(--muted); font-size: 14px; line-height: 1.6; }

.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  padding: 40px 32px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer-inner p { color: var(--muted); font-size: 12px; }

/* ===== App pages (dashboard / lessons / login) ===== */
.page {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 130px 32px 80px;
}
.page-title { font-size: 34px; font-weight: 700; letter-spacing: -1px; margin-bottom: 8px; }
.page-sub { color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 640px; margin-bottom: 40px; }

.card {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
}
.card h3 { font-size: 15px; font-weight: 600; color: var(--accent); letter-spacing: 0.5px; margin-bottom: 4px; }
.card .card-note { color: var(--muted); font-size: 12px; line-height: 1.5; margin-bottom: 18px; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.dash-grid .wide { grid-column: 1 / -1; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; color: var(--muted); font-weight: 500; padding: 8px 10px;
  border-bottom: 1px solid var(--line); font-size: 11px; letter-spacing: 0.5px; text-transform: uppercase;
}
.data-table td { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,0.04); }
.data-table tr.highlight td { color: var(--accent); font-weight: 600; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 11px; font-weight: 600; letter-spacing: 0.3px; }
.pill.new { background: rgba(77,225,255,0.12); color: var(--accent); }
.pill.full { background: rgba(124,92,255,0.15); color: var(--accent-2); }
.pill.warn { background: rgba(247,147,26,0.15); color: #f7931a; }
.pill.ok { background: rgba(80,220,140,0.12); color: #50dc8c; }

.price-big { font-size: 42px; font-weight: 800; letter-spacing: -1px; }
.price-big.tick-up { animation: flashUp 0.6s ease; }
.price-big.tick-down { animation: flashDown 0.6s ease; }
@keyframes flashUp { 0% { color: #50dc8c; } 100% { color: var(--text); } }
@keyframes flashDown { 0% { color: #ff6b6b; } 100% { color: var(--text); } }

.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #50dc8c;
  margin-right: 5px;
  vertical-align: middle;
  animation: livePulse 2s ease-out infinite;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(80,220,140,0.45); }
  70%  { box-shadow: 0 0 0 7px rgba(80,220,140,0); }
  100% { box-shadow: 0 0 0 0 rgba(80,220,140,0); }
}
.price-change { font-size: 15px; font-weight: 600; margin-left: 10px; }
.price-change.up { color: #50dc8c; }
.price-change.down { color: #ff6b6b; }
.data-source { color: var(--muted); font-size: 11px; margin-top: 6px; }

#priceChart { width: 100%; height: 340px; display: block; }

.caveat {
  border-left: 3px solid var(--accent-2);
  padding: 14px 18px;
  background: rgba(124,92,255,0.06);
  border-radius: 0 10px 10px 0;
  font-size: 13px; color: var(--muted); line-height: 1.65;
}

/* Auth */
.auth-box { max-width: 420px; margin: 0 auto; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 24px; }
.auth-tab {
  flex: 1; padding: 10px; border-radius: 12px; border: 1px solid var(--line);
  background: transparent; color: var(--muted); font-family: var(--font);
  font-weight: 600; font-size: 13px; cursor: pointer; transition: all 0.2s ease;
}
.auth-tab.active { color: var(--text); border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.04); }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.auth-field input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text);
  padding: 12px 14px; border-radius: 10px; font-family: var(--font); font-size: 14px;
}
.auth-field input:focus { outline: none; border-color: var(--accent); }
.auth-error { color: #ff6b6b; font-size: 13px; margin: 10px 0; min-height: 18px; }
.btn-block { width: 100%; }

.account-chip {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 100px; padding: 6px 14px 6px 8px;
  font-size: 12px; color: var(--muted);
}
.account-chip .avatar {
  width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: var(--bg);
  font-weight: 700; font-size: 11px;
}
.link-btn { background: none; border: none; color: var(--accent); font-family: var(--font); font-size: 12px; cursor: pointer; padding: 0; }

/* Lessons */
.lesson-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.lesson { border: 1px solid var(--line); border-radius: 16px; background: var(--bg-alt); overflow: hidden; }
.lesson-head {
  display: flex; align-items: center; gap: 16px; padding: 20px 24px; cursor: pointer;
  transition: background 0.2s ease;
}
.lesson-head:hover { background: rgba(255,255,255,0.02); }
.lesson-num { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: 1px; min-width: 28px; }
.lesson-title { font-size: 16px; font-weight: 600; flex: 1; }
.lesson-body { display: none; padding: 0 24px 24px 68px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.lesson.open .lesson-body { display: block; }
.lesson-body h4 { color: var(--text); font-size: 14px; margin: 18px 0 6px; }
.lesson-body .honest { color: var(--accent-2); font-weight: 600; }
.lesson.locked .lesson-head { opacity: 0.55; }

/* Lock overlay */
.lock-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(5,5,7,0.82); backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.lock-inner { max-width: 420px; padding: 32px; }
.lock-inner h2 { font-size: 26px; margin-bottom: 12px; letter-spacing: -0.5px; }
.lock-inner p { color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 24px; }

.disclaimer {
  max-width: 1100px; margin: 40px auto 0; padding: 0 32px;
  color: var(--muted); font-size: 11px; line-height: 1.6; text-align: center;
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .hero h1 { font-size: 38px; }
  .stat-row { flex-wrap: wrap; gap: 28px 40px; }
  .pillars { grid-template-columns: 1fr; }
  .dash-grid { grid-template-columns: 1fr; }
}
