:root {
  --motion-duration-fast: 180ms;
  --motion-duration-medium: 260ms;
  --motion-duration-slow: 420ms;
  --motion-ease-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
  --motion-ease-soft: cubic-bezier(0.25, 0.1, 0.25, 1);
  --reveal-distance: 18px;
  --shadow-rest: 0 12px 30px rgb(0 61 130 / 12%);
  --shadow-lift: 0 25px 55px rgb(0 61 130 / 18%);
  --header-shadow-rest: 0 10px 28px rgb(15 23 42 / 8%);
  --header-shadow-scrolled: 0 18px 40px rgb(15 23 42 / 12%);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: Inter, sans-serif;
  background-color: #f8fafc;
  color: #0f172a;
}

.gradient-rosatom {
  background: linear-gradient(135deg, #003d82 0%, #4a90e2 100%);
}

.cyber-glow {
  box-shadow: var(--shadow-rest);
  transition: box-shadow var(--motion-duration-medium) var(--motion-ease-standard);
}

.cyber-glow:hover,
.cyber-glow:focus-visible {
  box-shadow: var(--shadow-lift);
}

.grid-pattern {
  background-image:
    linear-gradient(rgb(255 255 255 / 10%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 10%) 1px, transparent 1px);
  background-size: 20px 20px;
}

.hero-bg {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.service-card {
  background: linear-gradient(145deg, #fff 0%, #f8fafc 100%);
  border: 1px solid #e2e8f0;
}

.section-divider {
  position: relative;
}

.section-divider::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: clamp(120px, 32vw, 220px);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    transparent,
    var(--divider-color, rgb(148 163 184 / 55%)),
    transparent
  );
  pointer-events: none;
  z-index: 1;
}

.section-divider--light {
  --divider-color: rgb(255 255 255 / 35%);
}

/* Иконки в карточках: единая глубина, контраст и предсказуемый hover. */
.icon-wrapper {
  display: grid;
  place-items: center;
  border-radius: 1.25rem;
  isolation: isolate;
}

.icon-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 28%),
    0 12px 26px rgb(15 23 42 / 16%);
  pointer-events: none;
}

.icon-bg {
  transform: translateZ(0);
  transition:
    transform var(--motion-duration-medium) var(--motion-ease-standard),
    box-shadow var(--motion-duration-medium) var(--motion-ease-standard),
    opacity var(--motion-duration-medium) var(--motion-ease-standard);
  box-shadow: 0 10px 24px rgb(15 23 42 / 18%);
}

.icon-wrapper svg {
  filter: drop-shadow(0 8px 16px rgb(15 23 42 / 20%));
  transition: transform var(--motion-duration-medium) var(--motion-ease-standard);
}

.group:hover .icon-bg,
.group:focus-within .icon-bg {
  transform: scale(1.04);
  opacity: 0.95;
}

.group:hover .icon-wrapper svg,
.group:focus-within .icon-wrapper svg {
  transform: translateY(-1px) scale(1.05);
}

.floating-animation {
  --parallax-y: 0px;

  animation: hero-float 6s var(--motion-ease-soft) infinite;
  will-change: transform;
}

@keyframes hero-float {
  0%,
  100% {
    transform: translate3d(0, var(--parallax-y, 0), 0);
  }

  50% {
    transform: translate3d(0, calc(var(--parallax-y, 0px) - 10px), 0);
  }
}

/* Для сертификации линия */

/* Раньше использовался общий scan, который конфликтовал с другими анимациями. */

/* Теперь keyframes уникален и адаптивен к высоте контейнера. */
@keyframes certification-scan {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 0;
  }

  12% {
    opacity: 1;
  }

  88% {
    opacity: 1;
  }

  100% {
    transform: translate3d(0, calc(100% - var(--scanline-size, 2px)), 0);
    opacity: 0;
  }
}

.animate-certification-scan {
  animation: certification-scan 4.6s ease-in-out infinite;
  will-change: transform, opacity;
}

/* Для пентеста вариант 1 - делает красную линию */
@keyframes draw-path {
  to {
    stroke-dashoffset: 0;
  }
}

.group:hover .path-animation {
  animation: draw-path 1.5s ease-out forwards;
}

/* Для пентеста вариант вариант с горизонтальной линией вниз */

/* Убрали магическое число 320px, теперь движение зависит от размеров блока. */
@keyframes pentest-scanline-y {
  0% {
    transform: translate3d(0, 0%, 0);
  }

  100% {
    transform: translate3d(0, calc(100% - var(--scanline-size, 2px)), 0);
  }
}

.animate-scanline {
  animation: pentest-scanline-y 4.2s linear infinite;
  will-change: transform;
}

/* Плавная бесконечная прокрутка двух одинаковых блоков кода */
@keyframes code-waterfall {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(0, -50%, 0);
  } /* сдвиг на высоту первого блока */
}

/* Едва заметный двигающийся блик */

/* Раньше использовался translateX(316px), что ломало адаптивность. */
@keyframes pentest-scan-x {
  0% {
    transform: translate3d(0%, 0, 0);
  }

  50% {
    transform: translate3d(calc(100% - var(--scanline-size, 4px)), 0, 0);
  }

  100% {
    transform: translate3d(0%, 0, 0);
  }
}

.animate-scan {
  animation: pentest-scan-x 6.4s ease-in-out infinite;
  will-change: transform;
}

.animate-waterfall {
  animation: code-waterfall var(--code-speed, 26s) linear infinite;
  will-change: transform;
}

/* Остановка анимации при ховере окна */
.group:hover .animate-waterfall,
.group:hover .animate-scan,
.group:hover .animate-scanline {
  animation-play-state: paused;
}

/* Подстраиваемся под prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .animate-waterfall,
  .animate-scan,
  .animate-scanline,
  .animate-certification-scan,
  .floating-animation {
    animation: none !important;
    transform: none !important;
  }
}

/* Гарантируем, что код не ломается на строки */
.code-block {
  white-space: pre;
}

/* --- Стили для ПЕНТЕСТА анимации сканирования и кода --- */

/* Стили для контейнера с кодом, чтобы он правильно переносился */
#code-container {
  word-break: break-all; /* Разрешаем перенос в любом месте */
  line-height: 1.5; /* Устанавливаем высоту строки для расчетов */
}

/* Стили для найденной "ошибки" */
.error-char {
  color: #ef4444; /* Красный цвет */
  animation: pulse 1.5s infinite; /* Анимация пульсации */
  text-shadow: 0 0 8px #ef4444; /* Эффект свечения */
}

/* --- СТИЛИ ДЛЯ СДЕРЖАННОГО ГЛИТЧ-ЭФФЕКТА + СВЕЧЕНИЕ ЧАСТИЦ --- */

/* --- СТИЛИ ДЛЯ ГЛИТЧ-ЭФФЕКТА И СВЕЧЕНИЯ --- */

.glitch-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glitch-layer-base,
.glitch-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.glitch-layer {
  opacity: 0;
  transition: opacity 0.1s ease-in;
}

.group:hover .glitch-layer {
  opacity: 1;
}

@keyframes glitch-subtle-animation {
  0% {
    transform: translate(0);
  }

  25% {
    transform: translate(-2px, 2px);
  }

  50% {
    transform: translate(2px, -2px);
  }

  75% {
    transform: translate(-1px, 1px);
  }

  100% {
    transform: translate(0);
  }
}

@keyframes glitch-scanline {
  0% {
    clip-path: inset(0% 0 95% 0);
  }

  25% {
    clip-path: inset(20% 0 75% 0);
  }

  50% {
    clip-path: inset(50% 0 40% 0);
  }

  75% {
    clip-path: inset(80% 0 10% 0);
  }

  100% {
    clip-path: inset(95% 0 0% 0);
  }
}

.group:hover .glitch-layer:nth-child(2) {
  mix-blend-mode: multiply;
  filter: brightness(0.8) contrast(1.5);
  animation: glitch-subtle-animation 0.7s linear both infinite;
}

.group:hover .glitch-layer:nth-child(3) {
  mix-blend-mode: color-dodge;
  filter: brightness(5) grayscale(1) contrast(3) sepia(0.5);
  animation: glitch-scanline 1.2s linear both infinite;
}

.group:hover .glitch-layer-base {
  filter: brightness(0.95);
  transition: filter 0.2s ease-in-out;
}

.group .glitch-layer-base {
  transition: filter 0.3s ease-in-out;
}

/* === ИЗМЕНЕНИЯ ЗДЕСЬ === */

/* Свечение и эффекты для частиц */
.glitch-layer-base circle {
  /* Добавляем transition для плавного изменения filter и transform */
  transition: filter 0.3s ease-out, transform 0.3s ease-out;

  /* Устанавливаем transform-origin в центр, чтобы масштабирование было корректным */
  transform-origin: center center;
}

/* При наведении на группу... */
.group:hover .glitch-layer-base circle {
  /* ...немного увеличиваем частицы */
  transform: scale(1.2);
}

.group:hover .glitch-layer-base circle[fill="#10b981"] {
  /* Добавляем blur(1px) к существующему свечению */
  filter: drop-shadow(0 0 8px #10b981) blur(1px);
}

.group:hover .glitch-layer-base circle[fill="#4a90e2"] {
  /* Добавляем blur(1px) к существующему свечению */
  filter: drop-shadow(0 0 8px #4a90e2) blur(1px);
}

.group:hover .glitch-layer-base circle[fill="#15256d"] {
  /* Добавляем blur(0.5px) для самых маленьких частиц */
  filter: drop-shadow(0 0 6px #4a90e2) blur(0.5px);
}

/* Анимация для плавного появления cookie-баннера */

/* Убрали общее имя fadeInUp, чтобы не пересекаться с JS-инжектом. */
@keyframes cg-fade-in-up {
  from {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.animate-fade-in-up {
  animation: cg-fade-in-up 0.6s var(--motion-ease-standard) forwards;
}

/* Скрытие cookie-баннера через класс вместо inline-стилей из JS */
#cookie-notice {
  transition:
    opacity var(--motion-duration-medium) var(--motion-ease-standard),
    transform var(--motion-duration-medium) var(--motion-ease-standard);
  will-change: opacity, transform;
}

#cookie-notice.cookie-notice--closing {
  opacity: 0;
  transform: translate3d(0, 100%, 0);
}

/* Мигающий курсор на конце напечатанного текста */
@keyframes caret-blink {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

#typed::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  background: #2563eb; /* замените на ваш rosatom-blue, если нужен */
  vertical-align: -2px;
  animation: caret-blink 1s steps(1) infinite;
}

.ide.paused #typed::after {
  animation-play-state: paused;
  opacity: 1;
}

/* Активная строка под курсором */
.ide .active-line {
  --lh: 1.5rem; /* leading-6 */

  position: absolute;
  transform: translateY(calc(var(--line-i, 0) * var(--lh)));
  transition: transform 120ms ease-out, opacity 200ms ease-out;
  opacity: 0.85;
}

/* Уважение prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  #typed::after {
    display: none;
  }
}

/* Уважение Анимация атаки на сервер (красные линии) */

/* Переименовали keyframes, чтобы не было коллизий с другими секциями. */
@keyframes tech-attack {
  0% {
    transform: translate3d(-20%, 0, 0) scaleX(0.6);
    opacity: 0;
  }

  35% {
    opacity: 1;
  }

  100% {
    transform: translate3d(var(--attack-travel, 180%), 0, 0) scaleX(1);
    opacity: 0;
  }
}

/* Анимация движения сканера вверх-вниз */

/* Старый scan переименован в certification-scan и вынесен выше. */

/* Анимация появления плашек справа */

/* Старый slideIn переименован в certification-slide-in. */
@keyframes certification-slide-in {
  0% {
    transform: translate3d(12px, 0, 0);
    opacity: 0;
  }

  12% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }

  45% {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }

  62% {
    transform: translate3d(12px, 0, 0);
    opacity: 0;
  }

  100% {
    transform: translate3d(12px, 0, 0);
    opacity: 0;
  }
}

/* Единый класс для reveal-анимаций без конфликтов transform на hover */
.reveal-on-scroll {
  --reveal-offset: var(--reveal-distance);
  --lift-offset: 0px;

  opacity: 0;
  transform: translate3d(0, calc(var(--reveal-offset) + var(--lift-offset)), 0);
  transition:
    opacity var(--motion-duration-slow) var(--motion-ease-standard),
    transform var(--motion-duration-slow) var(--motion-ease-standard),
    box-shadow var(--motion-duration-medium) var(--motion-ease-standard);
  will-change: transform, opacity;
}

.reveal-on-scroll.is-visible {
  --reveal-offset: 0px;

  opacity: 1;
}

/* Добавили hover-lift через CSS-переменную, чтобы не перетирать transform. */
.reveal-on-scroll.hover-lift:hover,
.reveal-on-scroll.hover-lift:focus-within {
  --lift-offset: -8px;

  box-shadow: var(--shadow-lift);
}

.hover-lift:not(.reveal-on-scroll) {
  --lift-offset: 0px;

  transform: translate3d(0, var(--lift-offset), 0);
  transition:
    transform var(--motion-duration-medium) var(--motion-ease-standard),
    box-shadow var(--motion-duration-medium) var(--motion-ease-standard);
}

.hover-lift:not(.reveal-on-scroll):hover,
.hover-lift:not(.reveal-on-scroll):focus-visible {
  --lift-offset: -8px;

  box-shadow: var(--shadow-lift);
}

/* Стили модального окна вынесены из JS, чтобы не дублировать и не инжектить <style>. */
.modal {
  position: fixed;
  inset: 0;
  padding: 1.5rem;
  background: rgb(15 23 42 / 72%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--motion-duration-medium) var(--motion-ease-standard),
    visibility var(--motion-duration-medium) linear;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  position: relative;
  background: #fff;
  padding: 2rem;
  border-radius: 16px;
  max-width: 520px;
  width: min(92vw, 520px);
  max-height: min(90vh, 760px);
  overflow-y: auto;
  transform: translate3d(0, 12px, 0) scale(0.98);
  transition: transform var(--motion-duration-medium) var(--motion-ease-standard);
  box-shadow: var(--shadow-lift);
}

.modal.show .modal-content {
  transform: translate3d(0, 0, 0) scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 0.25rem;
  border-radius: 10px;
  transition:
    color var(--motion-duration-fast) var(--motion-ease-standard),
    background-color var(--motion-duration-fast) var(--motion-ease-standard),
    transform var(--motion-duration-fast) var(--motion-ease-standard);
}

.modal-close:hover,
.modal-close:focus-visible {
  color: #0f172a;
  background-color: #f1f5f9;
  transform: scale(1.05);
}

.modal-title {
  color: #003d82;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.modal-text {
  color: #475569;
  margin-bottom: 1.5rem;
}

.modal-field {
  margin-bottom: 1rem;
}

.modal-field--honeypot {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.modal-label {
  display: block;
  color: #0f172a;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.modal-input,
.modal-select,
.modal-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-size: 1rem;
  background-color: #fff;
  transition:
    border-color var(--motion-duration-fast) var(--motion-ease-standard),
    box-shadow var(--motion-duration-fast) var(--motion-ease-standard);
}

.modal-input:focus-visible,
.modal-select:focus-visible,
.modal-textarea:focus-visible {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgb(37 99 235 / 20%);
}

.modal-textarea {
  min-height: 96px;
  resize: vertical;
}

.modal-consent {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.modal-consent input[type='checkbox'] {
  margin-top: 0.25rem;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  accent-color: #003d82;
}

.modal-consent-text {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.4;
}

.modal-consent-text a {
  color: #003d82;
  text-decoration: underline;
}

.modal-submit {
  width: 100%;
  background: #003d82;
  color: #fff;
  padding: 0.85rem 1rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color var(--motion-duration-fast) var(--motion-ease-standard),
    transform var(--motion-duration-fast) var(--motion-ease-standard),
    box-shadow var(--motion-duration-fast) var(--motion-ease-standard);
}

.modal-submit:hover,
.modal-submit:focus-visible {
  background: #002f66;
  transform: translateY(-1px);
  box-shadow: var(--shadow-lift);
}

.modal-submit:disabled {
  opacity: 0.85;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.modal-error {
  color: #d93025;
  text-align: center;
  margin-top: 1rem;
  font-weight: 600;
}

/* Ошибка формы теперь оформляется через класс, чтобы не писать inline-стили из JS. */
.form-error-message {
  color: #d93025;
  text-align: center;
  margin-top: 1rem;
  font-weight: 600;
}

.modal-success {
  text-align: center;
  padding: 2rem 1rem;
}

.modal-success-icon {
  margin: 0 auto 1rem;
}

.modal-success-title {
  color: #003d82;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.modal-success-text {
  color: #64748b;
  margin-bottom: 1.5rem;
}

.modal-secondary-action {
  background: #003d82;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  cursor: pointer;
  transition:
    background-color var(--motion-duration-fast) var(--motion-ease-standard),
    transform var(--motion-duration-fast) var(--motion-ease-standard);
}

.modal-secondary-action:hover,
.modal-secondary-action:focus-visible {
  background: #002f66;
  transform: translateY(-1px);
}

/* Уведомления теперь анимируются через класс, чтобы не менять inline-стили из JS. */
.cg-toast {
  transform: translateX(100%);
  transition: transform var(--motion-duration-fast) var(--motion-ease-standard);
  will-change: transform;
}

.cg-toast.is-visible {
  transform: translateX(0);
}

/* Единые focus-visible стили для доступности по всему сайту */
.focus-ring {
  outline: none;
}

.focus-ring:focus-visible {
  outline: 2px solid rgb(0 61 130 / 35%);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgb(59 130 246 / 25%);
}

/* Состояния sticky header без визуальных «прыжков» */
.site-header {
  box-shadow: var(--header-shadow-rest);
  transition:
    box-shadow var(--motion-duration-medium) var(--motion-ease-standard),
    background-color var(--motion-duration-fast) var(--motion-ease-standard);
}

.site-header.is-scrolled {
  box-shadow: var(--header-shadow-scrolled);
}

/* Единые состояния для ссылок в навигации */
.nav-link {
  position: relative;
  font-weight: 500;
  transition: color var(--motion-duration-fast) var(--motion-ease-standard);
}

/* Синхронизируем цвет текста при фокусе с hover, чтобы навигация была предсказуемой. */
.nav-link:focus-visible {
  color: #003d82;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.45rem;
  height: 2px;
  border-radius: 999px;
  background: currentcolor;
  opacity: 0.45;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--motion-duration-fast) var(--motion-ease-standard);
}

.nav-link:hover::after,
.nav-link:focus-visible::after,
.nav-link[aria-current='page']::after {
  transform: scaleX(1);
}

/* Dropdown теперь открывается не только по hover, но и по focus/click */
.dropdown-panel {
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 8px, 0);
  pointer-events: none;
  transition:
    opacity var(--motion-duration-fast) var(--motion-ease-standard),
    transform var(--motion-duration-fast) var(--motion-ease-standard),
    visibility var(--motion-duration-fast) linear;
}

.dropdown:hover .dropdown-panel,
.dropdown:focus-within .dropdown-panel,
.dropdown[data-open='true'] .dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
}

.dropdown-trigger-icon {
  transition: transform var(--motion-duration-fast) var(--motion-ease-standard);
}

.dropdown:hover .dropdown-trigger-icon,
.dropdown:focus-within .dropdown-trigger-icon,
.dropdown[data-open='true'] .dropdown-trigger-icon {
  transform: rotate(180deg);
}

.dropdown-panel a {
  transition:
    background-color var(--motion-duration-fast) var(--motion-ease-standard),
    color var(--motion-duration-fast) var(--motion-ease-standard);
}

.dropdown-panel a:hover,
.dropdown-panel a:focus-visible {
  background-color: #f1f5f9;
  color: #0f172a;
}

/* Уважение prefers-reduced-motion для интерактивных эффектов */
@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .dropdown-panel,
  .dropdown-trigger-icon,
  .nav-link::after,
  .hover-lift:not(.reveal-on-scroll),
  .cg-toast,
  .icon-bg,
  .icon-wrapper svg,
  #backToTop {
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    transform: none !important;
  }

  .glitch-layer,
  .glitch-layer-base circle {
    animation: none !important;
  }
}

/* Стили блока «КИБЕР свиток» (перенесено из page/licences.html) */
@keyframes glow-pulse {
  0%,
  100% {
    text-shadow: 0 0 5px rgba(0, 123, 255, 0.5), 0 0 10px rgba(0, 123, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.5);
  }
  50% {
    text-shadow: 0 0 10px rgba(0, 123, 255, 0.8), 0 0 20px rgba(0, 123, 255, 0.5);
    box-shadow: 0 0 25px rgba(0, 123, 255, 0.8);
  }
}

@keyframes scroll-unroll {
  0% {
    height: 0;
    opacity: 0;
    transform: translateY(-50px) rotateX(30deg);
  }
  100% {
    height: 100%;
    opacity: 1;
    transform: translateY(0) rotateX(0deg);
  }
}

@keyframes particle-burst {
  0% {
    transform: scale(0) translate(0, 0);
    opacity: 1;
  }
  100% {
    transform: scale(1.5) translate(var(--tx), var(--ty));
    opacity: 0;
  }
}

@keyframes holographic-scan {
  0% {
    transform: translateY(-100%);
    opacity: 0.3;
  }
  100% {
    transform: translateY(100%);
    opacity: 0;
  }
}

.cyber-scroll {
  --rosatom-blue: #007bff;
  --rosatom-light: #00bfff;
  transform-style: preserve-3d;
  animation: glow-pulse 2s infinite alternate;
}

.scroll-paper {
  background: linear-gradient(
    180deg,
    rgba(0, 123, 255, 0.1) 0%,
    rgba(255, 255, 255, 0.05) 100%
  );
  border: 1px solid var(--rosatom-light);
  box-shadow: 0 0 15px rgba(0, 123, 255, 0.5);
  animation: scroll-unroll 1.5s ease-out forwards;
  transform-origin: top;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.scroll-handle {
  background: radial-gradient(circle, var(--rosatom-blue) 0%, var(--rosatom-light) 100%);
  box-shadow: 0 0 10px var(--rosatom-light);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.scroll-content {
  color: white;
  text-shadow: 0 0 5px var(--rosatom-blue);
  animation: glow-pulse 2s infinite alternate;
}

.particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--rosatom-light);
  border-radius: 50%;
  animation: particle-burst 1.5s ease-out infinite;
  z-index: 0;
}

.holographic-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--rosatom-light), transparent);
  opacity: 0.5;
  animation: holographic-scan 3s linear infinite;
  z-index: 3;
}

.cyber-scroll:hover .scroll-paper,
.cyber-scroll:active .scroll-paper {
  box-shadow: 0 0 30px rgba(0, 123, 255, 1);
  transform: rotateX(5deg) scale(1.05);
  transition: all 0.3s ease;
}

.cyber-scroll::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    rgba(0, 123, 255, 0.3) 0%,
    transparent 70%
  );
  opacity: 0.6;
  z-index: -1;
  animation: glow-pulse 3s infinite alternate;
}

/* Улучшения для мобильных устройств (планшетов) */
@media (max-width: 1024px) {
  .cyber-scroll {
    animation-duration: 1.5s;
  }
  .scroll-paper {
    animation-duration: 1.2s;
  }
  .particle {
    animation-duration: 1.2s;
    animation-iteration-count: infinite;
  }
  .holographic-line {
    animation-duration: 2s;
  }
}

/* Стили Metro-line (перенесено из services/attestation.html) */
#process .route::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.25);
  animation: route-fill 1200ms ease-out forwards 120ms;
}

@keyframes route-fill {
  to {
    width: 100%;
  }
}

#process .node {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: 24px;
  width: 24px;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
  display: grid;
  place-items: center;
  z-index: 2;
  opacity: 0;
  transform-origin: center;
  animation: node-pop 0.5s ease-out forwards;
}

#process .node .dot {
  display: block;
  height: 12px;
  width: 12px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.35), inset 0 0 6px rgba(96, 165, 250, 0.45);
}

@keyframes node-pop {
  from {
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

#process .stem {
  position: absolute;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(
    180deg,
    rgba(37, 99, 235, 0.4),
    rgba(96, 165, 250, 0.4)
  );
  border-radius: 9999px;
  z-index: 1;
  opacity: 0;
  animation: stem-grow 0.5s ease-out forwards;
}

#process .stem-top {
  background: linear-gradient(
    180deg,
    rgba(96, 165, 250, 0.4),
    rgba(37, 99, 235, 0.4)
  );
}

@keyframes stem-grow {
  from {
    opacity: 0;
    transform: translateX(-50%) scaleY(0.3);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scaleY(1);
  }
}

#process .cardx {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 20rem;
  max-width: 92vw;
  border-radius: 1rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 8px 24px rgba(2, 6, 23, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  opacity: 0;
  animation: card-fade 0.6s ease-out forwards;
}

#process .cardx:hover {
  transform: translateX(-50%) translateY(-4px);
  box-shadow: 0 16px 36px rgba(2, 6, 23, 0.12);
  border-color: rgba(37, 99, 235, 0.25);
}

@keyframes card-fade {
  to {
    opacity: 1;
  }
}

#process .grid > div:nth-child(1) .node {
  animation-delay: 0.15s;
}

#process .grid > div:nth-child(2) .node {
  animation-delay: 0.25s;
}

#process .grid > div:nth-child(3) .node {
  animation-delay: 0.35s;
}

#process .grid > div:nth-child(4) .node {
  animation-delay: 0.45s;
}

#process .grid > div:nth-child(5) .node {
  animation-delay: 0.55s;
}

#process .grid > div:nth-child(6) .node {
  animation-delay: 0.65s;
}

#process .grid > div:nth-child(1) .stem,
#process .grid > div:nth-child(1) .cardx {
  animation-delay: 0.28s;
}

#process .grid > div:nth-child(2) .stem,
#process .grid > div:nth-child(2) .cardx {
  animation-delay: 0.38s;
}

#process .grid > div:nth-child(3) .stem,
#process .grid > div:nth-child(3) .cardx {
  animation-delay: 0.48s;
}

#process .grid > div:nth-child(4) .stem,
#process .grid > div:nth-child(4) .cardx {
  animation-delay: 0.58s;
}

#process .grid > div:nth-child(5) .stem,
#process .grid > div:nth-child(5) .cardx {
  animation-delay: 0.68s;
}

#process .grid > div:nth-child(6) .stem,
#process .grid > div:nth-child(6) .cardx {
  animation-delay: 0.78s;
}

#process .cardx-sm {
  border-radius: 1rem;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(148, 163, 184, 0.3);
  opacity: 0;
  animation: m-fade 0.5s ease-out forwards;
}

#process .m1 .cardx-sm {
  animation-delay: 0.18s;
}

#process .m2 .cardx-sm {
  animation-delay: 0.3s;
}

#process .m3 .cardx-sm {
  animation-delay: 0.42s;
}

#process .m4 .cardx-sm {
  animation-delay: 0.54s;
}

#process .m5 .cardx-sm {
  animation-delay: 0.66s;
}

#process .m6 .cardx-sm {
  animation-delay: 0.78s;
}

@keyframes m-fade {
  to {
    opacity: 1;
  }
}

#process .dot-sm {
  position: absolute;
  left: -11px;
  top: 0.6rem;
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  #process .route::after,
  #process .node,
  #process .stem,
  #process .cardx,
  #process .cardx-sm {
    animation: none !important;
    opacity: 1 !important;
  }
}

/* Стили секции #process (перенесено из services/certification.html) */
#process.process-blueprint {
  background-color: #0b1220;
}

#process .blueprint-bg {
  background: radial-gradient(
      60rem 60rem at 85% -10%,
      rgba(96, 165, 250, 0.2),
      transparent 60%
    ),
    radial-gradient(
      50rem 50rem at -10% 90%,
      rgba(37, 99, 235, 0.22),
      transparent 60%
    ),
    linear-gradient(180deg, #0b1220 0%, #0e1730 100%);
}

#process .blueprint-grid {
  background: linear-gradient(to right, rgba(255, 255, 255, 0.08) 1px, transparent 1px)
      0 0/40px 40px,
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px) 0 0/40px 40px;
}

#process .trace-h {
  position: absolute;
  left: 6%;
  right: 6%;
  height: 2px;
  border-radius: 9999px;
  background: linear-gradient(
    90deg,
    rgba(96, 165, 250, 0.7),
    rgba(37, 99, 235, 0.7)
  );
  box-shadow: 0 0 16px rgba(96, 165, 250, 0.25);
  overflow: hidden;
  z-index: 1;
}

#process .trace-h::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0 12px,
    rgba(255, 255, 255, 0.35) 12px 16px
  );
  opacity: 0.55;
  mix-blend-mode: screen;
  animation: trace-move 7s linear infinite;
}

#process .trace-h.top-row {
  top: 30%;
}

#process .trace-h.bottom-row {
  top: 74%;
}

@keyframes trace-move {
  to {
    transform: translateX(-28px);
  }
}

#process .tap {
  display: none;
}

@media (min-width: 768px) {
  #process .tap {
    display: block;
    position: absolute;
    width: 2px;
    height: 84px;
    background: linear-gradient(
      180deg,
      rgba(96, 165, 250, 0.8),
      rgba(37, 99, 235, 0.8)
    );
    box-shadow: 0 0 12px rgba(96, 165, 250, 0.25);
    z-index: 1;
  }

  #process .tap-1 {
    left: 13.5%;
    top: calc(30% - 84px);
  }
  #process .tap-2 {
    left: 50%;
    transform: translateX(-50%);
    top: calc(30% - 84px);
  }
  #process .tap-3 {
    right: 13.5%;
    top: calc(30% - 84px);
  }
  #process .tap-4 {
    left: 13.5%;
    top: 74%;
  }
  #process .tap-5 {
    left: 50%;
    transform: translateX(-50%);
    top: 74%;
  }
  #process .tap-6 {
    right: 13.5%;
    top: 74%;
  }
}

#process .module {
  position: relative;
  display: grid;
  place-items: center;
}

#process .chip {
  width: 100%;
  max-width: 22rem;
  position: relative;
  border-radius: 1rem;
  padding: 1.25rem 1.25rem;
  background: linear-gradient(0deg, rgba(12, 18, 35, 0.75), rgba(12, 18, 35, 0.75))
      padding-box,
    linear-gradient(120deg, rgba(96, 165, 250, 0.55), rgba(37, 99, 235, 0.55))
      border-box;
  border: 1px dashed transparent;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

#process .chip:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.55), 0 0 20px rgba(96, 165, 250, 0.14);
}

#process .chip::before,
#process .chip::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(147, 197, 253, 0.55);
  opacity: 0.65;
  pointer-events: none;
}

#process .chip::before {
  top: 10px;
  left: 10px;
  border-right: 0;
  border-bottom: 0;
  border-radius: 6px 0 0 0;
}

#process .chip::after {
  bottom: 10px;
  right: 10px;
  border-left: 0;
  border-top: 0;
  border-radius: 0 0 6px 0;
}

#process .pin {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: -12px;
  height: 30px;
  width: 6px;
  border-radius: 2px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.35);
}

#process .module-bottom .pin {
  left: auto;
  right: -12px;
}

#process .label {
  font-size: 0.82rem;
  color: #93c5fd;
  opacity: 0.95;
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

#process .title {
  font-weight: 600;
  color: #e5f0ff;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

#process .desc {
  color: #cfe0ff;
  opacity: 0.95;
}

#process .chip {
  opacity: 0;
  animation: chip-in 0.5s ease-out forwards;
}

#process .grid > .module:nth-child(1) .chip {
  animation-delay: 0.15s;
}

#process .grid > .module:nth-child(2) .chip {
  animation-delay: 0.27s;
}

#process .grid > .module:nth-child(3) .chip {
  animation-delay: 0.39s;
}

#process .grid > .module:nth-child(4) .chip {
  animation-delay: 0.51s;
}

#process .grid > .module:nth-child(5) .chip {
  animation-delay: 0.63s;
}

#process .grid > .module:nth-child(6) .chip {
  animation-delay: 0.75s;
}

@keyframes chip-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 767px) {
  #process .trace-h,
  #process .tap,
  #process .pin {
    display: none !important;
  }
  #process .board {
    padding: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #process .trace-h::after,
  #process .chip {
    animation: none !important;
    opacity: 1 !important;
  }
}

/* FAQ: поворот стрелки по aria-expanded */
[data-faq-trigger][aria-expanded='true'] [data-faq-icon] {
  transform: rotate(180deg);
}
