/* ============================================
   TSLA 360° Dashboard — TESLA VEHICLE UI
   Inspired by Tesla Model S Plaid / Cybertruck
   Minimal · Monochrome · High-Contrast · Sharp
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600;700&family=JetBrains+Mono:wght@200;300;400;500;600&family=Orbitron:wght@400;700;900&family=Syne:wght@200;400;600;800&display=swap');

:root {
  --bg-deep: #000000;
  --bg-card: #020202;
  --bg-card-hover: #0a0a0a;
  --bg-elevated: #060606;
  --border-subtle: rgba(255,255,255,0.03);
  --border-medium: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.12);
  --text-primary: #ffffff;
  --text-secondary: #999999;
  --text-muted: #555555;
  --green-bull: #00ff88;
  --green-bull-bright: #6bffb0;
  --green-bull-dim: rgba(0,255,136,0.08);
  --red-bear: #ff3355;
  --red-bear-dim: rgba(255,51,85,0.08);
  --gold-accent: #ffd700;
  --gold-dim: rgba(255,215,0,0.08);
  --orange-warn: #ff6d00;
  --blue-info: #3399ff;
  --tesla-red: #e82127;
  --tesla-red-bright: #ff3b3b;
  --tesla-red-dim: rgba(232,33,39,0.08);
  --tesla-white: #f0f0f0;
  --tesla-gray: #1a1a1a;
  --cyber-blue: #00d4ff;
  --cyber-blue-bright: #66e5ff;
  --cyber-purple: #7c3aed;
  --cyber-pink: #ff3bc3;
  --glass-bg: rgba(255,255,255,0.02);
  --glass-border: rgba(255,255,255,0.05);

  --font-display: 'Syne', 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  --font-cyber: 'Orbitron', 'Syne', sans-serif;

  --shadow-card: 0 0 0 1px rgba(255,255,255,0.03), 0 8px 48px rgba(0,0,0,0.9);
  --shadow-glow-green: 0 0 20px rgba(0,255,136,0.08);
  --shadow-glow-red: 0 0 20px rgba(232,33,39,0.08);
  --shadow-glow-blue: 0 0 20px rgba(0,212,255,0.08);
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --radius-xl: 0px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  font-weight: 300;
  font-size: 14px;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(232,33,39,0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(0,212,255,0.015) 0%, transparent 40%),
    radial-gradient(ellipse at 20% 60%, rgba(255,59,195,0.008) 0%, transparent 30%);
}

/* --- Tesla Cyber Grid + Holographic overlay --- */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(232,33,39,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
  animation: gridPulse 6s ease-in-out infinite;
  mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 70%);
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.7; }
}

/* --- Floating holographic particles overlay (CSS only) --- */
body::before {
  background-image:
    linear-gradient(rgba(232,33,39,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,212,255,0.02) 1px, transparent 1px),
    radial-gradient(circle at 20% 50%, rgba(232,33,39,0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 30%, rgba(0,212,255,0.03) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(255,59,195,0.02) 0%, transparent 40%);
  background-size: 48px 48px, 48px 48px, 100% 100%, 100% 100%, 100% 100%;
}

/* --- Scanline CRT effect (ultra subtle) --- */
.scanlines {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255,255,255,0.003) 2px,
    rgba(255,255,255,0.003) 4px
  );
  pointer-events: none;
  z-index: 1;
}

/* --- Price flash overlay (pulses on price change) --- */
.price-flash-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9997;
  opacity: 0;
  transition: opacity 0.1s;
}
.price-flash-overlay.flash-green {
  background: radial-gradient(ellipse at 50% 0%, rgba(0,255,136,0.04), transparent 60%);
  opacity: 1;
}
.price-flash-overlay.flash-red {
  background: radial-gradient(ellipse at 50% 0%, rgba(255,51,85,0.04), transparent 60%);
  opacity: 1;
}

/* 3D particles via Three.js */

/* --- Flowing Tesla ambient edge light strip --- */
body::after {
  content: '';
  position: fixed;
  top: 0; left: -100%;
  width: 300%; height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--tesla-red) 15%,
    var(--cyber-blue) 30%,
    var(--tesla-red) 45%,
    transparent 55%,
    var(--tesla-red) 70%,
    var(--cyber-blue) 85%,
    transparent 100%
  );
  opacity: 0.5;
  pointer-events: none;
  z-index: 9999;
  animation: lightFlow 6s linear infinite;
}

@keyframes lightFlow {
  0% { transform: translateX(0); }
  100% { transform: translateX(33.33%); }
}

/* --- Scrollbar (Tesla center console thin) --- */
::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* --- Selection (Tesla red) --- */
::selection { background: var(--tesla-red); color: #fff; }

/* ===== NAV (Tesla Center Console / Model S Plaid UI) ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(3,3,3,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 2.5rem;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.nav-logo .dot {
  width: 10px; height: 10px;
  background: var(--tesla-red);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.nav-links {
  display: flex;
  gap: 0;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.6rem;
  font-weight: 400;
  padding: 0.5rem 0.75rem;
  transition: all 0.15s;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  position: relative;
}

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

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

.ticker-price {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(255,255,255,0.05);
  transition: all 0.15s;
}

.ticker-price.flash-up {
  color: var(--green-bull);
  text-shadow: 0 0 20px rgba(0,255,136,0.4), 0 0 40px rgba(0,255,136,0.1);
}
.ticker-price.flash-down {
  color: var(--red-bear);
  text-shadow: 0 0 20px rgba(255,51,85,0.4), 0 0 40px rgba(255,51,85,0.1);
}

.ticker-change {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 300;
  padding: 0.1rem 0.4rem;
  border: 1px solid;
}

.ticker-change.up { border-color: var(--green-bull); color: var(--green-bull); }
.ticker-change.down { border-color: var(--red-bear); color: var(--red-bear); }

.rating-badge {
  font-size: 0.55rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 0.15rem 0.5rem;
  border: 1px solid;
}
.rating-badge.buy { border-color: var(--green-bull); color: var(--green-bull); }
.rating-badge.hold { border-color: var(--gold-accent); color: var(--gold-accent); }
.rating-badge.sell { border-color: var(--red-bear); color: var(--red-bear); }

.mobile-menu-btn { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.2rem; cursor: pointer; padding: 0.25rem; }

/* ===== HERO (Tesla Cyber Rodeo / Giga Press Aesthetic) ===== */
.hero {
  padding: 8rem 2rem 3.5rem;
  text-align: center;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Tesla logo glow ring — animated pulse with chromatic shift + cyber rings */
.hero::before {
  content: '';
  position: absolute;
  top: -40%; left: 50%;
  transform: translateX(-50%);
  width: 1000px; height: 800px;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(232,33,39,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 60%, rgba(0,212,255,0.06) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(255,59,195,0.04) 0%, transparent 30%);
  pointer-events: none;
  animation: heroPulse 5s ease-in-out infinite;
  mix-blend-mode: screen;
  filter: blur(20px);
}

@keyframes heroPulse {
  0%, 100% { opacity: 0.3; transform: translateX(-50%) scale(1) rotate(0deg); }
  25% { opacity: 0.6; transform: translateX(-50%) scale(1.08) rotate(3deg); }
  50% { opacity: 0.8; transform: translateX(-50%) scale(1.10) rotate(-2deg); }
  75% { opacity: 0.5; transform: translateX(-50%) scale(1.04) rotate(1deg); }
}

/* ----- Dual-tone rotating aurora rings behind hero ----- */
.hero-aurora {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 800px; height: 800px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    transparent, rgba(232,33,39,0.08), transparent 30%,
    transparent, rgba(0,212,255,0.06), transparent 60%,
    transparent, rgba(255,59,195,0.04), transparent 100%);
  animation: auroraSpin 20s linear infinite;
  pointer-events: none;
  filter: blur(40px);
  z-index: 0;
}

@keyframes auroraSpin {
  0% { transform: translate(-50%, -50%) rotate(0deg) scale(1); }
  50% { transform: translate(-50%, -50%) rotate(180deg) scale(1.05); }
  100% { transform: translate(-50%, -50%) rotate(360deg) scale(1); }
}

/* Tesla angular accent line — moving glow dot with neon */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, var(--tesla-red) 10%, var(--tesla-red-bright) 15%, var(--cyber-pink) 20%, var(--cyber-blue) 25%, transparent 30%, transparent 60%, var(--tesla-red) 65%, var(--tesla-red-bright) 70%, var(--cyber-pink) 75%, var(--cyber-blue) 80%, transparent 85%, transparent 95%);
  opacity: 0.4;
  animation: heroLineShift 6s linear infinite;
  background-size: 200% 100%;
  box-shadow: 0 0 20px rgba(232,33,39,0.15), 0 0 60px rgba(255,59,195,0.05);
}

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

/* Cyber ring decorations — animated aurora rings */
.hero-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 600px;
  border: 1px solid rgba(232,33,39,0.06);
  border-radius: 50%;
  pointer-events: none;
  animation: ringRotate 25s linear infinite;
  box-shadow: 0 0 40px rgba(232,33,39,0.03), inset 0 0 40px rgba(232,33,39,0.02);
}

.hero-ring:nth-child(2) {
  width: 420px; height: 420px;
  border-color: rgba(0,212,255,0.04);
  animation-direction: reverse;
  animation-duration: 18s;
  box-shadow: 0 0 40px rgba(0,212,255,0.03), inset 0 0 40px rgba(0,212,255,0.02);
}

.hero-ring:nth-child(3) {
  width: 250px; height: 250px;
  border: 1px solid rgba(255,59,195,0.03);
  animation-duration: 12s;
  box-shadow: 0 0 30px rgba(255,59,195,0.02);
}

@keyframes ringRotate {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.hero h1 {
  font-family: var(--font-cyber);
  font-size: clamp(2.5rem, 8vw, 5rem);
  font-weight: 900;
  line-height: 1.0;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--tesla-white);
  z-index: 2;
  position: relative;
  animation: textGlow 3s ease-in-out infinite;
  background: linear-gradient(180deg, #ffffff 30%, rgba(255,255,255,0.6) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 40px rgba(232,33,39,0.15)) drop-shadow(0 0 80px rgba(232,33,39,0.05));
}

@keyframes textGlow {
  0%, 100% { filter: drop-shadow(0 0 30px rgba(232,33,39,0.12)) drop-shadow(0 0 60px rgba(232,33,39,0.04)); }
  50% { filter: drop-shadow(0 0 60px rgba(232,33,39,0.3)) drop-shadow(0 0 120px rgba(232,33,39,0.08)) drop-shadow(0 0 200px rgba(232,33,39,0.03)); }
}

.hero h1 span.tsla-highlight {
  background: linear-gradient(135deg, var(--tesla-red-bright) 0%, var(--cyber-pink) 50%, var(--tesla-red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
  position: relative;
  filter: drop-shadow(0 0 30px rgba(232,33,39,0.5)) drop-shadow(0 0 80px rgba(232,33,39,0.2));
  animation: tslaPulse 2s ease-in-out infinite;
}

@keyframes tslaPulse {
  0%, 100% { filter: drop-shadow(0 0 30px rgba(232,33,39,0.4)) drop-shadow(0 0 60px rgba(255,59,195,0.15)) drop-shadow(0 0 100px rgba(232,33,39,0.05)); }
  50% { filter: drop-shadow(0 0 60px rgba(232,33,39,0.8)) drop-shadow(0 0 120px rgba(255,59,195,0.3)) drop-shadow(0 0 200px rgba(232,33,39,0.1)) drop-shadow(0 0 300px rgba(0,212,255,0.05)); }
}

.hero h1 span.tsla-highlight::after {
  content: '';
  position: absolute;
  bottom: 4px; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--tesla-red-bright), var(--cyber-pink), var(--tesla-red), transparent);
  box-shadow: 0 0 20px var(--tesla-red), 0 0 60px rgba(232,33,39,0.3);
  animation: linePulse 1.5s ease-in-out infinite;
  -webkit-text-fill-color: initial;
}

@keyframes linePulse {
  0%, 100% { opacity: 0.4; transform: scaleX(0.8); }
  50% { opacity: 1; transform: scaleX(1); }
}

.hero .hero-subtitle {
  color: rgba(255,255,255,0.5);
  font-size: 0.7rem;
  max-width: 500px;
  margin: 0 auto 2.5rem;
  letter-spacing: 6px;
  text-transform: uppercase;
  font-weight: 200;
  word-spacing: 10px;
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--tesla-red);
  animation: typewriter 4s steps(40) 1s 1 normal both, blinkCursor 0.8s step-end infinite;
  max-width: fit-content;
  font-family: var(--font-cyber);
  text-shadow: 0 0 20px rgba(232,33,39,0.1);
}

@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blinkCursor {
  from, to { border-color: transparent; }
  50% { border-color: var(--tesla-red); }
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  border: 1px solid rgba(232,33,39,0.12);
  display: inline-flex;
  margin: 0 auto;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 2;
  position: relative;
  box-shadow: 0 0 40px rgba(232,33,39,0.05), inset 0 0 60px rgba(232,33,39,0.02);
  animation: statsAppear 0.8s ease-out 4.5s both;
}

@keyframes statsAppear {
  from { opacity: 0; transform: translateY(20px) scale(0.95); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.hero-stat {
  text-align: center;
  padding: 1.2rem 2rem;
  position: relative;
}

.hero-stat:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 15%; height: 70%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(232,33,39,0.2), transparent);
}

.hero-stat .number {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--text-primary);
  line-height: 1;
  letter-spacing: -0.5px;
  text-shadow: 0 0 20px rgba(255,255,255,0.05);
}
.hero-stat .number.green { color: var(--green-bull); text-shadow: 0 0 20px rgba(0,255,136,0.3), 0 0 40px rgba(0,255,136,0.1); }
.hero-stat .number.red { color: var(--red-bear); text-shadow: 0 0 20px rgba(255,51,85,0.3), 0 0 40px rgba(255,51,85,0.1); }
.hero-stat .number.gold { color: var(--gold-accent); text-shadow: 0 0 20px rgba(255,215,0,0.3), 0 0 40px rgba(255,215,0,0.1); }
.hero-stat .number:hover {
  filter: brightness(1.3);
  transition: filter 0.3s;
}
.hero-stat .label {
  font-size: 0.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 0.4rem;
  font-weight: 400;
}

/* ===== SECTIONS (Tesla UI zones) ===== */
.section {
  padding: 4rem 2.5rem;
  max-width: 1320px;
  margin: 0 auto;
  position: relative;
}

/* Section live readings — tiny data ticker */
.section::before {
  content: '◈ SYS.ONLINE ◈ SIG:ACTIVE ◈ DATA:REALTIME';
  position: absolute;
  top: 4px; right: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.4rem;
  color: rgba(0,212,255,0.08);
  letter-spacing: 3px;
  pointer-events: none;
  animation: sectionDataPulse 4s ease-in-out infinite;
}

@keyframes sectionDataPulse {
  0%, 100% { opacity: 0.05; }
  50% { opacity: 0.2; }
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

.section-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--tesla-red-bright), var(--cyber-pink), transparent);
  box-shadow: 0 0 20px var(--tesla-red), 0 0 40px rgba(255,59,195,0.1);
  animation: headerLinePulse 3s ease-in-out infinite;
}

@keyframes headerLinePulse {
  0%, 100% { opacity: 0.4; width: 60px; filter: hue-rotate(0deg); }
  50% { opacity: 1; width: 140px; filter: hue-rotate(10deg); }
}

/* Section live readings — tiny data ticker */
.section::before {
  content: '◈ SYS.ONLINE ◈ SIG:ACTIVE ◈ DATA:REALTIME';
  position: absolute;
  top: 4px; right: 2.5rem;
  font-family: var(--font-mono);
  font-size: 0.4rem;
  color: rgba(0,212,255,0.08);
  letter-spacing: 3px;
  pointer-events: none;
  animation: sectionDataPulse 4s ease-in-out infinite;
}

@keyframes sectionDataPulse {
  0%, 100% { opacity: 0.05; }
  50% { opacity: 0.2; }
}

.section { position: relative; }

.section-icon {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.5rem;
  font-weight: 300;
  letter-spacing: 1px;
  border: 1px solid rgba(255,255,255,0.08);
  font-family: var(--font-mono);
}

.section-icon.green { border-color: var(--green-bull); color: var(--green-bull); }
.section-icon.gold { border-color: var(--gold-accent); color: var(--gold-accent); }
.section-icon.blue { border-color: var(--blue-info); color: var(--blue-info); }
.section-icon.purple { border-color: var(--tesla-red); color: var(--tesla-red); }

.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--tesla-white);
}

.section-header .sub {
  color: var(--text-muted);
  font-size: 0.55rem;
  margin-left: auto;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 300;
  font-family: var(--font-mono);
}

/* ===== CARDS GRID (Tesla spec-sheet precision) ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--border-subtle); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--border-subtle); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border-subtle); }
.grid-full { grid-column: 1 / -1; }

.card {
  background: var(--bg-card);
  border: none;
  padding: 1.25rem;
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  position: relative;
  overflow: hidden;
}

.card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card), var(--shadow-glow-green);
  border-left: 1px solid rgba(232,33,39,0.08);
}

/* Card cyber frame — neon scanning edge */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(232,33,39,0.02) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover::before {
  opacity: 1;
  background: linear-gradient(90deg, transparent 0%, var(--tesla-red) 25%, var(--cyber-pink) 50%, var(--cyber-blue) 75%, transparent 100%);
  animation: neonSweep 0.6s ease-out;
  box-shadow: 0 0 15px rgba(232,33,39,0.2);
}

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

.card-title {
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  font-weight: 300;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-title::before {
  content: '◆';
  font-size: 0.35rem;
  color: var(--tesla-red);
  opacity: 0.5;
}

.card-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.5px;
  transition: all 0.3s;
}

.card:hover .card-value {
  text-shadow: 0 0 20px currentColor;
}
.card-value.green { color: var(--green-bull); }
.card-value.red { color: var(--red-bear); }
.card-value.gold { color: var(--gold-accent); }

.card-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  font-weight: 300;
}

.chart-container {
  width: 100%;
  height: 240px;
  position: relative;
}
.chart-container.tall { height: 300px; }
.chart-container.short { height: 160px; }

/* Tesla corner marker on cards */
.card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 8px; height: 8px;
  border-top: 1px solid var(--border-medium);
  border-right: 1px solid var(--border-medium);
  opacity: 0;
  transition: opacity 0.2s;
}
.card:hover::after {
  opacity: 1;
}

/* ===== KPI ROW (Tesla vehicle spec-sheet) ===== */
.kpi-row {
  display: flex;
  gap: 1px;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  background: var(--border-subtle);
}

.kpi-card {
  background: var(--bg-card);
  border: none;
  padding: 0.85rem 1rem;
  flex: 1;
  min-width: 120px;
}

.kpi-card .label {
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  font-weight: 400;
  font-family: var(--font-mono);
}

.kpi-card .value {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 300;
  letter-spacing: -0.3px;
  transition: all 0.3s;
}

.kpi-card:hover .value {
  text-shadow: 0 0 15px currentColor;
}

.kpi-card .value.green { color: var(--green-bull); }
.kpi-card .value.red { color: var(--red-bear); }
.kpi-card .value.gold { color: var(--gold-accent); }

/* ===== SWOT (Tesla engineering spec cards) ===== */
.swot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border-subtle);
}

.swot-card {
  padding: 1.25rem;
  background: var(--bg-card);
  border: none;
  position: relative;
}

.swot-card h4 {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 400;
}

.swot-card ul {
  list-style: none;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 2;
}

.swot-card ul li::before {
  content: '— ';
  color: var(--text-muted);
}

.swot-card.s { border-top: 1px solid var(--green-bull); }
.swot-card.s h4 { color: var(--green-bull); }
.swot-card.w { border-top: 1px solid var(--red-bear); }
.swot-card.w h4 { color: var(--red-bear); }
.swot-card.o { border-top: 1px solid var(--blue-info); }
.swot-card.o h4 { color: var(--blue-info); }
.swot-card.t { border-top: 1px solid var(--orange-warn); }
.swot-card.t h4 { color: var(--orange-warn); }

/* ===== VALUATION (Tesla spec-sheet metrics) ===== */
.val-metrics {
  display: flex;
  gap: 1px;
  margin: 1rem 0;
  flex-wrap: wrap;
  background: var(--border-subtle);
}

.val-metric {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 0.85rem 0.5rem;
  background: var(--bg-card);
  border: none;
}

.val-metric .val-num {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 300;
  letter-spacing: -0.3px;
}

.val-metric .val-label {
  font-size: 0.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 0.25rem;
  font-weight: 300;
  font-family: var(--font-mono);
}

/* ===== VERDICT (Tesla final verdict UI) ===== */
.verdict-section {
  background: linear-gradient(135deg, rgba(0,0,0,0.95) 0%, rgba(10,0,5,0.95) 50%, rgba(0,5,10,0.95) 100%);
  border: 1px solid rgba(232,33,39,0.08);
  padding: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(232,33,39,0.03), inset 0 0 60px rgba(0,212,255,0.02);
}

.verdict-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--tesla-red) 20%, var(--cyber-pink) 40%, var(--cyber-blue) 60%, var(--tesla-red) 80%, transparent 100%);
  animation: verdictFlow 3s linear infinite;
  background-size: 300% 100%;
  box-shadow: 0 0 20px rgba(232,33,39,0.3), 0 0 60px rgba(255,59,195,0.1);
}

@keyframes verdictFlow {
  0% { background-position: 300% 0; }
  100% { background-position: 0% 0; }
}

.verdict-gauge {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.gauge-chart {
  width: 200px;
  height: 120px;
  flex-shrink: 0;
}

.verdict-details {
  flex: 1;
  min-width: 250px;
}

.verdict-rating {
  font-family: var(--font-cyber);
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, #00ff88 0%, #6bffb0 30%, #00ff88 60%, #00d4aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.1rem;
  letter-spacing: 6px;
  text-transform: uppercase;
  position: relative;
  display: inline-block;
  filter: drop-shadow(0 0 30px rgba(0,255,136,0.3)) drop-shadow(0 0 60px rgba(0,255,136,0.1));
  animation: verdictGlow 2s ease-in-out infinite;
}

@keyframes verdictGlow {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(0,255,136,0.2)) drop-shadow(0 0 40px rgba(0,255,136,0.05)); }
  50% { filter: drop-shadow(0 0 40px rgba(0,255,136,0.5)) drop-shadow(0 0 80px rgba(0,255,136,0.15)) drop-shadow(0 0 120px rgba(0,255,136,0.05)); }
}

.verdict-sub {
  color: var(--text-secondary);
  font-size: 0.7rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
  font-weight: 300;
}

.verdict-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.55rem;
  padding: 0.15rem 0.5rem;
  border: 1px solid;
  font-weight: 300;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.tag.buy { border-color: var(--green-bull); color: var(--green-bull); }
.tag.warn { border-color: var(--gold-accent); color: var(--gold-accent); }
.tag.risk { border-color: var(--red-bear); color: var(--red-bear); }

.verdict-actions {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-primary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--text-primary);
  padding: 0.6rem 1.5rem;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.6rem;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.btn-primary:hover {
  background: var(--text-primary);
  color: var(--bg-deep);
}

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  padding: 0.6rem 1.5rem;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.6rem;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.btn-secondary:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

/* ===== RISK BOX ===== */
.risk-box {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255,23,68,0.12);
  background: rgba(255,23,68,0.02);
}

.risk-box-title {
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--red-bear);
  font-weight: 400;
  margin-bottom: 0.4rem;
  font-family: var(--font-mono);
}

.risk-box p {
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.6;
  font-weight: 300;
}

/* ===== FOOTER (Tesla legal fine-print style) ===== */
.footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.55rem;
  letter-spacing: 1px;
  font-weight: 300;
}

.footer a { color: var(--text-secondary); text-decoration: none; }
.footer a:hover { color: var(--text-primary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); background: transparent; gap: 1px; }
  .grid-4 .card { border: 1px solid var(--border-subtle); }
  .nav-links { display: none; }
  .mobile-menu-btn { display: block; }
  .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 52px; left: 0; right: 0; background: rgba(3,3,3,0.98); padding: 0.5rem; border-bottom: 1px solid var(--border-subtle); }
  .nav-links.open a { padding: 0.5rem 0.75rem; }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; background: transparent; gap: 1px; }
  .grid-2 .card, .grid-3 .card, .grid-4 .card { border: 1px solid var(--border-subtle); }
  .swot-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: column; gap: 0; border: none; }
  .hero-stat { border: 1px solid var(--border-subtle); }
  .hero-stat:not(:last-child)::after { display: none; }
  .section { padding: 2.5rem 1.25rem; }
  .hero { padding: 5rem 1.25rem 2.5rem; }
  .verdict-gauge { flex-direction: column; align-items: stretch; }
  .gauge-chart { width: 100%; height: 100px; }
}

/* ===== Animations (Tesla UI fade-in, no delay) ===== */
@keyframes reveal {
  from { opacity: 0; transform: translateY(20px); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.section { animation: reveal 0.6s ease-out both; }
.section:nth-child(n+2) { animation-delay: 0.1s; }

/* Glitch data reveal for numbers */
@keyframes dataReveal {
  0% { opacity: 0; transform: scale(0.8); }
  50% { opacity: 0.5; }
  100% { opacity: 1; transform: scale(1); }
}

.kpi-card { animation: dataReveal 0.5s ease-out both; }
.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.1s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.2s; }
.kpi-card:nth-child(5) { animation-delay: 0.25s; }
.kpi-card:nth-child(6) { animation-delay: 0.3s; }

.card .chart-container canvas {
  max-width: 100%;
}

/* ===== Tesla battery-style thin progress bars ===== */
.progress-track {
  height: 2px;
  background: rgba(255,255,255,0.04);
  position: relative;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  transition: width 0.3s ease;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 4px; height: 100%;
  background: inherit;
  filter: brightness(1.5);
  animation: progressPulse 2s ease-in-out infinite;
}

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

/* ===== CYBER RAIN — Data stream falling lines ===== */
@keyframes dataRain {
  0% { transform: translateY(-100%); opacity: 0; }
  10% { opacity: 0.8; }
  50% { opacity: 0.5; filter: blur(0px); }
  90% { opacity: 0.2; }
  100% { transform: translateY(100vh); opacity: 0; filter: blur(1px); }
}

.data-column {
  position: fixed;
  top: 0;
  height: 300px;
  animation: dataRain 8s linear infinite;
  pointer-events: none;
  z-index: 0;
  filter: blur(0.5px);
  mix-blend-mode: screen;
}

/* ===== Tesla Battery-style animated gradient glow ===== */
@keyframes pulseGlow {
  0%, 100% { opacity: 0.3; filter: blur(8px); }
  50% { opacity: 0.6; filter: blur(12px); }
}

/* ===== Chart container upgrades for cyber feel ===== */
.chart-container {
  width: 100%;
  height: 240px;
  position: relative;
  overflow: hidden;
}

.chart-container::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,33,39,0.05), transparent);
}

/* ===== Glitch text effect ===== */
@keyframes glitchText {
  0% { clip-path: inset(0 0 95% 0); }
  5% { clip-path: inset(15% 0 80% 0); }
  10% { clip-path: inset(40% 0 55% 0); }
  15% { clip-path: inset(5% 0 70% 0); }
  20% { clip-path: inset(0 0 0 0); }
  100% { clip-path: inset(0 0 0 0); }
}

.glitch-ready {
  animation: glitchText 0.8s ease-out 0.5s 1;
}

/* ===== 3D Data Orb Glow ===== */
.corner-3d {
  position: absolute;
  width: 80px; height: 80px;
  border: 1px solid rgba(232,33,39,0.04);
  pointer-events: none;
}

/* ===== Wave pulse on section reveal ===== */
@keyframes waveReveal {
  0% { opacity: 0; transform: translateY(30px) scale(0.97); filter: blur(8px) hue-rotate(30deg); }
  50% { filter: blur(0) hue-rotate(0deg); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.section {
  animation: waveReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.section:nth-child(2) { animation-delay: 0.08s; }
.section:nth-child(3) { animation-delay: 0.16s; }
.section:nth-child(4) { animation-delay: 0.24s; }
.section:nth-child(5) { animation-delay: 0.32s; }
.section:nth-child(6) { animation-delay: 0.40s; }
