/**
 * MODERN LINEAR DESIGN SYSTEM
 * Precision, depth, and fluidity
 * Deep space aesthetic with ambient lighting
 */

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

/* ===== ROOT DESIGN TOKENS ===== */
:root {
  /* Color Palette - Deep Space */
  --bg-deep: #020203;
  --bg-base: #050506;
  --bg-elevated: #0a0a0c;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.08);
  
  /* Typography */
  --fg-primary: #EDEDEF;
  --fg-muted: #8A8F98;
  --fg-subtle: rgba(255, 255, 255, 0.60);
  
  /* Accent - Indigo */
  --accent: #5E6AD2;
  --accent-bright: #6872D9;
  --accent-glow: rgba(94, 106, 210, 0.3);
  
  /* Borders */
  --border-default: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.10);
  --border-accent: rgba(94, 106, 210, 0.30);
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  /* Animation Easing */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== GLOBAL RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--fg-primary);
  line-height: 1.6;
  position: relative;
  overflow-x: hidden;
}

/* Remove terminal font override */
*, *::before, *::after {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif !important;
}

/* ===== LAYERED BACKGROUND SYSTEM ===== */

/* Layer 1: Base gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at top, #0a0a0f 0%, var(--bg-base) 50%, var(--bg-deep) 100%);
  z-index: -4;
}

/* Layer 2: Noise texture */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='4' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.015;
  pointer-events: none;
  z-index: -3;
}

/* Layer 3: Animated gradient blobs */
.ambient-light {
  position: fixed;
  pointer-events: none;
  z-index: -2;
  filter: blur(150px);
  opacity: 0.25;
}

.ambient-light-1 {
  width: 900px;
  height: 1400px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  top: -400px;
  left: 50%;
  transform: translateX(-50%);
  animation: float-1 10s ease-in-out infinite;
}

.ambient-light-2 {
  width: 600px;
  height: 800px;
  background: radial-gradient(circle, rgba(147, 51, 234, 0.15), transparent 70%);
  top: 20%;
  left: -200px;
  filter: blur(120px);
  animation: float-2 12s ease-in-out infinite;
}

.ambient-light-3 {
  width: 500px;
  height: 700px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12), transparent 70%);
  top: 40%;
  right: -150px;
  filter: blur(100px);
  animation: float-3 14s ease-in-out infinite;
}

.ambient-light-4 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  bottom: -200px;
  left: 30%;
  opacity: 0.1;
  filter: blur(140px);
  animation: pulse-glow 8s ease-in-out infinite;
}

@keyframes float-1 {
  0%, 100% { transform: translate(-50%, 0) rotate(0deg); }
  50% { transform: translate(-50%, -20px) rotate(1deg); }
}

@keyframes float-2 {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(-1deg); }
}

@keyframes float-3 {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(25px) rotate(1deg); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.15; }
}

/* Layer 4: Grid overlay */
.grid-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(var(--border-default) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-default) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.02;
  pointer-events: none;
  z-index: -1;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.gradient-text {
  background: linear-gradient(to bottom, #ffffff 0%, rgba(255, 255, 255, 0.95) 50%, rgba(255, 255, 255, 0.7) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-accent {
  background: linear-gradient(to right, var(--accent) 0%, #818cf8 50%, var(--accent) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
}

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

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 200ms var(--ease-out);
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 
    0 0 0 1px rgba(94, 106, 210, 0.5),
    0 4px 12px rgba(94, 106, 210, 0.3),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  background: var(--accent-bright);
  box-shadow: 
    0 0 0 1px rgba(94, 106, 210, 0.6),
    0 6px 20px rgba(94, 106, 210, 0.4),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
}

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

/* Shine effect on hover */
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

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

.btn-secondary {
  background: var(--surface);
  color: var(--fg-primary);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: var(--surface-hover);
  box-shadow: 
    inset 0 1px 0 0 rgba(255, 255, 255, 0.15),
    0 0 20px rgba(94, 106, 210, 0.05);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
}

.btn-ghost:hover {
  background: var(--surface);
  color: var(--fg-primary);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== CARDS ===== */
.card {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  transition: all 300ms var(--ease-out);
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 2px 20px rgba(0, 0, 0, 0.4),
    0 0 40px rgba(0, 0, 0, 0.2);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 300ms var(--ease-out);
}

.card:hover {
  border-color: var(--border-hover);
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.1),
    0 8px 40px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(94, 106, 210, 0.1);
  transform: translateY(-4px);
}

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

/* Mouse tracking spotlight effect */
.card-spotlight {
  position: relative;
  overflow: hidden;
}

.card-spotlight::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms var(--ease-out);
  transform: translate(-50%, -50%);
}

.card-spotlight:hover::after {
  opacity: 0.15;
}

/* ===== INPUTS ===== */
.input-wrapper {
  position: relative;
}

.input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: #0F0F12;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--fg-primary);
  font-size: 0.875rem;
  transition: all 200ms var(--ease-out);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.1);
}

.input::placeholder {
  color: var(--fg-subtle);
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%238A8F98' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* ===== NAVIGATION ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 5, 6, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-default);
}

.nav-link {
  color: var(--fg-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 200ms var(--ease-out);
  position: relative;
}

.nav-link:hover {
  color: var(--fg-primary);
}

.nav-link-active {
  color: var(--fg-primary);
}

.nav-link-active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
}

/* Mobile menu */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 5, 6, 0.95);
  backdrop-filter: blur(20px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 5rem 2rem 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease-out);
}

.mobile-menu.active {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu-link {
  color: var(--fg-primary);
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 600;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-default);
  transition: color 200ms var(--ease-out);
}

.mobile-menu-link:hover {
  color: var(--accent);
}

/* Hamburger icon */
.hamburger {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--fg-primary);
  transition: all 200ms var(--ease-out);
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-accent);
  background: rgba(94, 106, 210, 0.1);
  color: var(--accent-bright);
}

/* ===== LOADING STATES ===== */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(94, 106, 210, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.15);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) var(--bg-base);
}

/* ===== UTILITY CLASSES ===== */
.text-muted {
  color: var(--fg-muted);
}

.text-subtle {
  color: var(--fg-subtle);
}

.border-default {
  border: 1px solid var(--border-default);
}

.surface {
  background: var(--surface);
}

.surface-hover:hover {
  background: var(--surface-hover);
}

/* ===== ANIMATIONS ===== */
.fade-in {
  animation: fadeIn 600ms var(--ease-out);
}

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

.scale-in {
  animation: scaleIn 600ms var(--ease-out);
}

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

/* Stagger children */
.stagger-children > * {
  animation: fadeIn 600ms var(--ease-out) backwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 80ms; }
.stagger-children > *:nth-child(3) { animation-delay: 160ms; }
.stagger-children > *:nth-child(4) { animation-delay: 240ms; }
.stagger-children > *:nth-child(5) { animation-delay: 320ms; }
.stagger-children > *:nth-child(6) { animation-delay: 400ms; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  :root {
    font-size: 14px;
  }
  
  .card {
    padding: 1rem;
  }
  
  .ambient-light {
    filter: blur(100px);
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .ambient-light {
    animation: none;
  }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== MODERN COMPONENT CLASSES ===== */
/* For About and Guide pages */

.modern-h1 {
  font-size: 2.5rem;
  line-height: 1.1;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: -0.02em;
}

@media (min-width: 640px) {
  .modern-h1 {
    font-size: 3rem;
  }
}

.modern-subtitle {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
}

.modern-gradient-text {
  background: linear-gradient(135deg, var(--accent), #8B5CF6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.modern-card-glass {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 1rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.modern-accent-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(94, 106, 210, 0.1);
  border: 1px solid rgba(94, 106, 210, 0.2);
  border-radius: 9999px;
}

.modern-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  background: var(--accent);
  border-radius: 0.75rem;
  transition: all 200ms var(--ease-out);
}

.modern-btn-primary:hover {
  background: #4F5ABF;
  box-shadow: 0 8px 30px rgba(94, 106, 210, 0.3);
  transform: translateY(-1px);
}

.modern-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 2rem 0;
  margin-top: 4rem;
}

.modern-logo {
  font-size: 1.125rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), #8B5CF6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.modern-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 5, 6, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modern-nav-link {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 200ms var(--ease-out);
}

.modern-nav-link:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}

.modern-nav-link-active {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}
