/* ============================================
   adserve.ai Design System
   AI-Native Enterprise — Blue/Grey Palette
   ============================================ */

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

:root {
  /* Primary Palette — Deep Blue */
  --navy-900: #030C1E;
  --navy-800: #071428;
  --navy-700: #0E2350;
  --navy-600: #163878;
  --navy-500: #1E4FA0;

  /* Accent — Brand Blue (from logo: "serve / .ai" colour) */
  --orange-500: #4257CC;
  --orange-600: #3348BD;
  --orange-400: #6478D8;
  --orange-300: #8BA4F2;
  --orange-100: #EEF2FF;

  /* Neutrals — Cool Grey */
  --white: #FFFFFF;
  --gray-50: #F7F9FC;
  --gray-100: #EFF2F8;
  --gray-200: #DDE3EE;
  --gray-300: #C3CDE1;
  --gray-400: #8FA0BE;
  --gray-500: #60748F;
  --gray-600: #445268;
  --gray-700: #2E3D54;
  --gray-800: #1A2840;
  --gray-900: #0D1826;

  /* Semantic */
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-tertiary: var(--gray-400);
  --text-on-dark: var(--white);
  --text-on-dark-muted: rgba(255,255,255,0.7);

  /* Surfaces */
  --surface-primary: var(--white);
  --surface-secondary: var(--gray-50);
  --surface-tertiary: var(--gray-100);
  --surface-dark: var(--navy-800);
  --surface-darker: var(--navy-900);

  /* Typography Scale */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --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;

  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.6;
  --leading-relaxed: 1.75;

  --tracking-tight: -0.025em;
  --tracking-normal: 0;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
  --space-40: 10rem;

  /* Layout */
  --container-max: 1140px;
  --container-wide: 1280px;
  --container-narrow: 720px;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.15);
  --shadow-glow: 0 0 40px rgba(59,91,219,0.18);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
}

/* --- Base Styles --- */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--surface-primary);
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }

/* --- Layout --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

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

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

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}

h1 { font-size: var(--text-6xl); }
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; }

p { line-height: var(--leading-normal); }

.text-lead {
  font-size: var(--text-xl);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

.text-overline {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--orange-500);
}

.text-on-dark { color: var(--text-on-dark); }
.text-on-dark h1, .text-on-dark h2, .text-on-dark h3 { color: var(--text-on-dark); }
.text-on-dark p, .text-on-dark .text-lead { color: var(--text-on-dark-muted); }
.text-on-dark .text-overline { color: var(--orange-400); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  white-space: nowrap;
}

.btn--primary {
  background: var(--orange-500);
  color: var(--white);
  box-shadow: 0 1px 2px rgba(59,91,219,0.3);
}
.btn--primary:hover {
  background: var(--orange-600);
  box-shadow: 0 4px 12px rgba(59,91,219,0.35);
  transform: translateY(-1px);
}

.btn--secondary {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.3);
}
.btn--secondary:hover {
  border-color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.05);
}

.btn--outline {
  background: transparent;
  color: var(--navy-800);
  border: 1.5px solid var(--gray-300);
}
.btn--outline:hover {
  border-color: var(--navy-800);
  background: var(--gray-50);
}

.btn--ghost {
  background: transparent;
  color: var(--orange-500);
  padding-left: 0;
  padding-right: 0;
}
.btn--ghost:hover {
  color: var(--orange-600);
}
.btn--ghost .btn-arrow {
  transition: transform var(--duration-normal) var(--ease-out);
}
.btn--ghost:hover .btn-arrow {
  transform: translateX(4px);
}

.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

.btn--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

/* --- Cards --- */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  padding: var(--space-8);
  transition: all var(--duration-normal) var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--gray-300);
  transform: translateY(-2px);
}

.card--dark {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}
.card--dark:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--orange-100);
  color: var(--orange-600);
}

.badge--dark {
  background: rgba(66,87,204,0.15);
  color: var(--orange-400);
}

.badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* --- Sections --- */
.section {
  padding: var(--space-24) 0;
}

.section--lg {
  padding: var(--space-32) 0;
}

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

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

.section--gray {
  background: var(--surface-secondary);
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto var(--space-16);
}

.section-header h2 {
  margin-top: var(--space-4);
  margin-bottom: var(--space-6);
}

/* --- Grid --- */
.grid {
  display: grid;
  gap: var(--space-8);
}

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

/* --- Logo Bar --- */
.logo-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-12);
  flex-wrap: wrap;
  opacity: 0.5;
  filter: grayscale(100%);
  transition: all var(--duration-slow) var(--ease-out);
}

.logo-bar:hover {
  opacity: 0.7;
}

.logo-bar img {
  height: 28px;
  width: auto;
}

/* --- Stat --- */
.stat {
  text-align: center;
}

.stat__number {
  font-size: var(--text-5xl);
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
  color: var(--orange-500);
  line-height: 1;
}

.stat__label {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* --- Icon Box --- */
.icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--orange-100);
  color: var(--orange-500);
  flex-shrink: 0;
}

.icon-box--dark {
  background: rgba(66,87,204,0.12);
  color: var(--orange-400);
}

.icon-box svg {
  width: 24px;
  height: 24px;
}

/* --- Divider --- */
.divider {
  height: 1px;
  background: var(--gray-200);
  border: none;
}

.divider--dark {
  background: rgba(255,255,255,0.08);
}

/* --- Scroll Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

.reveal-scale {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

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

@media (max-width: 768px) {
  html { font-size: 15px; }
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .section { padding: var(--space-16) 0; }
  .section--lg { padding: var(--space-20) 0; }
  .container { padding: 0 var(--space-5); }
}

@media (max-width: 480px) {
  h1 { font-size: var(--text-3xl); }
}
