:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-card-hover: #1c2129;
  --border: #30363d;
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --accent: #f7931a;
  --accent-dim: rgba(247, 147, 26, 0.15);
  --green: #3fb950;
  --red: #f85149;
  --blue: #58a6ff;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 8px;
}

[data-theme="light"] {
  --bg: #f6f8fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f3f4f6;
  --border: #d0d7de;
  --text: #1f2328;
  --text-secondary: #656d76;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Dashboard Grid */
.dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  transition: background 0.2s;
}
.card:hover { background: var(--bg-card-hover); }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-wide { grid-column: span 2; }
.card-full { grid-column: 1 / -1; }

/* Price display */
.price-main {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1.2;
}

.price-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.change-positive { color: var(--green); }
.change-negative { color: var(--red); }

/* Fear & Greed gauge */
.gauge {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.gauge-value {
  font-size: 3rem;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1;
}

.gauge-label {
  font-size: 1rem;
  font-weight: 600;
}

.gauge-bar {
  width: 100%;
  height: 8px;
  background: linear-gradient(to right, #f85149, #f0883e, #d29922, #3fb950);
  border-radius: 4px;
  position: relative;
  margin-top: 0.5rem;
}

.gauge-indicator {
  position: absolute;
  top: -4px;
  width: 16px;
  height: 16px;
  background: var(--text);
  border-radius: 50%;
  transform: translateX(-50%);
  border: 2px solid var(--bg-card);
}

/* Header */
.site-header {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.site-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.site-nav a {
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-secondary); }

/* Status dot */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-live { background: var(--green); animation: pulse 2s infinite; }
.status-stale { background: var(--red); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Updated timestamp */
.updated-at {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-card-hover) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Responsive */
@media (max-width: 768px) {
  .dashboard { grid-template-columns: 1fr; }
  .card-wide, .card-full { grid-column: 1; }
  .price-main { font-size: 1.5rem; }
}

/* Footer */
.site-footer {
  max-width: 1400px;
  margin: 2rem auto 0;
  padding: 1rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
