/* ============================================
   CONNECT ESTONIA — Design System
   Estonia-inspired: Deep Blue, White, Black, 
   Light Grey, Digital Green
   ============================================ */

/* ---------- 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&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ============================================
   1. CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
  /* --- Primary (Estonian Blue) --- */
  --color-primary: #003399;
  --color-primary-light: #1a4fbd;
  --color-primary-lighter: #3366cc;
  --color-primary-dark: #001f5c;
  --color-primary-darkest: #000d33;

  /* --- Accent (Digital Green) --- */
  --color-accent: #00C853;
  --color-accent-light: #69F0AE;
  --color-accent-dark: #00963e;
  --color-accent-glow: rgba(0, 200, 83, 0.25);

  /* --- Neutrals --- */
  --color-white: #FFFFFF;
  --color-neutral-50: #FAFBFD;
  --color-neutral-100: #F5F7FA;
  --color-neutral-200: #E8ECF1;
  --color-neutral-300: #D1D8E0;
  --color-neutral-400: #A0AEC0;
  --color-neutral-500: #718096;
  --color-neutral-600: #4A5568;
  --color-neutral-700: #2D3748;
  --color-neutral-800: #1A1A2E;
  --color-neutral-900: #0D0D1A;

  /* --- Semantic --- */
  --color-success: #00C853;
  --color-warning: #FFB300;
  --color-error: #FF1744;
  --color-info: #2979FF;

  /* --- Gradients --- */
  --gradient-primary: linear-gradient(135deg, #003399 0%, #1a4fbd 50%, #3366cc 100%);
  --gradient-hero: linear-gradient(135deg, #000d33 0%, #003399 40%, #1a4fbd 100%);
  --gradient-accent: linear-gradient(135deg, #00963e 0%, #00C853 50%, #69F0AE 100%);
  --gradient-dark: linear-gradient(180deg, #0D0D1A 0%, #1A1A2E 100%);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
  --gradient-glass: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
  --gradient-blue-green: linear-gradient(135deg, #003399 0%, #00C853 100%);
  --gradient-section: linear-gradient(180deg, #F5F7FA 0%, #FFFFFF 100%);

  /* --- Typography --- */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-accent: 'Space Grotesk', 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;

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

  /* --- Borders & Radius --- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.15);
  --shadow-2xl: 0 24px 64px rgba(0, 0, 0, 0.2);
  --shadow-blue: 0 8px 30px rgba(0, 51, 153, 0.2);
  --shadow-green: 0 8px 30px rgba(0, 200, 83, 0.2);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 8px 32px rgba(0, 51, 153, 0.15), 0 16px 48px rgba(0, 0, 0, 0.1);
  --shadow-glow-blue: 0 0 40px rgba(0, 51, 153, 0.3);
  --shadow-glow-green: 0 0 40px rgba(0, 200, 83, 0.3);

  /* --- Transitions --- */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-spring: 500ms cubic-bezier(0.175, 0.885, 0.32, 1.275);

  /* --- Z-Index --- */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-navbar: 1000;
  --z-modal-backdrop: 1100;
  --z-modal: 1200;
  --z-toast: 1300;
  --z-tooltip: 1400;

  /* --- Layout --- */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1200px;
  --container-2xl: 1400px;
  --navbar-height: 80px;
}

/* ============================================
   2. RESET & BASE STYLES
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

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

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-primary-light);
}

ul, ol {
  list-style: none;
}

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

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

::selection {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* ============================================
   3. TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--color-neutral-900);
}

h1 {
  font-size: var(--text-5xl);
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--text-4xl);
  letter-spacing: -0.015em;
}

h3 {
  font-size: var(--text-2xl);
  font-weight: 600;
}

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

p {
  margin-bottom: var(--space-4);
  color: var(--color-neutral-600);
}

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

.text-accent {
  color: var(--color-accent);
}

.text-primary {
  color: var(--color-primary);
}

.text-white {
  color: var(--color-white);
}

.text-center {
  text-align: center;
}

.font-accent {
  font-family: var(--font-accent);
}

/* ============================================
   4. LAYOUT UTILITIES
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

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

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

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

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

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

.section-dark {
  background: var(--gradient-dark);
  color: var(--color-white);
}

.section-dark h1, .section-dark h2, .section-dark h3,
.section-dark h4, .section-dark h5, .section-dark h6 {
  color: var(--color-white);
}

.section-dark p {
  color: var(--color-neutral-300);
}

.section-grey {
  background: var(--color-neutral-100);
}

.section-gradient {
  background: var(--gradient-section);
}

/* Flexbox */
.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-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.gap-10 { gap: var(--space-10); }
.gap-12 { gap: var(--space-12); }

/* Grid */
.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-auto {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* ============================================
   5. ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

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

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

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

@keyframes rotateGlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes nodeFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.6;
  }
  25% {
    transform: translate(10px, -15px) scale(1.1);
    opacity: 0.8;
  }
  50% {
    transform: translate(-5px, -25px) scale(1);
    opacity: 0.5;
  }
  75% {
    transform: translate(-15px, -10px) scale(1.05);
    opacity: 0.7;
  }
}

@keyframes lineGrow {
  from { stroke-dashoffset: 1000; }
  to { stroke-dashoffset: 0; }
}

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

/* Scroll Reveal Classes */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-right.revealed {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Staggered children */
.stagger-children .reveal:nth-child(1) { transition-delay: 0.05s; }
.stagger-children .reveal:nth-child(2) { transition-delay: 0.1s; }
.stagger-children .reveal:nth-child(3) { transition-delay: 0.15s; }
.stagger-children .reveal:nth-child(4) { transition-delay: 0.2s; }
.stagger-children .reveal:nth-child(5) { transition-delay: 0.25s; }
.stagger-children .reveal:nth-child(6) { transition-delay: 0.3s; }
.stagger-children .reveal:nth-child(7) { transition-delay: 0.35s; }
.stagger-children .reveal:nth-child(8) { transition-delay: 0.4s; }
.stagger-children .reveal:nth-child(9) { transition-delay: 0.45s; }
.stagger-children .reveal:nth-child(10) { transition-delay: 0.5s; }
.stagger-children .reveal:nth-child(11) { transition-delay: 0.55s; }
.stagger-children .reveal:nth-child(12) { transition-delay: 0.6s; }

/* ============================================
   6. GLASSMORPHISM
   ============================================ */
.glass {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.glass-light {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.glass-dark {
  background: rgba(0, 13, 51, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================
   7. RESPONSIVE BREAKPOINTS
   ============================================ */
@media (max-width: 1200px) {
  :root {
    --text-7xl: 3.75rem;
    --text-6xl: 3rem;
    --text-5xl: 2.5rem;
  }
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }

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

@media (max-width: 768px) {
  :root {
    --text-7xl: 2.75rem;
    --text-6xl: 2.25rem;
    --text-5xl: 2rem;
    --text-4xl: 1.75rem;
    --text-3xl: 1.5rem;
    --navbar-height: 70px;
  }

  .container {
    padding: 0 var(--space-4);
  }

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

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

  .hide-mobile { display: none !important; }
}

@media (max-width: 480px) {
  :root {
    --text-5xl: 1.75rem;
    --text-4xl: 1.5rem;
    --text-3xl: 1.25rem;
  }
}

/* ============================================
   8. UTILITY CLASSES
   ============================================ */
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mb-12 { margin-bottom: var(--space-12); }
.mb-16 { margin-bottom: var(--space-16); }

.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }

.mx-auto { margin-left: auto; margin-right: auto; }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.w-full { width: 100%; }
.max-w-lg { max-width: 720px; }
.max-w-xl { max-width: 960px; }

.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Section heading pattern */
.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto var(--space-16);
}

.section-header .section-label {
  display: inline-block;
  font-family: var(--font-accent);
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  background: rgba(0, 200, 83, 0.1);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

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

.section-header p {
  font-size: var(--text-lg);
  color: var(--color-neutral-500);
  max-width: 640px;
  margin: 0 auto;
}

.section-dark .section-header .section-label {
  background: rgba(0, 200, 83, 0.15);
}

/* Divider */
.divider {
  width: 60px;
  height: 3px;
  background: var(--gradient-blue-green);
  border-radius: var(--radius-full);
  margin: var(--space-6) auto;
}
