/* ═══════════════════════════════════════════════════════════════════════
   MAGNUS WEBSITE — Design System (Light Theme)
   AutoGain Insight Systems · Living Reliability Systems
   Inspired by: Relyence, Spicy SE — clean, professional, flowing
   ═══════════════════════════════════════════════════════════════════════ */

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

/* ── CSS Custom Properties (Light Theme) ──────────────────────────────── */
:root {
  /* Backgrounds — bright & clean */
  --bg-primary:    #FFFFFF;
  --bg-secondary:  #F8FAFC;
  --bg-elevated:   #F1F5F9;
  --bg-surface:    #EFF6FF;
  --bg-hero:       linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 50%, #FFF7ED 100%);
  --bg-hero-alt:   linear-gradient(180deg, #EFF6FF 0%, #FFFFFF 100%);
  --bg-overlay:    rgba(255, 255, 255, 0.92);
  --bg-dark:       #0F172A;
  --bg-dark-card:  #1E293B;

  /* Brand primary — deep professional blue */
  --brand-primary:   #1D4ED8;
  --brand-dark:      #1E3A5F;
  --brand-darker:    #0F172A;
  --brand-light:     #DBEAFE;
  --brand-lighter:   #EFF6FF;

  /* Accent colors */
  --accent-blue:     #2563EB;
  --accent-indigo:   #4F46E5;
  --accent-violet:   #7C3AED;
  --accent-green:    #059669;
  --accent-emerald:  #10B981;
  --accent-amber:    #D97706;
  --accent-red:      #DC2626;
  --accent-cyan:     #0891B2;
  --accent-rose:     #E11D48;
  --accent-orange:   #EA580C;
  --accent-teal:     #0D9488;

  /* Text — dark legible text on light backgrounds */
  --text-primary:    #0F172A;
  --text-secondary:  #475569;
  --text-muted:      #94A3B8;
  --text-on-brand:   #FFFFFF;
  --text-on-dark:    #F1F5F9;
  --text-link:       #2563EB;

  /* Borders — soft & subtle */
  --border:          #E2E8F0;
  --border-hover:    #CBD5E1;
  --border-accent:   rgba(37, 99, 235, 0.2);

  /* Gradients */
  --gradient-primary:  linear-gradient(135deg, #2563EB, #4F46E5);
  --gradient-ai:       linear-gradient(135deg, #7C3AED, #EC4899);
  --gradient-cta:      linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  --gradient-card:     linear-gradient(145deg, #FFFFFF 0%, #F8FAFC 100%);
  --gradient-hero-glow: radial-gradient(600px circle at 30% 40%, rgba(37, 99, 235, 0.08), transparent 60%);
  --gradient-section:  linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);

  /* Product accent colors */
  --color-dfmea:     #2563EB;
  --color-pfmea:     #059669;
  --color-resolve:   #D97706;
  --color-genesis:   #7C3AED;
  --color-quantify:  #0891B2;
  --color-fta:       #DC2626;

  /* Shadows — light, elevated, airy */
  --shadow-xs:    0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm:    0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md:    0 4px 6px rgba(0, 0, 0, 0.04), 0 2px 4px rgba(0, 0, 0, 0.03);
  --shadow-lg:    0 10px 25px rgba(0, 0, 0, 0.06), 0 4px 10px rgba(0, 0, 0, 0.03);
  --shadow-xl:    0 20px 50px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(0, 0, 0, 0.04);
  --shadow-2xl:   0 25px 60px rgba(0, 0, 0, 0.1);
  --shadow-card:  0 1px 3px rgba(0,0,0,0.04), 0 6px 16px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 8px 30px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-blue:  0 4px 14px rgba(37, 99, 235, 0.2);

  /* Spacing scale */
  --space-xs:   0.25rem;
  --space-sm:   0.5rem;
  --space-md:   1rem;
  --space-lg:   1.5rem;
  --space-xl:   2rem;
  --space-2xl:  3rem;
  --space-3xl:  4rem;
  --space-4xl:  6rem;
  --space-5xl:  8rem;

  /* Border radius */
  --radius-sm:   0.375rem;
  --radius-md:   0.5rem;
  --radius-lg:   0.75rem;
  --radius-xl:   1rem;
  --radius-2xl:  1.5rem;
  --radius-full: 9999px;

  /* Typography */
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;
  --text-7xl:  4.5rem;

  /* Transitions */
  --ease-out:        cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:     cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast:   150ms;
  --duration-base:   250ms;
  --duration-slow:   400ms;
  --duration-slower:  600ms;

  /* Z-index */
  --z-base:      1;
  --z-dropdown:  100;
  --z-sticky:    200;
  --z-navbar:    500;
  --z-modal:     1000;
  --z-lightbox:  2000;
  --z-toast:     3000;

  /* Layout */
  --max-width:  1280px;
  --max-width-lg: 1440px;
  --max-width-content: 720px;
  --navbar-height: 80px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

::selection {
  background: rgba(37, 99, 235, 0.15);
  color: var(--text-primary);
}

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--duration-fast) ease;
}
a:hover {
  color: var(--accent-indigo);
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul, ol { list-style: none; }

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

h1 { font-size: var(--text-6xl); font-weight: 800; }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); font-weight: 600; }
h5 { font-size: var(--text-lg); font-weight: 600; }
h6 { font-size: var(--text-base); font-weight: 600; }

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-ai {
  background: var(--gradient-ai);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 640px;
}

.overline {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-blue);
}

/* ── Layout Utilities ─────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-lg {
  max-width: var(--max-width-lg);
}

.section {
  padding: var(--space-5xl) 0;
  position: relative;
}

.section-sm {
  padding: var(--space-3xl) 0;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.gap-2xl { gap: var(--space-2xl); }
.gap-3xl { gap: var(--space-3xl); }

.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }
.relative { position: relative; }
.hidden { display: none; }

/* ── Section Backgrounds ──────────────────────────────────────────────── */
.bg-primary   { background-color: var(--bg-primary); }
.bg-secondary { background-color: var(--bg-secondary); }
.bg-elevated  { background-color: var(--bg-elevated); }
.bg-surface   { background-color: var(--bg-surface); }

.bg-dark {
  background-color: var(--bg-dark);
  color: var(--text-on-dark);
}
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5, .bg-dark h6 {
  color: var(--text-on-dark);
}
.bg-dark .subtitle, .bg-dark .product-card__desc, .bg-dark .text-secondary {
  color: #94A3B8;
}

.section-divider {
  height: 1px;
  background: var(--border);
  border: none;
}

.section-glow {
  position: relative;
}
.section-glow::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(37, 99, 235, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Animation Keyframes ──────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

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

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

@keyframes pulse-soft {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.1); }
  50%      { box-shadow: 0 0 0 12px rgba(37, 99, 235, 0); }
}

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

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

/* Animation utility classes */
.animate-fade-in       { animation: fadeIn var(--duration-slow) var(--ease-out) both; }
.animate-fade-in-up    { animation: fadeInUp var(--duration-slower) var(--ease-out) both; }
.animate-fade-in-down  { animation: fadeInDown var(--duration-slow) var(--ease-out) both; }
.animate-fade-in-left  { animation: fadeInLeft var(--duration-slow) var(--ease-out) both; }
.animate-fade-in-right { animation: fadeInRight var(--duration-slow) var(--ease-out) both; }
.animate-scale-in      { animation: scaleIn var(--duration-slow) var(--ease-out) both; }
.animate-float         { animation: float 4s ease-in-out infinite; }

/* Stagger delays */
.stagger > *:nth-child(1) { animation-delay: 0ms; }
.stagger > *:nth-child(2) { animation-delay: 100ms; }
.stagger > *:nth-child(3) { animation-delay: 200ms; }
.stagger > *:nth-child(4) { animation-delay: 300ms; }
.stagger > *:nth-child(5) { animation-delay: 400ms; }
.stagger > *:nth-child(6) { animation-delay: 500ms; }
.stagger > *:nth-child(7) { animation-delay: 600ms; }
.stagger > *:nth-child(8) { animation-delay: 700ms; }

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slower) var(--ease-out),
              transform var(--duration-slower) var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Responsive Breakpoints ───────────────────────────────────────────── */
@media (max-width: 1280px) {
  h1 { font-size: var(--text-5xl); }
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .section { padding: var(--space-4xl) 0; }
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
}

@media (max-width: 768px) {
  :root {
    --navbar-height: 64px;
  }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
  .section { padding: var(--space-3xl) 0; }
  .container { padding: 0 var(--space-md); }
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  .subtitle { font-size: var(--text-base); }
  .hidden-mobile { display: none !important; }
}

@media (max-width: 480px) {
  .grid-6 { grid-template-columns: repeat(2, 1fr); }
  h1 { font-size: var(--text-2xl); }
}
