@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --bg-base:       #0a0a0a;
  --bg-surface:    #111111;
  --bg-elevated:   #1a1a1a;
  --bg-border:     #2a2a2a;

  --orange-500:    #F97316;
  --orange-400:    #FB923C;
  --orange-300:    #FED7AA;
  --orange-glow:   rgba(249, 115, 22, 0.3);

  --purple-500:    #A855F7;
  --purple-400:    #C084FC;
  --purple-glow:   rgba(168, 85, 247, 0.25);

  --text-primary:  #F5F5F5;
  --text-secondary:#A3A3A3;
  --text-muted:    #525252;

  --status-active:   #22C55E;
  --status-progress: #EAB308;
  --status-archived: #6B7280;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Typography Scale */
.text-hero    { font: 700 clamp(2.5rem, 6vw, 4rem)/1.1 var(--font-display); letter-spacing: -0.02em; }
.text-heading { font: 600 clamp(1.5rem, 3vw, 2rem)/1.2 var(--font-display); }
.text-title   { font: 600 1.125rem/1.3 var(--font-display); }
.text-body    { font: 400 1rem/1.6 var(--font-body); }
.text-small   { font: 400 0.875rem/1.5 var(--font-body); }
.text-micro   { font: 500 0.75rem/1.4 var(--font-body); letter-spacing: 0.05em; text-transform: uppercase; }

/* Category badge colors */
.cat-ev-charging    { background: rgba(249,115,22,0.15); color: #FB923C; }
.cat-cms            { background: rgba(168,85,247,0.15); color: #C084FC; }
.cat-e-commerce     { background: rgba(59,130,246,0.15); color: #60A5FA; }
.cat-dashboard      { background: rgba(20,184,166,0.15); color: #2DD4BF; }
.cat-ai-product     { background: rgba(236,72,153,0.15); color: #F472B6; }
.cat-vault          { background: rgba(139,92,246,0.15); color: #A78BFA; }
.cat-ai-insurance   { background: rgba(245,158,11,0.15); color: #FBBF24; }
.cat-default        { background: rgba(107,114,128,0.15); color: #9CA3AF; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--bg-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

/* Focus styles */
:focus-visible {
  outline: 2px solid var(--orange-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Animations */
@media (prefers-reduced-motion: no-preference) {
  @keyframes cardEnter {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%       { transform: translate(30px, -20px) scale(1.05); }
    66%       { transform: translate(-20px, 10px) scale(0.95); }
  }

  @keyframes float2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    40%       { transform: translate(-25px, 15px) scale(1.03); }
    70%       { transform: translate(20px, -10px) scale(0.97); }
  }

  @keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50%       { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  }

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

  @keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
  }

  @keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }

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

  @keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
  }

  @keyframes countUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .card-enter { animation: cardEnter 0.4s ease both; }
  .fade-in    { animation: fadeIn 0.3s ease both; }
  .slide-up   { animation: slideUp 0.3s ease both; }
  .scale-in   { animation: scaleIn 0.25s ease both; }

  .orb {
    animation: float 8s ease-in-out infinite;
  }
  .orb:nth-child(2) { animation-name: float2; animation-duration: 11s; }
  .orb:nth-child(3) { animation-duration: 14s; animation-delay: -3s; }

  .status-active .status-dot {
    animation: pulseGlow 2s infinite;
  }
}

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-elevated) 50%, var(--bg-surface) 75%);
  background-size: 200% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: shimmer 1.5s infinite; }
}

/* Links */
a { color: var(--orange-500); text-decoration: none; }
a:hover { color: var(--orange-400); }

/* Utility */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.truncate-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hover-orange { transition: color 0.15s; }
.hover-orange:hover { color: var(--orange-400) !important; }

/* ===== LIGHT MODE ===== */
:root {
  --nav-bg: rgba(10, 10, 10, 0.85);
}

[data-theme="light"] {
  --bg-base:       #F5F4F0;
  --bg-surface:    #FFFFFF;
  --bg-elevated:   #EDECE8;
  --bg-border:     #D8D6D0;

  --text-primary:  #181818;
  --text-secondary:#454545;
  --text-muted:    #888888;

  --nav-bg: rgba(255, 255, 255, 0.92);
  --orange-glow: rgba(249, 115, 22, 0.18);
}

/* Badge text colours adjusted for light backgrounds */
[data-theme="light"] .cat-ev-charging    { background: rgba(249,115,22,0.1);  color: #C05200; }
[data-theme="light"] .cat-cms            { background: rgba(168,85,247,0.1);  color: #6B21A8; }
[data-theme="light"] .cat-e-commerce     { background: rgba(59,130,246,0.1);  color: #1D4ED8; }
[data-theme="light"] .cat-dashboard      { background: rgba(20,184,166,0.1);  color: #0F766E; }
[data-theme="light"] .cat-ai-product     { background: rgba(236,72,153,0.1);  color: #BE185D; }
[data-theme="light"] .cat-vault          { background: rgba(139,92,246,0.1);  color: #5B21B6; }
[data-theme="light"] .cat-ai-insurance   { background: rgba(245,158,11,0.1);  color: #B45309; }
[data-theme="light"] .cat-default        { background: rgba(107,114,128,0.1); color: #374151; }

[data-theme="light"] mark {
  background: rgba(249,115,22,0.12);
  color: #C05200;
}

[data-theme="light"] .skeleton {
  background: linear-gradient(90deg, #E8E7E2 25%, #F0EFE9 50%, #E8E7E2 75%);
  background-size: 200% 100%;
}

[data-theme="light"] ::-webkit-scrollbar-track { background: var(--bg-base); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #C8C6C0; }

/* Hero heading gradient inverted for light backgrounds */
[data-theme="light"] .hero-title {
  background: linear-gradient(135deg, #181818 55%, var(--orange-500)) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}
