:root {
  --bg: #0a0e15;
  --bg-elev: #111827;
  --bg-elev-2: #1A2332;
  --border: rgba(255,255,255,0.06);
  --border-strong: rgba(255,255,255,0.12);
  --text: #E5E7EB;
  --text-muted: #94A3B8;
  --text-faint: #475569;
  --accent: #8EA2FF;
  --accent-bg: rgba(142,162,255,0.08);
  --amber: #FBBF24;
  --amber-bg: rgba(251,191,36,0.08);
  --blue: #60A5FA;
  --blue-bg: rgba(96,165,250,0.08);
  --pos: #4ADE80;
  --neg: #F87171;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Urbanist', -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── SHELL ── */
.shell { display: block; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: 96px;
  background: #070C17;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 16px;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}
.nav-item {
  width: 84px; height: 52px;
  border-radius: 10px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
  text-decoration: none;
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.05); }
.nav-item.active { background: var(--accent-bg); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -1px; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 22px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}
.nav-item.disabled { opacity: 0.3; cursor: not-allowed; pointer-events: none; }
.nav-icon {
  font-size: 19px;
  color: var(--text-faint);
  line-height: 1;
}
.nav-item.active .nav-icon { color: var(--accent); }
.nav-item:hover:not(.disabled) .nav-icon { color: var(--text-muted); }
.nav-label {
  font-family: 'Urbanist', ui-sans-serif, sans-serif;
  font-size: 8px;
  color: var(--text-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.1;
  width: 100%; white-space: nowrap;
}
.nav-item.active .nav-label { color: var(--accent); }
.nav-divider { width: 32px; height: 1px; background: var(--border); margin: 8px 0; }
.nav-bottom { margin-top: auto; }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
}
/* ── MAIN ── */
.main { margin-left: 96px; min-width: 0; }

/* ── TOPBAR ── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,15,28,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 48px 0 24px;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar-brand { display: flex; align-items: center; gap: 12px; }
.wordmark { display: flex; align-items: center; gap: 10px; }
.ae-topbar-logo {
  display: inline-flex; align-items: center; text-decoration: none;
  height: 34px; min-width: 160px;
}
.ae-topbar-logo img {
  width: 154px; height: auto; display: block;
  object-fit: contain; object-position: left center;
}
.ae-topbar-logout-form { margin: 0; display: inline-flex; }
.ae-topbar-logout {
  min-width: 76px; height: 32px;
  border-radius: 999px;
  background: var(--bg-elev-2);
  border: 1px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Urbanist', ui-sans-serif, sans-serif;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 12px;
  text-decoration: none;
}
.ae-topbar-logout:hover { color: var(--accent); border-color: rgba(142,162,255,0.5); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.live-badge {
  display: flex; align-items: center; gap: 6px;
  font-family: 'Urbanist', ui-sans-serif, sans-serif;
  font-size: 10px; color: var(--text-faint);
  letter-spacing: 0.06em;
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--pos);
  box-shadow: 0 0 6px rgba(74,222,128,0.6);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── HERO ── */
.hero {
  position: relative;
  display: flex; flex-direction: column; align-items: stretch;
  gap: 36px;
  padding: 88px 48px 56px;
  overflow: hidden;
  /* Full-width chart/wave graphic anchored right; left side darkened by
     the .hero::before gradient so headline + subtext remain readable. */
  background-image: url('/static/images/slider-1.png');
  background-repeat: no-repeat;
  background-position: 75% center;
  background-size: cover;
  background-color: var(--bg);
}
.hero::before {
  content: '';
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  /* Dark left → mid-transparent → dark right (so image doesn't bleed past),
     plus a bottom-fade so the hero blends into the next section. */
  background:
    linear-gradient(to right,
      rgba(10,15,28,0.97) 0%,
      rgba(10,15,28,0.90) 40%,
      rgba(10,15,28,0.75) 65%,
      rgba(10,15,28,0.95) 85%,
      rgba(10,15,28,1.0) 100%),
    linear-gradient(to bottom,
      rgba(10,15,28,0) 0%,
      rgba(10,15,28,0) 65%,
      rgba(10,15,28,1.0) 100%);
}
#hero-canvas {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
}
.hero-content { position: relative; z-index: 1; max-width: 680px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Urbanist', ui-sans-serif, sans-serif;
  font-size: 10px; color: var(--accent);
  letter-spacing: 0.1em; text-transform: uppercase;
  border: 1px solid rgba(142,162,255,0.2);
  border-radius: 4px;
  padding: 5px 10px;
  margin-bottom: 28px;
  background: var(--accent-bg);
}
.hero-badge-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.hero-title {
  font-size: 52px; font-weight: 700;
  line-height: 1.1; letter-spacing: 0;
  color: var(--text);
  margin-bottom: 8px;
}
.hero-title .market-gradient {
  background: linear-gradient(90deg, #FF5AE1 0%, #6D96FF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.hero-title .dim { color: var(--text-muted); font-weight: 300; }
.hero-subtitle {
  font-size: 16px; color: var(--text-muted);
  line-height: 1.7; max-width: 520px;
  margin-bottom: 40px;
  font-weight: 400;
}
.hero-subtitle strong { color: var(--text); font-weight: 500; }
/* ── Hero CTAs + stat strip ── */
.hero-actions { display: flex; gap: 12px; align-items: center; margin-bottom: 56px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent);
  color: #0A0F1C;
  font-family: 'Urbanist', ui-sans-serif, sans-serif;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.15s;
  border: none; cursor: pointer;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent;
  color: var(--amber);
  font-family: 'Urbanist', ui-sans-serif, sans-serif;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 10px 20px;
  border-radius: 6px;
  border: 1px solid rgba(251,191,36,0.3);
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
  cursor: pointer;
}
.btn-secondary:hover { background: var(--amber-bg); transform: translateY(-1px); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent;
  color: var(--text-faint);
  font-family: 'Urbanist', ui-sans-serif, sans-serif;
  font-size: 11px;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 10px 20px;
  border-radius: 6px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.15s;
  cursor: pointer;
}
.btn-ghost:hover { background: var(--bg-elev); color: var(--text-muted); }
.hero-stats {
  display: flex; gap: 0;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}
.hero-stat {
  display: flex; flex-direction: column; gap: 4px;
  padding-right: 32px; margin-right: 32px;
  border-right: 1px solid var(--border);
}
.hero-stat:last-child { border-right: none; padding-right: 0; margin-right: 0; }
.hero-stat-num {
  font-size: 26px; font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
  font-family: 'Urbanist', sans-serif;
}
.hero-stat-num.amber { color: var(--amber); }
.hero-stat-num.blue { color: var(--blue); }
.hero-stat-label {
  font-family: 'Urbanist', ui-sans-serif, sans-serif;
  font-size: 9px; color: var(--text-faint);
  letter-spacing: 0.1em; text-transform: uppercase;
}

/* ── SECTION COMMON ── */
.section { padding: 80px 48px; }
.section-label {
  font-family: 'Urbanist', ui-sans-serif, sans-serif;
  font-size: 10px; color: var(--text-faint);
  letter-spacing: 0.16em; text-transform: uppercase;
  margin-bottom: 10px;
}
.section-title {
  font-size: 28px; font-weight: 600;
  letter-spacing: -0.02em; color: var(--text);
  margin-bottom: 6px;
  line-height: 1.25;
}
.section-sub {
  font-size: 14px; color: var(--text-muted);
  max-width: 560px; line-height: 1.7;
  margin-bottom: 40px;
}

/* ── PRODUCTS ── */
/* Cards now live INSIDE the hero (no separate section wrapper). The
   grid sits flush over the hero's gradient backdrop. */
.products-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(3,1fr); gap: 1px;
  background: var(--border);
  border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden;
}
.product-card {
  background: var(--bg-elev);
  padding: 32px 28px;
  display: flex; flex-direction: column;
  position: relative;
  transition: background 0.15s;
}
.product-card:hover { background: var(--bg-elev-2); }
.product-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}
.product-card.views::before { background: var(--accent); }
.product-card.trade::before { background: var(--amber); }
.product-card.api::before { background: var(--blue); }
.product-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 20px;
}
.product-icon.views { background: var(--accent-bg); color: var(--accent); }
.product-icon.trade { background: var(--amber-bg); color: var(--amber); }
.product-icon.api { background: var(--blue-bg); color: var(--blue); }
.product-name {
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.01em; color: var(--text);
  margin-bottom: 4px;
}
.product-name .accent-views { color: var(--accent); }
.product-name .accent-trade { color: var(--amber); }
.product-name .accent-api { color: var(--blue); }
.product-tag {
  font-family: 'Urbanist', ui-sans-serif, sans-serif;
  font-size: 9px; color: var(--text-faint);
  letter-spacing: 0.1em; text-transform: uppercase;
  margin-bottom: 16px;
}
.product-desc {
  font-size: 12.5px; color: var(--text-muted);
  line-height: 1.65; flex: 1;
  margin-bottom: 20px;
}
.product-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.chip {
  font-family: 'Urbanist', ui-sans-serif, sans-serif;
  font-size: 9.5px; padding: 3px 8px;
  border-radius: 4px; letter-spacing: 0.04em;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--bg);
}
.product-note {
  font-size: 11px; color: rgba(251,191,36,0.6);
  border: 1px solid rgba(251,191,36,0.12);
  border-radius: 6px; padding: 10px 12px;
  line-height: 1.6; margin-bottom: 16px;
  background: rgba(251,191,36,0.03);
}
.product-cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Urbanist', ui-sans-serif, sans-serif;
  font-size: 10px; letter-spacing: 0.06em;
  text-decoration: none;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  transition: gap 0.15s;
}
.product-cta:hover { gap: 10px; }
.product-cta.views { color: var(--accent); }
.product-cta.trade { color: var(--amber); }
.product-cta.api { color: var(--blue); }
.product-cta.disabled { color: var(--text-faint); cursor: not-allowed; pointer-events: none; }
.product-cta.api.disabled { color: var(--blue); }

/* ── WHAT POWERS THE PLATFORM (3×2 capability grid) ── */
.powers-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.power-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.power-card::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--pc-color, var(--accent));
  border-radius: 0 0 12px 12px;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.power-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
}
.power-card:hover::after { opacity: 1; }
.power-card.logo-blue { --pc-color: var(--accent); }
.power-card.amber  { --pc-color: var(--amber); }
.power-card.blue   { --pc-color: var(--blue); }
.power-card.ice-blue { --pc-color: #C7D2FE; }
.power-card.green  { --pc-color: var(--pos); }
.power-icon {
  font-size: 22px; line-height: 1;
  width: 38px; height: 38px; border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--pc-color, var(--accent));
}
.power-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  letter-spacing: -0.01em;
}
.power-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }
.power-bullets {
  list-style: none; padding: 0; margin: 4px 0 0;
  display: flex; flex-direction: column; gap: 6px;
}
.power-bullets li {
  font-family: 'Urbanist', ui-sans-serif, sans-serif;
  font-size: 10.5px; color: var(--text-faint);
  letter-spacing: 0.02em;
  padding-left: 14px; position: relative;
}
.power-bullets li::before {
  content: '·';
  position: absolute; left: 4px; top: -1px;
  color: var(--pc-color, var(--accent));
  font-weight: 700;
}

/* ── WHO THIS IS BUILT FOR (4 flip cards) ── */
.personas-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.persona-card {
  perspective: 1200px;
  height: 260px;
}
.persona-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}
.persona-card:hover .persona-inner { transform: rotateY(180deg); }
.persona-face {
  position: absolute; inset: 0;
  border: 1px solid var(--persona-color, var(--accent));
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column;
  background: var(--bg-elev);
}
.persona-card.logo-blue { --persona-color: rgba(142,162,255,0.40); }
.persona-card.amber  { --persona-color: rgba(251,191,36,0.40); }
.persona-card.blue   { --persona-color: rgba(96,165,250,0.40); }
.persona-card.ice-blue { --persona-color: rgba(199,210,254,0.40); }
.persona-front {
  align-items: center; justify-content: center; gap: 14px;
  padding: 24px;
}
.persona-icon-wrap {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--persona-color, var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.persona-title {
  font-size: 16px; font-weight: 600; color: var(--text);
  letter-spacing: -0.01em; text-align: center;
}
.persona-tagline {
  font-size: 12px; color: var(--text-muted);
  text-align: center; line-height: 1.5;
  font-style: italic;
}
.persona-back {
  transform: rotateY(180deg);
  background: var(--bg-elev-2);
  padding: 24px;
  gap: 12px;
}
.persona-back-desc {
  font-size: 12px; color: var(--text-muted); line-height: 1.6;
}
.persona-back-bullets {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 5px;
}
.persona-back-bullets li {
  font-size: 11px; color: var(--text-muted); line-height: 1.45;
  padding-left: 12px; position: relative;
}
.persona-back-bullets li::before {
  content: '·';
  position: absolute; left: 2px; top: -1px;
  color: var(--persona-color, var(--accent));
  font-weight: 700;
}

/* ── FOOTER ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 28px 48px;
  display: flex; align-items: center; justify-content: space-between;
}
.footer-brand {
  font-family: 'Urbanist', ui-sans-serif, sans-serif;
  font-size: 11px; color: var(--text-faint);
  letter-spacing: 0.04em;
}
.footer-links { display: flex; gap: 24px; }
.footer-link {
  font-family: 'Urbanist', ui-sans-serif, sans-serif;
  font-size: 10px; color: var(--text-faint);
  text-decoration: none; letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.15s;
}
.footer-link:hover { color: var(--text-muted); }

@media (max-width: 1180px) {
  .hero { padding: 72px 36px 48px; }
  .hero-title { font-size: 46px; }
  .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-card.api { grid-column: 1 / -1; }
  .powers-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .personas-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .main { margin-left: 60px; min-width: 0; }
  .topbar { height: 54px; padding: 0 16px 0 14px; }
  .ae-topbar-logo { min-width: 132px; height: 30px; }
  .ae-topbar-logo img { width: 132px; }
  .topbar-right { gap: 10px; }
  .live-badge { display: none; }
  .avatar { width: 30px; height: 30px; }

  .hero {
    gap: 28px;
    padding: 56px 18px 36px;
    background-position: 64% center;
  }
  .hero::before {
    background:
      linear-gradient(to right,
        rgba(10,15,28,0.98) 0%,
        rgba(10,15,28,0.94) 52%,
        rgba(10,15,28,0.84) 78%,
        rgba(10,15,28,0.98) 100%),
      linear-gradient(to bottom,
        rgba(10,15,28,0) 0%,
        rgba(10,15,28,0.26) 62%,
        rgba(10,15,28,1.0) 100%);
  }
  .hero-content { max-width: none; }
  .hero-badge {
    max-width: 100%;
    flex-wrap: wrap;
    font-size: 9px;
    line-height: 1.35;
    margin-bottom: 22px;
  }
  .hero-title { font-size: 38px; line-height: 1.12; }
  .hero-subtitle {
    font-size: 14px;
    line-height: 1.65;
    max-width: none;
    margin-bottom: 24px;
  }
  .hero-actions { flex-wrap: wrap; margin-bottom: 34px; }
  .hero-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .hero-stat {
    padding: 0 0 14px;
    margin: 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .hero-stat:last-child { border-bottom: 0; }

  .products-grid,
  .powers-grid,
  .personas-grid {
    grid-template-columns: 1fr;
  }
  .product-card.api { grid-column: auto; }
  .product-card { padding: 24px 20px; }
  .product-icon { margin-bottom: 16px; }
  .product-desc { margin-bottom: 16px; }
  .product-chips { margin-bottom: 16px; }

  .section { padding: 56px 18px; }
  .section-title { font-size: 24px; line-height: 1.25; }
  .section-sub { margin-bottom: 28px; }
  .power-card { padding: 22px 20px; }

  .footer {
    padding: 24px 18px 28px;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .footer-links {
    gap: 14px;
    flex-wrap: wrap;
  }
}

@media (max-width: 460px) {
  .hero { padding: 44px 14px 30px; }
  .hero-title { font-size: 31px; }
  .hero-badge { font-size: 8.5px; letter-spacing: 0.08em; }
  .product-card,
  .power-card,
  .persona-front,
  .persona-back {
    padding: 20px 16px;
  }
  .section { padding: 44px 14px; }
  .section-title { font-size: 22px; }
  .chip { font-size: 9px; }
}

@media (hover: none), (pointer: coarse) {
  .persona-card {
    height: auto;
    perspective: none;
  }
  .persona-inner {
    height: auto;
    transform: none !important;
    transform-style: flat;
    display: grid;
    gap: 1px;
    border: 1px solid var(--persona-color, var(--accent));
    border-radius: 12px;
    overflow: hidden;
    background: var(--persona-color, var(--accent));
  }
  .persona-card:hover .persona-inner { transform: none; }
  .persona-face {
    position: relative;
    inset: auto;
    border: 0;
    border-radius: 0;
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
  }
  .persona-back { transform: none; }
}
