:root {
  --brand: #1e40af;
  --brand-2: #3b82f6;
  --accent: #f59e0b;
  --brand-rgb: 30, 64, 175;
  --accent-rgb: 245, 158, 11;
}

* {
  box-sizing: border-box;
}

html.js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
}

html.js .reveal.in {
  opacity: 1;
  transform: translateY(0);
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Header sticky */
.header-sticky {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(var(--bg-rgb, 255, 255, 255), 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: var(--space-2) 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-sticky a {
  text-decoration: none;
  color: inherit;
}

/* Sections */
.section {
  padding: clamp(60px, 12vw, 120px) 0;
}

.section.hero {
  padding: clamp(80px, 15vw, 160px) 0;
  background: linear-gradient(135deg, rgba(var(--brand-rgb), 0.03) 0%, rgba(var(--accent-rgb), 0.05) 100%);
  position: relative;
  overflow: hidden;
}

.section.hero::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(var(--brand-rgb), 0.08) 0%, transparent 70%);
  border-radius: 50%;
  top: -150px;
  right: -150px;
  pointer-events: none;
}

.section.hero::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.06) 0%, transparent 70%);
  border-radius: 50%;
  bottom: -100px;
  left: -100px;
  pointer-events: none;
}

/* Grid и утилиты */
.container {
  max-width: var(--container, 1200px);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.grid {
  display: grid;
  gap: var(--space-4);
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Карточки */
.card,
.surface {
  border: 1px solid var(--border);
  border-radius: var(--radius-2, 16px);
  background: var(--surface);
  box-shadow: var(--shadow-1, 0 2px 8px rgba(0, 0, 0, 0.04));
  transition: box-shadow 250ms var(--ease-out), transform 250ms var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-2, 0 12px 24px rgba(0, 0, 0, 0.12));
  transform: translateY(-2px);
}

/* Кнопки */
.btn {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
  background: var(--brand);
  color: white;
  border: none;
  border-radius: var(--radius-2, 12px);
  font-size: var(--step-0, 1rem);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 200ms var(--ease-out);
  box-shadow: 0 4px 12px rgba(var(--brand-rgb), 0.3);
}

.btn:hover {
  background: var(--brand-2);
  box-shadow: 0 8px 20px rgba(var(--brand-rgb), 0.4);
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--surface-2);
  box-shadow: none;
  border-color: var(--brand);
  color: var(--brand);
}

/* Footer */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--space-6) 0;
  margin-top: var(--space-8);
  text-align: center;
}

.footer a {
  color: var(--brand);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Формы */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="url"],
input[type="file"],
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  padding: var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-1, 8px);
  background: var(--bg);
  color: var(--text);
  transition: border-color 150ms, box-shadow 150ms;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(var(--brand-rgb), 0.1);
}

textarea {
  resize: vertical;
}

/* Адаптив для мобиля */
@media (max-width: 768px) {
  .section {
    padding: clamp(40px, 8vw, 80px) 0;
  }

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

  .grid {
    grid-template-columns: 1fr !important;
  }

  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  [style*="grid-template-columns: repeat(auto-fit"] {
    grid-template-columns: 1fr !important;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .cluster {
    justify-content: center;
  }
}

/* Дополнительно для превью резюме */
#preview {
  font-size: 10px;
  line-height: 1.35;
}

@media (max-width: 1024px) {
  [style*="display: grid; grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  #preview {
    width: 100% !important;
    height: auto !important;
    margin: 0 auto;
    page-break-after: always;
  }
}

/* Детали (details) */
details {
  cursor: pointer;
}

details summary::-webkit-details-marker {
  color: var(--brand);
}

details summary::marker {
  color: var(--brand);
}

/* Анимация появления */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  animation: slideUp 0.6s var(--ease-out) forwards;
}

/* Предпочтение уменьшенного движения */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Кастомный фокус для клавиатурной навигации */
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Мобильное меню */
@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
  }

  h2 {
    font-size: clamp(1.4rem, 3vw, 1.8rem);
  }

  .header-sticky .cluster {
    flex-direction: column;
    gap: var(--space-1);
  }

  .header-sticky .btn {
    width: 100%;
  }
}