/* ================================
   CLEAN & SCIENTIFIC DESIGN SYSTEM
   Modern lab aesthetic - professional, clean, trustworthy
   ================================ */

:root {
  /* ========== Primary Color Palette - Clean & Scientific ========== */
  --primary: #10b981;        /* Fresh emerald green - vitality, science, growth */
  --primary-dark: #059669;   /* Deep emerald */
  --primary-light: #34d399;  /* Light emerald */
  --primary-lighter: #6ee7b7;/* Very light emerald */
  
  --secondary: #1a365d;      /* Deep navy - trust, professionalism, depth */
  --secondary-dark: #0f2744; /* Darker navy */
  --secondary-light: #2d4a7c;/* Lighter navy */
  --secondary-lighter: #3b5998;/* Even lighter navy */
  
  --accent: #3b82f6;         /* Clean blue - clarity, precision */
  --accent-dark: #2563eb;    /* Deep blue */
  --accent-light: #60a5fa;   /* Light blue */
  --accent-lighter: #93c5fd; /* Very light blue */
  
  /* ========== Neutral Colors - Clean Backgrounds ========== */
  --white: #ffffff;
  --off-white: #fafafa;      /* Slightly off-white for subtle contrast */
  --gray-50: #f9fafb;        /* Very light gray background */
  --gray-100: #f3f4f6;       /* Light gray background */
  --gray-200: #e5e7eb;       /* Border gray */
  --gray-300: #d1d5db;       /* Muted border */
  --gray-400: #9ca3af;       /* Muted text */
  --gray-500: #6b7280;       /* Secondary text */
  --gray-600: #4b5563;       /* Body text */
  --gray-700: #374151;       /* Headings */
  --gray-800: #1f2937;       /* Dark text */
  --gray-900: #111827;       /* Darkest text */
  
  /* ========== Semantic Colors ========== */
  --success: #10b981;
  --info: #3b82f6;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  /* ========== Spacing Scale (4px base) ========== */
  --space-0: 0;
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */
  
  /* ========== Typography Scale ========== */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */
  --text-6xl: 3.75rem;     /* 60px */
  --text-7xl: 4.5rem;      /* 72px */
  
  /* ========== Font Weights ========== */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;
  
  /* ========== Line Heights ========== */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;
  
  /* ========== Border Radius ========== */
  --radius-none: 0;
  --radius-sm: 0.25rem;    /* 4px */
  --radius-base: 0.5rem;   /* 8px */
  --radius-md: 0.75rem;    /* 12px */
  --radius-lg: 1rem;       /* 16px */
  --radius-xl: 1.5rem;     /* 24px */
  --radius-2xl: 2rem;      /* 32px */
  --radius-full: 9999px;   /* Fully rounded */
  
  /* ========== Shadows - Subtle & Professional ========== */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-base: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* ========== Z-index Scale ========== */
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  
  /* ========== Transitions ========== */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== Typography Base ========== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--gray-700);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--gray-900);
  margin: 0 0 var(--space-4) 0;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  margin: 0 0 var(--space-4) 0;
}

/* ========== Utility Classes ========== */

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

/* Glass Effect - Subtle */
.glass-clean {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--gray-200);
}

/* Card Styles */
.card-clean {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  transition: all var(--transition-base);
}

.card-clean:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Buttons - Clean & Professional */
.btn-clean {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  line-height: 1;
  border-radius: var(--radius-base);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-clean-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-clean-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-clean-secondary {
  background: var(--secondary);
  color: var(--white);
}

.btn-clean-secondary:hover {
  background: var(--secondary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-clean-outline {
  background: transparent;
  color: var(--secondary);
  border: 2px solid var(--secondary);
}

.btn-clean-outline:hover {
  background: var(--secondary);
  color: var(--white);
}

/* Badges */
.badge-clean {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
  background: var(--gray-100);
  color: var(--gray-700);
}

.badge-clean-primary {
  background: rgba(16, 185, 129, 0.1);
  color: var(--primary-dark);
}

.badge-clean-secondary {
  background: rgba(26, 54, 93, 0.1);
  color: var(--secondary);
}

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

.section-clean-gray {
  background: var(--gray-50);
}

/* Focus Styles */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: var(--primary-light);
  color: var(--white);
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* ========== Scroll to Top Button ========== */
#scrollBtn {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  width: 56px;
  height: 56px;
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  z-index: var(--z-fixed);
}

#scrollBtn:hover {
  background: var(--primary-dark);
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* SVG кольцо */
.progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 56px;
  height: 56px;
  transform: rotate(-90deg);
  z-index: 10;
  pointer-events: none;
}

.progress-ring circle {
  fill: none;
  stroke-width: 3;
}

.progress-ring circle.bg {
  stroke: rgba(255, 255, 255, 0.2);
}

.progress-ring circle.progress {
  stroke: var(--white);
  stroke-linecap: round;
  stroke-dasharray: 163.36; /* длина окружности = 2πr */
  stroke-dashoffset: 0; /* чтобы кольцо было полным */
  transition: stroke-dashoffset 0.1s ease;
}

/* стрелка */
#scrollBtn i {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
}

/* Без анимаций при reduce motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  #scrollBtn {
    transition: none !important;
  }
}

/* ========== Responsive Design Utilities ========== */

/* Small Mobile (320px - 575px) */
@media (max-width: 575px) {
  :root {
    /* Adjust spacing for small screens */
    --space-20: 3rem;
    --space-24: 4rem;
    --space-32: 5rem;
  }

  body {
    font-size: 15px;
  }

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

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

  .card-clean {
    padding: var(--space-4);
  }

  .btn-clean {
    padding: var(--space-3) var(--space-5);
    font-size: var(--text-sm);
    width: 100%;
    max-width: 100%;
  }

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

  #scrollBtn {
    width: 44px;
    height: 44px;
    font-size: var(--text-lg);
    bottom: var(--space-4);
    right: var(--space-4);
  }

  .progress-ring {
    width: 44px;
    height: 44px;
  }

  .progress-ring circle {
    stroke-width: 2.5;
  }
}

/* Medium Mobile (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
  .container-clean {
    max-width: 540px;
    padding: 0 var(--space-5);
  }

  .btn-clean {
    width: auto;
  }

  #scrollBtn {
    width: 48px;
    height: 48px;
    bottom: var(--space-5);
    right: var(--space-5);
  }

  .progress-ring {
    width: 48px;
    height: 48px;
  }
}

/* Tablets (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
  .container-clean {
    max-width: 720px;
  }

  #scrollBtn {
    width: 52px;
    height: 52px;
    bottom: var(--space-6);
    right: var(--space-6);
  }

  .progress-ring {
    width: 52px;
    height: 52px;
  }
}

/* Small Laptops (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
  .container-clean {
    max-width: 960px;
  }
}

/* Large Screens (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
  .container-clean {
    max-width: 1140px;
  }
}

/* Extra Large Screens (1400px+) */
@media (min-width: 1400px) {
  .container-clean {
    max-width: 1320px;
  }
}

/* ========== Responsive Utilities ========== */

/* Hide on mobile */
@media (max-width: 767px) {
  .hide-mobile {
    display: none !important;
  }
}

/* Hide on tablet */
@media (min-width: 768px) and (max-width: 991px) {
  .hide-tablet {
    display: none !important;
  }
}

/* Hide on desktop */
@media (min-width: 992px) {
  .hide-desktop {
    display: none !important;
  }
}

/* Show only on mobile */
.show-mobile {
  display: none !important;
}

@media (max-width: 767px) {
  .show-mobile {
    display: block !important;
  }
}

/* Responsive Text Alignment */
@media (max-width: 767px) {
  .text-center-mobile {
    text-align: center !important;
  }

  .text-left-mobile {
    text-align: left !important;
  }
}

/* Responsive Spacing */
@media (max-width: 767px) {
  .p-mobile-4 {
    padding: var(--space-4) !important;
  }

  .px-mobile-4 {
    padding-left: var(--space-4) !important;
    padding-right: var(--space-4) !important;
  }

  .py-mobile-4 {
    padding-top: var(--space-4) !important;
    padding-bottom: var(--space-4) !important;
  }

  .m-mobile-4 {
    margin: var(--space-4) !important;
  }

  .mx-mobile-4 {
    margin-left: var(--space-4) !important;
    margin-right: var(--space-4) !important;
  }

  .my-mobile-4 {
    margin-top: var(--space-4) !important;
    margin-bottom: var(--space-4) !important;
  }
}

/* Responsive Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

.img-responsive {
  width: 100%;
  height: auto;
}

/* Responsive Containers */
@media (max-width: 767px) {
  .container,
  .container-fluid {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

/* Touch-friendly elements */
@media (hover: none) and (pointer: coarse) {
  a, button, .btn-clean, .card-clean {
    min-height: 44px;
    min-width: 44px;
  }

  /* Remove hover effects on touch devices */
  .card-clean:hover {
    transform: none;
  }

  .btn-clean:hover {
    transform: none;
  }
}

/* Landscape phone optimization */
@media (max-height: 600px) and (orientation: landscape) {
  .section-clean {
    padding: var(--space-8) 0;
  }

  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
}


