/* ============================================================
   TRADE ZENITH — DESIGN SYSTEM
   Concept: "Celestial Navigation"
   — Zenith is the point directly overhead, the fixed
     reference used to navigate. The brand sits at that point:
     a guiding star for traders.
   — Visual language: obsidian night sky, starlight gold,
     hairline coordinate grids, a single apex light.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,400;1,9..144,500&family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ---------- Tokens (override legacy vars by name) ---------- */
:root {
  /* Surfaces */
  --bg-void: #06070B;
  --bg-base: #0A0B11;
  --bg-raised: #0F1119;
  --bg-elev: #161925;

  /* Legacy aliases kept so existing inline styles inherit the refresh */
  --bg: var(--bg-void);
  --bg-dark: var(--bg-void);
  --bg-mid: var(--bg-base);
  --bg-card: rgba(255, 255, 255, 0.035);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --dark-bg: var(--bg-void);
  --dark-card: var(--bg-raised);

  /* Borders (hairline — suggest coordinate grid) */
  --border: rgba(255, 255, 255, 0.07);
  --border-bright: rgba(255, 255, 255, 0.14);
  --border-gold: rgba(229, 192, 116, 0.22);

  /* Foreground — warm ivory, paper-like */
  --fg: #F4F1EA;
  --fg-dim: #A5A9B5;
  --fg-subtle: #5F6476;
  --text: var(--fg);
  --text-muted: var(--fg-dim);
  --light-text: var(--fg);

  /* Signature accent: starlight gold (apex, premium, celestial) */
  --zenith-gold: #E5C074;
  --zenith-gold-bright: #F3D896;
  --zenith-gold-deep: #A07E3A;
  --zenith-gold-soft: rgba(229, 192, 116, 0.14);
  --zenith-gold-glow: rgba(229, 192, 116, 0.28);

  /* Secondary: astral blue — partner for gradients, night-sky depth */
  --astral: #7B8EFF;
  --astral-deep: #3847A6;
  --astral-soft: rgba(123, 142, 255, 0.12);

  /* Legacy accent aliases → signature gold */
  --accent: var(--zenith-gold);
  --accent-bright: var(--zenith-gold-bright);
  --accent-dim: var(--zenith-gold-soft);
  --accent-glow: var(--zenith-gold-glow);
  --green: var(--zenith-gold);
  --green-dark: var(--zenith-gold-deep);
  --gold: var(--zenith-gold);
  --blue: var(--astral);

  /* Status — refined for traders */
  --success: #5FD49C;
  --success-soft: rgba(95, 212, 156, 0.12);
  --danger: #F06A6A;
  --danger-soft: rgba(240, 106, 106, 0.12);
  --warning: #E8B869;
  --red: var(--danger);

  /* Radii */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Typography */
  --font-display: 'Fraunces', 'Times New Roman', ui-serif, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font: var(--font-sans);

  /* Motion */
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 12px 40px rgba(229, 192, 116, 0.18);
}

/* ---------- Base typography ---------- */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-feature-settings: 'ss01', 'cv11', 'cv02';
  letter-spacing: -0.005em;
  color: var(--fg);
  background: var(--bg-void);
}

h1, h2, h3, .display, .zenith-display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
  font-variation-settings: 'opsz' 96;
}

h1, .display-xl { font-size: clamp(2.5rem, 6vw, 4.75rem); }
h2, .display-lg { font-size: clamp(2rem, 4.5vw, 3.25rem); }
h3, .display-md { font-size: clamp(1.5rem, 3vw, 2.25rem); }

.display em, .zenith-display em, h1 em, h2 em, h3 em {
  font-style: italic;
  color: var(--zenith-gold);
  font-variation-settings: 'opsz' 144;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--zenith-gold);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--zenith-gold);
  opacity: 0.6;
}

/* Numerical/tabular data — traders expect mono for prices */
.mono, .tabular, code, kbd,
.price, .pnl, .stat-value, .points-counter, .streak-counter {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum', 'zero';
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ---------- Signature element: the Zenith Mark ----------
   A single apex star — used as a bullet, divider, brand dot.
   ---------------------------------------------------------- */
.zenith-mark {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  vertical-align: -0.08em;
  background: currentColor;
  color: var(--zenith-gold);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 1.5 13.9 10.1 22.5 12 13.9 13.9 12 22.5 10.1 13.9 1.5 12 10.1 10.1 Z'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 1.5 13.9 10.1 22.5 12 13.9 13.9 12 22.5 10.1 13.9 1.5 12 10.1 10.1 Z'/></svg>") center/contain no-repeat;
  filter: drop-shadow(0 0 6px rgba(229, 192, 116, 0.55));
}

.zenith-mark.lg { width: 1.4em; height: 1.4em; }
.zenith-mark.sm { width: 0.7em; height: 0.7em; }

/* Orbit dot — small pulsing star-point for emphasis */
.zenith-orbit {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--zenith-gold);
  box-shadow: 0 0 12px var(--zenith-gold-glow);
}
.zenith-orbit::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--zenith-gold);
  opacity: 0.4;
  animation: zenith-pulse 2.8s var(--ease-out) infinite;
}
@keyframes zenith-pulse {
  0%   { transform: scale(0.6); opacity: 0.7; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* ---------- Signature element: the Zenith Aura ----------
   A cone of light emanating from the top-center of a section,
   as if from the zenith position directly overhead.
   -------------------------------------------------------- */
.zenith-aura {
  position: relative;
  isolation: isolate;
}
.zenith-aura::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(229, 192, 116, 0.14) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 50% -5%, rgba(243, 216, 150, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 100% 70% at 80% 110%, rgba(123, 142, 255, 0.06) 0%, transparent 55%);
  pointer-events: none;
}

/* Page-level aura applied to body */
.zenith-page {
  background: var(--bg-void);
  background-image:
    radial-gradient(ellipse 90% 55% at 50% -15%, rgba(229, 192, 116, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(243, 216, 150, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 120% 80% at 90% 110%, rgba(123, 142, 255, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 10% 100%, rgba(56, 71, 166, 0.04) 0%, transparent 55%);
  background-attachment: fixed;
}

/* ---------- Signature element: Hairline Meridian ----------
   A 1px gradient line, brightest at center — suggests the
   meridian, the horizon at the zenith. Used at top of cards,
   below headings, in hero dividers.
   ----------------------------------------------------------- */
.zenith-meridian {
  position: relative;
}
.zenith-meridian::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(229, 192, 116, 0.0) 15%,
    rgba(229, 192, 116, 0.55) 50%,
    rgba(229, 192, 116, 0.0) 85%,
    transparent 100%
  );
  pointer-events: none;
}

.zenith-meridian-bottom::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.08) 50%,
    transparent
  );
  pointer-events: none;
}

/* ---------- Signature element: Coordinate Grid ----------
   Barely-visible grid lines suggesting a star chart.
   Apply .zenith-grid to any container for subtle texture.
   -------------------------------------------------------- */
.zenith-grid {
  position: relative;
}
.zenith-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 30%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}
.zenith-grid > * { position: relative; z-index: 1; }

/* ---------- Card: premium glass surface ---------- */
.zenith-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.045) 0%, rgba(255,255,255,0.015) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}
.zenith-card.with-meridian::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(229, 192, 116, 0.45) 50%,
    transparent
  );
}

/* ---------- Button: refined primary ---------- */
.zenith-btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.25s var(--ease-out);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.zenith-btn-primary {
  background: linear-gradient(180deg, var(--zenith-gold-bright) 0%, var(--zenith-gold) 100%);
  color: #1A1408;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.25) inset,
    0 -1px 0 rgba(0, 0, 0, 0.15) inset,
    0 8px 24px rgba(229, 192, 116, 0.2);
}
.zenith-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.3) inset,
    0 -1px 0 rgba(0, 0, 0, 0.15) inset,
    0 14px 40px rgba(229, 192, 116, 0.32);
}

.zenith-btn-ghost {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--border-bright);
  color: var(--fg);
}
.zenith-btn-ghost:hover {
  background: rgba(229, 192, 116, 0.06);
  border-color: var(--zenith-gold);
  color: var(--zenith-gold);
}

/* ---------- Legacy button rescue ----------
   Existing pages use .btn — upgrade its fonts & spring. */
.btn, .btn-primary, .cta-btn {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.btn:hover, .btn-primary:hover {
  transform: translateY(-1px);
}

/* ---------- Logo lockup ---------- */
.zenith-logo {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-variation-settings: 'opsz' 48;
}
.zenith-logo .zenith-mark {
  color: var(--zenith-gold);
}
.zenith-logo span.apex {
  color: var(--zenith-gold);
  font-style: italic;
}

/* ---------- Section headings ---------- */
.section-kicker {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 40px;
}

/* ---------- Utility: reduce motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .zenith-orbit::after { animation: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- Starfield (optional decorative layer) ---------- */
.zenith-starfield {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
  opacity: 0.7;
}
.zenith-starfield::before,
.zenith-starfield::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 18% 22%, rgba(255, 255, 255, 0.7), transparent 50%),
    radial-gradient(1px 1px at 72% 18%, rgba(229, 192, 116, 0.8), transparent 50%),
    radial-gradient(1px 1px at 38% 68%, rgba(255, 255, 255, 0.5), transparent 50%),
    radial-gradient(1.5px 1.5px at 84% 54%, rgba(255, 255, 255, 0.85), transparent 50%),
    radial-gradient(1px 1px at 14% 82%, rgba(229, 192, 116, 0.6), transparent 50%),
    radial-gradient(1px 1px at 56% 12%, rgba(255, 255, 255, 0.4), transparent 50%),
    radial-gradient(1px 1px at 92% 88%, rgba(123, 142, 255, 0.6), transparent 50%),
    radial-gradient(1px 1px at 28% 42%, rgba(255, 255, 255, 0.3), transparent 50%);
  animation: zenith-twinkle 6s ease-in-out infinite alternate;
}
.zenith-starfield::after {
  animation-delay: -3s;
  opacity: 0.6;
  transform: scale(1.2) rotate(12deg);
}
@keyframes zenith-twinkle {
  0%   { opacity: 0.45; }
  100% { opacity: 0.95; }
}

/* ---------- Scrollbar (subtle) ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(229, 192, 116, 0.25); background-clip: padding-box; border: 2px solid transparent; }

/* ---------- Selection ---------- */
::selection { background: var(--zenith-gold-soft); color: var(--zenith-gold-bright); }
