/* ===================================
   SPOT-CHAIN — MAIN STYLES
   Coinbase Design System tokens
   =================================== */

/* CSS Variables */
:root {
  --color-bg:           #FFFFFF;
  --color-surface:      #F7F7F7;
  --color-surface-strong:#EEF0F3;
  --color-border:       #DEE1E6;
  --color-text:         #0A0B0D;
  --color-text-body:    #5B616E;
  --color-text-muted:   #7C828A;
  --color-primary:      #0052FF;
  --color-primary-hover:#003ECC;
  --color-bull:         #05B169;
  --color-bear:         #CF202F;
}

.dark {
  --color-bg:           #0A0B0D;
  --color-surface:      #16181C;
  --color-surface-strong:#212328;
  --color-border:       #212328;
  --color-text:         #FFFFFF;
  --color-text-body:    #A8B0C0;
  --color-text-muted:   #7C828A;
  --color-primary:      #0052FF;
  --color-primary-hover:#003ECC;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Sora", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

.dark ::-webkit-scrollbar-track {
  background: #0A0B0D;
}

.dark ::-webkit-scrollbar-thumb {
  background: #212328;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #2e3138;
}

/* Gradient Text — CB blue only */
.gradient-text {
  background: linear-gradient(135deg, #0052FF, #003ECC);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Gradient Background — CB blue only */
.gradient-bg {
  background: #0052FF;
}

/* Glass Effect */
.glass-effect {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.dark .glass-effect {
  background: rgba(22, 24, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

/* Card Hover Effect */
.card-hover {
  transition: all 0.25s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 82, 255, 0.08);
}

.dark .card-hover:hover {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

/* Button — primary solid blue */
.btn-primary {
  position: relative;
  overflow: hidden;
  transition: background-color 0.2s ease, transform 0.15s ease;
  background-color: #0052FF;
  color: #fff;
  border-radius: 9999px;
}

.btn-primary:hover {
  background-color: #003ECC;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transition: left 0.45s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

/* Pulse Animation — CB blue */
@keyframes pulse-ring {
  0%   { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 82, 255, 0.5); }
  70%  { transform: scale(1);    box-shadow: 0 0 0 10px rgba(0, 82, 255, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 82, 255, 0); }
}

.pulse-ring {
  animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

/* Shimmer Effect */
@keyframes shimmer {
  0%   { background-position: -1000px 0; }
  100% { background-position:  1000px 0; }
}

.shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* Float Animation */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-18px); }
}

.float          { animation: float 6s ease-in-out infinite; }
.float-delayed  { animation: float 6s ease-in-out 2s infinite; }

/* Fade In */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeIn 0.55s ease-out; }

/* Slide In */
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-48px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(48px); }
  to   { opacity: 1; transform: translateX(0); }
}

.slide-in-left  { animation: slideInLeft  0.55s ease-out; }
.slide-in-right { animation: slideInRight 0.55s ease-out; }

/* Ticker Animation */
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-wrapper {
  overflow: hidden;
  white-space: nowrap;
}

.ticker-animate {
  display: inline-flex;
  /* duration set dynamically by JS based on coin count */
  animation: ticker 48s linear infinite;
  will-change: transform;
}

.ticker-animate:hover {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  padding: 0 1.25rem;
  white-space: nowrap;
}

/* Ticker separator dot */
.ticker-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-border);
  display: inline-block;
  margin: 0 0.75rem;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Image Loading Placeholder */
[data-src] {
  transition: opacity 0.3s ease;
}

[data-src].loaded {
  opacity: 1 !important;
}

/* Loading Spinner — CB blue */
.spinner {
  border: 3px solid rgba(0, 82, 255, 0.1);
  border-top: 3px solid var(--color-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Selection */
::selection      { background-color: #0052FF; color: #fff; }
::-moz-selection { background-color: #0052FF; color: #fff; }

/* Focus */
:focus-visible {
  outline: 2px solid #0052FF;
  outline-offset: 2px;
}

/* Print */
@media print {
  .no-print { display: none !important; }
}

/* Utilities */
.text-balance { text-wrap: balance; }
.text-pretty  { text-wrap: pretty; }

/* Responsive Typography */
@media (max-width: 640px)  { html { font-size: 14px; } }
@media (min-width: 1280px) { html { font-size: 16px; } }

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

/* ===================================
   HERO AMBIENT ORBS — CB blue tones
   =================================== */
@keyframes orb-drift {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%       { transform: translate(38px,-28px) scale(1.07); }
  66%       { transform: translate(-22px,20px) scale(0.95); }
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
  pointer-events: none;
  z-index: 0;
}

.orb-1 { width: 500px; height: 500px; background: rgba(0,82,255,0.07);  top: -140px; left: -90px;   animation: orb-drift 14s ease-in-out infinite; }
.orb-2 { width: 420px; height: 420px; background: rgba(0,62,204,0.05);  bottom: -120px; right: -80px; animation: orb-drift 18s ease-in-out infinite reverse; }
.orb-3 { width: 280px; height: 280px; background: rgba(0,82,255,0.04);  top: 45%; left: 58%;   animation: orb-drift 24s ease-in-out infinite 5s; }
.orb-4 { width: 200px; height: 200px; background: rgba(0,82,255,0.035); top: 10%; right: 20%;  animation: orb-drift 16s ease-in-out infinite 2s reverse; }

/* Light mode: very subtle */
html:not(.dark) .orb { opacity: 0.6; }

/* ===================================
   HERO CONTENT STAGGER
   =================================== */
.hero-stagger > * {
  opacity: 0;
  animation: fadeIn 0.7s ease forwards;
}
.hero-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.hero-stagger > *:nth-child(2) { animation-delay: 0.18s; }
.hero-stagger > *:nth-child(3) { animation-delay: 0.32s; }
.hero-stagger > *:nth-child(4) { animation-delay: 0.46s; }
.hero-stagger > *:nth-child(5) { animation-delay: 0.60s; }
.hero-stagger > *:nth-child(6) { animation-delay: 0.74s; }

/* ===================================
   HOW IT WORKS — CONNECTOR LINE
   =================================== */
.connector-line {
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 1.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.connector-line.drawn { transform: scaleX(1); }

/* ===================================
   SECTION HEADER ANIMATED UNDERLINE
   =================================== */
.animated-underline {
  position: relative;
  display: inline;
}
.animated-underline::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 3px;
  background: #0052FF;
  border-radius: 2px;
  transition: width 0.85s cubic-bezier(0.16, 1, 0.3, 1) 0.25s;
}
.fade-in .animated-underline::after { width: 100%; }

/* ===================================
   HERO PRICE CARD (pure HTML mockup)
   =================================== */
.hero-price-card {
  background: #FFFFFF;
  border: 1px solid #DEE1E6;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.dark .hero-price-card {
  background: #16181C;
  border-color: #212328;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
.hero-price-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,82,255,0.10);
}

/* ===================================
   REDUCED MOTION
   =================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
