/* ============================================
   KVANT-C.RU — Design System
   Premium Senior Developer Style
   ============================================ */

/* ============================================
   CSS Variables — легко менять дизайн
   ============================================ */
:root {
  /* Цвета фона */
  --bg-primary: #0a0a0b;
  --bg-secondary: #111113;
  --bg-card: #18181b;
  --bg-card-hover: #1f1f23;

  /* Акцентные цвета */
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-gold: #f59e0b;
  --accent-gold-hover: #d97706;
  --accent-green: #10b981;

  /* Текст */
  --text-primary: #fafafa;
  --text-secondary: #e4e4e7;
  --text-muted: #a1a1aa;
  --text-dark: #71717a;

  /* Границы и разделители */
  --border: #27272a;
  --border-light: #3f3f46;

  /* Градиенты */
  --gradient-hero: linear-gradient(135deg, #0a0a0b 0%, #1a1a2e 100%);
  --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --gradient-gold: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);

  /* Тени */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.15);

  /* Типографика */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 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;

  /* Отступы */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Радиусы */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Анимации */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Ширина контента */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
}

/* ============================================
   Light Theme
   ============================================ */
[data-theme="light"] {
  /* Цвета фона */
  --bg-primary: #ffffff;
  --bg-secondary: #f4f4f5;
  --bg-card: #ffffff;
  --bg-card-hover: #f9fafb;

  /* Текст */
  --text-primary: #18181b;
  --text-secondary: #3f3f46;
  --text-muted: #71717a;
  --text-dark: #a1a1aa;

  /* Границы и разделители */
  --border: #e4e4e7;
  --border-light: #d4d4d8;

  /* Градиенты */
  --gradient-hero: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 100%);

  /* Тени */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 40px rgba(59, 130, 246, 0.1);
}

/* ============================================
   Reset & Base
   ============================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
}

/* ============================================
   Typography
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 {
  font-size: var(--text-5xl);
}

h2 {
  font-size: var(--text-4xl);
}

h3 {
  font-size: var(--text-2xl);
}

h4 {
  font-size: var(--text-xl);
}

p {
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-hover);
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.2em 0.4em;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}

/* ============================================
   Layout
   ============================================ */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-24) 0;
}

.section-sm {
  padding: var(--space-16) 0;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  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: 500;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-gold {
  background: var(--gradient-gold);
  color: white;
  font-weight: 600;
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-outline:hover {
  background: var(--bg-card);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--transition-base);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-glow:hover {
  box-shadow: var(--shadow-glow);
}

/* ============================================
   Header / Navigation
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 11, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.logo span {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.nav-link {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-phone {
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}

.nav-phone:hover {
  color: var(--accent);
}

/* Theme Toggle */
.theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  color: var(--text-primary);
}

.theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .nav.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    padding: var(--space-6);
    border-bottom: 1px solid var(--border);
  }
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--gradient-hero);
  padding-top: 72px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.hero-image {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}

@media (max-width: 968px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-image {
    order: -1;
    max-width: 400px;
    margin: 0 auto;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: var(--space-6);
  line-height: 1.1;
}

.hero-title-accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: var(--text-xl);
  color: var(--text-muted);
  margin-bottom: var(--space-8);
  max-width: 600px;
}

.hero-buttons {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: var(--space-12);
  margin-top: var(--space-16);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
}

.hero-stat {
  text-align: left;
}

.hero-stat-value {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--text-primary);
}

.hero-stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* ============================================
   Services Section
   ============================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
}

.service-card {
  padding: var(--space-8);
}

.service-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-accent);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-4);
}

.service-title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.service-description {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-bottom: 0;
}

/* Detailed Services */
.services-detailed {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .services-detailed {
    grid-template-columns: 1fr;
  }
}

.service-detailed-card {
  padding: var(--space-8);
}

.service-detailed-card .service-title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.service-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.service-list li {
  color: var(--text-muted);
  font-size: var(--text-sm);
  padding: var(--space-2) 0;
  padding-left: var(--space-6);
  position: relative;
}

.service-list li::before {
  content: '•';
  color: var(--accent);
  position: absolute;
  left: 0;
}

.service-link {
  display: inline-block;
  margin-top: var(--space-4);
  color: var(--accent);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.service-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Advantages Grid - 2 columns */
.advantages-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .advantages-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Pricing Section
   ============================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

.pricing-card {
  padding: var(--space-8);
  text-align: center;
}

.pricing-card.featured {
  border-color: var(--accent-gold);
  position: relative;
}

.pricing-card.featured::before {
  content: 'Популярный';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-gold);
  color: #000;
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.pricing-name {
  font-size: var(--text-lg);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.pricing-price {
  font-size: var(--text-4xl);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.pricing-price span {
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--text-muted);
}

.pricing-hours {
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}

.pricing-subtitle {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-6);
  min-height: 40px;
}

.pricing-features {
  list-style: none;
  text-align: left;
  margin-bottom: var(--space-8);
}

.pricing-features li {
  padding: var(--space-2) 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.pricing-features {
  list-style: none;
  text-align: left;
  margin-bottom: var(--space-8);
}

.pricing-features li {
  padding: var(--space-2) 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pricing-features li::before {
  content: '✓';
  color: var(--accent-green);
  font-weight: 600;
}

/* ============================================
   Clients/Partners
   ============================================ */
.clients-logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-6);
}

.client-logo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-6);
  text-decoration: none;
  min-height: 140px;
}

.client-logo-card .client-logo {
  max-height: 48px;
  max-width: 120px;
  object-fit: contain;
  transition: all var(--transition-base);
}

.client-logo-card:hover .client-logo {
  transform: scale(1.1);
}

.client-logo-card .client-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
}

.client-logo-card:hover .client-desc {
  color: var(--accent);
}

/* Contacts Grid */
.contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-6);
}

.mt-16 {
  margin-top: var(--space-16);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: var(--space-6) 0;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
}

.footer-brand {
  max-width: 300px;
}

.footer-brand p {
  margin-top: var(--space-4);
  font-size: var(--text-sm);
}

.footer-title {
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-2);
}

.footer-links a {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
}

/* ============================================
   Utilities
   ============================================ */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-muted {
  color: var(--text-muted);
}

.text-accent {
  color: var(--accent);
}

.text-gold {
  color: var(--accent-gold);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.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);
}

/* ============================================
   Section Headers
   ============================================ */
.section-header {
  text-align: center;
  max-width: 600px;
  margin: 0 auto var(--space-16);
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  font-size: var(--text-lg);
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* Stagger children */
.stagger-children>* {
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

.stagger-children>*:nth-child(1) {
  animation-delay: 0.1s;
}

.stagger-children>*:nth-child(2) {
  animation-delay: 0.2s;
}

.stagger-children>*:nth-child(3) {
  animation-delay: 0.3s;
}

.stagger-children>*:nth-child(4) {
  animation-delay: 0.4s;
}

/* ============================================
   Modal & Form Styles
   ============================================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  max-width: 450px;
  width: 90%;
  padding: var(--space-8);
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.form-group {
  margin-bottom: var(--space-4);
}

.form-input {
  width: 100%;
  padding: var(--space-4);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-base);
  transition: border-color var(--transition-base);
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.form-input::placeholder {
  color: var(--text-muted);
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

.w-full {
  width: 100%;
}

/* Callback floating button */
.callback-btn {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  z-index: 100;
}

.callback-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(245, 158, 11, 0.5);
}

.callback-btn svg {
  width: 28px;
  height: 28px;
  fill: white;
}

/* ============================================
   FAQ Styles
   ============================================ */
.faq-categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

@media (max-width: 768px) {
  .faq-categories {
    grid-template-columns: 1fr;
  }
}

.faq-category {
  padding: var(--space-8);
}

.faq-category h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-6);
}

.faq-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.faq-list li {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}

.faq-list li:last-child {
  border-bottom: none;
}

.faq-list a {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  transition: color var(--transition-base);
}

.faq-list a:hover {
  color: var(--accent);
}

.nav-link.active {
  color: var(--accent);
}