/* ============================================
   DINOSHI VAULT — Crypto-Native Cool
   Dark theme, neon accents (cyan / purple / green)
   ============================================ */

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Surfaces */
  --bg: #0a0b0f;
  --surface: #12131a;
  --surface-2: #181a24;
  --surface-3: #1e2030;
  --border: rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.1);

  /* Text */
  --text: #e8e9ed;
  --text-muted: #8b8d98;
  --text-faint: #565869;

  /* Accent — Cyan (primary) */
  --cyan: #00e5ff;
  --cyan-dim: #00b8d4;
  --cyan-glow: rgba(0, 229, 255, 0.15);
  --cyan-glow-strong: rgba(0, 229, 255, 0.3);

  /* Accent — Purple */
  --purple: #b388ff;
  --purple-dim: #9c64ff;
  --purple-glow: rgba(179, 136, 255, 0.15);

  /* Accent — Green (profit) */
  --green: #00e676;
  --green-dim: #00c853;
  --green-glow: rgba(0, 230, 118, 0.15);

  /* Accent — Red (loss) */
  --red: #ff5252;
  --red-glow: rgba(255, 82, 82, 0.15);

  /* Accent — Gold */
  --gold: #ffd740;
  --gold-glow: rgba(255, 215, 64, 0.15);

  /* Type */
  --font-display: 'Cabinet Grotesk', 'Inter', sans-serif;
  --font-body: 'Satoshi', 'Inter', sans-serif;

  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Misc */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --content-wide: 1140px;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; }

.container {
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* === Nav === */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-4) 0;
  background: rgba(10, 11, 15, 0.8);
  backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.nav-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.logo-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--text-lg);
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-links a {
  font-size: var(--text-sm);
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--text);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  border-radius: var(--radius-lg);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan-dim), var(--purple-dim));
  color: #fff;
  box-shadow: 0 0 20px var(--cyan-glow), 0 0 40px var(--purple-glow);
}

.btn-primary:hover {
  box-shadow: 0 0 30px var(--cyan-glow-strong), 0 0 60px var(--purple-glow);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

/* === Hero === */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-24) var(--space-6) var(--space-12);
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at 50% 50%, black 20%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 20%, transparent 70%);
}

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
}

.glow-1 {
  width: 500px;
  height: 500px;
  background: var(--cyan);
  top: 10%;
  left: 20%;
  opacity: 0.08;
}

.glow-2 {
  width: 600px;
  height: 600px;
  background: var(--purple);
  top: 30%;
  right: 10%;
  opacity: 0.06;
}

.glow-3 {
  width: 400px;
  height: 400px;
  background: var(--green);
  bottom: 10%;
  left: 50%;
  opacity: 0.04;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 720px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: var(--radius-xl);
  font-size: var(--text-xs);
  color: var(--cyan);
  margin-bottom: var(--space-6);
  font-weight: 500;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.5); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(0, 230, 118, 0); }
}

.hero h1 {
  font-size: var(--text-3xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
  background: linear-gradient(180deg, #fff 40%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto var(--space-8);
  line-height: 1.6;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* === Stats Ticker === */
.stats-ticker {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-4);
  width: 100%;
  max-width: var(--content-wide);
  margin-top: var(--space-12);
  padding: 0 var(--space-6);
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-3);
  text-align: center;
}

.glow-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.glow-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, var(--cyan-glow) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.glow-card:hover::before {
  opacity: 1;
}

.stat-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}

.stat-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
}

.stat-value.accent {
  color: var(--green);
}

/* ROI Card — Info & Note */
.roi-card {
  position: relative;
  overflow: visible !important;
}

.roi-info {
  font-size: 0.7em;
  color: var(--text-faint);
  cursor: help;
  vertical-align: middle;
  margin-left: 0.25em;
  transition: color 0.2s;
}

.roi-info:hover {
  color: var(--cyan);
}

.roi-note {
  font-size: 0.65rem;
  color: var(--text-faint);
  font-weight: 400;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

/* Custom tooltip for ROI info */
.roi-card .stat-label {
  position: relative;
}

.roi-info[title] {
  position: relative;
}

.roi-info[title]:hover::after {
  content: attr(title);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 1.8em;
  width: 280px;
  padding: 12px 14px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: 0;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 100;
  pointer-events: none;
  white-space: normal;
}

/* === Sections === */
.section {
  padding: clamp(var(--space-12), 8vw, var(--space-24)) 0;
}

.section-dark {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cyan);
  margin-bottom: var(--space-3);
}

.section-header h2 {
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-4);
}

.section-sub {
  font-size: var(--text-base);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* === KPI Grid === */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.kpi-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon.green { background: var(--green-glow); color: var(--green); }
.kpi-icon.purple { background: var(--purple-glow); color: var(--purple); }
.kpi-icon.cyan { background: var(--cyan-glow); color: var(--cyan); }
.kpi-icon.gold { background: var(--gold-glow); color: var(--gold); }

.kpi-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.kpi-label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
}

/* === Chart === */
.chart-container {
  padding: var(--space-6);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.chart-header h3 {
  font-size: var(--text-lg);
  font-weight: 700;
}

.chart-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.chart-updated {
  font-size: var(--text-xs);
  color: var(--text-faint);
}

.chart-wrapper {
  position: relative;
  height: 320px;
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-note {
  font-size: var(--text-xs);
  color: var(--text-faint);
  margin-top: var(--space-3);
  text-align: center;
}

/* === Features === */
.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.feature-card {
  padding: var(--space-6);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition);
}

.feature-card:hover {
  border-color: var(--border-strong);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--cyan-glow);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.feature-card h3 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.feature-card p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

/* === Steps === */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-bottom: var(--space-10);
}

.step-card {
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}

.step-num {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  margin-bottom: var(--space-3);
}

.step-card h3 {
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.step-card p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 100%;
}

.cta-center {
  text-align: center;
}

/* === Footer === */
.footer {
  padding: var(--space-10) 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-8);
}

.footer-brand-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.footer-brand .logo-text,
.footer-brand-logo .logo-text {
  font-size: var(--text-base);
  margin-bottom: var(--space-2);
}

.footer-note {
  font-size: var(--text-xs);
  color: var(--text-faint);
  max-width: 400px;
  line-height: 1.5;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: flex-end;
}

.footer-links a {
  font-size: var(--text-xs);
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--text);
}

/* === Scroll Animations === */
@supports (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 80%;
  }
}

@keyframes reveal-fade {
  to { opacity: 1; }
}

/* === Positions Table === */
.positions-table-wrap {
  padding: var(--space-4);
  overflow-x: auto;
}

.positions-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums lining-nums;
}

.positions-table thead th {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.positions-table tbody td {
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.positions-table tbody tr:last-child td {
  border-bottom: none;
}

.positions-table .coin-cell {
  font-weight: 700;
  font-family: var(--font-display);
}

.positions-table .side-short {
  color: var(--red);
  font-weight: 600;
}

.positions-table .side-long {
  color: var(--green);
  font-weight: 600;
}

.positions-table .pnl-positive {
  color: var(--green);
}

.positions-table .pnl-negative {
  color: var(--red);
}

.loading-row td {
  text-align: center;
  color: var(--text-faint);
  padding: var(--space-8) !important;
}

.no-positions td {
  text-align: center;
  color: var(--text-faint);
  padding: var(--space-6) !important;
}

.positions-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4) 0;
  border-top: 1px solid var(--border);
  margin-top: var(--space-2);
}

.positions-summary {
  display: flex;
  gap: var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.positions-summary strong {
  color: var(--text);
}

.positions-updated {
  font-size: var(--text-xs);
  color: var(--text-faint);
}

/* === AI Banner === */
.ai-banner {
  margin-top: var(--space-10);
  padding: var(--space-6);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.05), rgba(179, 136, 255, 0.05));
  border: 1px solid rgba(0, 229, 255, 0.15);
}

.ai-banner-content {
  display: flex;
  gap: var(--space-6);
  align-items: flex-start;
}

.ai-banner-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--cyan-glow), var(--purple-glow));
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-banner h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: var(--space-2);
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ai-banner p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 100%;
}

/* === Feature Highlight (AI card) === */
.feature-highlight {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.04), rgba(179, 136, 255, 0.04));
  border-color: rgba(0, 229, 255, 0.15);
}

.feature-highlight .feature-icon,
.ai-icon {
  background: linear-gradient(135deg, var(--cyan-glow), var(--purple-glow));
  color: var(--cyan);
}

/* === Mobile Responsive === */
@media (max-width: 768px) {
  .stats-ticker {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .positions-table-wrap {
    padding: var(--space-3);
  }

  .positions-footer {
    flex-direction: column;
    gap: var(--space-2);
    align-items: flex-start;
  }

  .positions-summary {
    flex-direction: column;
    gap: var(--space-2);
  }

  .ai-banner-content {
    flex-direction: column;
  }

  .ai-banner-icon {
    width: 48px;
    height: 48px;
  }


  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .feature-highlight {
    grid-column: 1;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    flex-direction: column;
    gap: var(--space-6);
  }

  .footer-links {
    align-items: flex-start;
  }

  .hero h1 {
    font-size: var(--text-2xl);
  }

  .hero-sub {
    font-size: var(--text-base);
  }

  .chart-wrapper {
    height: 240px;
  }

  .nav-links a:not(.btn) {
    display: none;
  }
}

@media (max-width: 480px) {
  .stats-ticker {
    grid-template-columns: 1fr 1fr;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    padding: var(--space-3);
  }

  .hero-cta {
    flex-direction: column;
  }
}

/* Win/Loss dollar amounts under win rate */
.wl-dollars {
  display: block;
  font-size: 0.55em;
  font-weight: 500;
  margin-top: 4px;
  opacity: 0.8;
  letter-spacing: 0.02em;
}
.wl-win {
  color: var(--green);
}
.wl-loss {
  color: var(--red, #ff5252);
}
