/* ============================================
   Merniki.ru — Base Styles & Design Tokens
   Колористика логотипа: #01328e / #fdfdfd / #08090b
   ============================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Brand Colors */
  --color-blue:        #01328e;
  --color-blue-light:  #1a4faa;
  --color-blue-lighter:#336bc6;
  --color-blue-dark:   #01246a;
  --color-blue-ghost:  #e8f0fb;
  --color-blue-surface:#f0f4fc;

  --color-white:       #fdfdfd;
  --color-black:       #08090b;

  /* Neutrals */
  --color-gray-50:     #f8f9fa;
  --color-gray-100:    #f1f3f5;
  --color-gray-200:    #e9ecef;
  --color-gray-300:    #dee2e6;
  --color-gray-400:    #ced4da;
  --color-gray-500:    #adb5bd;
  --color-gray-600:    #6c757d;
  --color-gray-700:    #495057;
  --color-gray-800:    #343a40;
  --color-gray-900:    #212529;

  /* Form controls — slightly cooler/darker than page white */
  --color-input-bg:    #eceef2;
  --color-input-bg-focus: #f7f8fa;

  /* Accent */
  --color-accent:      #01328e;
  --color-success:     #2b8a3e;
  --color-warning:     #e67700;
  --color-error:       #c92a2a;

  /* Typography */
  --font-primary:      'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:         'SF Mono', 'Fira Code', monospace;

  /* Spacing Scale */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  /* Border Radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 2px rgba(8,9,11,0.06);
  --shadow-md:  0 4px 12px rgba(8,9,11,0.08);
  --shadow-lg:  0 8px 30px rgba(8,9,11,0.12);
  --shadow-xl:  0 20px 60px rgba(8,9,11,0.16);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Container */
  --container-max: 1320px;
  --container-narrow: 960px;
}

/* ---------- CSS Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-gray-800);
  background: #fafbfc;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

input, textarea, select {
  font: inherit;
  color: inherit;
  background-color: var(--color-input-bg);
}

/* ---------- Utility Classes ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ---------- Button Base ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  white-space: nowrap;
  user-select: none;
}

.btn--primary {
  background: var(--color-blue);
  color: var(--color-white);
  box-shadow: 0 2px 8px rgba(1,50,142,0.25);
}
.btn--primary:hover {
  background: var(--color-blue-light);
  box-shadow: 0 4px 16px rgba(1,50,142,0.35);
  transform: translateY(-1px);
}
.btn--primary:active {
  background: var(--color-blue-dark);
  transform: translateY(0);
}

.btn--outline {
  border: 2px solid var(--color-blue);
  color: var(--color-blue);
  background: transparent;
}
.btn--outline:hover {
  background: var(--color-blue);
  color: var(--color-white);
}

.btn--ghost {
  color: var(--color-blue);
  padding: 8px 16px;
}
.btn--ghost:hover {
  background: var(--color-blue-ghost);
}

.btn--lg {
  padding: 16px 36px;
  font-size: 17px;
  border-radius: var(--radius-lg);
}

/* ---------- Typography Helpers ---------- */
.text-xs  { font-size: 12px; line-height: 1.5; }
.text-sm  { font-size: 14px; line-height: 1.5; }
.text-lg  { font-size: 18px; line-height: 1.6; }
.text-xl  { font-size: 20px; line-height: 1.4; }
.text-2xl { font-size: 24px; line-height: 1.3; }
.text-3xl { font-size: 32px; line-height: 1.2; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-blue { color: var(--color-blue); }
.text-gray { color: var(--color-gray-600); }

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ---------- Card Base ---------- */
.card {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  overflow: hidden;
}
.card:hover {
  border-color: var(--color-blue-lighter);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  :root {
    --space-2xl: 32px;
    --space-3xl: 48px;
    --space-4xl: 64px;
  }
  .container {
    padding: 0 var(--space-md);
  }
}
