*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-main);
  background: var(--bg-light);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.nav-open {
  overflow: hidden;
}

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

h1, h2, h3, p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

main {
  overflow-x: hidden;
}

section {
  position: relative;
  overflow: hidden;
}

/* Все секции в Figma имеют одинаковую высоту фрейма (920px десктоп),
   независимо от объёма контента — контент прижат к верху секции,
   снизу остаётся воздух, если контента меньше (как и в самом макете). */
@media (min-width: 1024px) {
  .hero,
  .technologies,
  .approach,
  .product,
  .production,
  .process,
  .contacts {
    min-height: 920px;
  }
}

/* Якоря секций не должны прятаться под фиксированной шапкой */
section[id] {
  scroll-margin-top: var(--header-height);
}

@media (max-width: 900px) {
  section[id] {
    scroll-margin-top: var(--header-height-mobile);
  }
}

/* Skip-link для доступности */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--white);
  color: var(--ink-900);
  padding: 12px 20px;
  z-index: 999;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

/* Видимый outline только при клавиатурной навигации */
body:not(.user-is-tabbing) *:focus {
  outline: none;
}

body.user-is-tabbing *:focus-visible,
*:focus-visible {
  outline: 2px solid var(--brand-orange);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Контейнер секции */
.section-inner {
  position: relative;
  z-index: 2;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: clamp(64px, 8vw, 96px) var(--container-padding);
}

.section-label {
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 1.6px;
  color: var(--ink-muted-light);
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-label--dark {
  color: var(--ink-muted-dark-3);
}

.section-divider {
  border: none;
  border-top: 1px solid rgba(11, 18, 37, 0.17);
  margin: 0 0 32px;
}

.section-divider--dark {
  border-top-color: rgba(255, 255, 255, 0.15);
}

.section-title {
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink-900);
  font-size: clamp(32px, 4.4vw, 44px);
  line-height: 1.15;
  max-width: 1240px;
}

.section-title--dark {
  color: var(--paper);
}

.section-intro {
  margin-top: 22px;
  max-width: 900px;
  font-size: clamp(15px, 1.4vw, 16px);
  line-height: 1.6;
  color: var(--ink-muted-light);
}

.heading-accent {
  display: block;
  width: 128px;
  height: 5px;
  border-radius: 3px;
  background: var(--brand-gradient);
  margin-top: 18px;
  box-shadow: 0 0 10px rgba(240, 0, 117, 0.28);
}

.text-gradient {
  background: var(--brand-gradient-diag);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-gradient-alt {
  background: linear-gradient(90deg, var(--brand-pink), var(--brand-orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Стеклянные поверхности */
.glass-panel {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-lg);
}

.glass-chip {
  background: var(--glass-fill-dark);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.18);
}

.glass-frame {
  position: relative;
  border-radius: var(--radius-xl);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  overflow: hidden;
  box-shadow: 0 20px 42px -10px rgba(5, 10, 31, 0.24);
}

.glass-rail {
  border: 1px solid rgba(102, 168, 255, 0.52);
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, rgba(26, 46, 102, 0.72) 0%, rgba(8, 15, 41, 0.84) 46%, rgba(92, 13, 71, 0.62) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 38px -8px rgba(0, 5, 36, 0.68);
}

.glass-light-wrap {
  position: relative;
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  padding: 18px 26px;
  border-radius: var(--radius-pill);
  border: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.btn--light {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(199, 222, 255, 0.88));
  color: #0b1225;
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 28px -5px rgba(10, 43, 117, 0.38);
}

.btn--light:hover,
.btn--light:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 34px -5px rgba(10, 43, 117, 0.48);
}

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

/* Декоративные фоновые формы (замена недоступных экспортов SVG из Figma) */
.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
  animation: glow-pulse 4.2s ease-in-out infinite;
}

/* Заметная пульсация свечения — похоже на мерцание звёзд: быстрая яркая
   вспышка и более медленный спад. Разный шаг/длительность у соседних
   кругов — чтобы не мигали синхронно, а выглядели живее. */
@keyframes glow-pulse {
  0%, 100% {
    opacity: 0.45;
    filter: blur(60px) brightness(0.85);
  }
  35% {
    opacity: 1;
    filter: blur(60px) brightness(1.5);
  }
  60% {
    opacity: 0.6;
    filter: blur(60px) brightness(1);
  }
}

.glow--services-pink,
.glow--process-pink { animation-duration: 3.8s; }

.glow--services-blue,
.glow--process-blue { animation-duration: 4.8s; animation-delay: -1.5s; }

.glow--product,
.glow--product-blue { animation-duration: 4.4s; animation-delay: -0.8s; }

.glow--production-warm { animation-duration: 3.6s; }

.glow--brand,
.glow--art-orange { animation-duration: 5s; animation-delay: -2s; }

.glow--contacts-blue { animation-duration: 4s; animation-delay: -2.5s; }

@media (prefers-reduced-motion: reduce) {
  .glow {
    animation: none;
  }
}

/* ==========================================================
   Плавное появление элементов при прокрутке (scroll-reveal)
   ==========================================================
   Прогрессивное улучшение: без класса .js-anim-ready на <html>
   (JS не выполнился) элементы .reveal остаются полностью видимыми —
   ничего не сломается и не «зависнет» невидимым. Анимация включается
   только когда main.js успешно отработал И добавил класс. */
html.js-anim-ready .reveal {
  opacity: 0;
  transform: translateY(34px) scale(0.975);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.95s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0s);
}

html.js-anim-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Лёгкий каскад для карточек в сетках — по 60мс на элемент, не больше 5 шагов */
.tech-grid .reveal:nth-child(2) { --reveal-delay: 0.06s; }
.tech-grid .reveal:nth-child(3) { --reveal-delay: 0.12s; }
.tech-grid .reveal:nth-child(4) { --reveal-delay: 0.06s; }
.tech-grid .reveal:nth-child(5) { --reveal-delay: 0.12s; }
.tech-grid .reveal:nth-child(6) { --reveal-delay: 0.18s; }

.process-grid .reveal:nth-child(2) { --reveal-delay: 0.08s; }
.process-grid .reveal:nth-child(3) { --reveal-delay: 0.16s; }
.process-grid .reveal:nth-child(4) { --reveal-delay: 0.24s; }

.contact-list .reveal:nth-child(2) { --reveal-delay: 0.08s; }
.contact-list .reveal:nth-child(3) { --reveal-delay: 0.16s; }

@media (prefers-reduced-motion: reduce) {
  html.js-anim-ready .reveal {
    transition: none;
    transform: none;
    opacity: 1;
  }
}
