/* ==========================================================================
   NEXORA — Core Styles & Design System
   "WE DON'T PREDICT THE FUTURE. WE ENGINEER IT."
   ========================================================================== */

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

:root {
  /* Core Color Palette */
  --bg-primary: #03050a;
  --bg-space: #080b14;
  --bg-secondary: #101522;
  --bg-card: rgba(16, 21, 34, 0.75);
  --bg-card-hover: rgba(22, 30, 48, 0.85);
  --bg-glass: rgba(8, 11, 20, 0.65);
  --bg-input: rgba(16, 21, 34, 0.9);

  /* Brand Accents */
  --electric-blue: #4d7cfe;
  --cyber-cyan: #00d9ff;
  --electric-violet: #8b5cf6;
  --neon-emerald: #10b981;
  --alert-amber: #f59e0b;
  --danger-rose: #f43f5e;

  /* Typography Colors */
  --text-primary: #f5f7ff;
  --text-secondary: #c0cadb;
  --text-muted: #8d96a8;
  --text-dark: #080b14;

  /* Glowing Borders & Shadows */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(77, 124, 254, 0.35);
  --border-cyan-glow: rgba(0, 217, 255, 0.4);
  --glow-blue: 0 0 35px rgba(77, 124, 254, 0.25);
  --glow-cyan: 0 0 35px rgba(0, 217, 255, 0.25);
  --glow-violet: 0 0 35px rgba(139, 92, 246, 0.25);

  /* Fonts */
  --font-display: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Layout Spacing */
  --container-max: 1320px;
  --container-wide: 1540px;
  --header-height: 84px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Motion Transitions */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out-circ: cubic-bezier(0.85, 0, 0.15, 1);
  --transition-fast: 0.2s ease;
  --transition-base: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset & Document Rules */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  background: radial-gradient(circle at 50% 0%, #0d1326 0%, var(--bg-primary) 70%);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Background Canvas & Grid Container */
#neural-canvas-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
  opacity: 0.45;
}

.noise-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6, .font-display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.75rem);
  line-height: 1.12;
}

h3 {
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1.25;
}

h4 {
  font-size: 1.25rem;
  font-weight: 600;
}

p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
}

p.lead {
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  color: var(--text-secondary);
  line-height: 1.6;
  font-weight: 400;
}

.text-gradient {
  background: linear-gradient(135deg, #ffffff 0%, #c3d3ff 45%, var(--cyber-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-gradient-accent {
  background: linear-gradient(135deg, var(--electric-blue) 0%, var(--cyber-cyan) 50%, var(--electric-violet) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.text-cyan { color: var(--cyber-cyan); }
.text-blue { color: var(--electric-blue); }
.text-violet { color: var(--electric-violet); }
.text-muted { color: var(--text-muted); }

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.container-wide {
  width: 100%;
  max-width: var(--container-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.section {
  padding-top: clamp(80px, 10vw, 140px);
  padding-bottom: clamp(80px, 10vw, 140px);
  position: relative;
}

.section-header {
  margin-bottom: clamp(48px, 6vw, 80px);
}

.section-header.text-center {
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(77, 124, 254, 0.1);
  border: 1px solid rgba(77, 124, 254, 0.25);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cyber-cyan);
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.section-tag .tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyber-cyan);
  box-shadow: 0 0 8px var(--cyber-cyan);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.6); opacity: 0.4; }
}

/* Glassmorphic Cards & Panels */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transition: border-color var(--transition-base), transform var(--transition-base), box-shadow var(--transition-base);
  position: relative;
  overflow: hidden;
}

.glass-panel:hover {
  border-color: var(--border-glow);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), var(--glow-blue);
}

.glass-panel-glow {
  border-color: rgba(77, 124, 254, 0.3);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(77, 124, 254, 0.15);
}

/* Buttons & CTA Elements */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--electric-blue) 0%, #3562e3 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 20px rgba(77, 124, 254, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5b87fe 0%, var(--electric-blue) 100%);
  box-shadow: 0 8px 30px rgba(77, 124, 254, 0.6), 0 0 15px var(--cyber-cyan);
  transform: translateY(-2px);
}

.btn-cyan {
  background: linear-gradient(135deg, var(--cyber-cyan) 0%, #00b3d6 100%);
  color: var(--bg-primary);
  font-weight: 700;
  box-shadow: 0 4px 20px rgba(0, 217, 255, 0.35);
}

.btn-cyan:hover {
  background: #26e0ff;
  box-shadow: 0 8px 30px rgba(0, 217, 255, 0.6);
  transform: translateY(-2px);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 18px;
}

.btn-ghost:hover {
  color: var(--cyber-cyan);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 18px 36px;
  font-size: 1.05rem;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* Magnetic Button Wrapper */
.magnetic-wrap {
  display: inline-block;
  position: relative;
}

/* Form Controls */
.form-group {
  margin-bottom: 24px;
  position: relative;
}

.form-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-control, .form-select, .form-textarea {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.98rem;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--cyber-cyan);
  box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.15), 0 0 15px rgba(0, 217, 255, 0.2);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238D96A8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  padding-right: 44px;
}

.form-error {
  color: var(--danger-rose);
  font-size: 0.82rem;
  margin-top: 6px;
  display: none;
}

.has-error .form-control, .has-error .form-select {
  border-color: var(--danger-rose);
}

.has-error .form-error {
  display: block;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 300px;
  max-width: 420px;
  background: rgba(16, 21, 34, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glow);
  border-left: 4px solid var(--cyber-cyan);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  color: var(--text-primary);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transform: translateX(120%);
  transition: transform 0.4s var(--ease-out-expo), opacity 0.4s ease;
  opacity: 0;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-icon {
  color: var(--cyber-cyan);
  flex-shrink: 0;
  margin-top: 2px;
}

.toast-content {
  flex-grow: 1;
}

.toast-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Grid & Flex Helpers */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); gap: 32px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); gap: 32px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); gap: 24px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

/* Accessible hidden element */
.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;
}

/* Link Resets */
a {
  color: inherit;
  text-decoration: none;
}
