/* QuantX site — global styles. Tailwind via CDN supplies utilities; this file
   defines the brand layer: tokens, hero atmosphere, motion, custom components. */

:root {
  --bg-base: #060911;
  --bg-elevated: #0c1220;
  --bg-elevated-2: #111a2e;
  --bg-nav: rgba(6, 9, 17, 0.78);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);
  --border-brand: rgba(74, 140, 255, 0.30);

  --brand-blue: #4a8cff;
  --brand-blue-light: #7ba3ff;
  --brand-blue-press: #3a72d8;
  --brand-blue-tint: rgba(74, 140, 255, 0.12);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.14);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.14);
  --warn: #f59e0b;
  --purple: #a78bfa;

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;   /* was #94a3b8 — bumped one stop for legibility */
  --text-muted: #94a3b8;       /* was #64748b — minimum body contrast on dark */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

::selection { background: var(--brand-blue); color: #ffffff; }

/* ---------- Tokens used as utility classes ---------- */
.bg-base { background: var(--bg-base); }
.bg-elevated { background: var(--bg-elevated); }
.bg-elevated-2 { background: var(--bg-elevated-2); }
.bg-brand { background: var(--brand-blue); }
.bg-brand-tint { background: var(--brand-blue-tint); }
.text-brand { color: var(--brand-blue); }
.text-brand-light { color: var(--brand-blue-light); }
.text-primary-c { color: var(--text-primary); }
.text-secondary-c { color: var(--text-secondary); }
.text-muted-c { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-purple { color: var(--purple); }
.border-subtle { border-color: var(--border-subtle); }
.border-strong { border-color: var(--border-strong); }
.border-brand { border-color: var(--brand-blue); }
.border-brand-soft { border-color: var(--border-brand); }

/* tabular numerals for any data block */
.tabular { font-variant-numeric: tabular-nums; }

/* Global readability bump — Tailwind's `text-ink-dim` (#94a3b8) and
   `text-ink-mute` (#64748b) tokens are defined in each page's tailwind
   config and used heavily for body text and labels. Override those
   utilities here so body copy lifts to slate-300 and small/mute labels
   lift to slate-400 — both well above the WCAG AA contrast floor on
   our dark surfaces. Page-specific inline color styles still win. */
.text-ink-dim { color: #cbd5e1 !important; }
.text-ink-mute { color: #94a3b8 !important; }

/* ---------- Brand mark ---------- */
.brand-x {
  color: var(--brand-blue);
  font-weight: 800;
  text-shadow: 0 0 18px rgba(74, 140, 255, 0.45);
}

/* Real product logo. The PNG ships its own dark rounded-square frame
   plus a glowing Q glyph, so we don't add a second frame around it —
   just a soft brand-blue halo to make it pop on the nav surface. */
.logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 7px;
  flex-shrink: 0;
  box-shadow: 0 0 16px rgba(74, 140, 255, 0.22);
  display: block;
}
.logo-img.lg { width: 56px; height: 56px; border-radius: 12px; }
.logo-img.xl { width: 72px; height: 72px; border-radius: 14px; }

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-blue);
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 12px;
  box-shadow: 0 8px 24px -8px rgba(74, 140, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: filter 200ms ease, transform 200ms ease, box-shadow 200ms ease;
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative; overflow: hidden;
}
.btn-primary:hover { filter: brightness(1.10); box-shadow: 0 12px 30px -8px rgba(74, 140, 255, 0.7); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: sheen 5s ease-in-out infinite;
}
@keyframes sheen { 0%, 70% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  transition: border-color 200ms ease, background 200ms ease, color 200ms ease;
}
.btn-secondary:hover { border-color: var(--brand-blue); background: var(--brand-blue-tint); }

.btn-ghost {
  color: var(--text-secondary);
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
  transition: color 200ms ease;
}
.btn-ghost:hover { color: var(--text-primary); }
.btn-ghost .arrow { transition: transform 200ms ease; }
.btn-ghost:hover .arrow { transform: translateX(4px); }

.btn-disabled {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-elevated-2);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: 12px;
  border: 1px dashed var(--border-strong);
  cursor: not-allowed;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 28px;
  transition: border-color 300ms ease, transform 300ms ease, box-shadow 300ms ease, background 300ms ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
}
.card:hover {
  border-color: var(--border-brand);
  transform: translateY(-2px);
  box-shadow: 0 14px 40px -22px rgba(74, 140, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.card-glow {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 28px;
}
.card-glow::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: 19px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(74, 140, 255, 0.6), transparent 40%, transparent 60%, rgba(74, 140, 255, 0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

/* ---------- Kicker ---------- */
.kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brand-blue);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  line-height: 1;
}
.badge-coming {
  color: var(--brand-blue-light);
  background: var(--brand-blue-tint);
  border: 1px solid var(--border-brand);
}
.badge-new {
  color: #ffffff;
  background: var(--brand-blue);
  box-shadow: 0 0 14px rgba(74, 140, 255, 0.5);
}
.badge-popular {
  color: #ffffff;
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-light));
  box-shadow: 0 0 22px rgba(74, 140, 255, 0.55);
}
.badge-flagship {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.10);
  border: 1px solid rgba(251, 191, 36, 0.35);
}
.badge-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 999px;
  background: var(--success); margin-right: 8px;
  box-shadow: 0 0 8px var(--success);
  animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ---------- Nav ---------- */
.nav-shell {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: var(--bg-nav);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-link {
  position: relative;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 2px;
  transition: color 200ms ease;
}
.nav-link:hover { color: var(--text-primary); }
.nav-link.active { color: var(--brand-blue); }
.nav-link.active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -8px;
  height: 2px;
  background: var(--brand-blue);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(74, 140, 255, 0.7);
}

/* ---------- Hero atmosphere ---------- */
.hero-mesh {
  position: absolute; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(74, 140, 255, 0.18), transparent 60%),
    radial-gradient(ellipse 50% 40% at 80% 30%, rgba(123, 163, 255, 0.10), transparent 60%),
    radial-gradient(ellipse 70% 60% at 50% 90%, rgba(58, 114, 216, 0.08), transparent 60%);
  animation: mesh-drift 40s ease-in-out infinite;
  z-index: 0;
}
@keyframes mesh-drift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  33% { transform: translate3d(2%, -1%, 0) scale(1.05); }
  66% { transform: translate3d(-1%, 2%, 0) scale(1.03); }
}
.grid-pattern {
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(74, 140, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 140, 255, 0.06) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 30%, transparent 75%);
  z-index: 0;
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1), transform 700ms cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Mobile drawer ---------- */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(6, 9, 17, 0.7);
  backdrop-filter: blur(8px);
  z-index: 60;
  opacity: 0; pointer-events: none;
  transition: opacity 250ms ease;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 86%; max-width: 380px;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-subtle);
  z-index: 61;
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
  padding: 24px;
  overflow-y: auto;
}
.drawer-panel.open { transform: translateX(0); }

/* ---------- Tier card variations ---------- */
.tier-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  padding: 32px;
  transition: border-color 300ms ease, transform 300ms ease, box-shadow 300ms ease;
}
.tier-card:hover { transform: translateY(-4px); border-color: var(--border-brand); }
.tier-card.featured {
  border-color: var(--brand-blue);
  background: linear-gradient(180deg, rgba(74, 140, 255, 0.08), var(--bg-elevated) 60%);
  box-shadow: 0 30px 60px -30px rgba(74, 140, 255, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.tier-card.featured::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: 23px;
  padding: 1px;
  background: linear-gradient(135deg, var(--brand-blue), transparent 50%, var(--brand-blue-light));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}

/* ---------- Accordion ---------- */
.faq-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 200ms ease;
}
.faq-item:hover { border-color: var(--border-brand); }
.faq-item[open] { border-color: var(--border-brand); }
.faq-summary {
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600;
  user-select: none;
}
.faq-summary::-webkit-details-marker { display: none; }
.faq-summary .chev {
  width: 20px; height: 20px;
  transition: transform 250ms ease;
  color: var(--brand-blue);
}
.faq-item[open] .faq-summary .chev { transform: rotate(180deg); }
.faq-body {
  padding: 0 22px 22px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- Tables (admin/account) ---------- */
.tbl {
  width: 100%; border-collapse: collapse;
}
.tbl th, .tbl td {
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
}
.tbl th {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--text-muted);
  font-weight: 600;
}

/* ---------- GEX mock chart ---------- */
.gex-bar {
  height: 14px;
  border-radius: 3px;
  display: flex; align-items: center;
}
.gex-row { display: grid; grid-template-columns: 60px 1fr 60px; gap: 8px; align-items: center; padding: 4px 0; font-size: 11px; }
.gex-strike { color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }
.gex-track { display: flex; align-items: center; height: 14px; }

/* ---------- Equity curve illustration ---------- */
.eq-stroke {
  stroke: var(--brand-blue);
  stroke-width: 2;
  fill: none;
  filter: drop-shadow(0 0 6px rgba(74, 140, 255, 0.6));
}
.eq-fill {
  fill: url(#eqGradient);
  opacity: 0.55;
}

/* ---------- Inputs ---------- */
.input {
  width: 100%;
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 14px;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.input:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(74, 140, 255, 0.18);
}
.input::placeholder { color: var(--text-muted); }
.label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

/* ---------- Footer ---------- */
.footer-shell {
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
}

/* ---------- Coming-soon shimmer card ---------- */
.coming-soon {
  position: relative;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  padding: 20px;
  overflow: hidden;
}
.coming-soon::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(74, 140, 255, 0.08) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: shimmer 3.5s ease-in-out infinite;
}
@keyframes shimmer { 0%, 60% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* ---------- Section dividers ---------- */
.divider-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
}

/* ---------- Stat numbers ---------- */
.stat-value {
  font-size: clamp(2.6rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Stats bar — homepage. All 4 entries share .stat-num / .stat-label
   so font-size, weight, line-height, gradient, and tracking are
   byte-identical regardless of whether the value is a digit, %, or word.
   No animation — countup mid-tween briefly renders narrower digits. */
.stat-num {
  font-size: 2.25rem;             /* matches Tailwind text-4xl */
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
@media (min-width: 768px) {
  .stat-num { font-size: 3rem; }   /* matches Tailwind md:text-5xl */
}
.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  margin-top: 12px;
  line-height: 1.3;
}

/* ---------- Smooth focus rings ---------- */
:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Scrollbar (subtle) ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: rgba(74, 140, 255, 0.18); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(74, 140, 255, 0.32); }

/* ---------- Hero "X" mark special ---------- */
.hero-x { color: var(--brand-blue); font-style: italic; font-weight: 700; }

/* ---------- Utility: max content ---------- */
.container-x { max-width: 1200px; margin-left: auto; margin-right: auto; padding-left: 24px; padding-right: 24px; }
@media (min-width: 768px) { .container-x { padding-left: 32px; padding-right: 32px; } }

/* ---------- Section spacing ---------- */
.section { padding-top: 80px; padding-bottom: 80px; }
@media (min-width: 768px) { .section { padding-top: 128px; padding-bottom: 128px; } }

/* ---------- Hide on small ---------- */
@media (max-width: 767px) { .hide-sm { display: none !important; } }
@media (min-width: 768px) { .hide-md { display: none !important; } }

/* ---------- Mobile drawer link ---------- */
.drawer-link {
  display: block;
  padding: 14px 4px;
  font-size: 18px;
  font-weight: 500;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}
.drawer-link.active { color: var(--brand-blue); }

/* ---------- Tag chip ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--bg-elevated-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.chip svg { width: 12px; height: 12px; }

/* ---------- Prose for legal pages ---------- */
.prose-x { color: var(--text-secondary); line-height: 1.7; max-width: 720px; }
.prose-x h2 { color: var(--text-primary); font-size: 22px; font-weight: 700; margin-top: 36px; margin-bottom: 12px; }
.prose-x h3 { color: var(--text-primary); font-size: 16px; font-weight: 600; margin-top: 24px; margin-bottom: 8px; }
.prose-x p { margin-bottom: 14px; }
.prose-x ul { list-style: disc; padding-left: 24px; margin-bottom: 14px; }
.prose-x li { margin-bottom: 6px; }
.prose-x a { color: var(--brand-blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- Tabs (login/admin) ---------- */
.tab-btn {
  flex: 1;
  padding: 12px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: color 200ms ease, border-color 200ms ease;
  cursor: pointer;
}
.tab-btn.active { color: var(--brand-blue); border-bottom-color: var(--brand-blue); }
